ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkPolygonSpatialObject.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 itkPolygonSpatialObject_h
19 #define itkPolygonSpatialObject_h
20 
22 
23 namespace itk
24 {
30 template< unsigned int TDimension = 3 >
31 class ITK_TEMPLATE_EXPORT PolygonSpatialObject:
32  public PointBasedSpatialObject< TDimension, SpatialObjectPoint< TDimension > >
33 {
34 public:
35  ITK_DISALLOW_COPY_AND_ASSIGN(PolygonSpatialObject);
36 
41 
43  using PolygonPointListType = std::vector< PolygonPointType >;
44 
45  using PointType = typename Superclass::PointType;
46  using TransformType = typename Superclass::TransformType;
47  using SpatialObjectPointType = typename Superclass::SpatialObjectPointType;
48 
49  using ObjectDimensionType = unsigned int;
50  static constexpr ObjectDimensionType ObjectDimension = TDimension;
51 
53  itkNewMacro(Self);
54 
57 
59  int GetOrientationInObjectSpace() const;
60 
62  itkSetMacro(ThicknessInObjectSpace, double);
63 
65  itkGetConstMacro(ThicknessInObjectSpace, double);
66 
68  itkSetMacro(IsClosed, bool);
69 
71  itkGetConstMacro(IsClosed, bool);
72 
74  double MeasureAreaInObjectSpace() const;
75 
77  double MeasureVolumeInObjectSpace() const;
78 
80  double MeasurePerimeterInObjectSpace() const;
81 
83  bool IsInsideInObjectSpace(const PointType & point, unsigned int depth,
84  const std::string & name) const override;
85 
86 protected:
88  ~PolygonSpatialObject() override = default;
89 
90  void PrintSelf(std::ostream & os, Indent indent) const override;
91 
92  typename LightObject::Pointer InternalClone() const override;
93 
94 private:
95  mutable bool m_IsClosed;
99 };
100 
101 }
102 
103 #ifndef ITK_MANUAL_INSTANTIATION
104 #include "itkPolygonSpatialObject.hxx"
105 #endif
106 
107 #endif // itkPolygonSpatialObject_h
typename Superclass::SpatialObjectPointType SpatialObjectPointType
This class serves as the base class for point-based spatial objects.
typename Superclass::TransformType TransformType
typename Superclass::PointType PointType
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:104
Point used for spatial objets.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
ModifiedTimeType m_OrientationInObjectSpaceMTime
Base class for most ITK classes.
Definition: itkObject.h:60
Base class for all data objects in ITK.
std::vector< PolygonPointType > PolygonPointListType