[vtk-developers] Another 'major' change in vtkSetGet

Volpe, Christopher R (CRD) volpecr at crd.ge.com
Fri Feb 8 10:49:57 EST 2002



> I'm not sure about the "vtkSetObjectBodyMacro".  If we 
> provide the macro
> for objects, developers may expect it for the other set/get 
> macros.  This
> could get ugly:
> 
> vtkSetBodyMacro
> vtkSetVector2BodyMacro
> vtkSetClampBodyMacro
> vtkSetStringBodyMacro

I don't consider this ugly. (At least no more so than the barrage of vtk${PROJECT}Instantiator${NUM}
that has recently appeared in the class list in my DevStudio window.)  I would consider that an added
convenience and possibly a Good Idea. But then, I had also proposed a mechanism to address the same
issue as the vtkSetObjectBody macro, and it got shot down.

> ...
> 
> Anyone that needs to write a special Set method should know enough to
> correctly implement it.

You could also argue for the elimination of all the SetGet macros on the same basis.

>  In some cases, the macro's body 
> implementation
> may not be suitable for the special method anyway.

Sure, there'll still be special cases. But there would be fewer. And fewer special cases means fewer
things to fix if there should ever come a time when it is decided that the implementation of the
SetGet macros needs to change, for whatever reason. The macros do more than provide convenience: they
ensure consistency.

-Chris



More information about the vtk-developers mailing list