[vtkusers] Proper way to append to vtkPoints
Cory Quammen
cory.quammen at kitware.com
Wed Sep 14 14:50:27 EDT 2016
For expanding the list of points, use points->InsertPoint(1, 1, 1, 1)
instead of points->SetPoint(1, 1, 1, 1).
HTH,
Cory
On Wed, Sep 14, 2016 at 2:43 PM, Bud Bundy <budric at gmail.com> wrote:
> 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.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
--
Cory Quammen
Staff R&D Engineer
Kitware, Inc.
More information about the vtkusers
mailing list