<html><head></head><body><div>My short question is: I am having some problems to understand time handling in VTK, so I would like to find some documentations that can enlighten me! So far my Google research has only shown me that a) there have been different approaches in the past (which I do not need to understand) and b) there are many more options available than I will ever need to use...</div><div><br></div><div>The specific problem that I am dealing with is in a project. In a filter that is supposed to run inside ParaView I am programmatically generating a time series of unsigned grids and tables, i.e. the filter has several several output ports that all have to change per time step. Empirically I found out that I have to put this code into RequestInformation:</div><div><br></div><div>
<pre><!--StartFragment--><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">//</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">tell</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">the</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">caller</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">that</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">we</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">can</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">provide</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">time</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">varying</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">data</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">and</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">specify</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">the</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">range</span></pre>
<pre><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">double</span><span style=" color:#c0c0c0;"> </span><span style=" color:#092e64;">tRange</span>[]<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>{<span style=" color:#000080;">0.</span>,<span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">1.</span>};</pre>
<pre><br></pre>
<pre><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">//</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">generate</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">a</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">vector</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">with</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">the</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">steps</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">-</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">from</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">0</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">to</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">NumSteps</span></pre>
<pre><span style=" color:#c0c0c0;"> </span><span style=" color:#800000;">Steps</span>.<span style=" color:#00677c;">resize</span>(<span style=" color:#800000;">NumPeriods</span><span style=" color:#c0c0c0;"> </span>+<span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">1</span>);</pre>
<pre><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">for</span>(<span style=" color:#808000;">int</span><span style=" color:#c0c0c0;"> </span><span style=" color:#092e64;">s</span><span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">0</span>;<span style=" color:#c0c0c0;"> </span><span style=" color:#092e64;">s</span><span style=" color:#c0c0c0;"> </span><=<span style=" color:#c0c0c0;"> </span><span style=" color:#800000;">NumPeriods</span>;<span style=" color:#c0c0c0;"> </span>++<span style=" color:#092e64;">s</span>)</pre>
<pre><span style=" color:#c0c0c0;"> </span><span style=" color:#800000;">Steps</span>[<span style=" color:#092e64;">s</span>]<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>(<span style=" color:#808000;">double</span>)<span style=" color:#092e64;">s</span><span style=" color:#c0c0c0;"> </span>/<span style=" color:#c0c0c0;"> </span>(<span style=" color:#808000;">double</span>)<span style=" color:#800000;">NumPeriods</span>;</pre>
<pre><br></pre>
<pre><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">for</span>(<span style=" color:#808000;">int</span><span style=" color:#c0c0c0;"> </span><span style=" color:#092e64;">n</span><span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">0</span>;<span style=" color:#c0c0c0;"> </span><span style=" color:#092e64;">n</span><span style=" color:#c0c0c0;"> </span><<span style=" color:#c0c0c0;"> </span><span style=" color:#00677c;">GetNumberOfOutputPorts</span>();<span style=" color:#c0c0c0;"> </span>++<span style=" color:#092e64;">n</span>)</pre>
<pre><span style=" color:#c0c0c0;"> </span>{</pre>
<pre><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">vtkInformation</span>*<span style=" color:#c0c0c0;"> </span><span style=" color:#092e64;">info</span><span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span><span style=" color:#092e64;">outputVector</span>-><span style=" color:#00677c;">GetInformationObject</span>(<span style=" color:#092e64;">n</span>);</pre>
<pre><span style=" color:#c0c0c0;"> </span><span style=" color:#092e64;">info</span>-><span style=" color:#00677c;">Set</span>(<span style=" color:#800080;">vtkStreamingDemandDrivenPipeline</span>::<span style=" color:#00677c;">TIME_RANGE</span>(),<span style=" color:#c0c0c0;"> </span><span style=" color:#092e64;">tRange</span>,<span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">2</span>);</pre>
<pre><span style=" color:#c0c0c0;"> </span><span style=" color:#092e64;">info</span>-><span style=" color:#00677c;">Set</span>(<span style=" color:#800080;">vtkStreamingDemandDrivenPipeline</span>::<span style=" color:#00677c;">TIME_STEPS</span>(),<span style=" color:#c0c0c0;"> </span><span style=" color:#800000;">Steps</span>.<span style=" color:#00677c;">data</span>(),<span style=" color:#c0c0c0;"> </span><span style=" color:#800000;">Steps</span>.<span style=" color:#00677c;">size</span>());</pre>
<pre><span style=" color:#c0c0c0;"> </span><span style=" color:#092e64;">info</span>-><span style=" color:#00677c;">Set</span>(<span style=" color:#00677c;">CAN_HANDLE_PIECE_REQUEST</span>(),<span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">1</span>);</pre>
<pre><span style=" color:#c0c0c0;"> </span>}</pre>
<pre><br><!--EndFragment--></pre></div><div>Some of the calculations are a bit tedious, so I am caching many data in the filter object, but not more than so far required. This means that in RequestData a decision has to be taken if more data need to be calculated first, or else directly copy from the cached data, like for example this:</div><div><br></div><div>- jump to step 5 of 20 directly -> calculate steps 1 - 2 - 3 - 4 - 5 internally, then copy data from step 5 to the output ports</div><div><br></div><div>- jump back to step 3 -> simply copy the data from step 3 to the output ports</div><div><br></div><div>- jump to step 7 -> calculate steps 6 - 7, then copy etc.</div><div><br></div><div>During the calculations I am using other filters for some data processing, not attached to the pipeline, for some data transformations. For some time this worked now "somehow", but now I am suddenly getting crashes in one of these "detached filters" - when some "trivial producer" wants to ask for MTime - which is completely irrelevant in that context...</div><div><br></div><div>In other words: I am now a bit confused - and at the same time I am afraid that I cannot easily strip down my problem to a size that I can easily share!</div><div><br></div><div>Specifically I am not sure which way to try further:</div><div><br></div><div>- somehow "tell the filters" that they should not care about time?</div><div><br></div><div>- reconsider my caching because maybe it interferes with some similar functionality that is already built into ParaView?</div><div><br></div><div>- somehow "tell" the output unstructured grids and tables which is their current MTime? But so far I thought I had understood that this is managed by ParaView, not by the data objects...</div><div><br></div><div>...but then some of the data objects have a GetMTime function, but no way to explicitly set this fabulous MTime: where does it come from?</div><div><br></div><div>Actually such a call is the location where the program crashes!</div><div><br></div><div>Regards,</div><div>Cornelis Bockemühl</div></body></html>