[vtkusers] Proper way to append to vtkPoints

Bud Bundy budric at gmail.com
Wed Sep 14 14:43:43 EDT 2016


Hi,

What's the proper, efficient way to append point data to vtkPoints?  The 
following does not work (assume 2 batches insert thousands of points not 
1 per each batch)

     vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
     points->SetNumberOfPoints(1);        //first batch insert
     points->SetPoint(0, 0, 0, 0);
     points->Resize(2);                    //second batch insert
     points->SetPoint(1, 1, 1, 1);
     size_t size = points->GetNumberOfPoints();
     //size == 1 not 2

I'm using VTK 7.0.0.

Thank you.



More information about the vtkusers mailing list