[vtk-developers] VTK-5 - Filter with multiple outputs
Moreland, Kenneth
kmorel at sandia.gov
Mon Oct 17 11:01:55 EDT 2005
This isn't the solution you are looking for, but if you want to have
different objects updated implemented independently, consider having
different vtkAlgorithm objects updating them. That way, the pipeline
will update them automatically without having to jump through
implementation dependent hoops. If these multiple vtkAlgorithms share
the some of the same computation, you could coordinate them with the
Mediator pattern (see the gang of four book) so that you don't have to
redo the computation in each vtkAlgorithm object.
-Ken
**** Kenneth Moreland
*** Sandia National Laboratories
***********
*** *** *** email: kmorel at sandia.gov
** *** ** phone: (505) 844-8919
*** fax: (505) 845-0833
> -----Original Message-----
> From: vtk-developers-bounces+kmorel=sandia.gov at vtk.org
> [mailto:vtk-developers-bounces+kmorel=sandia.gov at vtk.org] On
> Behalf Of Ovidiu Toader
> Sent: Monday, October 17, 2005 2:55 AM
> To: vtk-developers at vtk.org
> Subject: [vtk-developers] VTK-5 - Filter with multiple outputs
>
> 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
>
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
More information about the vtk-developers
mailing list