[vtkusers] Const get macros?

Sean McBride sean at rogue-research.com
Fri Aug 14 17:17:27 EDT 2009


On 8/10/09 4:59 PM, David Doria said:

>Are there const get macros? (I didn't see any in vtkSetGet.h)
>
>I have done this:
>class vtkRay
>{
>vtkGetVector3Macro(Origin,double);
>}
>
>and later accessed it with;
>void MyFunc(const vtkRay* R)
>{
>const double Ray1P1[3] = R->GetOrigin();
>}
>
>and it is saying that I can't call GetOrigin on R because R is const and
>GetOrigin() is not a const function.
>
>Should I just define my own Get functions when they need to be const?

I think ITK has const versions, you might copy how it does it, and
submit that as a patch to VTK.

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada





More information about the vtkusers mailing list