Switch from Gauss to Mean curvature no working
To reproduce:
- Source -> Sphere -> Apply
- Filter-> Curvature -> Apply (the default curvature displayed is Gaussian, and is working fine )
- Switch the curvature type to Mean, nothing is displayed, and the legend caption remain Gauss_Curvature.
In filters_filtersgeneral.xml we have
<IntVectorProperty command="SetCurvatureType"
default_values="0"
name="CurvatureType"
number_of_elements="1">
<EnumerationDomain name="enum">
<Entry text="Gaussian"
value="0" />
<Entry text="Mean"
value="1" />
If we switch default_values="0"
to default_values="1"
, the opposite happen: the Mean curvature is working, but not the Gaussian.
So this is not a problem in the implementation of the Mean curvature.
In vtkCurvatures::GetGaussCurvature(vtkPolyData* output) we have something equivalent to:
gaussCurvature->SetName("Gauss_Curvature");
output->GetPointData()->AddArray(gaussCurvature);
output->GetPointData()->SetActiveScalars(gaussCurvature->GetName());
and in vtkCurvatures::GetMeanCurvature(vtkPolyData* output) we have something equivalent to:
meanCurvature->SetName("Mean_Curvature");
output->GetPointData()->AddArray(meanCurvature);
output->GetPointData()->SetActiveScalars(meanCurvature->GetName());
If both names "Mean_Curvature"
and "Gauss_Curvature"
are renamed with the same name as for instance "Curvature"
, things are working fine.
So the problem would be that SetActiveScalars
is not working correctly, or that the filter is not loading the active scalar. But I don't know where this happen.
Any thought?
Edited by Florian Maurin