vtkQuadricDecimation - why not copy PointData every time?
I have scalars on my pointdata in a vtkPolyData (RGB values).
When I run the polydata through vtkQuadricDecimation, the results do not have the pointdata anymore.
If I first call decimate->SetAttributeErrorMetric(1);
then the decimator will copy the pointdata, on line vtkQuadricDecimation.cxx:231
if (this->AttributeErrorMetric)
{
this->Mesh->GetPointData()->DeepCopy(input->GetPointData());
}
The results are as I would expect (ie my RGB values survive the decimation),
and the decimation results appear to be the same (no actual attribute-errors are used in the calculation, because I never call decimate->SetScalarAttribute()
or any other extra attribute setting.
The only difference appears to be that the algorithm calls ComputeCost2() rather than the simpler ComputeCost().
If I adjust the code to always copy the PointData, and do not enable the AttributeErrorMetric(), then the results are still what I'd like - RGB scalars survive, AND the algorithm uses ComputeCost().
My question is, why not always do a PointData deep copy?
ie change the code to simply: vtkQuadricDecimation.cxx:231
this->Mesh->GetPointData()->DeepCopy(input->GetPointData());
Best regards, Paul