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: 2005/01/21 17:59:18 $
00007   Version:   $Revision: 1.8 $
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 template <unsigned int TDimension = 3> class 
00025 PolygonSpatialObject
00026   :public BlobSpatialObject<TDimension>
00027 {
00028 public:
00029   typedef PolygonSpatialObject<TDimension>         Self;
00030   typedef BlobSpatialObject< TDimension >            Superclass;
00031   typedef SmartPointer < Self >                      Pointer;
00032   typedef SmartPointer < const Self >                ConstPointer;
00033   typedef typename Superclass::PointType             PointType;
00034   typedef typename Superclass::TransformType         TransformType;
00035   typedef typename Superclass::PointListType         PointListType;
00036   typedef typename Superclass::BlobPointType         BlobPointType;
00038   itkNewMacro( Self );
00039 
00041   itkTypeMacro( PolygonSpatialObject, BlobSpatialObject );
00042   
00044   PolygonGroupOrientation Plane();
00045 
00047   itkSetMacro(Thickness,double);
00048 
00050   itkGetMacro(Thickness,double);
00051 
00053   bool IsClosed();
00054 
00056   unsigned int NumberOfPoints() const;
00057 
00059   PointType ClosestPoint(PointType &curPoint);
00060 
00062   double MeasureArea();
00063 
00065   double MeasureVolume();
00066 
00068   double MeasurePerimeter();
00069 
00071   bool DeletePoint(PointType &pointToDelete);
00072 
00074   bool AddPoint(PointType &pointToAdd);
00075 
00077   bool InsertPoint(PointType &point1, PointType &pointToAdd);
00078 
00080   bool ReplacePoint(PointType &oldpoint, PointType &newPoint);
00081 
00083   bool RemoveSegment(PointType &startpoint,PointType &endPoint);
00084 
00086   virtual bool IsInside( const PointType & point,
00087                          unsigned int depth,
00088                          char * name) const;
00089 
00093   virtual bool IsInside( const PointType & point) const
00094   {
00095     return this->IsInside(point, 0, NULL);
00096   };
00097 
00098 private:
00099   PolygonGroupOrientation m_Orientation;
00100   double m_Thickness;
00101   PolygonSpatialObject() 
00102   { 
00103     m_Orientation = Unknown; 
00104     m_Thickness = 0.0;
00105   }
00106 };
00107 }
00108 #ifndef ITK_MANUAL_INSTANTIATION 
00109 #include "itkPolygonSpatialObject.txx" 
00110 #endif 
00111 
00112 #endif  // __itkPolygonSpatialObject_h

Generated at Wed May 24 23:53:00 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000