itkPolygonSpatialObject.h
Go to the documentation of this file.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
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&);
00106 void operator=(const Self&);
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