# issue about converting VTK 5.0.3 codes to VTK 9.0.1.

**URL:** <https://discourse.vtk.org/t/issue-about-converting-vtk-5-0-3-codes-to-vtk-9-0-1/5875>\
**Category:** Development\
**Created:** [May 27, 2021, 2:31pm UTC](https://discourse.vtk.org/t/issue-about-converting-vtk-5-0-3-codes-to-vtk-9-0-1/5875 "2021-05-27T14:31:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hyunwoo\_Kim](https://discourse.vtk.org/user_avatar/discourse.vtk.org/hyunwoo_kim/32/3465_2.png) [@Hyunwoo\_Kim](https://discourse.vtk.org/u/Hyunwoo_Kim)\
**Post date:** [May 27, 2021, 2:31pm UTC](https://discourse.vtk.org/t/issue-about-converting-vtk-5-0-3-codes-to-vtk-9-0-1/5875/1 "2021-05-27T14:31:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![will.schroeder](https://discourse.vtk.org/user_avatar/discourse.vtk.org/will.schroeder/32/233_2.png) [@will.schroeder](https://discourse.vtk.org/u/will.schroeder)\
**Post date:** [May 27, 2021, 2:46pm UTC](https://discourse.vtk.org/t/issue-about-converting-vtk-5-0-3-codes-to-vtk-9-0-1/5875/2 "2021-05-27T14:46:59Z")

</div>

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](https://vtk.org/Wiki/VTK/Tutorials/New_Pipeline).
