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: 2007-01-28 19:24:38 $
00007   Version:   $Revision: 1.7 $
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 
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 } // end of namespace itk
00130 
00131 #ifndef ITK_MANUAL_INSTANTIATION
00132 #include "itkMeshSpatialObject.txx"
00133 #endif
00134 
00135 #endif //__itkMeshSpatialObject_h
00136 

Generated at Mon Apr 14 13:32:00 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000