This is what I do. I set up the whole scene, load in all the different readers, and connect the first reader to the vtkMarchingCubes. Then I use a timer that calls an update function every second. This update function sets the inputconnection of the vtkMarchingCubes to the current reader (contours->setInputConnection(reader[current]->getOutputPort()). This is working, but results in small (but very noticable) hickups in the interaction. I think this is because the isosurfaces have to be re-calculated every time. That's why I think that I will need an array of vtkMarchingCubes too.<br>
<br>Tijmen<br><br><div class="gmail_quote">On Wed, Jul 6, 2011 at 11:02 AM, Dominik Szczerba <span dir="ltr"><<a href="mailto:dominik@itis.ethz.ch">dominik@itis.ethz.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
You should update your reader only from a callback function once you<br>
have your scene/camera/etc set up...<br>
<font color="#888888"><br>
Dominik<br>
</font><div><div></div><div class="h5"><br>
On Wed, Jul 6, 2011 at 10:51 AM, Tijmen Klein <<a href="mailto:T.R.Klein@student.rug.nl">T.R.Klein@student.rug.nl</a>> wrote:<br>
> Thank you for the reply. First of all, I'm not trying to export a animation;<br>
> it should be realtime and allowing the user to navigate the scene.<br>
><br>
> I'm currently applying the fist technique (update the reader in a loop).<br>
> Technically this works fine, but it is really slow and also blocks the mean<br>
> thread of the program (the program simply freezes when switching between 2<br>
> frames). A possible solution that I came up with is the following: create N<br>
> pipelines (up to the mapper), where N is the number of frames. This mean I<br>
> can load the data first, create the isosurfaces and then based on the<br>
> current time let the actor point to the corresponding mapper. This would<br>
> mean that all the calculations are already completed.<br>
><br>
> Is this a viable solution? It feels a bit hack-ish to do it like this.<br>
><br>
> Tijmen<br>
><br>
> On Tue, Jul 5, 2011 at 4:00 PM, Dominik Szczerba <<a href="mailto:dominik@itis.ethz.ch">dominik@itis.ethz.ch</a>><br>
> wrote:<br>
>><br>
>> There are a few possibilities. The simplest would be to update the<br>
>> reader in a loop and dumping screen renderings. More sophisticated<br>
>> would be to import them first into a temporal dataset and then request<br>
>> a specific time value.<br>
>><br>
>> Dominik<br>
>><br>
>> On Tue, Jul 5, 2011 at 2:57 PM, Tijmen Klein <<a href="mailto:T.R.Klein@student.rug.nl">T.R.Klein@student.rug.nl</a>><br>
>> wrote:<br>
>> > I'm trying to animate multiple input files. These files are in the<br>
>> > legacy<br>
>> > VTK format (.vtk), and named filename[x].vtk, where [x] is an integer. A<br>
>> > contourfilter is used to generate isosurfaces, and these isosurfaces<br>
>> > should<br>
>> > be animated.<br>
>> ><br>
>> > This is behaviour that is quite easy to achieve in Paraview (open the<br>
>> > files,<br>
>> > apply contour filter, choose a frame or click play). How can something<br>
>> > similar be achieved in VTK? It should be possible to create a<br>
>> > time-dependent<br>
>> > animation, but also manually set the current frame. I thought of<br>
>> > creating<br>
>> > multiple InputReaders, and have the 'current' reader's outputport<br>
>> > connected<br>
>> > to the input port of the contour filter. But I think this would not be<br>
>> > very<br>
>> > efficient, since it's not possible to cache the results in this way.<br>
>> > This<br>
>> > would mean that all the calculations happen again when the animations<br>
>> > restarts from frame 1. What would be a better solution?<br>
>> ><br>
>> > Cheers,<br>
>> > Tijmen<br>
>> ><br>
>> > _______________________________________________<br>
>> > Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>> ><br>
>> > Visit other Kitware open-source projects at<br>
>> > <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>> ><br>
>> > Please keep messages on-topic and check the VTK FAQ at:<br>
>> > <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
>> ><br>
>> > Follow this link to subscribe/unsubscribe:<br>
>> > <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
>> ><br>
>> ><br>
><br>
><br>
</div></div></blockquote></div><br>