[vtkusers] create a polyData from selected cell

David Doria daviddoria at gmail.com
Fri May 18 11:05:16 EDT 2012


 vtkSmartPointer<vtkPolyData> newdata =
   vtkSmartPointer<vtkPolyData>::New();
vtkPoints* cellPoints = selected->GetPoints();
newdata->SetPoints(cellPoints);

vtkSmartPointer< vtkTriangleFilter > triangleFilter =
  vtkSmartPointer<vtkTriangleFilter>::New();
triangleFilter->SetInputConnection(newdata->GetProducerPort());
triangleFilter->Update();

vtkSmartPointer< vtkLoopSubdivisionFilter > subdivisionFilter =
  vtkSmartPointer<vtkLoopSubdivisionFilter>::New();
subdivisionFilter->SetNumberOfSubdivisions(numberOfSubdivisions);
subdivisionFilter->SetInputConnection(triangleFilter->GetOutputPort());
subdivisionFilter->Update();



More information about the vtkusers mailing list