ITK  6.0.0
Insight Toolkit
itkPointBasedSpatialObject.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 * https://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 itkPointBasedSpatialObject_h
19#define itkPointBasedSpatialObject_h
20
21#include "itkSpatialObject.h"
23
24namespace itk
25{
36template <unsigned int TDimension = 3, class TSpatialObjectPointType = SpatialObjectPoint<TDimension>>
37class ITK_TEMPLATE_EXPORT PointBasedSpatialObject : public SpatialObject<TDimension>
38{
39public:
40 ITK_DISALLOW_COPY_AND_MOVE(PointBasedSpatialObject);
41
46
47 using ScalarType = double;
48
49 using SpatialObjectPointType = TSpatialObjectPointType;
50 using SpatialObjectPointListType = std::vector<SpatialObjectPointType>;
51
52 using typename Superclass::PointType;
53 using typename Superclass::TransformType;
54 using typename Superclass::VectorType;
55 using typename Superclass::CovariantVectorType;
56 using typename Superclass::BoundingBoxType;
58 itkNewMacro(Self);
59
61 itkOverrideGetNameOfClassMacro(PointBasedSpatialObject);
62
65 void
66 Clear() override;
67
70 virtual void
72
74 virtual void
76
79 virtual void
81
85 {
86 return m_Points;
87 }
88
90 virtual const SpatialObjectPointListType &
91 GetPoints() const
92 {
93 return m_Points;
94 }
95
97 virtual const SpatialObjectPointType *
99 {
100 return &(m_Points[id]);
101 }
102
103 virtual SpatialObjectPointType *
105 {
106 return &(m_Points[id]);
107 }
108
110 virtual SizeValueType
112 {
113 return static_cast<SizeValueType>(m_Points.size());
114 }
115
117 TSpatialObjectPointType
119
121 TSpatialObjectPointType
123
128 bool
129 IsInsideInObjectSpace(const PointType & point) const override;
130
131 /* Avoid hiding the overload that supports depth and name arguments */
132 using Superclass::IsInsideInObjectSpace;
133
134protected:
136 void
138
140 ~PointBasedSpatialObject() override = default;
141
143
145 void
146 PrintSelf(std::ostream & os, Indent indent) const override;
147
148 typename LightObject::Pointer
149 InternalClone() const override;
150};
151} // end namespace itk
152
153#ifndef ITK_MANUAL_INSTANTIATION
154# include "itkPointBasedSpatialObject.hxx"
155#endif
156
157#endif // itkPointBasedSpatialObject_h
Base class for all data objects in ITK.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Base class for most ITK classes.
Definition: itkObject.h:62
This class serves as the base class for point-based spatial objects.
bool IsInsideInObjectSpace(const PointType &point) const override
LightObject::Pointer InternalClone() const override
void ComputeMyBoundingBox() override
virtual const SpatialObjectPointListType & GetPoints() const
TSpatialObjectPointType ClosestPointInWorldSpace(const PointType &point) const
void PrintSelf(std::ostream &os, Indent indent) const override
virtual void SetPoints(const SpatialObjectPointListType &newPoints)
virtual SpatialObjectPointType * GetPoint(IdentifierType id)
virtual void AddPoint(const SpatialObjectPointType &newPoint)
TSpatialObjectPointType ClosestPointInObjectSpace(const PointType &point) const
TSpatialObjectPointType SpatialObjectPointType
std::vector< SpatialObjectPointType > SpatialObjectPointListType
virtual SizeValueType GetNumberOfPoints() const
virtual const SpatialObjectPointType * GetPoint(IdentifierType id) const
~PointBasedSpatialObject() override=default
virtual SpatialObjectPointListType & GetPoints()
virtual void RemovePoint(IdentifierType id)
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:54
Implementation of the composite pattern.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
*par Constraints *The filter image with at least two dimensions and a vector *length of at least The theory supports extension to scalar but *the implementation of the itk vector classes do not **The template parameter TRealType must be floating point(float or double) or *a user-defined "real" numerical type with arithmetic operations defined *sufficient to compute derivatives. **\par Performance *This filter will automatically multithread if run with *SetUsePrincipleComponents
SizeValueType IdentifierType
Definition: itkIntTypes.h:90
unsigned long SizeValueType
Definition: itkIntTypes.h:86