OTB
9.0.0
Orfeo Toolbox
|
#include <otbPolygon.h>
Public Member Functions | |
void | AddVertex (const ContinuousIndexType &vertex) override |
virtual ::itk::LightObject::Pointer | CreateAnother (void) const |
virtual double | GetEpsilon () |
virtual const char * | GetNameOfClass () const |
bool | IsInside (VertexType point) const |
virtual void | SetEpsilon (double _arg) |
Public Member Functions inherited from otb::PolyLineParametricPathWithValue< double, 2 > | |
virtual ::itk::LightObject::Pointer | CreateAnother (void) const |
virtual std::string | GetKey () |
virtual const char * | GetNameOfClass () const |
ValueType | GetValue (void) const |
void | SetValue (ValueType value) |
virtual double | GetLength () const |
virtual RegionType | GetBoundingRegion (void) const |
Static Public Member Functions | |
static Pointer | New () |
Static Public Member Functions inherited from otb::PolyLineParametricPathWithValue< double, 2 > | |
static Pointer | New () |
Protected Member Functions | |
Polygon () | |
~Polygon () override | |
Protected Member Functions inherited from otb::PolyLineParametricPathWithValue< double, 2 > | |
~PolyLineParametricPathWithValue () override | |
PolyLineParametricPathWithValue () | |
void | PrintSelf (std::ostream &os, itk::Indent indent) const override |
virtual void | ComputeLength () const |
virtual void | ComputeBoundingRegion () const |
void | Modified () const override |
Private Member Functions | |
void | operator= (const Self &)=delete |
Polygon (const Self &)=delete | |
Private Attributes | |
double | m_Area |
bool | m_AreaIsValid |
double | m_Epsilon |
bool | IsOnEdge (VertexType point) const |
unsigned int | NbCrossing (VertexType a, VertexType b) const |
unsigned int | NbTouching (VertexType a, VertexType b) const |
bool | IsCrossing (VertexType a1, VertexType a2, VertexType b1, VertexType b2) const |
bool | IsTouching (VertexType a1, VertexType a2, VertexType b1, VertexType b2) const |
virtual double | GetArea () const |
double | GetLength () const override |
void | PrintSelf (std::ostream &os, itk::Indent indent) const override |
virtual void | ComputeArea () const |
void | Modified () const override |
This class represent a 2D polygon.
It derives from otb::PolyLineParametricPathWithValue. The polygon is considered to be the closed path represented by the PolyLineParametricPathWithValue.
It implements some useful methods to work with polygons, such as surface computation, as well as method useful in the spatial reasoning context, such as IsInside, IsOnEdge, IsTouching, IsCrossing.
Definition at line 44 of file otbPolygon.h.
typedef itk::SmartPointer<const Self> otb::Polygon< TValue >::ConstPointer |
Definition at line 51 of file otbPolygon.h.
typedef Superclass::ContinuousIndexType otb::Polygon< TValue >::ContinuousIndexType |
Definition at line 63 of file otbPolygon.h.
typedef itk::SmartPointer<Self> otb::Polygon< TValue >::Pointer |
Definition at line 50 of file otbPolygon.h.
typedef Polygon otb::Polygon< TValue >::Self |
Standard typedefs
Definition at line 48 of file otbPolygon.h.
typedef PolyLineParametricPathWithValue<TValue, 2> otb::Polygon< TValue >::Superclass |
Definition at line 49 of file otbPolygon.h.
typedef TValue otb::Polygon< TValue >::ValueType |
Definition at line 52 of file otbPolygon.h.
typedef Superclass::VertexListConstIteratorType otb::Polygon< TValue >::VertexListConstIteratorType |
Definition at line 64 of file otbPolygon.h.
typedef Superclass::VertexListType otb::Polygon< TValue >::VertexListType |
Definition at line 62 of file otbPolygon.h.
typedef Superclass::VertexType otb::Polygon< TValue >::VertexType |
Derived typedefs
Definition at line 58 of file otbPolygon.h.
|
inlineprotected |
Constructor
Definition at line 135 of file otbPolygon.h.
|
inlineoverrideprotected |
Destructor
Definition at line 143 of file otbPolygon.h.
|
privatedelete |
|
overridevirtual |
Return the path length (perimeter).
Reimplemented from otb::PolyLineParametricPathWithValue< double, 2 >.
Definition at line 30 of file otbPolygon.hxx.
|
protectedvirtual |
Area computation (for non convex polygons as well)
Definition at line 403 of file otbPolygon.hxx.
virtual::itk::LightObject::Pointer otb::Polygon< TValue >::CreateAnother | ( | void | ) | const |
|
virtual |
Return the polygon area.
Get surface
Definition at line 443 of file otbPolygon.hxx.
|
virtual |
|
override |
Return the polygon length (perimeter).
Length computation (difference with path is in the last addition)
Definition at line 457 of file otbPolygon.hxx.
|
virtual |
Creation through object factory macro
bool otb::Polygon< TValue >::IsCrossing | ( | VertexType | a1, |
VertexType | a2, | ||
VertexType | b1, | ||
VertexType | b2 | ||
) | const |
Check whether two segments [a1a2] and [b1b2] are strictly crossing.
a1 | First point of the first segment, |
a1 | Second point of the first segment, |
a1 | First point of the second segment, |
a1 | Second point of the second segment. |
Definition at line 267 of file otbPolygon.hxx.
bool otb::Polygon< TValue >::IsInside | ( | VertexType | point | ) | const |
Check whether point is strictly inside the polygon.
point | The point to check. |
Definition at line 43 of file otbPolygon.hxx.
bool otb::Polygon< TValue >::IsOnEdge | ( | VertexType | point | ) | const |
Check whether point is strictly on the edge of the polygon.
point | The point to check. |
Definition at line 120 of file otbPolygon.hxx.
bool otb::Polygon< TValue >::IsTouching | ( | VertexType | a1, |
VertexType | a2, | ||
VertexType | b1, | ||
VertexType | b2 | ||
) | const |
Check whether two segments[a1a2] and [b1b2] are touching without crossing.
a1 | First point of the first segment, |
a1 | Second point of the first segment, |
a1 | First point of the second segment, |
a1 | Second point of the second segment. |
Definition at line 320 of file otbPolygon.hxx.
|
overrideprotected |
Check whether point is strictly on the edge of the polygon.
point | The point to check. |
Definition at line 501 of file otbPolygon.hxx.
unsigned int otb::Polygon< TValue >::NbCrossing | ( | VertexType | a, |
VertexType | b | ||
) | const |
Returns the number of crossings of the polygon with a given segment.
a | First point of the segment, |
b | Second point of the segment, |
Definition at line 199 of file otbPolygon.hxx.
unsigned int otb::Polygon< TValue >::NbTouching | ( | VertexType | a, |
VertexType | b | ||
) | const |
Returns the number of touchings without crossing of the polygon with a given segment.
a | First point of the segment, |
b | Second point of the segment, |
Definition at line 232 of file otbPolygon.hxx.
|
static |
Type macro
|
privatedelete |
|
overrideprotected |
|
virtual |
|
mutableprivate |
Definition at line 158 of file otbPolygon.h.
|
mutableprivate |
Definition at line 159 of file otbPolygon.h.
|
private |
Definition at line 157 of file otbPolygon.h.