00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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