I (think that I) am allready precomputing the marching cubes. See my code snippet below, I think this would mean that the marching cubes are pre-calculated and can be cached?<div><br></div><div><div>for(int i = 0; i &lt; numberOfFrames; ++i)</div>

<div>{</div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>reader[i] = vtkSmartPointer&lt;vtkStructuredPointsReader&gt;::New();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>std::stringstream name;</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>name &lt;&lt; &quot;C:/Temp/vtk/FTLE&quot; &lt;&lt; (i+1) &lt;&lt; &quot;.vtk&quot;;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>cout &lt;&lt; &quot;Loading: &quot; &lt;&lt; name.str();</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>reader[i]-&gt;SetFileName(name.str().c_str());</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>reader[i]-&gt;Update();</div><div><br>

</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>cout &lt;&lt; &quot;, and calculating ISO surface\n&quot;;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>// Create surfaces between range specified</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>contours[i] = vtkSmartPointer&lt;vtkMarchingCubes&gt;::New();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>contours[i]-&gt;GenerateValues(10, minValue, maxValue); </div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>contours[i]-&gt;ComputeNormalsOn(); // fancy and expensive</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>contours[i]-&gt;ComputeScalarsOn();</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>contours[i]-&gt;SetInputConnection(reader[i]-&gt;GetOutputPort());</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>contours[i]-&gt;Update();</div>

<div>}</div><br><div class="gmail_quote">On Thu, Jul 7, 2011 at 1:04 PM, Dominik Szczerba <span dir="ltr">&lt;<a href="mailto:dominik@itis.ethz.ch">dominik@itis.ethz.ch</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

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