[vtk-developers] Changing computation of PipelineMTime.
Charles Law
charles.law at kitware.com
Fri Jul 27 15:01:28 EDT 2001
Hello,
In order to fix a problem I had with the pipeline re executing when it
wasn't necessary, I had to change the computation of the pipeline modified
time. Although all the regression tests still pass, such a change warrants
a warning on the developers list.
filter --- mapper (piece 0 of 2)
/
reader
\
filter --- mapper (piece 1 of 2)
The problem was that when a pipeline splits (the reader supplies two
branches of the pipeline) and two mappers request different extents/pieces
of the data, then the whole pipeline re executes multiple times on each
render. After branch 1 executes, branch two executes and causes the
reader to execute again to produce a different portion of the data. The
readers output gets a new "MTime" and "PipelineMTime". Since the new
PipelineMTime is later than the update time of the first mapper, the next
update to the first mapper causes every thing to execute again. ....
The only way I found to fix this problem is to remove the data's MTime from
the computation of the PipelineMTime.
The implications of this:
If you muck around with a data object that "belongs" to a source, then the
pipeline will not re execute for you.
If the data object has no source, then It behaves as before.
If this causes a problem for you, you can always do something like:
reader->Update();
// Get a pointer to the data object and make sure it does not destruct when
released by the source.
vtkDataObject *data = reader->GetOutput();
data->Register(NULL);
// Orphan the data object so it has no source.
reader->SetOutput(NULL);
// Then do anything you want to the data.
data->GetPointData()->SetScalars(myScalars);
...
Charles.
More information about the vtk-developers
mailing list