Declare and initialize a vtkPointSet with vtkPoints

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Declare and initialize a vtkPointSet with vtkPoints

gouc
Hello,

I need to use a vtkPointSet in order to create a mesh.

Problem, vtkPointSet has a private constructor.

I then used a vtkPolyData initialised as following:

vtkSmartPointer<vtkPolyData> points1Set = vtkSmartPointer<vtkPolyData>::New();
points1Set->SetPoints(points1);

where points is of type vtkSmartPointer<vtkPoints> and contains 70 points.

In order to get a vtkPointSet, I use  vtkPointSet::SafeDownCast(points1Set)

The problem is that it seems that it seems to return an empty set of point.

What is a good way to generate a vtkPointSet from vtkPoints?

Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: Declare and initialize a vtkPointSet with vtkPoints

gouc
So I have my answer,

To create a vtkPolyData :

1/ I store the points (in my test it contains 70 points)
in the variable of type:
vtkSmartPointer<vtkPoints> points1;

2/ I create a vtkPolyData
vtkSmartPointer<vtkPolyData> points1Polydata = vtkSmartPointer<vtkPolyData>::New();
points1Polydata->SetPoints(points1);

vtkPolyData inherits from vtkPointSet.