[vtkusers] Fixing Python examples; question about best practice...
diego0020
da.angulo39 at uniandes.edu.co
Thu Apr 3 19:52:22 EDT 2014
Great work
My understanding is that mapper.SetInputConnection( source.GetOutputPort() )
creates a pipeline connection. This means that any changes in the input will
be propagated to the mapper. This is used for example to connect several
filters in a chain, and have changes propagate across the pipeline.
mapper.SetInputData( source ) is used where source is a static object, like
some polydata read from a file.
mapper.SetInput( source.GetOutput() ) could be used to connect the mapper to
the output of a filter, but without creating a pipeline connection. In this
case the current output will be the one the mapper will see. This would
usually be used after calling source.Update(); and if you know the filter or
its input will never change again. I think it is better to stay away from
this.
For me, the best practices would then be:
Use mapper.SetInputConnection( source.GetOutputPort() ) for connecting to
filters
Use mapper.SetInputData( source ) for connecting to static objects
This is only my opinion though.
Best regards
--
View this message in context: http://vtk.1045678.n5.nabble.com/Fixing-Python-examples-question-about-best-practice-tp5726633p5726639.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list