[vtkusers] vtkQuadricDecimation does not propagate Pedigree IDs to output

Mikhail SAZONOV mikhail.sazonov at opencascade.com
Tue Nov 20 04:52:20 EST 2018


I am wondering if there is possibility to propagate Pedigree IDs of cells from input of vtkQuadricDecimation to its output. I was tried many ways, with and without pipelines. Every time the array of pedigree ids is a null pointer.

  vtkSmartPointer<vtkPolyData> aPolyData = vtkSmartPointer<vtkPolyData>::New ();
  vtkSmartPointer<vtkPoints> aVertData = vtkSmartPointer<vtkPoints>::New ();
 aPolyData->SetPoints (aVertData);
  vtkSmartPointer<vtkIdFilter> aIdFilter = vtkIdFilter::New ();
  aIdFilter->SetInputData (aPolyData);
  aIdFilter->SetFieldData (1);
  aIdFilter->SetPointIds (0);
  aIdFilter->SetCellIds (1);
  aIdFilter->SetIdsArrayName ("id");

  vtkSmartPointer<vtkQuadricDecimation> anAlgo = vtkSmartPointer<vtkQuadricDecimation>::New();
  anAlgo->SetInputConnection (aIdFilter->GetOutputPort ());
  anAlgo->SetTargetReduction (theTargetRatio);
  anAlgo->Update ();

  auto* aNewPolyData = anAlgo->GetOutput();
  vtkIntArray* aNewPedIds = static_cast<vtkIntArray*>(aNewPolyData->GetCellData()->GetPedigreeIds());

aNewPedIds is null.

Thanks in advance.
Best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20181120/3272836f/attachment.html>

More information about the vtkusers mailing list