<div class="gmail_quote">2010/2/27 David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Jordi,<br>
<br>
Whenever you want to do custom modifications to data that is going<br>
through the pipeline, the best option is to use one of VTK's<br>
programmable filters. In your case, vtkProgrammableFilter is the one<br>
that you should use. These programmable filters allow you to set a<br>
callback function that will do the data modifications as the data<br>
passes through the pipeline.<br>
<br>
You can look at VTK/Graphics/Testing/Tcl/deciPlane.tcl as an example<br>
of how to use vtkProgrammableFilter. It's also possible to use them<br>
in Python, Java, and C++ but I'm not sure if there are good examples<br>
for those languages.<br>
<br>
Animation in VTK should usually be done as follows:<br>
<br>
Note that VTK will execute the pipeline automatically whenever<br>
Render() is called on the window that is displaying the data. So if<br>
you want to animate, you usually do it like this:<br>
<br>
1) Use the RenderWindowInteractor to create a repeating timer, and<br>
make it repeat at your desired frame rate.<br>
2) Make an observer for the RenderWindowInteractor TimerEvent<br>
3) When a TimerEvent occurs, set the filter parameters for the current<br>
frame (e.g. the amplitude and phase of your waves), and then call<br>
Render() on the vtkRenderWindowInteractor.<br>
<br>
When you call Render(), VTK will automatically execute the pipeline<br>
for any data that is displayed in the VTK window. So if you have made<br>
your filter properly, then it will automatically re-compute all the Z<br>
positions according to the new parameters. And because none of the<br>
Delaunay2D parameters have changed, Delaunay will not re-execute...<br>
only the filters where things have changed will re-execute when Render<br>
is called.<br>
<br>
David<br><br></blockquote><div><br></div><div>Here is an example of vtkProgrammableFilter in c++: </div><a href="http://www.vtk.org/Wiki/VTK/Examples/ProgrammableFilter">http://www.vtk.org/Wiki/VTK/Examples/ProgrammableFilter</a></div>
<div class="gmail_quote"><br></div><div class="gmail_quote">David G, maybe you can verify that it looks reasonable?</div><div class="gmail_quote"><br clear="all">Thanks,<br><br>David</div>