VTK/Tutorials/PipelineInput

From KitwarePublic
< VTK‎ | Tutorials
Revision as of 22:27, 11 June 2012 by Daviddoria (talk | contribs) (Created page with "** Reader beware: This is a very high level, "get it to work" set of instructions, not a lesson in the workings of the VTK pipeline. ** In VTK 4, there were functions like: fil...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
    • Reader beware: This is a very high level, "get it to work" set of instructions, not a lesson in the workings of the VTK pipeline. **

In VTK 4, there were functions like:

filter->SetInput(vtkPolyData*)

In VTK 5, many of these functions still work, but they were supposed to have been deprecated in favor of: filter->SetInputConnection(anotherFilter->GetOutputPort());

What do you do if you don't have anotherFilter, but rather just a dataSet? You can use the GetProducerPort() function of the dataSet: filter->SetInputConnection(dataSet->GetProducerPort());

which "fakes" as if it were the output of a filter.

In VTK 6, we are back to being able to pass a non-filter output (a dataSet) directly to a filter, but it is now called SetInputData: filter->SetInputData(vtkPolyData*)