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=0,
char *name=NULL)
const;
00088
00090
bool ComputeBoundingBox() const;
00091
00093
unsigned long GetMTime(
void ) const;
00094
00096 const
char* GetPixelType()
00097 {
00098
return m_PixelType.c_str();
00099 }
00100
00101
00102
protected:
00103
00104 MeshPointer m_Mesh;
00105 std::string
m_PixelType;
00106
MeshSpatialObject();
00107
virtual ~MeshSpatialObject();
00108
00109
void PrintSelf( std::ostream& os,
Indent indent )
const;
00110
00111 };
00112
00113 }
00114
00115
#ifndef ITK_MANUAL_INSTANTIATION
00116
#include "itkMeshSpatialObject.txx"
00117
#endif
00118
00119
#endif //__itkMeshSpatialObject_h