ITK  5.0.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  using ScalarType = double;
44 
45  static constexpr unsigned int Dimension = TMesh::PointDimension;
46 
50 
51  using MeshType = TMesh;
52  using MeshPointer = typename MeshType::Pointer;
53  using TransformType = typename Superclass::TransformType;
54  using PointType = typename Superclass::PointType;
55  using BoundingBoxType = typename Superclass::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 
75  bool IsInsideInObjectSpace(const PointType & point, unsigned int depth=0,
76  const std::string & name="") const override;
77 
79  bool ComputeMyBoundingBox() const override;
80 
82  ModifiedTimeType GetMTime() const override;
83 
85  const char * GetPixelTypeName()
86  {
87  return m_PixelType.c_str();
88  }
89 
96  itkSetMacro(IsInsidePrecisionInObjectSpace, double);
97  itkGetConstMacro(IsInsidePrecisionInObjectSpace, double);
99 
100 protected:
101 
103  ~MeshSpatialObject() override = default;
104 
105  void PrintSelf(std::ostream & os, Indent indent) const override;
106 
107  typename LightObject::Pointer InternalClone() const override;
108 
109 private:
111  std::string m_PixelType;
113 
114 };
115 } // end of namespace itk
116 
117 #ifndef ITK_MANUAL_INSTANTIATION
118 #include "itkMeshSpatialObject.hxx"
119 #endif
120 
121 #endif //itkMeshSpatialObject_h
Implementation of an Mesh as spatial object.
typename MeshType::Pointer MeshPointer
Implements the N-dimensional mesh structure.
Definition: itkMesh.h:108
typename PointContainerType::Pointer PointContainerPointer
Implementation of the composite pattern.
typename Superclass::TransformType TransformType
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:104
typename Superclass::BoundingBoxType BoundingBoxType
typename Superclass::PointType PointType
Define a front-end to the STL &quot;vector&quot; container that conforms to the IndexedContainerInterface.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for most ITK classes.
Definition: itkObject.h:60
Base class for all data objects in ITK.