[vtk-developers] VTK-5 - Filter with multiple outputs

Ovidiu Toader ovi at physics.utoronto.ca
Mon Oct 17 04:54:40 EDT 2005


Hello VTK developers,

This weekend I attempted to convert some of my old VTK4 filters to the new 
pipeline. Most of the information that I used to re-code the filters I 
gathered directly from the code with the help of a debugger, therefore it is 
possible that my understanding of the pipeline could be flawed. Not being 
able to finish what I started I decided to use the next best option which in 
this case is this mail-list. I am aware that the longer my message gets the 
less likely it is for it to receive a reply so I will try my best to 
illustrate the problem with a simple artificial example.

Lets say that $A is a vtkAlgorithm with 0 inputs and 3 outputs. $A has some 
methods which can affect differently the 3 outputs. Consequently, the outputs 
should be "scheduled for update" selectively based on state of $A. With the 
current pipeline implementation I am able to achieve this goal by making use 
of code like:

  out->SetPipelineMTime(out->GetMTime()+1);

which works as intended because after this line of code is executed "out" will
be out of date, thus being sent to $A's ExecuteData which will take care of it 
at the appropriate time. Is there an equivalent (or better) way in which one 
could do the same thing using the new pipeline infrastructure found in VTK-5? 
The problem that I have right now is that $A can have a single vtkExecutive 
associated with it and the available Executives don't seem to treat the 
outputs in a totally independent manner. For example code like:

  if(this->Algorithm && request->Has(REQUEST_DATA_OBJECT()))
    {
    // if we are up to date then short circuit
    if (this->PipelineMTime < this->DataObjectTime.GetMTime())
      {
      return 1;
      }

taken from vtkDemandDrivenPipeline::ProcessRequest compares the PipelineMTime 
against the time stamp of the DataObjectTime member but does not care about 
the port the request is associated with. 

The actual filter has more than 3 outputs and is designed to compute only the 
outputs that are needed by the pipeline. I believe that in principle it 
should be possible to achieve this selective computation based only on logic 
that is internal to $A but the ability to interact with the pipeline would 
offer the cleanest possible design. My hope is that this feature is present 
in the new pipeline but haven't yet been able to discover it myself.

Thanks for your time,
Ovidiu




More information about the vtk-developers mailing list