ITK  5.2.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  * 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 itkPolygonSpatialObject_h
19 #define itkPolygonSpatialObject_h
20 
22 
23 namespace itk
24 {
31 template <unsigned int TDimension = 3>
32 class ITK_TEMPLATE_EXPORT PolygonSpatialObject
33  : public PointBasedSpatialObject<TDimension, SpatialObjectPoint<TDimension>>
34 {
35 public:
36  ITK_DISALLOW_COPY_AND_ASSIGN(PolygonSpatialObject);
37 
42 
44  using PolygonPointListType = std::vector<PolygonPointType>;
45 
46  using PointType = typename Superclass::PointType;
47  using TransformType = typename Superclass::TransformType;
48  using SpatialObjectPointType = typename Superclass::SpatialObjectPointType;
49 
50  using ObjectDimensionType = unsigned int;
51  static constexpr ObjectDimensionType ObjectDimension = TDimension;
52 
54  itkNewMacro(Self);
55 
58 
61  void
62  Clear() override;
63 
65  int
66  GetOrientationInObjectSpace() const;
67 
69  itkSetMacro(ThicknessInObjectSpace, double);
70 
72  itkGetConstMacro(ThicknessInObjectSpace, double);
73 
75  itkSetMacro(IsClosed, bool);
76 
78  itkGetConstMacro(IsClosed, bool);
79 
81  double
82  MeasureAreaInObjectSpace() const;
83 
85  double
86  MeasureVolumeInObjectSpace() const;
87 
89  double
90  MeasurePerimeterInObjectSpace() const;
91 
93  bool
94  IsInsideInObjectSpace(const PointType & point) const override;
95 
96  /* Avoid hiding the overload that supports depth and name arguments */
97  using Superclass::IsInsideInObjectSpace;
98 
99 protected:
101  ~PolygonSpatialObject() override = default;
102 
103  void
104  PrintSelf(std::ostream & os, Indent indent) const override;
105 
106  typename LightObject::Pointer
107  InternalClone() const override;
108 
109 private:
110  mutable bool m_IsClosed;
114 };
115 
116 } // namespace itk
117 
118 #ifndef ITK_MANUAL_INSTANTIATION
119 # include "itkPolygonSpatialObject.hxx"
120 #endif
121 
122 #endif // itkPolygonSpatialObject_h
itk::PointBasedSpatialObject
This class serves as the base class for point-based spatial objects.
Definition: itkPointBasedSpatialObject.h:37
itk::PolygonSpatialObject::ObjectDimensionType
unsigned int ObjectDimensionType
Definition: itkPolygonSpatialObject.h:50
itk::ModifiedTimeType
SizeValueType ModifiedTimeType
Definition: itkIntTypes.h:102
itk::PolygonSpatialObject::m_OrientationInObjectSpaceMTime
ModifiedTimeType m_OrientationInObjectSpaceMTime
Definition: itkPolygonSpatialObject.h:112
itk::PolygonSpatialObject::SpatialObjectPointType
typename Superclass::SpatialObjectPointType SpatialObjectPointType
Definition: itkPolygonSpatialObject.h:48
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::PolygonSpatialObject
TODO.
Definition: itkPolygonSpatialObject.h:32
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::PolygonSpatialObject::PolygonPointListType
std::vector< PolygonPointType > PolygonPointListType
Definition: itkPolygonSpatialObject.h:44
itk::PolygonSpatialObject::m_ThicknessInObjectSpace
double m_ThicknessInObjectSpace
Definition: itkPolygonSpatialObject.h:113
itk::PolygonSpatialObject::PointType
typename Superclass::PointType PointType
Definition: itkPolygonSpatialObject.h:46
itk::PolygonSpatialObject::TransformType
typename Superclass::TransformType TransformType
Definition: itkPolygonSpatialObject.h:47
itk::PolygonSpatialObject::m_OrientationInObjectSpace
int m_OrientationInObjectSpace
Definition: itkPolygonSpatialObject.h:111
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:60
itkPointBasedSpatialObject.h
itk::PolygonSpatialObject::m_IsClosed
bool m_IsClosed
Definition: itkPolygonSpatialObject.h:110
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293
itk::SpatialObjectPoint
Point used for spatial objets.
Definition: itkSpatialObjectPoint.h:44