40 #include <vtkSmartPointer.h>
41 #include <vtkPoints.h>
42 #include <vtkPolygon.h>
43 #include <vtkUnstructuredGrid.h>
50 if (cloud->
points.empty ())
56 poly_points->SetNumberOfPoints (cloud->
points.size ());
57 polygon->GetPointIds ()->SetNumberOfIds (cloud->
points.size ());
60 for (i = 0; i < cloud->
points.size (); ++i)
63 polygon->GetPointIds ()->SetId (i, i);
67 poly_grid->Allocate (1, 1);
68 poly_grid->InsertNextCell (polygon->GetCellType (), polygon->GetPointIds ());
69 poly_grid->SetPoints (poly_points);
86 poly_points->SetNumberOfPoints (planar_polygon.
getContour ().
size () + 1);
87 polygon->GetPointIds ()->SetNumberOfIds (planar_polygon.
getContour ().
size () + 1);
92 poly_points->SetPoint (i, planar_polygon.
getContour ()[i].x,
95 polygon->GetPointIds ()->SetId (i, i);
98 poly_points->SetPoint (i, planar_polygon.
getContour ()[0].x,
101 polygon->GetPointIds ()->SetId (i, i);
104 poly_grid->Allocate (1, 1);
105 poly_grid->InsertNextCell (polygon->GetCellType (), polygon->GetPointIds ());
106 poly_grid->SetPoints (poly_points);
107 poly_grid->Update ();