[vtkusers] 'vtkCurvatures' class has no member called 'GetMaximumCurvature'

Goodwin Lawlor goodwin.lawlor at ucd.ie
Mon Oct 6 14:00:21 EDT 2008


B. C. wrote:
> Good evening everybody.
> I'm using vtkCurvatures class to extract curvatures from a polydata 
> object. I'm using vtk 4.4 and i'm refering to '*VTK vtkCurvatures Class 
> Reference.mht*'
>  
> When i try to extract maximum curvatures using 'GetMaximumCurvature' , i 
> have this error message:
> 'GetMaximumCurvature' : is not a member of 'vtkCurvatures'
> And, when i try to extract mean curvatures using 'GetMeanCurvature' , i 
> have this error message:
> 'GetMeanCurvature' : cannot access protected member declared in class 
> 'vtkCurvatures'
>  
> What should i do for each case??
>  
> Thank you so much

Hi B.C.

There's a couple of things here:

1. Max/Min curvature calculation was added to this class after the 
VTK4.4 release - you should upgrade to 5.0.4 or 5.2, if you can, to get 
this functionality.

2. GetMeanCurvature, GetGaussianCurvature, GetMaximumCurvature, and 
GetMinimumCurvature are "protected" methods used internally in this 
class. They can't be used externally by you. You have to use the class 
as Francois wrote:

vtkCurvatures *curve1=vtkCurvatures::New();
curve1->SetInputConnection(cleaner->GetOutputPort());
curve1->SetCurvatureTypeToGaussian();
curve1->Update();

vtkPolyData *result=curve1->GetOutput():
vtkDoubleArray *gauss_curves = result->GetPointData()->GetScalars();

// get the gauss value at point 0
double val = gauss_curves->GetValue(0);

The class is designed like this so that it works as a filter within 
VTK's pipeline architecture (just in case you are asking yourself why 
you can't just used those protected methods...)

hth

Goodwin




More information about the vtkusers mailing list