OTB  9.0.0
Orfeo Toolbox
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
otb::Polygon< TValue > Class Template Reference

#include <otbPolygon.h>

+ Inheritance diagram for otb::Polygon< TValue >:
+ Collaboration diagram for otb::Polygon< TValue >:

Public Types

typedef itk::SmartPointer< const SelfConstPointer
 
typedef Superclass::ContinuousIndexType ContinuousIndexType
 
typedef itk::SmartPointer< SelfPointer
 
typedef Polygon Self
 
typedef PolyLineParametricPathWithValue< TValue, 2 > Superclass
 
typedef TValue ValueType
 
typedef Superclass::VertexListConstIteratorType VertexListConstIteratorType
 
typedef Superclass::VertexListType VertexListType
 
typedef Superclass::VertexType VertexType
 
- Public Types inherited from otb::PolyLineParametricPathWithValue< double, 2 >
typedef itk::SmartPointer< const SelfConstPointer
 
typedef Superclass::ContinuousIndexType ContinuousIndexType
 
typedef RegionType::IndexType IndexType
 
typedef itk::SmartPointer< SelfPointer
 
typedef otb::RemoteSensingRegion< double > RegionType
 
typedef PolyLineParametricPathWithValue Self
 
typedef RegionType::SizeType SizeType
 
typedef itk::PolyLineParametricPath< VDimension > Superclass
 
typedef double ValueType
 
typedef VertexListType::ConstIterator VertexListConstIteratorType
 
typedef Superclass::VertexListType VertexListType
 
typedef Superclass::VertexType VertexType
 

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
 

Detailed Description

template<class TValue = double>
class otb::Polygon< TValue >

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.

See also
otb::PolyLineParametricPathWithValue

Definition at line 44 of file otbPolygon.h.

Member Typedef Documentation

◆ ConstPointer

template<class TValue = double>
typedef itk::SmartPointer<const Self> otb::Polygon< TValue >::ConstPointer

Definition at line 51 of file otbPolygon.h.

◆ ContinuousIndexType

template<class TValue = double>
typedef Superclass::ContinuousIndexType otb::Polygon< TValue >::ContinuousIndexType

Definition at line 63 of file otbPolygon.h.

◆ Pointer

template<class TValue = double>
typedef itk::SmartPointer<Self> otb::Polygon< TValue >::Pointer

Definition at line 50 of file otbPolygon.h.

◆ Self

template<class TValue = double>
typedef Polygon otb::Polygon< TValue >::Self

Standard typedefs

Definition at line 48 of file otbPolygon.h.

◆ Superclass

template<class TValue = double>
typedef PolyLineParametricPathWithValue<TValue, 2> otb::Polygon< TValue >::Superclass

Definition at line 49 of file otbPolygon.h.

◆ ValueType

template<class TValue = double>
typedef TValue otb::Polygon< TValue >::ValueType

Definition at line 52 of file otbPolygon.h.

◆ VertexListConstIteratorType

template<class TValue = double>
typedef Superclass::VertexListConstIteratorType otb::Polygon< TValue >::VertexListConstIteratorType

Definition at line 64 of file otbPolygon.h.

◆ VertexListType

template<class TValue = double>
typedef Superclass::VertexListType otb::Polygon< TValue >::VertexListType

Definition at line 62 of file otbPolygon.h.

◆ VertexType

template<class TValue = double>
typedef Superclass::VertexType otb::Polygon< TValue >::VertexType

Derived typedefs

Definition at line 58 of file otbPolygon.h.

Constructor & Destructor Documentation

◆ Polygon() [1/2]

template<class TValue = double>
otb::Polygon< TValue >::Polygon ( )
inlineprotected

Constructor

Definition at line 135 of file otbPolygon.h.

◆ ~Polygon()

template<class TValue = double>
otb::Polygon< TValue >::~Polygon ( )
inlineoverrideprotected

Destructor

Definition at line 143 of file otbPolygon.h.

◆ Polygon() [2/2]

template<class TValue = double>
otb::Polygon< TValue >::Polygon ( const Self )
privatedelete

Member Function Documentation

◆ AddVertex()

template<class TValue >
void otb::Polygon< TValue >::AddVertex ( const ContinuousIndexType vertex)
overridevirtual

Return the path length (perimeter).

Returns
The length.

Reimplemented from otb::PolyLineParametricPathWithValue< double, 2 >.

Definition at line 30 of file otbPolygon.hxx.

◆ ComputeArea()

template<class TValue >
void otb::Polygon< TValue >::ComputeArea
protectedvirtual

Area computation (for non convex polygons as well)

Definition at line 403 of file otbPolygon.hxx.

◆ CreateAnother()

template<class TValue = double>
virtual::itk::LightObject::Pointer otb::Polygon< TValue >::CreateAnother ( void  ) const

◆ GetArea()

template<class TValue >
double otb::Polygon< TValue >::GetArea
virtual

Return the polygon area.

Returns
The area.

Get surface

Definition at line 443 of file otbPolygon.hxx.

◆ GetEpsilon()

template<class TValue = double>
virtual double otb::Polygon< TValue >::GetEpsilon ( )
virtual

◆ GetLength()

template<class TValue >
double otb::Polygon< TValue >::GetLength
override

Return the polygon length (perimeter).

Returns
The length.

Length computation (difference with path is in the last addition)

Definition at line 457 of file otbPolygon.hxx.

◆ GetNameOfClass()

template<class TValue = double>
virtual const char* otb::Polygon< TValue >::GetNameOfClass ( ) const
virtual

Creation through object factory macro

◆ IsCrossing()

template<class TValue >
bool otb::Polygon< TValue >::IsCrossing ( VertexType  a1,
VertexType  a2,
VertexType  b1,
VertexType  b2 
) const

Check whether two segments [a1a2] and [b1b2] are strictly crossing.

Parameters
a1First point of the first segment,
a1Second point of the first segment,
a1First point of the second segment,
a1Second point of the second segment.
Returns
True if the two segments are strictly crossing.

Definition at line 267 of file otbPolygon.hxx.

◆ IsInside()

template<class TValue >
bool otb::Polygon< TValue >::IsInside ( VertexType  point) const

Check whether point is strictly inside the polygon.

Parameters
pointThe point to check.
Returns
True if the point is inside the polygon.

Definition at line 43 of file otbPolygon.hxx.

◆ IsOnEdge()

template<class TValue >
bool otb::Polygon< TValue >::IsOnEdge ( VertexType  point) const

Check whether point is strictly on the edge of the polygon.

Parameters
pointThe point to check.
Returns
True if the point is on the edge of the polygon.

Definition at line 120 of file otbPolygon.hxx.

◆ IsTouching()

template<class TValue >
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.

Parameters
a1First point of the first segment,
a1Second point of the first segment,
a1First point of the second segment,
a1Second point of the second segment.
Returns
True if the two segments are touching without crossing.

Definition at line 320 of file otbPolygon.hxx.

◆ Modified()

template<class TValue >
void otb::Polygon< TValue >::Modified
overrideprotected

Check whether point is strictly on the edge of the polygon.

Parameters
pointThe point to check.
Returns
True if the point is on the edge of the polygon.

Definition at line 501 of file otbPolygon.hxx.

◆ NbCrossing()

template<class TValue >
unsigned int otb::Polygon< TValue >::NbCrossing ( VertexType  a,
VertexType  b 
) const

Returns the number of crossings of the polygon with a given segment.

Parameters
aFirst point of the segment,
bSecond point of the segment,
Returns
the number of strict crossings of segment [ab] with the polygon.

Definition at line 199 of file otbPolygon.hxx.

◆ NbTouching()

template<class TValue >
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.

Parameters
aFirst point of the segment,
bSecond point of the segment,
Returns
the number of touchings without crossing of segment [ab] with the polygon.

Definition at line 232 of file otbPolygon.hxx.

◆ New()

template<class TValue = double>
static Pointer otb::Polygon< TValue >::New ( )
static

Type macro

◆ operator=()

template<class TValue = double>
void otb::Polygon< TValue >::operator= ( const Self )
privatedelete

◆ PrintSelf()

template<class TValue >
void otb::Polygon< TValue >::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotected

PrintSelf method

PrintSelf Method

Definition at line 511 of file otbPolygon.hxx.

◆ SetEpsilon()

template<class TValue = double>
virtual void otb::Polygon< TValue >::SetEpsilon ( double  _arg)
virtual

Member Data Documentation

◆ m_Area

template<class TValue = double>
double otb::Polygon< TValue >::m_Area
mutableprivate

Definition at line 158 of file otbPolygon.h.

◆ m_AreaIsValid

template<class TValue = double>
bool otb::Polygon< TValue >::m_AreaIsValid
mutableprivate

Definition at line 159 of file otbPolygon.h.

◆ m_Epsilon

template<class TValue = double>
double otb::Polygon< TValue >::m_Epsilon
private

Definition at line 157 of file otbPolygon.h.


The documentation for this class was generated from the following files: