Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __itkLineSpatialObject_h
00019 #define __itkLineSpatialObject_h
00020
00021 #include <list>
00022
00023 #include "itkPointBasedSpatialObject.h"
00024 #include "itkLineSpatialObjectPoint.h"
00025
00026 namespace itk
00027 {
00028
00038 template < unsigned int TDimension = 3 >
00039 class ITK_EXPORT LineSpatialObject
00040 :public PointBasedSpatialObject< TDimension >
00041 {
00042
00043 public:
00044
00045 typedef LineSpatialObject Self;
00046 typedef PointBasedSpatialObject< TDimension > Superclass;
00047 typedef SmartPointer < Self > Pointer;
00048 typedef SmartPointer < const Self > ConstPointer;
00049 typedef double ScalarType;
00050 typedef LineSpatialObjectPoint< TDimension > LinePointType;
00051 typedef std::vector< LinePointType > PointListType;
00052 typedef typename Superclass::SpatialObjectPointType SpatialObjectPointType;
00053 typedef typename Superclass::PointType PointType;
00054 typedef typename Superclass::TransformType TransformType;
00055 typedef typename Superclass::BoundingBoxType BoundingBoxType;
00056 typedef VectorContainer<unsigned long,PointType> PointContainerType;
00057 typedef SmartPointer<PointContainerType> PointContainerPointer;
00058
00060 itkNewMacro( Self );
00061
00063 itkTypeMacro( LineSpatialObject, PointBasedSpatialObject );
00064
00066 PointListType & GetPoints( void );
00067
00069 void SetPoints( PointListType & newPoints );
00070
00072 const SpatialObjectPointType* GetPoint(unsigned long id) const
00073 {
00074 return &(m_Points[id]);
00075 }
00076
00078 SpatialObjectPointType* GetPoint(unsigned long id) {return &(m_Points[id]);}
00079
00081 unsigned long GetNumberOfPoints(void) const {return m_Points.size();}
00082
00085 bool IsEvaluableAt( const PointType & point,
00086 unsigned int depth=0, char * name=NULL ) const;
00087
00092 bool ValueAt( const PointType & point, double & value,
00093 unsigned int depth=0, char * name=NULL ) const;
00094
00096 bool IsInside( const PointType & point,
00097 unsigned int depth, char * name) const;
00098
00102 virtual bool IsInside( const PointType & point) const;
00103
00105 bool ComputeLocalBoundingBox() const;
00106
00107 protected:
00108 LineSpatialObject(const Self&);
00109 void operator=(const Self&);
00110
00111 PointListType m_Points;
00112
00113 LineSpatialObject();
00114 virtual ~LineSpatialObject();
00115
00117 virtual void PrintSelf( std::ostream& os, Indent indent ) const;
00118 };
00119
00120 }
00121
00122 #ifndef ITK_MANUAL_INSTANTIATION
00123 #include "itkLineSpatialObject.txx"
00124 #endif
00125
00126 #endif // __itkLineSpatialObject_h
00127