[vtkusers] Forcing an Update of a vtkSource

Berk Geveci berk.geveci at kitware.com
Tue Feb 19 17:31:03 EST 2002


Uh. I undestand the problem now. Tricky tricky. Can't you execute
the reader and separate it's output ? Once you do that, if you
modify the output in any way, the pipeline will re-execute.
Something like this:

reader->Update();
data = reader->GetOutput();
data->Register(0);
data->SetSource(0);
reader->SetOutput(0);
... keep data around, when the ui needs to change it, it
can call a function which does the modifications and call
data->Modified() ...
This way, you won't have to hack Execute() or anything nasty
like that. There are other ways of doing the same thing but this
is the first that came to my mind.

-Berk
 
On Tue, 2002-02-19 at 17:03, Kevin Teich wrote:
> [Berk]
> > Calling Modified() on the outut object will have no effect because
> > the pipeline does not check the modification time of outputs.
> > You need to call Modified() on the source itself (assuming that
> > it is a sub-class of something like vtkSource, vtkImageSource etc.)
> 
> That seems to restore the scalars to their original values, i.e. the
> content of the file. Probably because in my SetValue() function, I am
> modifying the scalars of the output, not the scalars in the Reader object
> itself. (I realize this is probably incorrect, but I played with a bunch
> of different methods and this is the only one I found that works.)
> 
> I guess my problem is that I'm not sure where I should be changing this
> data. My Reader is based on vtkVolume16Reader and it doesn't do anything
> like this. In fact, it appears to only supply its output with scalar
> information once in its Execute() function, probably because it assumes
> the file data will not change. I assumed the output cached this data, and
> that if I wanted to modify it, i would modify the output's scalars.
> 
> Perhaps, in my Reader, I should keep an internal copy of the file data as
> a DataArray, change that in my SetValue() function, and modify Execute()
> in the Reader to set the output scalars to that copy?
> 
> Thanks for your help.
> 
> -- 
> Kevin Teich
> 





More information about the vtkusers mailing list