Difference between revisions of "VTK6 Migration Guide"
Jump to navigation
Jump to search
m (2 revisions) |
m (JasminMetzger moved page VTK6 to VTK6 Migration Guide) |
(No difference)
|
Revision as of 14:56, 22 October 2014
VTK6 Migration Guide
http://www.vtk.org/Wiki/VTK/VTK_6_Migration_Guide
http://vtk.org/Wiki/VTK/VTK_6_Migration/Overview
FloatingPointType
vtkFloatingPointType has to be replaced with double
- vtkFloatingPointType point[3]; + double point[3];
versionMacros
When vtk version macros (like VTK_MAJOR_VERSION) are used, the following header has to be included:
+#include <vtkVersionMacros.h>
Pipeline changes
http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Replacement_of_SetInput
Example 1
anotherFilter->SetInput(aFilter->GetOutput());
should become
anotherFilter->SetInputConnection(aFilter->GetOutputPort());
Example 2
vtkDataObject* output = aFilter->GetOutput(); anotherFilter->SetInput(output);
should become
anotherFilter->SetInputConnection(aFilter->GetOutputPort());
Example 3
vtkPolyData *pd = vtkPolyData::New(); aFilter->SetInput(pd);
should become
vtkPolyData *pd = vtkPolyData::New(); aFilter->SetInputData(pd);
Update on vtkData
Since vtkData Objects no longer have a source, the update method is not existing anymore. Instead, call the update method of the source directly.
CxxRevisionMacro
Deprecated Macro. Just remove it.
-vtkCxxRevisionMacro(vtkPVAxesActor, "$Revision$");
vtkTypeRevisionMacro
Renamed macro
- vtkTypeRevisionMacro(vtkPVAxesActor,vtkProp3D); + vtkTypeMacro(vtkPVAxesActor,vtkProp3D);
allocateScalars
Example 1
Replace
int vtkMyAlg::RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector* outInfoVec) { vtkImageData* output = this->GetOutput(); output->GetScalarType(); output->GetNumberOfScalarComponents();
with
int vtkMyAlg::RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector* outInfoVec) { vtkInformation* outInfo = outInfoVec->GetInformationObject(0); vtkImageData::GetScalarType(outInfo); vtkImageData::GetNumberOfScalarComponents(outInfo);
Example 2
int vtkMyAlg::RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector* outInfoVec) { vtkImageData* output = vtkImageData::GetData(outInfoVec); // Allocate output scalars here output->GetScalarType(); output->GetNumberOfScalarComponents();
This code does not need to be changed.