[vtkusers] How to delete points ?

Stefan sickboy at 9elements.com
Wed Feb 20 07:59:51 EST 2008


How can i delete a point of my PolyData Geometry ?
This is my geometry. I'd like to delete point 0 for example.

for (int i = 1; i < 6; i++)
{
                float xmax = xmin + xLength*i;
                float ymax = ymin + yLength*i;
                vtkPoints* pts = vtkPoints::New();
 
                pts->InsertPoint(0, xmin, ymin, 0);
                pts->InsertPoint(1, xmax, ymin, 0);
                pts->InsertPoint(2, xmax, ymax, 0);
                pts->InsertPoint(3, xmin, ymax, 0);
 
                vtkCellArray* rect = vtkCellArray::New();
                rect->InsertNextCell(5);
                rect->InsertCellPoint(0);
                rect->InsertCellPoint(1);
                rect->InsertCellPoint(2);
                rect->InsertCellPoint(3);
                rect->InsertCellPoint(0);
                
                selectRect = vtkPolyData::New();
                selectRect->SetPoints(pts);
                selectRect->SetPolys(rect);
 
                vtkPolyDataMapper* pRectPolyMapper = 
vtkPolyDataMapper::New();
                p2DRectPolyMapper->SetInput(selectRect);

                p2DRectActor = vtkActor::New();
                p2DRectActor->SetMapper(pRectPolyMapper);

                pRenderer->AddActor2D(pRectActor);
 
                selectRect2D->DeletePoint(0);
}




More information about the vtkusers mailing list