ITK  6.0.0
Insight Toolkit
itkPolygonSpatialObject.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 itkPolygonSpatialObject_h
19#define itkPolygonSpatialObject_h
20
22
23namespace itk
24{
31template <unsigned int TDimension = 3>
32class ITK_TEMPLATE_EXPORT PolygonSpatialObject
33 : public PointBasedSpatialObject<TDimension, SpatialObjectPoint<TDimension>>
34{
35public:
36 ITK_DISALLOW_COPY_AND_MOVE(PolygonSpatialObject);
37
42
44 using PolygonPointListType = std::vector<PolygonPointType>;
45
46 using typename Superclass::PointType;
47 using typename Superclass::TransformType;
48 using typename Superclass::SpatialObjectPointType;
49
50 using ObjectDimensionType = unsigned int;
51 static constexpr ObjectDimensionType ObjectDimension = TDimension;
52
54 itkNewMacro(Self);
55
57 itkOverrideGetNameOfClassMacro(PolygonSpatialObject);
58
61 void
62 Clear() override;
63
65 int
67
69 itkSetMacro(ThicknessInObjectSpace, double);
70
72 itkGetConstMacro(ThicknessInObjectSpace, double);
73
75 itkSetMacro(IsClosed, bool);
76
78 itkGetConstMacro(IsClosed, bool);
79
80 itkBooleanMacro(IsClosed);
81
83 double
85
87 double
89
91 double
93
95 bool
96 IsInsideInObjectSpace(const PointType & point) const override;
97
98 /* Avoid hiding the overload that supports depth and name arguments */
99 using Superclass::IsInsideInObjectSpace;
100
101protected:
103 ~PolygonSpatialObject() override = default;
104
105 void
106 PrintSelf(std::ostream & os, Indent indent) const override;
107
108 typename LightObject::Pointer
109 InternalClone() const override;
110
111private:
112 mutable bool m_IsClosed{};
113 mutable int m_OrientationInObjectSpace{};
114 mutable ModifiedTimeType m_OrientationInObjectSpaceMTime{};
115 double m_ThicknessInObjectSpace{};
116};
117
118} // namespace itk
119
120#ifndef ITK_MANUAL_INSTANTIATION
121# include "itkPolygonSpatialObject.hxx"
122#endif
123
124#endif // itkPolygonSpatialObject_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.
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:54
double MeasureAreaInObjectSpace() const
int GetOrientationInObjectSpace() const
bool IsInsideInObjectSpace(const PointType &point) const override
~PolygonSpatialObject() override=default
double MeasureVolumeInObjectSpace() const
LightObject::Pointer InternalClone() const override
std::vector< PolygonPointType > PolygonPointListType
void PrintSelf(std::ostream &os, Indent indent) const override
double MeasurePerimeterInObjectSpace() const
Point used for spatial objects.
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 ModifiedTimeType
Definition: itkIntTypes.h:105