[vtk-developers] Proposed change in vtkSetGet.h

Thompson, David C dcthomp at sandia.gov
Fri Dec 11 11:08:22 EST 2009


The doxygen documentation doesn't run the C preprocessor on input files
so the macros have nothing to do with the generated documentation.
Instead, in VTK/Utilities/Doxygen/doxyfile.in you can see that the PREDEFINED
keyword is used to list substitutions for each of the macros. If anything
gets changed, it should be that, not vtkSetGet.h.

    David
________________________________________
From: vtk-developers-bounces at vtk.org [vtk-developers-bounces at vtk.org] On Behalf Of Moreland, Kenneth [kmorel at sandia.gov]
Sent: Friday, December 11, 2009 07:10
To: David Doria; VTK Developers
Subject: Re: [vtk-developers] Proposed change in vtkSetGet.h

I don't think this is a good idea.  First, you are making an argument to the method be the same as the class member you are setting, which gives me the heebie-jeebies.  Second, naming the argument does not seem all that necessary as its nature is implied by the method name and associated documentation.  That is, I don't see how the current documentation is in any way ambiguous and this seems to be a non-issue.

-Ken
________________________________________
From: vtk-developers-bounces at vtk.org [vtk-developers-bounces at vtk.org] On Behalf Of David Doria [daviddoria+vtk at gmail.com]
Sent: Thursday, December 10, 2009 4:28 PM
To: VTK Developers
Subject: [vtk-developers] Proposed change in vtkSetGet.h

It seems that the macros do not name the variable. This causes very
obscure documentation such as
(double, double, double) or simply () in some cases. Can we change
things like the following:

#define vtkSetMacro(name,type) \
virtual void Set##name (type _arg) \
  { \
  vtkDebugMacro(<< this->GetClassName() << " (" << this << "): setting
" #name " to " << _arg); \
  if (this->name != _arg) \
    { \
    this->name = _arg; \
    this->Modified(); \
    } \
  }

to something like

#define vtkSetMacro(name,type) \
virtual void Set##name (type name) \
  { \
  vtkDebugMacro(<< this->GetClassName() << " (" << this << "): setting
" #name " to " << name); \
  if (this->name != name) \
    { \
    this->name = name; \
    this->Modified(); \
    } \
  }

Exactly this code may not be the solution because 'name' and
'this->name' may be ambiguous, but can something be done here?

I'm also curious why the _arg does not show up in the doxygen
documentation - is this removed by the doxygen parser or one of the
scripts that is run to convert the header to doxygen?

Thanks,

David
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtk-developers



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtk-developers






More information about the vtk-developers mailing list