Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkPolygonSpatialObject.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkPolygonSpatialObject.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-01-16 11:38:00 $
00007   Version:   $Revision: 1.11 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkPolygonSpatialObject_h
00018 #define __itkPolygonSpatialObject_h
00019 #include "itkBlobSpatialObject.h"
00020 #include "itkPolygonGroupOrientation.h"
00021 
00022 namespace itk
00023 {
00024 
00029 template <unsigned int TDimension = 3> class 
00030 PolygonSpatialObject
00031   :public BlobSpatialObject<TDimension>
00032 {
00033 public:
00034   typedef PolygonSpatialObject<TDimension>       Self;
00035   typedef BlobSpatialObject< TDimension >        Superclass;
00036   typedef SmartPointer < Self >                  Pointer;
00037   typedef SmartPointer < const Self >            ConstPointer;
00038   typedef typename Superclass::PointType         PointType;
00039   typedef typename Superclass::TransformType     TransformType;
00040   typedef typename Superclass::PointListType     PointListType;
00041   typedef typename Superclass::BlobPointType     BlobPointType;
00043   itkNewMacro( Self );
00044 
00046   itkTypeMacro( PolygonSpatialObject, BlobSpatialObject );
00047 
00049   PolygonGroupOrientation Plane();
00050 
00052   itkSetMacro(Thickness,double);
00053 
00055   itkGetMacro(Thickness,double);
00056 
00058   bool IsClosed();
00059 
00061   unsigned int NumberOfPoints() const;
00062 
00064   PointType ClosestPoint(PointType &curPoint);
00065 
00067   double MeasureArea();
00068 
00070   double MeasureVolume();
00071 
00073   double MeasurePerimeter();
00074 
00076   bool DeletePoint(PointType &pointToDelete);
00077 
00079   bool AddPoint(PointType &pointToAdd);
00080 
00082   bool InsertPoint(PointType &point1, PointType &pointToAdd);
00083 
00085   bool ReplacePoint(PointType &oldpoint, PointType &newPoint);
00086 
00088   bool RemoveSegment(PointType &startpoint,PointType &endPoint);
00089 
00091   virtual bool IsInside( const PointType & point,
00092                          unsigned int depth,
00093                          char * name) const;
00094 
00098   virtual bool IsInside( const PointType & point) const
00099     {
00100     return this->IsInside(point, 0, NULL);
00101     };
00103 
00104 private:
00105   PolygonSpatialObject(const Self&); //purposely not implemented
00106   void operator=(const Self&); //purposely not implemented
00107   
00108   PolygonGroupOrientation m_Orientation;
00109   double                  m_Thickness;
00110   PolygonSpatialObject() 
00111     { 
00112     m_Orientation = Unknown; 
00113     m_Thickness = 0.0;
00114     }
00115 };
00116 }
00117 #ifndef ITK_MANUAL_INSTANTIATION 
00118 #include "itkPolygonSpatialObject.txx" 
00119 #endif 
00120 
00121 #endif  // __itkPolygonSpatialObject_h
00122 

Generated at Sat Feb 28 13:16:57 2009 for ITK by doxygen 1.5.6 written by Dimitri van Heesch, © 1997-2000