ITK  4.13.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 > >
37 class ITK_TEMPLATE_EXPORT MeshSpatialObject:
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;
53  typedef typename Superclass::TransformType TransformType;
54  typedef typename Superclass::PointType PointType;
55  typedef typename Superclass::BoundingBoxType BoundingBoxType;
56 
59 
61  itkNewMacro(Self);
62 
64  itkTypeMacro(MeshSpatialObject, SpatialObject);
65 
67  void SetMesh(MeshType *Mesh);
68 
70  MeshType * GetMesh();
71  const MeshType *GetMesh() const;
73 
76  bool IsEvaluableAt(const PointType & point,
77  unsigned int depth = 0, char *name = ITK_NULLPTR) const ITK_OVERRIDE;
78 
82  bool ValueAt(const PointType & point, double & value,
83  unsigned int depth = 0, char *name = ITK_NULLPTR) const ITK_OVERRIDE;
84 
86  bool IsInside(const PointType & point,
87  unsigned int depth, char *name) const ITK_OVERRIDE;
88 
92  virtual bool IsInside(const PointType & point) const;
93 
95  bool ComputeLocalBoundingBox() const ITK_OVERRIDE;
96 
98  ModifiedTimeType GetMTime(void) const ITK_OVERRIDE;
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() ITK_OVERRIDE;
124 
125  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
126 };
127 } // end of namespace itk
128 
129 #ifndef ITK_MANUAL_INSTANTIATION
130 #include "itkMeshSpatialObject.hxx"
131 #endif
132 
133 #endif //itkMeshSpatialObject_h
MeshType::Pointer MeshPointer
Implementation of an Mesh as spatial object.
Superclass::PointType PointType
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:164
VectorContainer< IdentifierType, PointType > PointContainerType
SpatialObject< itkGetStaticConstMacro(Dimension) > Superclass
Superclass::TransformType TransformType
Superclass::BoundingBoxType BoundingBoxType
Implements the N-dimensional mesh structure.
Definition: itkMesh.h:108
MeshSpatialObject< TMesh > Self
Implementation of the composite pattern.
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
Base class for all data objects in ITK.