issue about converting VTK 5.0.3 codes to VTK 9.0.1.

Hi,

I have an old project which uses VTK 5.0.3 version.

And I’d like to make that version up to date.

Therefore, I’m trying to convert VTK 5.0.3 codes to VTK 9.0.1.

However, I’m struggling with two classes that were deprecated.

  • vtkPolyDataToPolyDataFilter
  • vtkPolyDataSource

How can I convert these two classes used for overriding?

this is a example code


#ifndef VTKBEAMSOURCE2D_H_YOO
#define VTKBEAMSOURCE2D_H_YOO

#pragma once

#include “point3d.h”
#include “vtkPolyDataSource.h” → ##error
#include “vtkTransformPolyDataFilter.h”

class vtkBeamSource2DFieldSize : public vtkPolyDataSource → ##error
{
public:
vtkTypeMacro(vtkBeamSource2DFieldSize,vtkPolyDataSource);
void PrintSelf(ostream& os, vtkIndent indent);


#ifndef VTKBEAMSOURCE3DFIELDSIZE_H_YOO
#define VTKBEAMSOURCE3DFIELDSIZE_H_YOO

#pragma once

#include “point3d.h”
#include “vtkPolyDataSource.h” → ##error
#include “vtkTransformPolyDataFilter.h”

class AFX_EXT_CLASS vtkBeamSource3DFieldSize : public vtkImagePlaneWidget.h → ##error
{
public:
vtkTypeMacro(vtkBeamSource3DFieldSize,vtkPolyDataSource);
void PrintSelf(ostream& os, vtkIndent indent);

It’d be so glad to recommend any solution.

Thanks.

Off of the top of my head: these are classes related to the visualization pipeline. The simplest thing to do is to look at classes that are similar (e…g, filter that take vtkPolyData as input, and produce vtkPolyData as output such as vtkDecimatePro; and a source like vtkSphereSource that produces vtkPolyData). In particular, note the inheritance of the new classes from vtkPolyDataAlgorithm.

If you want a deeper understanding, see documentation like this: https://vtk.org/Wiki/VTK/Tutorials/New_Pipeline.

1 Like