[vtkusers] Forcing an Update of a vtkSource
Berk Geveci
berk.geveci at kitware.com
Tue Feb 19 16:51:05 EST 2002
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.)
-Berk
On Tue, 2002-02-19 at 16:34, Kevin Teich wrote:
> I'm writing a viewer/editor for volume data. I wrote a custom
> vtkVolumeReader that reads in my data. That works fine. Now, I want to be
> able to change that data in the middle of the pipeline execution.
>
> I wrote a SetValue(x,y,z,v) function for the Reader class and call it from
> my Tcl app. However, I don't see the changes until I change the origin of
> the vtkImageReslice object (i.e. in a pan or zoom). How can I tell the
> Reader that its data is changed and it should update the rest of the
> pipeline?
>
> I tried calling Modified() from within the object and from the Tcl script
> ($volumeReader Modified) followed by an Update call, but that seems to
> restore the data to its original state, probably from some hidden cache.
> Any ideas?
>
> I realize that my method for setting data this way is probably horribly
> and offensively incorrect and unelegant. If anyone would like to offer
> advice on how I should do this properly, I would appreciate it.
>
> My SetValue(x,y,z,value), sans error checking, does this:
>
> vtkStructuredPoints *output = this->GetOutput();
> vtkDataArray *scalars = output->GetPointData()->GetScalars();
> int index = x +
> (y * this->DataDimensions[0]) +
> (z * this->DataDimensions[0] * this->DataDimensions[1]);
> scalars->SetComponent( index, 0, value );
> output->Modified();
>
> Thanks in advance.
>
> --
> Kevin Teich
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list