ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkMeshSpatialObject.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkMeshSpatialObject_h
19 #define __itkMeshSpatialObject_h
20 
21 #include "itkMesh.h"
22 #include "itkSpatialObject.h"
23 
24 namespace itk
25 {
36 template< typename TMesh = Mesh< int > >
38  public SpatialObject< TMesh::PointDimension >
39 {
40 public:
41 
42  typedef double ScalarType;
44 
45  itkStaticConstMacro(Dimension, unsigned int, TMesh::PointDimension);
46 
50 
51  typedef TMesh MeshType;
52  typedef typename MeshType::Pointer MeshPointer;
54  typedef typename Superclass::PointType PointType;
56 
59 
61  itkNewMacro(Self);
62 
64  itkTypeMacro(MeshSpatialObject, SpatialObject);
65 
67  void SetMesh(MeshType *Mesh);
68 
70  MeshType * GetMesh(void);
71  const MeshType *GetMesh(void) const;
73 
76  bool IsEvaluableAt(const PointType & point,
77  unsigned int depth = 0, char *name = ITK_NULLPTR) const;
78 
82  bool ValueAt(const PointType & point, double & value,
83  unsigned int depth = 0, char *name = ITK_NULLPTR) const;
84 
86  bool IsInside(const PointType & point,
87  unsigned int depth, char *name) const;
88 
92  virtual bool IsInside(const PointType & point) const;
93 
95  bool ComputeLocalBoundingBox() const;
96 
98  ModifiedTimeType GetMTime(void) const;
99 
101  const char * GetPixelType()
102  {
103  return m_PixelType.c_str();
104  }
105 
112  itkSetMacro(IsInsidePrecision, double);
113  itkGetMacro(IsInsidePrecision, double);
115 
116 protected:
117 
119  std::string m_PixelType;
121 
123  virtual ~MeshSpatialObject();
124 
125  void PrintSelf(std::ostream & os, Indent indent) const;
126 };
127 } // end of namespace itk
128 
129 #ifndef ITK_MANUAL_INSTANTIATION
130 #include "itkMeshSpatialObject.hxx"
131 #endif
132 
133 #endif //__itkMeshSpatialObject_h
Point< ScalarType, VDimension > PointType
void SetMesh(MeshType *Mesh)
MeshType::Pointer MeshPointer
BoundingBox< IdentifierType, VDimension, ScalarType, VectorContainerType > BoundingBoxType
virtual ~MeshSpatialObject()
Implementation of an Mesh as spatial object.
Superclass::PointType PointType
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:164
VectorContainer< IdentifierType, PointType > PointContainerType
static const unsigned int Dimension
SpatialObject< itkGetStaticConstMacro(Dimension) > Superclass
Superclass::TransformType TransformType
Superclass::BoundingBoxType BoundingBoxType
Implements the N-dimensional mesh structure.
Definition: itkMesh.h:108
bool ValueAt(const PointType &point, double &value, unsigned int depth=0, char *name=ITK_NULLPTR) const
bool IsInside(const PointType &point, unsigned int depth, char *name) const
MeshType * GetMesh(void)
MeshSpatialObject< TMesh > Self
Implementation of the composite pattern.
bool ComputeLocalBoundingBox() const
bool IsEvaluableAt(const PointType &point, unsigned int depth=0, char *name=ITK_NULLPTR) const
ModifiedTimeType GetMTime(void) const
void PrintSelf(std::ostream &os, Indent indent) const
PointContainerType::Pointer PointContainerPointer
SmartPointer< Self > Pointer
Define a front-end to the STL &quot;vector&quot; container that conforms to the IndexedContainerInterface.
SmartPointer< const Self > ConstPointer
Control indentation during Print() invocation.
Definition: itkIndent.h:49
ScalableAffineTransform< double, VDimension > TransformType
Base class for all data objects in ITK.