<!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: itkPolygonSpatialObject.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_084028962346eb941dab2e2ab3977cb8.html">SpatialObject</a> </div> <div class="contents"> <h1>itkPolygonSpatialObject.h</h1><a href="itkPolygonSpatialObject_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: itkPolygonSpatialObject.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-16 11:38:00 $</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 __itkPolygonSpatialObject_h</span> <a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define __itkPolygonSpatialObject_h</span> <a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="itkBlobSpatialObject_8h.html">itkBlobSpatialObject.h</a>"</span> <a name="l00020"></a>00020 <span class="preprocessor">#include "<a class="code" href="itkPolygonGroupOrientation_8h.html">itkPolygonGroupOrientation.h</a>"</span> <a name="l00021"></a>00021 <a name="l00022"></a>00022 <span class="keyword">namespace </span>itk <a name="l00023"></a>00023 { <a name="l00024"></a>00024 <a name="l00029"></a><a class="code" href="classitk_1_1PolygonSpatialObject.html">00029</a> <span class="keyword">template</span> <<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> TDimension = 3> <span class="keyword">class </span> <a name="l00030"></a>00030 <a class="code" href="classitk_1_1PolygonSpatialObject.html" title="TODO.">PolygonSpatialObject</a> <a name="l00031"></a>00031 :<span class="keyword">public</span> <a class="code" href="classitk_1_1BlobSpatialObject.html" title="Spatial object representing a potentially amorphous object.">BlobSpatialObject</a><TDimension> <a name="l00032"></a>00032 { <a name="l00033"></a>00033 <span class="keyword">public</span>: <a name="l00034"></a><a class="code" href="classitk_1_1PolygonSpatialObject.html#78e3cf1c7b62c1e17923283cec6f7d57">00034</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1PolygonSpatialObject.html" title="TODO.">PolygonSpatialObject<TDimension></a> <a class="code" href="classitk_1_1DataObject.html" title="Base class for all data objects in ITK.">Self</a>; <a name="l00035"></a><a class="code" href="classitk_1_1PolygonSpatialObject.html#206f81ffeab2809506a8536b7ed2ec27">00035</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1BlobSpatialObject.html">BlobSpatialObject< TDimension ></a> <a class="code" href="classitk_1_1Object.html" title="Base class for most itk classes.">Superclass</a>; <a name="l00036"></a><a class="code" href="classitk_1_1PolygonSpatialObject.html#7d8ac204ae839349c735477d9d21efc2">00036</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1SmartPointer.html">SmartPointer < Self ></a> <a class="code" href="classitk_1_1SmartPointer.html">Pointer</a>; <a name="l00037"></a><a class="code" href="classitk_1_1PolygonSpatialObject.html#28de52ae675ba982e2fb790eeee90e7d">00037</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1SmartPointer.html">SmartPointer < const Self ></a> <a class="code" href="classitk_1_1SmartPointer.html">ConstPointer</a>; <a name="l00038"></a><a class="code" href="classitk_1_1PolygonSpatialObject.html#2924a90319e82f73c7bd9d89a1c96706">00038</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classitk_1_1BlobSpatialObject.html#99f5dd02771d2c364ae934f80a29b799">Superclass::PointType</a> <a class="code" href="classitk_1_1PolygonSpatialObject.html#2924a90319e82f73c7bd9d89a1c96706">PointType</a>; <a name="l00039"></a><a class="code" href="classitk_1_1PolygonSpatialObject.html#5f37bd39f97c7780d2889d1943b6d455">00039</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classitk_1_1BlobSpatialObject.html#7a407b40590cb23a8a9a9e7f257bbf25">Superclass::TransformType</a> <a class="code" href="classitk_1_1PolygonSpatialObject.html#5f37bd39f97c7780d2889d1943b6d455">TransformType</a>; <a name="l00040"></a><a class="code" href="classitk_1_1PolygonSpatialObject.html#f3cc92e9291ab2dc21eca8ed317b7c08">00040</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classitk_1_1BlobSpatialObject.html#4e877381a7afde0efb42593996e12e73">Superclass::PointListType</a> <a class="code" href="classitk_1_1PolygonSpatialObject.html#f3cc92e9291ab2dc21eca8ed317b7c08">PointListType</a>; <a name="l00041"></a><a class="code" href="classitk_1_1PolygonSpatialObject.html#e84726ebb096e2e225739a4bc31242dc">00041</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classitk_1_1BlobSpatialObject.html#6ba84f7cfdd6b6a548d50c258b0b5276">Superclass::BlobPointType</a> <a class="code" href="classitk_1_1PolygonSpatialObject.html#e84726ebb096e2e225739a4bc31242dc">BlobPointType</a>; <a name="l00043"></a>00043 <a class="code" href="itkMacro_8h.html#0fdc15685afa271857c57e7cd482f30c">itkNewMacro</a>( <a class="code" href="classitk_1_1DataObject.html" title="Base class for all data objects in ITK.">Self</a> ); <a name="l00044"></a>00044 <a name="l00046"></a>00046 <a class="code" href="itkMacro_8h.html#574c1f86661d409dd32c742307a0e96a">itkTypeMacro</a>( <a class="code" href="classitk_1_1PolygonSpatialObject.html" title="TODO.">PolygonSpatialObject</a>, <a class="code" href="classitk_1_1BlobSpatialObject.html" title="Spatial object representing a potentially amorphous object.">BlobSpatialObject</a> ); <a name="l00047"></a>00047 <a name="l00049"></a>00049 <a class="code" href="namespaceitk.html#7b4767a0dc591bc3c1e1af6dcab61791" title="enumerates the possible spatial orientations">PolygonGroupOrientation</a> <a class="code" href="classitk_1_1PolygonSpatialObject.html#83a442d138ac8b8f0afe0fb676681ac0">Plane</a>(); <a name="l00050"></a>00050 <a name="l00052"></a>00052 <a class="code" href="itkMacro_8h.html#7ebdd33cc5e7d74720ced9099c034faa">itkSetMacro</a>(Thickness,<span class="keywordtype">double</span>); <a name="l00053"></a>00053 <a name="l00055"></a>00055 <a class="code" href="itkMacro_8h.html#1600305bb01e39e87c472d8bf29bd1cf">itkGetMacro</a>(Thickness,<span class="keywordtype">double</span>); <a name="l00056"></a>00056 <a name="l00058"></a>00058 <span class="keywordtype">bool</span> <a class="code" href="classitk_1_1PolygonSpatialObject.html#2704a130eae3e4f2ed603f37aaeba9a4">IsClosed</a>(); <a name="l00059"></a>00059 <a name="l00061"></a>00061 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classitk_1_1PolygonSpatialObject.html#ff9f14ccf621a15d11369c12201a7a6f">NumberOfPoints</a>() <span class="keyword">const</span>; <a name="l00062"></a>00062 <a name="l00064"></a>00064 <a class="code" href="classitk_1_1PolygonSpatialObject.html#2924a90319e82f73c7bd9d89a1c96706">PointType</a> <a class="code" href="classitk_1_1PolygonSpatialObject.html#c8f83d91ee58b13e81b422366a9e5854">ClosestPoint</a>(<a class="code" href="classitk_1_1PolygonSpatialObject.html#2924a90319e82f73c7bd9d89a1c96706">PointType</a> &curPoint); <a name="l00065"></a>00065 <a name="l00067"></a>00067 <span class="keywordtype">double</span> <a class="code" href="classitk_1_1PolygonSpatialObject.html#8733e19150a55673de5cf09b7e12c7c9">MeasureArea</a>(); <a name="l00068"></a>00068 <a name="l00070"></a>00070 <span class="keywordtype">double</span> <a class="code" href="classitk_1_1PolygonSpatialObject.html#dd0b20d75a101dab1470230f29949a96">MeasureVolume</a>(); <a name="l00071"></a>00071 <a name="l00073"></a>00073 <span class="keywordtype">double</span> <a class="code" href="classitk_1_1PolygonSpatialObject.html#f1738c9d2a7ea46e30033b5aff209a0e">MeasurePerimeter</a>(); <a name="l00074"></a>00074 <a name="l00076"></a>00076 <span class="keywordtype">bool</span> <a class="code" href="classitk_1_1PolygonSpatialObject.html#23186c9d17102b70ca2ea569d1ec9421">DeletePoint</a>(<a class="code" href="classitk_1_1PolygonSpatialObject.html#2924a90319e82f73c7bd9d89a1c96706">PointType</a> &pointToDelete); <a name="l00077"></a>00077 <a name="l00079"></a>00079 <span class="keywordtype">bool</span> <a class="code" href="classitk_1_1PolygonSpatialObject.html#9b34d1be617c546eca02450dc9974589">AddPoint</a>(<a class="code" href="classitk_1_1PolygonSpatialObject.html#2924a90319e82f73c7bd9d89a1c96706">PointType</a> &pointToAdd); <a name="l00080"></a>00080 <a name="l00082"></a>00082 <span class="keywordtype">bool</span> <a class="code" href="classitk_1_1PolygonSpatialObject.html#473cda448362b80e3c5070f667a81edb">InsertPoint</a>(<a class="code" href="classitk_1_1PolygonSpatialObject.html#2924a90319e82f73c7bd9d89a1c96706">PointType</a> &point1, <a class="code" href="classitk_1_1PolygonSpatialObject.html#2924a90319e82f73c7bd9d89a1c96706">PointType</a> &pointToAdd); <a name="l00083"></a>00083 <a name="l00085"></a>00085 <span class="keywordtype">bool</span> <a class="code" href="classitk_1_1PolygonSpatialObject.html#2e80c8655566b34a3719bc8e2589d7e6">ReplacePoint</a>(<a class="code" href="classitk_1_1PolygonSpatialObject.html#2924a90319e82f73c7bd9d89a1c96706">PointType</a> &oldpoint, <a class="code" href="classitk_1_1PolygonSpatialObject.html#2924a90319e82f73c7bd9d89a1c96706">PointType</a> &newPoint); <a name="l00086"></a>00086 <a name="l00088"></a>00088 <span class="keywordtype">bool</span> <a class="code" href="classitk_1_1PolygonSpatialObject.html#9762ade86bc46f4bcae8987fccf4d5b6">RemoveSegment</a>(<a class="code" href="classitk_1_1PolygonSpatialObject.html#2924a90319e82f73c7bd9d89a1c96706">PointType</a> &startpoint,<a class="code" href="classitk_1_1PolygonSpatialObject.html#2924a90319e82f73c7bd9d89a1c96706">PointType</a> &endPoint); <a name="l00089"></a>00089 <a name="l00091"></a>00091 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classitk_1_1PolygonSpatialObject.html#a476dd6077b3483700551ab3d0339f28">IsInside</a>( <span class="keyword">const</span> <a class="code" href="classitk_1_1PolygonSpatialObject.html#2924a90319e82f73c7bd9d89a1c96706">PointType</a> & point, <a name="l00092"></a>00092 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> depth, <a name="l00093"></a>00093 <span class="keywordtype">char</span> * name) <span class="keyword">const</span>; <a name="l00094"></a>00094 <a name="l00098"></a><a class="code" href="classitk_1_1PolygonSpatialObject.html#95aa92ff402140fa97dc7df002089bb4">00098</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classitk_1_1PolygonSpatialObject.html#a476dd6077b3483700551ab3d0339f28">IsInside</a>( <span class="keyword">const</span> <a class="code" href="classitk_1_1PolygonSpatialObject.html#2924a90319e82f73c7bd9d89a1c96706">PointType</a> & point)<span class="keyword"> const</span> <a name="l00099"></a>00099 <span class="keyword"> </span>{ <a name="l00100"></a>00100 <span class="keywordflow">return</span> this-><a class="code" href="classitk_1_1PolygonSpatialObject.html#a476dd6077b3483700551ab3d0339f28">IsInside</a>(point, 0, <a class="code" href="itkVoronoiDiagram2D_8h.html#070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>); <a name="l00101"></a>00101 }; <a name="l00103"></a>00103 <a name="l00104"></a>00104 <span class="keyword">private</span>: <a name="l00105"></a>00105 <a class="code" href="classitk_1_1PolygonSpatialObject.html" title="TODO.">PolygonSpatialObject</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1PolygonSpatialObject.html#78e3cf1c7b62c1e17923283cec6f7d57">Self</a>&); <span class="comment">//purposely not implemented</span> <a name="l00106"></a>00106 <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="classitk_1_1PolygonSpatialObject.html#78e3cf1c7b62c1e17923283cec6f7d57">Self</a>&); <span class="comment">//purposely not implemented</span> <a name="l00107"></a>00107 <a name="l00108"></a>00108 <a class="code" href="namespaceitk.html#7b4767a0dc591bc3c1e1af6dcab61791" title="enumerates the possible spatial orientations">PolygonGroupOrientation</a> m_Orientation; <a name="l00109"></a>00109 <span class="keywordtype">double</span> m_Thickness; <a name="l00110"></a>00110 <a class="code" href="classitk_1_1PolygonSpatialObject.html" title="TODO.">PolygonSpatialObject</a>() <a name="l00111"></a>00111 { <a name="l00112"></a>00112 m_Orientation = <a class="code" href="namespaceitk.html#7b4767a0dc591bc3c1e1af6dcab61791f7abba533cb4f3fe9abd761914a8fcad">Unknown</a>; <a name="l00113"></a>00113 m_Thickness = 0.0; <a name="l00114"></a>00114 } <a name="l00115"></a>00115 }; <a name="l00116"></a>00116 } <a name="l00117"></a>00117 <span class="preprocessor">#ifndef ITK_MANUAL_INSTANTIATION </span> <a name="l00118"></a>00118 <span class="preprocessor"></span><span class="preprocessor">#include "itkPolygonSpatialObject.txx"</span> <a name="l00119"></a>00119 <span class="preprocessor">#endif </span> <a name="l00120"></a>00120 <span class="preprocessor"></span> <a name="l00121"></a>00121 <span class="preprocessor">#endif // __itkPolygonSpatialObject_h</span> <a name="l00122"></a>00122 <span class="preprocessor"></span> </pre></div></div> <hr><address><small> Generated at Thu May 7 23:52:06 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>