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

Brad King brad.king at kitware.com
Fri Feb 8 10:40:45 EST 2002


> vtkSetObjectCxxMacro or vtkCxxSetObjectMacro
> If you all agree, I will make the change.

I had previously added "vtkCxxRevisionMacro" with that particular name
because it is intended to be used only in a .cxx file.  For consistency, I
would choose "vtkCxxSetObjectMacro" for the new macro's name.  It isn't
much longer than "vtkSetObjectMacro", and it clearly indicates it should
be used in a .cxx only.

One other detail:

>         void SetTransformMatrix(vtkMatrix4x4*);

This declaration should be

       virtual void SetTransformMatrix(vtkMatrix4x4*);

to be consistent with the old vtkSetObjectMacro implementation.  It is
necessary to enable subclasses to replace the set method.

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
...

Anyone that needs to write a special Set method should know enough to
correctly implement it.  In some cases, the macro's body implementation
may not be suitable for the special method anyway.

-Brad




More information about the vtk-developers mailing list