[vtkusers] Cannot access to functions in vtkCurvatures class!!!

Peter F Bradshaw pfb at exadios.com
Mon Sep 22 01:04:55 EDT 2008


Hi;

Which version of the VTK library are you using?

On Fri, 19 Sep 2008, B. C. wrote:

> Good evening everybody.
> I'm using vtkCurvatures class to extract curvatures from a polydata object. 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'

Are you aware that, in the VTK 5.* versions of the library, those
functions are protected members of vtkCurvatures? This means that they
are not avaliable to outside users of the class. So, for instance, the
following will not work:

vtkPolyData *myData = vtkPolyData::New();
vtkCurvatures *aCurvaturesFilter = vtkCurvatures::New;
.
.
.
  aCurvaturesFilter->GetMeanCurvature(myData);  // Error - function not
                                                // declared public.

>
> What should i do for each case??

Assuming that the problem is that only you have overlooked the protected
decls of these functions then the simplest fix is that you write a class
that is derived from vtkCurvatures in which you decl public those
protected functions you need to access. For those functions you then
code the access to the protected parent functions.

However, the answer in a wider sense may depend on how you are using
vtkCurvatures in the context of your program.

>  
> Thank you so much
>

Cheers

-- 
Peter F Bradshaw: http://www.exadios.com (public keys avaliable there).
Personal site: http://personal.exadios.com
"I love truth, and the way the government still uses it occasionally to
 keep us guessing." - Sam Kekovich.



More information about the vtkusers mailing list