00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __itkMeshSpatialObject_h
00019 #define __itkMeshSpatialObject_h
00020
00021 #include "itkMesh.h"
00022 #include "itkExceptionObject.h"
00023 #include "itkSpatialObject.h"
00024
00025 namespace itk
00026 {
00027
00037 template <class TMesh = Mesh<int> >
00038 class MeshSpatialObject
00039 : public SpatialObject< ::itk::GetMeshDimension<TMesh>::PointDimension >
00040 {
00041
00042 public:
00043
00044 typedef double ScalarType;
00045 typedef MeshSpatialObject< TMesh> Self;
00046
00047 itkStaticConstMacro(Dimension, unsigned int,TMesh::PointDimension);
00048
00049 typedef SpatialObject< itkGetStaticConstMacro(Dimension) > Superclass;
00050 typedef SmartPointer< Self > Pointer;
00051 typedef SmartPointer< const Self > ConstPointer;
00052
00053 typedef TMesh MeshType;
00054 typedef typename MeshType::Pointer MeshPointer;
00055 typedef typename Superclass::TransformType TransformType;
00056 typedef typename Superclass::PointType PointType;
00057 typedef typename Superclass::BoundingBoxType BoundingBoxType;
00058
00059 typedef VectorContainer< unsigned long, PointType> PointContainerType;
00060 typedef typename PointContainerType::Pointer PointContainerPointer;
00061
00063 itkNewMacro( Self );
00064
00066 itkTypeMacro( MeshSpatialObject, SpatialObject );
00067
00069 void SetMesh( MeshType * Mesh );
00070
00072 MeshType * GetMesh( void );
00073
00076 bool IsEvaluableAt( const PointType & point,
00077 unsigned int depth=0, char *name=NULL) const;
00078
00082 bool ValueAt( const PointType & point, double & value,
00083 unsigned int depth=0, char *name=NULL) const;
00084
00086 bool IsInside( const PointType & point,
00087 unsigned int depth, char *name) const;
00088
00092 virtual bool IsInside( const PointType & point) const;
00093
00095 bool ComputeLocalBoundingBox() const;
00096
00098 unsigned long GetMTime( void ) const;
00099
00101 const char* GetPixelType()
00102 {
00103 return m_PixelType.c_str();
00104 }
00105
00112 itkSetMacro(IsInsidePrecision, double);
00113 itkGetMacro(IsInsidePrecision, double);
00115
00116 protected:
00117
00118 MeshPointer m_Mesh;
00119 std::string m_PixelType;
00120 double m_IsInsidePrecision;
00121
00122 MeshSpatialObject();
00123 virtual ~MeshSpatialObject();
00124
00125 void PrintSelf( std::ostream& os, Indent indent ) const;
00126
00127 };
00128
00129 }
00130
00131 #ifndef ITK_MANUAL_INSTANTIATION
00132 #include "itkMeshSpatialObject.txx"
00133 #endif
00134
00135 #endif //__itkMeshSpatialObject_h
00136