itkSurfaceSpatialObject.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
00018 #ifndef __itkSurfaceSpatialObject_h
00019 #define __itkSurfaceSpatialObject_h
00020
00021 #include <list>
00022
00023 #include "itkPointBasedSpatialObject.h"
00024 #include "itkSurfaceSpatialObjectPoint.h"
00025
00026 namespace itk
00027 {
00028
00038 template < unsigned int TDimension = 3 >
00039 class SurfaceSpatialObject
00040 :public PointBasedSpatialObject< TDimension >
00041 {
00042
00043 public:
00044
00045 typedef SurfaceSpatialObject Self;
00046 typedef PointBasedSpatialObject< TDimension > Superclass;
00047 typedef SmartPointer < Self > Pointer;
00048 typedef SmartPointer < const Self > ConstPointer;
00049 typedef double ScalarType;
00050 typedef SurfaceSpatialObjectPoint< TDimension > SurfacePointType;
00051 typedef std::vector< SurfacePointType > PointListType;
00052 typedef typename Superclass::SpatialObjectPointType SpatialObjectPointType;
00053 typedef typename Superclass::PointType PointType;
00054 typedef typename Superclass::TransformType TransformType;
00055 typedef VectorContainer<unsigned long,PointType> PointContainerType;
00056 typedef SmartPointer<PointContainerType> PointContainerPointer;
00057 typedef typename Superclass::BoundingBoxType BoundingBoxType;
00058 typedef typename Superclass::CovariantVectorType CovariantVectorType;
00059
00061 itkNewMacro( Self );
00062
00064 itkTypeMacro( SurfaceSpatialObject, PointBasedSpatialObject );
00065
00067 PointListType & GetPoints( void );
00068
00070 const SpatialObjectPointType* GetPoint(unsigned long id) const
00071 {
00072 return &(m_Points[id]);
00073 }
00074
00076 SpatialObjectPointType* GetPoint(unsigned long id) {return &(m_Points[id]);}
00077
00079 unsigned long GetNumberOfPoints(void) const {return m_Points.size();}
00080
00082 void SetPoints( PointListType & newPoints );
00083
00086 bool IsEvaluableAt( const PointType & point,
00087 unsigned int depth=0, char * name=NULL) const;
00088
00093 bool ValueAt( const PointType & point, double & value,
00094 unsigned int depth=0, char * name=NULL) const;
00095
00097 bool IsInside( const PointType & point,
00098 unsigned int depth, char * name) const;
00099
00103 virtual bool IsInside( const PointType & point) const;
00104
00106 bool ComputeLocalBoundingBox( ) const;
00107
00109 bool Approximate3DNormals();
00110
00111 protected:
00112 SurfaceSpatialObject(const Self&);
00113 void operator=(const Self&);
00114
00115 PointListType m_Points;
00116
00117 SurfaceSpatialObject();
00118 virtual ~SurfaceSpatialObject();
00119
00121 virtual void PrintSelf( std::ostream& os, Indent indent ) const;
00122 };
00123
00124 }
00125
00126 #ifndef ITK_MANUAL_INSTANTIATION
00127 #include "itkSurfaceSpatialObject.txx"
00128 #endif
00129
00130 #endif // __itkSurfaceSpatialObject_h
00131