62 vtkInformationVector** inputVector,
63 vtkInformationVector* outputVector)
73 const std::vector<GeoLib::Point*>* surfacePoints =
74 (*_surfaces)[0]->getPointVec();
75 std::size_t
const nPoints = surfacePoints->size();
77 vtkSmartPointer<vtkInformation> outInfo =
78 outputVector->GetInformationObject(0);
79 vtkSmartPointer<vtkPolyData> output =
80 vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
81 if (outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER()) >
87 vtkSmartPointer<vtkPoints> newPoints = vtkSmartPointer<vtkPoints>::New();
88 newPoints->SetNumberOfPoints(nPoints);
90 vtkSmartPointer<vtkCellArray> newPolygons =
91 vtkSmartPointer<vtkCellArray>::New();
94 vtkSmartPointer<vtkIntArray> sfcIDs = vtkSmartPointer<vtkIntArray>::New();
95 sfcIDs->SetNumberOfComponents(1);
96 sfcIDs->SetName(
"SurfaceIDs");
98 for (std::size_t i = 0; i < nPoints; ++i)
100 newPoints->SetPoint(i, (*surfacePoints)[i]->data());
106 const std::size_t nTriangles = surface->getNumberOfTriangles();
108 for (std::size_t i = 0; i < nTriangles; ++i)
110 vtkTriangle* new_tri = vtkTriangle::New();
111 new_tri->GetPointIds()->SetNumberOfIds(3);
114 for (std::size_t j = 0; j < 3; ++j)
116 new_tri->GetPointIds()->SetId(j, ((*triangle)[j]));
118 newPolygons->InsertNextCell(new_tri);
119 sfcIDs->InsertNextValue(count);
125 output->SetPoints(newPoints);
126 output->SetPolys(newPolygons);
127 output->GetCellData()->AddArray(sfcIDs);
128 output->GetCellData()->SetActiveAttribute(
"SurfaceIDs",
129 vtkDataSetAttributes::SCALARS);