[vtkusers] Breaking the pipeline

Kevin Wright Kevin.Wright at ansys.com
Thu Aug 28 15:29:19 EDT 2003


> the clue is, the vtkImageData is the output of a vtkPNGReader 
> and that's 
> not changed, I just want to disable it to prevent the 
> pipeline to access 
> it when something is changed.

You could just split the pipeline, and take the output of the reader, pass it through the image flip, and then change the input of the actor to point to the flipped data, instead of the original, or create a whole new actor and set the visibility of them on and off to prevent unneccessary updates.

If there's some reason why you need to keep the same pipeline you could maybe try something like this:

If you take the output of the image reader and Register it, then call SetOutput on the reader and set it to null, then I think you will have broken the pipeline, and you will still have a copy of the original data, which you can use to build a new pipeline (rather than copying different data back into the original image structure, I would recommend just changing the pipeline to pass that data through another filter and into the mapper.

So...

vtkImageData *img = imageReader->GetOutput();
img->Register(0);
imageReader->SetOutput(0);

imageFlip->SetInput(img);
actor->SetInput(imageFlip->GetOutput());

I've never tried anything like that, but it might work.

Kevin.



More information about the vtkusers mailing list