[vtkusers] How do you turn on/off a pipeline?

David Gobbi dgobbi at irus.rri.on.ca
Thu Jul 6 12:56:10 EDT 2000


On Thu, 6 Jul 2000, Charles Law wrote:

> prabhu,
> 
> In Tcl and empty string is interpreted as NULL.  I do not know about python.

The wrappers convert the special python value None to NULL.  This is a 
recent addition, however, and I'm not sure if it made it into VTK 3.1.2.

 - David 
 
> If I have my python syntax correct, this should work.
> 
> 
> >c = vtkContourFilter()
> ># do something with c
> >...
> ># turn c off
> save = c.GetOutput()
> >  dummy = vtkPolyData()
> >c.SetOutput(dummy)
> ># do whatever
> >...
> ># turn it back on
> >c.SetOutput(save)
> 
> 
> Charles.
> 
> 
> 
> 
> At 11:24 PM 7/5/00 +0530, you wrote:
> >hi,
> >
> >         Thanks for all the tips.  But how does one do all this with
> >python?  Using SetInput(0) results in an exception (SystemError).  Or
> >should I just do something like
> >
> >c = vtkContourFilter()
> ># do something with c
> >...
> ># turn c off
> >s = vtkPolyDataReader()
> >c.SetInput(s.GetOutput())
> ># do whatever
> >...
> ># turn it back on
> >c.SetInput(correct_object.GetOutput())
> >
> >Is there no other way to do this?  Or am I missing something?
> >
> >prabhu
> >
> > >>>>> "Law" == Charles Law <charles.law at kitware.com> writes:
> >
> >     Law> Setting the output of a source/filter to NULL will have the
> >     Law> same effect.  Turn the pipeline back on by setting the output
> >     Law> back to the old value.
> >
> >     Law> Charles.
> >
> >     Law> At 10:57 AM 7/5/00 +0100, John Biddiscombe wrote:
> >     >> >A simple question: > How does one turn on or off a particular
> >     >> VTK pipeline?  Or how >does one disconnect a pipeline??
> >     >>
> >     >> Write a simple filter which takes an input, and generates an
> >     >> output, all it does is copystructure from input to output and
> >     >> pass point and cell data, override the update mechanism so that
> >     >> when flag=false, output doesn't get updated, when flag=true it
> >     >> acts as usual.
> >     >>





More information about the vtkusers mailing list