ITK  5.2.0
Insight Toolkit
itkMeshSpatialObject.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 {
37 template <typename TMesh = Mesh<int>>
38 class ITK_TEMPLATE_EXPORT MeshSpatialObject : public SpatialObject<TMesh::PointDimension>
39 {
40 public:
41  using ScalarType = double;
43 
44  static constexpr unsigned int Dimension = TMesh::PointDimension;
45 
49 
50  using MeshType = TMesh;
51  using MeshPointer = typename MeshType::Pointer;
52  using TransformType = typename Superclass::TransformType;
53  using PointType = typename Superclass::PointType;
54  using BoundingBoxType = typename Superclass::BoundingBoxType;
55 
58 
60  itkNewMacro(Self);
61 
63  itkTypeMacro(MeshSpatialObject, SpatialObject);
64 
67  void
68  Clear() override;
69 
71  void
72  SetMesh(MeshType * Mesh);
73 
75  MeshType *
76  GetMesh();
77  const MeshType *
78  GetMesh() const;
80 
82  bool
83  IsInsideInObjectSpace(const PointType & point) const override;
84 
85  /* Avoid hiding the overload that supports depth and name arguments */
86  using Superclass::IsInsideInObjectSpace;
87 
90  GetMTime() const override;
91 
92 #if !defined(ITK_LEGACY_REMOVE)
93 
94  itkLegacyMacro(const char * GetPixelTypeName()) { return m_PixelType.c_str(); }
95 #endif
96 
103  itkSetMacro(IsInsidePrecisionInObjectSpace, double);
104  itkGetConstMacro(IsInsidePrecisionInObjectSpace, double);
106 
107 protected:
109  void
110  ComputeMyBoundingBox() override;
111 
113  ~MeshSpatialObject() override = default;
114 
115  void
116  PrintSelf(std::ostream & os, Indent indent) const override;
117 
118  typename LightObject::Pointer
119  InternalClone() const override;
120 
121 private:
123 #if !defined(ITK_LEGACY_REMOVE)
124  std::string m_PixelType;
125 #endif
127 };
128 } // end of namespace itk
129 
130 #ifndef ITK_MANUAL_INSTANTIATION
131 # include "itkMeshSpatialObject.hxx"
132 #endif
133 
134 #endif // itkMeshSpatialObject_h
itk::MeshSpatialObject::PointContainerPointer
typename PointContainerType::Pointer PointContainerPointer
Definition: itkMeshSpatialObject.h:57
itk::MeshSpatialObject
Implementation of an Mesh as spatial object.
Definition: itkMeshSpatialObject.h:38
itk::ModifiedTimeType
SizeValueType ModifiedTimeType
Definition: itkIntTypes.h:102
itkSpatialObject.h
itk::MeshSpatialObject::MeshPointer
typename MeshType::Pointer MeshPointer
Definition: itkMeshSpatialObject.h:51
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::MeshSpatialObject::TransformType
typename Superclass::TransformType TransformType
Definition: itkMeshSpatialObject.h:52
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::MeshSpatialObject::m_IsInsidePrecisionInObjectSpace
double m_IsInsidePrecisionInObjectSpace
Definition: itkMeshSpatialObject.h:126
itk::MeshSpatialObject::m_Mesh
MeshPointer m_Mesh
Definition: itkMeshSpatialObject.h:122
itk::MeshSpatialObject::PointType
typename Superclass::PointType PointType
Definition: itkMeshSpatialObject.h:53
itkMesh.h
itk::SpatialObject
Implementation of the composite pattern.
Definition: itkSpatialObject.h:57
itk::MeshSpatialObject::BoundingBoxType
typename Superclass::BoundingBoxType BoundingBoxType
Definition: itkMeshSpatialObject.h:54
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Mesh
Implements the N-dimensional mesh structure.
Definition: itkMesh.h:114
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:62
itk::MeshSpatialObject::MeshType
TMesh MeshType
Definition: itkMeshSpatialObject.h:50
itk::GTest::TypedefsAndConstructors::Dimension2::Dimension
constexpr unsigned int Dimension
Definition: itkGTestTypedefsAndConstructors.h:44
itk::MeshSpatialObject::ScalarType
double ScalarType
Definition: itkMeshSpatialObject.h:41
itk::VectorContainer
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
Definition: itkVectorContainer.h:48
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293