00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __itkTubeSpatialObject_h
00019 #define __itkTubeSpatialObject_h
00020
00021 #include <list>
00022
00023 #include "itkPointBasedSpatialObject.h"
00024 #include "itkTubeSpatialObjectPoint.h"
00025
00026 namespace itk
00027 {
00028
00041 template < unsigned int TDimension = 3 >
00042 class TubeSpatialObject
00043 :public PointBasedSpatialObject< TDimension >
00044 {
00045
00046 public:
00047
00048 typedef TubeSpatialObject Self;
00049 typedef PointBasedSpatialObject< TDimension > Superclass;
00050 typedef SmartPointer < Self > Pointer;
00051 typedef SmartPointer < const Self > ConstPointer;
00052 typedef double ScalarType;
00053 typedef itk::TubeSpatialObjectPoint< TDimension > TubePointType;
00054 typedef std::vector< TubePointType > PointListType;
00055 typedef PointListType * PointListPointer;
00056 typedef typename Superclass::PointType PointType;
00057 typedef typename Superclass::TransformType TransformType;
00058 typedef typename Superclass::SpatialObjectPointType SpatialObjectPointType;
00059 typedef VectorContainer<unsigned long,PointType> PointContainerType;
00060 typedef SmartPointer<PointContainerType> PointContainerPointer;
00061 typedef typename Superclass::VectorType VectorType;
00062 typedef typename Superclass::CovariantVectorType CovariantVectorType;
00063
00065 itkNewMacro( Self );
00066
00068 itkTypeMacro( Self, Superclass );
00069
00071 PointListType & GetPoints( void );
00072
00074 const PointListType & GetPoints( void ) const;
00075
00077 void SetPoints( PointListType & newPoints );
00078
00080 const SpatialObjectPointType* GetPoint(unsigned long id) const {return &(m_Points[id]);}
00081
00083 unsigned long GetNumberOfPoints(void) const {return m_Points.size();}
00084
00086 void Clear( void );
00087
00089 bool ComputeTangentAndNormals( void );
00090
00093 bool IsEvaluableAt( const PointType & point,
00094 unsigned int depth=0, char * name=NULL ) const;
00095
00100 bool ValueAt( const PointType & point, double & value,
00101 unsigned int depth=0, char * name=NULL ) const;
00102
00104 bool IsInside( const PointType & point,
00105 unsigned int depth=0, char * name=NULL ) const;
00106
00108 bool ComputeBoundingBox( ) const;
00109
00112 itkSetMacro(ParentPoint,int);
00113 itkGetMacro(ParentPoint,int);
00114
00115 protected:
00116
00117 PointListType m_Points;
00118 int m_ParentPoint;
00119
00120 TubeSpatialObject();
00121 virtual ~TubeSpatialObject();
00122
00124 virtual void PrintSelf( std::ostream& os, Indent indent ) const;
00125 };
00126
00127 }
00128
00129 #ifndef ITK_MANUAL_INSTANTIATION
00130 #include "itkTubeSpatialObject.txx"
00131 #endif
00132
00133 #endif // __itkTubeSpatialObject_h