Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkMeshSpatialObject.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkMeshSpatialObject.h,v $
00005   Language:  C++
00006   Date:      $Date: 2004/11/16 15:53:38 $
00007   Version:   $Revision: 1.6 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
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 
00110   itkSetMacro(IsInsidePrecision, double);
00111   itkGetMacro(IsInsidePrecision, double);
00112 
00113 protected:
00114 
00115   MeshPointer m_Mesh;
00116   std::string m_PixelType;
00117   double m_IsInsidePrecision;
00118 
00119   MeshSpatialObject();
00120   virtual ~MeshSpatialObject();
00121 
00122   void PrintSelf( std::ostream& os, Indent indent ) const;
00123 
00124 };
00125 
00126 } // end of namespace itk
00127 
00128 #ifndef ITK_MANUAL_INSTANTIATION
00129 #include "itkMeshSpatialObject.txx"
00130 #endif
00131 
00132 #endif //__itkMeshSpatialObject_h

Generated at Wed May 24 23:40:22 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000