<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta name="robots" content="noindex"> <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>ITK: itkFEMP.h Source File</title> <link href="DoxygenStyle.css" rel="stylesheet" type="text/css"> </head><body bgcolor="#ffffff"> <!-- Section customized for INSIGHT : Tue Jul 17 01:02:45 2001 --> <center> <a href="index.html" class="qindex">Main Page</a> <a href="modules.html" class="qindex">Groups</a> <a href="namespaces.html" class="qindex">Namespace List</a> <a href="hierarchy.html" class="qindex">Class Hierarchy</a> <a href="classes.html" class="qindex">Alphabetical List</a> <a href="annotated.html" class="qindex">Compound List</a> <a href="files.html" class="qindex">File List</a> <a href="namespacemembers.html" class="qindex">Namespace Members</a> <a href="functions.html" class="qindex">Compound Members</a> <a href="globals.html" class="qindex">File Members</a> <a href="pages.html" class="qindex">Concepts</a></center> <!-- Generated by Doxygen 1.5.9 --> <div class="navpath"><a class="el" href="dir_02e23d841c198393a6e961e9a0678fff.html">Code</a> » <a class="el" href="dir_2c33022d19e8077162952ea9ed57656d.html">Numerics</a> » <a class="el" href="dir_316e5ab5c8a9cb56a9dce1c9fc454a23.html">FEM</a> </div> <div class="contents"> <h1>itkFEMP.h</h1><a href="itkFEMP_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*=========================================================================</span> <a name="l00002"></a>00002 <span class="comment"></span> <a name="l00003"></a>00003 <span class="comment"> Program: Insight Segmentation & Registration Toolkit</span> <a name="l00004"></a>00004 <span class="comment"> Module: $RCSfile: itkFEMP.h,v $</span> <a name="l00005"></a>00005 <span class="comment"> Language: C++</span> <a name="l00006"></a>00006 <span class="comment"> Date: $Date: 2009-01-30 21:53:03 $</span> <a name="l00007"></a>00007 <span class="comment"> Version: $Revision: 1.11 $</span> <a name="l00008"></a>00008 <span class="comment"></span> <a name="l00009"></a>00009 <span class="comment"> Copyright (c) Insight Software Consortium. All rights reserved.</span> <a name="l00010"></a>00010 <span class="comment"> See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.</span> <a name="l00011"></a>00011 <span class="comment"></span> <a name="l00012"></a>00012 <span class="comment"> This software is distributed WITHOUT ANY WARRANTY; without even </span> <a name="l00013"></a>00013 <span class="comment"> the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR </span> <a name="l00014"></a>00014 <span class="comment"> PURPOSE. See the above copyright notices for more information.</span> <a name="l00015"></a>00015 <span class="comment"></span> <a name="l00016"></a>00016 <span class="comment">=========================================================================*/</span> <a name="l00017"></a>00017 <span class="preprocessor">#ifndef __itkFEMP_h</span> <a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define __itkFEMP_h</span> <a name="l00019"></a>00019 <span class="preprocessor"></span> <a name="l00020"></a>00020 <span class="keyword">namespace </span>itk { <a name="l00021"></a>00021 <span class="keyword">namespace </span>fem { <a name="l00022"></a>00022 <a name="l00042"></a>00042 <span class="keyword">template</span><<span class="keyword">class</span> T> <a name="l00043"></a><a class="code" href="classitk_1_1fem_1_1FEMP.html">00043</a> <span class="keyword">class </span><a class="code" href="classitk_1_1fem_1_1FEMP.html" title="Pointer used to store polymorphic elements in STL arrays.">FEMP</a> <a name="l00044"></a>00044 { <a name="l00045"></a>00045 <span class="keyword">public</span>: <a name="l00046"></a>00046 <a name="l00052"></a><a class="code" href="classitk_1_1fem_1_1FEMP.html#fa30291203cbe8757f857aaf85a44e5d">00052</a> <a class="code" href="classitk_1_1fem_1_1FEMP.html#fa30291203cbe8757f857aaf85a44e5d">FEMP</a>() : m_Data(0) <a name="l00053"></a>00053 { <a name="l00054"></a>00054 } <a name="l00055"></a>00055 <a name="l00060"></a><a class="code" href="classitk_1_1fem_1_1FEMP.html#f17997734c17f055ce9bf70ed8695107">00060</a> <a class="code" href="classitk_1_1fem_1_1FEMP.html#fa30291203cbe8757f857aaf85a44e5d">FEMP</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1fem_1_1FEMP.html" title="Pointer used to store polymorphic elements in STL arrays.">FEMP</a>& x) <a name="l00061"></a>00061 { <a name="l00062"></a>00062 <span class="keywordflow">if</span> (x.m_Data) <a name="l00063"></a>00063 { <a name="l00064"></a>00064 m_Data=<span class="keyword">static_cast<</span>T*<span class="keyword">></span>(&*x.m_Data->Clone()); <a name="l00065"></a>00065 } <a name="l00066"></a>00066 <span class="keywordflow">else</span> <a name="l00067"></a>00067 { <a name="l00068"></a>00068 m_Data=0; <a name="l00069"></a>00069 } <a name="l00070"></a>00070 } <a name="l00072"></a>00072 <a name="l00079"></a><a class="code" href="classitk_1_1fem_1_1FEMP.html#d11e3b551625498d578424ca75e6be87">00079</a> <span class="keyword">explicit</span> <a class="code" href="classitk_1_1fem_1_1FEMP.html#fa30291203cbe8757f857aaf85a44e5d">FEMP</a>(<span class="keyword">typename</span> <a class="code" href="itkFEMMacro_8h.html#539cce1a3282ba59952dedcbf9cdb23f">T::Pointer</a> x) : m_Data(x) <a name="l00080"></a>00080 {} <a name="l00081"></a>00081 <a name="l00085"></a><a class="code" href="classitk_1_1fem_1_1FEMP.html#fbe1ef85178d0cc286101d1d4754eb8a">00085</a> <a class="code" href="classitk_1_1fem_1_1FEMP.html#fbe1ef85178d0cc286101d1d4754eb8a">~FEMP</a>() <a name="l00086"></a>00086 { <a name="l00087"></a>00087 <span class="preprocessor"> #ifndef FEM_USE_SMART_POINTERS</span> <a name="l00088"></a>00088 <span class="preprocessor"></span> <span class="keyword">delete</span> m_Data; <a name="l00089"></a>00089 <span class="preprocessor"> #endif</span> <a name="l00090"></a>00090 <span class="preprocessor"></span> } <a name="l00091"></a>00091 <a name="l00095"></a>00095 <span class="keyword">const</span> <a class="code" href="classitk_1_1fem_1_1FEMP.html" title="Pointer used to store polymorphic elements in STL arrays.">FEMP</a>& <a class="code" href="classitk_1_1fem_1_1FEMP.html#2c318caf112435284d205b155e2515a8">operator= </a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1fem_1_1FEMP.html" title="Pointer used to store polymorphic elements in STL arrays.">FEMP</a> &rhs); <a name="l00096"></a>00096 <a name="l00100"></a><a class="code" href="classitk_1_1fem_1_1FEMP.html#45b0daf938929f39a9e4065c2da4dac1">00100</a> <span class="keyword">typename</span> <a class="code" href="itkFEMMacro_8h.html#539cce1a3282ba59952dedcbf9cdb23f">T::Pointer</a> <a class="code" href="classitk_1_1fem_1_1FEMP.html#45b0daf938929f39a9e4065c2da4dac1">operator-> </a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Data; } <a name="l00101"></a>00101 <a name="l00106"></a><a class="code" href="classitk_1_1fem_1_1FEMP.html#ba5c232fe12b9fa9e5e4e8c1babd8008">00106</a> <a class="code" href="classitk_1_1fem_1_1FEMP.html#ba5c232fe12b9fa9e5e4e8c1babd8008">operator T * </a>()<span class="keyword"> const</span> <a name="l00107"></a>00107 <span class="keyword"> </span>{ <a name="l00108"></a>00108 <span class="keywordflow">return</span> m_Data; <a name="l00109"></a>00109 } <a name="l00110"></a>00110 <a name="l00115"></a><a class="code" href="classitk_1_1fem_1_1FEMP.html#76c0b24ef12222935e4036f1a7620c21">00115</a> <span class="keywordtype">bool</span> <a class="code" href="classitk_1_1fem_1_1FEMP.html#76c0b24ef12222935e4036f1a7620c21">IsNULL</a>()<span class="keyword"> const</span> <a name="l00116"></a>00116 <span class="keyword"> </span>{ <a name="l00117"></a>00117 <span class="keywordflow">return</span> (m_Data==0); <a name="l00118"></a>00118 } <a name="l00119"></a>00119 <a name="l00120"></a>00120 <span class="keyword">private</span>: <a name="l00121"></a>00121 <a name="l00125"></a>00125 <span class="keyword">typename</span> <a class="code" href="itkFEMMacro_8h.html#539cce1a3282ba59952dedcbf9cdb23f">T::Pointer</a> m_Data; <a name="l00126"></a>00126 <a name="l00127"></a>00127 }; <a name="l00128"></a>00128 <a name="l00129"></a>00129 <span class="keyword">template</span><<span class="keyword">class</span> T> <a name="l00130"></a><a class="code" href="classitk_1_1fem_1_1FEMP.html#2c318caf112435284d205b155e2515a8">00130</a> <span class="keyword">const</span> <a class="code" href="classitk_1_1fem_1_1FEMP.html" title="Pointer used to store polymorphic elements in STL arrays.">FEMP<T></a>& <a class="code" href="classitk_1_1fem_1_1FEMP.html#2c318caf112435284d205b155e2515a8">FEMP<T>::operator= </a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1fem_1_1FEMP.html" title="Pointer used to store polymorphic elements in STL arrays.">FEMP</a> &rhs) <a name="l00131"></a>00131 { <a name="l00132"></a>00132 <a name="l00134"></a>00134 <span class="keywordflow">if</span> (&rhs!=<span class="keyword">this</span>) <a name="l00135"></a>00135 { <a name="l00136"></a>00136 <a name="l00140"></a>00140 <span class="preprocessor"> #ifndef FEM_USE_SMART_POINTERS</span> <a name="l00141"></a>00141 <span class="preprocessor"></span> <span class="keyword">delete</span> m_Data; <a name="l00142"></a>00142 <span class="preprocessor"> #else</span> <a name="l00143"></a>00143 <span class="preprocessor"></span> m_Data=0; <a name="l00144"></a>00144 <span class="preprocessor"> #endif</span> <a name="l00145"></a>00145 <span class="preprocessor"></span> <a name="l00150"></a>00150 <span class="keywordflow">if</span> (rhs.m_Data) <a name="l00151"></a>00151 { <a name="l00152"></a>00152 m_Data=<span class="keyword">static_cast<</span>T*<span class="keyword">></span>(&*rhs.m_Data->Clone()); <a name="l00153"></a>00153 } <a name="l00154"></a>00154 <span class="keywordflow">else</span> <a name="l00155"></a>00155 { <a name="l00156"></a>00156 m_Data=0; <a name="l00157"></a>00157 } <a name="l00159"></a>00159 <a name="l00160"></a>00160 } <a name="l00161"></a>00161 <span class="keywordflow">return</span> *<span class="keyword">this</span>; <a name="l00162"></a>00162 } <a name="l00163"></a>00163 <a name="l00164"></a>00164 }} <span class="comment">// end namespace itk::fem</span> <a name="l00165"></a>00165 <a name="l00166"></a>00166 <span class="preprocessor">#endif // #ifndef __itkFEMP_h</span> <a name="l00167"></a>00167 <span class="preprocessor"></span> </pre></div></div> <hr><address><small> Generated at Thu May 7 22:42:00 2009 for ITK by <a href="http://www.stack.nl/~dimitri/doxygen/index.html"> <img src="http://www.stack.nl/~dimitri/doxygen/doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53> </a> 1.5.9 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>, © 1997-2000</small></address> </body> </html>