<br><br><div class="gmail_quote">On Fri, Aug 14, 2009 at 11:38 PM, Bill Lorensen <span dir="ltr">&lt;<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
David,<br>
<br>
Be aware that adding a const version of the get macro may affect<br>
wrapping. I believe that vtkParse.l handles vtkGetMacro, but there is<br>
not provision to handle a GetConstMacro.<br>
<br>
Bill<br>
<div><div></div><div class="h5"></div></div></blockquote><div><br>In  /..../itk/src/Code/Common/itkMacro.h there is simply<br>
<br>
#define itkGetConstMacro(name,type) \<br>
  virtual type Get##name () const \<br>
  { \<br>
    itkDebugMacro(&quot;returning &quot; &lt;&lt; #name &quot; of &quot; &lt;&lt; this-&gt;m_##name ); \<br>
    return this-&gt;m_##name; \<br>
  }<br>
<br>
To make the const macro, this could just be changed to:<br>
<br>
#define vtkGetConstMacro(name,type) \<br>

  virtual type Get##name () const { \<br>
    vtkDebugMacro(&lt;&lt; this-&gt;GetClassName() &lt;&lt; &quot; (&quot;
&lt;&lt; this &lt;&lt; &quot;): returning &quot; &lt;&lt; #name &quot; of &quot; &lt;&lt;
this-&gt;m_name ); \<br>

    return this-&gt;m_name; \<br>

  }<br>
<br>
(copied from  /..../vtk/src/Common/vtkSetGet.h ) which was:<br>
#define vtkGetMacro(name,type) \<br>
virtual type Get##name () { \<br>
  vtkDebugMacro(&lt;&lt; this-&gt;GetClassName() &lt;&lt; &quot; (&quot; &lt;&lt;
this &lt;&lt; &quot;): returning &quot; &lt;&lt; #name &quot; of &quot; &lt;&lt;
this-&gt;name ); \<br>
  return this-&gt;name; \<br>
  } <br>
<br>
@Bill, I have no idea about wrapping - so if someone sees a problem can
you please take a look? Was there a reason that this const get method
was omited in the first place?<br>
<br>
Object macros :<br>
<br>
I am a bit confused about the ObjectMacros. In vtkSetGet.h, it says
vtkSetObjectMacro should be used in the h file and vtkCxxSetObjectMacro
should be used in the cxx file. But the comment for
vtkCxxSetObjectMacro says you have to actually put<br>
virtual void Set&quot;name&quot;(&quot;type&quot; *);<br>
in the header file... so then what would be the use of vtkSetObjectMacro? and why is there no vtkCxxGetObjectMacro?<br>
<br>
Thanks,<br><br>David <br></div></div>