[Insight-developers] FEM Smart Pointers

Magnotta, Vincent A vincent-magnotta at uiowa.edu
Mon Feb 21 11:07:23 EST 2011


I have started to make a pass through the FEM framework to enable Smart Pointers. This address a bug report 0011527. Based on the bugs that I am finding in the macros it appears that it has been a long time since this worked. What I did was to uncomment the the line in ITK/Code/Numerics/FEM/itkFEMMacro.h to enable smart pointers. After I added a couple of semicolons to get the basic syntax of the macros correct I get several compiler errors related to incorrect casting. To resolve several of the problems, I had to add the GetPointer() to method several smart pointer variables. For example, lines 168-171 of  itkFEMMacro.h were modified to

virtual Baseclass::Pointer Clone() const \
 { Pointer o=New(); /*new Self(*this);*/           \
   o->SetReferenceCount(1);             \
   return o.GetPointer(); }                \

and lines 175-176 were modified to

static Baseclass::Pointer NewB()         \
  { return New().GetPointer(); }                      \

I have made several other changes to the CXX files that are similar. Before I go any further, I was wondering if this is the right think to do or if there is a better way to solve this problem.

Thanks,
Vince


--
Associate Professor
Department of Radiology
0453-D JCP
200 Hawkins Drive
Iowa City, IA 52242
E-mail: vincent-magnotta at uiowa.edu
Phone: 319-356-8255 Fax: 319-353-6275
Website: http://www.healthcare.uiowa.edu/Radiology



________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20110221/aef3333a/attachment.htm>


More information about the Insight-developers mailing list