OTB  6.7.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 Self
ConstPointer
 
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< TValue, 2 >
typedef itk::SmartPointer
< const Self
ConstPointer
 
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 TValue ValueType
 
typedef
VertexListType::ConstIterator 
VertexListConstIteratorType
 
typedef Superclass::VertexListType VertexListType
 
typedef Superclass::VertexType VertexType
 
- Public Types inherited from itk::PolyLineParametricPath< VDimension >
typedef SmartPointer< const SelfConstPointer
 
typedef
Superclass::ContinuousIndexType 
ContinuousIndexType
 
typedef Index< VDimension > IndexType
 
typedef Superclass::InputType InputType
 
typedef Offset< VDimension > OffsetType
 
typedef Superclass::OutputType OutputType
 
typedef SmartPointer< SelfPointer
 
typedef Point< double, VDimension > PointType
 
typedef PolyLineParametricPath Self
 
typedef ParametricPath
< VDimension > 
Superclass
 
typedef Vector< double,
VDimension > 
VectorType
 
typedef VertexListType::Pointer VertexListPointer
 
typedef VectorContainer
< unsigned, VertexType
VertexListType
 
typedef ContinuousIndexType VertexType
 
- Public Types inherited from itk::ParametricPath< VDimension >
typedef SmartPointer< const SelfConstPointer
 
typedef ContinuousIndex
< SpacePrecisionType,
VDimension > 
ContinuousIndexType
 
typedef Index< VDimension > IndexType
 
typedef Superclass::InputType InputType
 
typedef Offset< VDimension > OffsetType
 
typedef Superclass::OutputType OutputType
 
typedef SmartPointer< SelfPointer
 
typedef ParametricPath Self
 
typedef Path< double,
ContinuousIndexType,
VDimension > 
Superclass
 
typedef Vector< double,
VDimension > 
VectorType
 
- Public Types inherited from itk::Path< double, ContinuousIndex< SpacePrecisionType, VDimension >, VDimension >
typedef SmartPointer< const SelfConstPointer
 
typedef Index< VDimension > IndexType
 
typedef double InputType
 
typedef Offset< VDimension > OffsetType
 
typedef ContinuousIndex
< SpacePrecisionType,
VDimension > 
OutputType
 
typedef SmartPointer< SelfPointer
 
typedef Path Self
 
typedef DataObject Superclass
 
- Public Types inherited from itk::DataObject
typedef SmartPointer< const SelfConstPointer
 
typedef std::string DataObjectIdentifierType
 
typedef std::vector< Pointer >
::size_type 
DataObjectPointerArraySizeType
 
typedef SmartPointer< SelfPointer
 
typedef DataObject Self
 
typedef Object Superclass
 
- Public Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Object Self
 
typedef LightObject Superclass
 
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

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< TValue, 2 >
virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual RegionType GetBoundingRegion (void) const
 
virtual std::string GetKey ()
 
ValueType GetValue (void) const
 
void SetValue (ValueType value)
 
- Public Member Functions inherited from itk::PolyLineParametricPath< VDimension >
void AddVertex (const ContinuousIndexType &vertex)
 
virtual InputType EndOfInput () const override
 
virtual OutputType Evaluate (const InputType &input) const override
 
virtual VectorType EvaluateDerivative (const InputType &input) const override
 
virtual VertexListTypeGetModifiableVertexList ()
 
virtual const VertexListTypeGetVertexList () const
 
virtual OffsetType IncrementInput (InputType &input) const override
 
virtual void Initialize (void) override
 
- Public Member Functions inherited from itk::ParametricPath< VDimension >
virtual VectorType EvaluateDerivative (const InputType &input) const
 
virtual IndexType EvaluateToIndex (const InputType &input) const override
 
virtual const InputTypeGetDefaultInputStepSize () const
 
virtual OffsetType IncrementInput (InputType &input) const override
 
virtual void SetDefaultInputStepSize (InputType _arg)
 
- Public Member Functions inherited from itk::Path< double, ContinuousIndex< SpacePrecisionType, VDimension >, VDimension >
virtual OutputType Evaluate (const InputType &input) const =0
 
virtual IndexType EvaluateToIndex (const InputType &input) const =0
 
virtual OffsetType IncrementInput (InputType &input) const =0
 
virtual InputType StartOfInput () const
 
- Public Member Functions inherited from itk::DataObject
virtual void CopyInformation (const DataObject *)
 
virtual void DataHasBeenGenerated ()
 
void DisconnectPipeline ()
 
bool GetDataReleased () const
 
virtual const ModifiedTimeTypeGetPipelineMTime () const
 
virtual const RealTimeStampGetRealTimeStamp () const
 
virtual const bool & GetReleaseDataFlag () const
 
SmartPointerForwardReference
< ProcessObject
GetSource () const
 
DataObjectPointerArraySizeType GetSourceOutputIndex () const
 
const DataObjectIdentifierTypeGetSourceOutputName () const
 
virtual ModifiedTimeType GetUpdateMTime () const
 
virtual void Graft (const DataObject *)
 
virtual void PrepareForNewData ()
 
virtual void PropagateRequestedRegion ()
 
void ReleaseData ()
 
virtual void ReleaseDataFlagOff ()
 
virtual void ReleaseDataFlagOn ()
 
virtual bool RequestedRegionIsOutsideOfTheBufferedRegion ()
 
virtual void ResetPipeline ()
 
void SetPipelineMTime (ModifiedTimeType time)
 
virtual void SetRealTimeStamp (RealTimeStamp _arg)
 
void SetReleaseDataFlag (bool flag)
 
virtual void SetRequestedRegion (const DataObject *)
 
virtual void SetRequestedRegionToLargestPossibleRegion ()
 
bool ShouldIReleaseData () const
 
virtual void Update ()
 
virtual void UpdateOutputData ()
 
virtual void UpdateOutputInformation ()
 
virtual bool VerifyRequestedRegion ()
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
virtual ModifiedTimeType GetMTime () const
 
virtual const std::string & GetObjectName () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual void SetReferenceCount (int) override
 
virtual void UnRegister () const noexceptoverride
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from otb::PolyLineParametricPathWithValue< TValue, 2 >
static Pointer New ()
 
- Static Public Member Functions inherited from itk::PolyLineParametricPath< VDimension >
static Pointer New ()
 
- Static Public Member Functions inherited from itk::DataObject
static bool GetGlobalReleaseDataFlag ()
 
static void GlobalReleaseDataFlagOff ()
 
static void GlobalReleaseDataFlagOn ()
 
static void SetGlobalReleaseDataFlag (bool val)
 
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool flag)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Protected Member Functions

 Polygon ()
 
 ~Polygon () override
 
- Protected Member Functions inherited from otb::PolyLineParametricPathWithValue< TValue, 2 >
virtual void ComputeBoundingRegion () const
 
virtual void ComputeLength () const
 
void Modified () const override
 
 PolyLineParametricPathWithValue ()
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
 ~PolyLineParametricPathWithValue () override
 
- Protected Member Functions inherited from itk::PolyLineParametricPath< VDimension >
 PolyLineParametricPath ()
 
 ~PolyLineParametricPath ()
 
- Protected Member Functions inherited from itk::ParametricPath< VDimension >
 ParametricPath ()
 
 ~ParametricPath ()
 
- Protected Member Functions inherited from itk::Path< double, ContinuousIndex< SpacePrecisionType, VDimension >, VDimension >
virtual IndexType GetZeroIndex () const
 
virtual OffsetType GetZeroOffset () const
 
 Path ()
 
 ~Path ()
 
- Protected Member Functions inherited from itk::DataObject
 DataObject ()
 
virtual void PropagateResetPipeline ()
 
 ~DataObject ()
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &time)
 
virtual ~Object ()
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

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
 
virtual void ComputeArea () const
 
double GetLength () const override
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
void Modified () const override
 

Additional Inherited Members

- Static Public Attributes inherited from itk::Path< double, ContinuousIndex< SpacePrecisionType, VDimension >, VDimension >
static const unsigned int PathDimension
 
- Protected Attributes inherited from itk::ParametricPath< VDimension >
InputType m_DefaultInputStepSize
 
- Protected Attributes inherited from itk::LightObject
AtomicInt< int > m_ReferenceCount
 

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

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

Definition at line 52 of file otbPolygon.h.

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

Definition at line 64 of file otbPolygon.h.

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

Definition at line 51 of file otbPolygon.h.

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

Standard typedefs

Definition at line 49 of file otbPolygon.h.

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

Definition at line 50 of file otbPolygon.h.

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

Definition at line 53 of file otbPolygon.h.

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

Definition at line 65 of file otbPolygon.h.

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

Definition at line 63 of file otbPolygon.h.

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

Derived typedefs

Definition at line 59 of file otbPolygon.h.

Constructor & Destructor Documentation

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

Constructor

Definition at line 136 of file otbPolygon.h.

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

Destructor

Definition at line 144 of file otbPolygon.h.

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

Member Function Documentation

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

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

Definition at line 32 of file otbPolygon.hxx.

template<class TValue >
void otb::Polygon< TValue >::ComputeArea ( ) const
protectedvirtual

Area computation (for non convex polygons as well)

Definition at line 435 of file otbPolygon.hxx.

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

Return the polygon area.

Returns
The area.

Get surface

Definition at line 478 of file otbPolygon.hxx.

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

Return the polygon length (perimeter).

Returns
The length.

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

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

Definition at line 493 of file otbPolygon.hxx.

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

Creation through object factory macro

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

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 287 of file otbPolygon.hxx.

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 47 of file otbPolygon.hxx.

References itk::FixedArray< TValue, VLength >::Begin().

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 126 of file otbPolygon.hxx.

References itk::FixedArray< TValue, VLength >::Begin().

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 345 of file otbPolygon.hxx.

template<class TValue >
void otb::Polygon< TValue >::Modified ( void  ) const
overrideprotectedvirtual

Return the polygon length (perimeter).

Returns
The length.

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

Reimplemented from itk::Object.

Definition at line 540 of file otbPolygon.hxx.

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 215 of file otbPolygon.hxx.

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 250 of file otbPolygon.hxx.

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

Type macro

template<class TValue = double>
void otb::Polygon< TValue >::operator= ( const Self )
privatedelete
template<class TValue >
void otb::Polygon< TValue >::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotectedvirtual

PrintSelf method

PrintSelf Method

Reimplemented from itk::PolyLineParametricPath< VDimension >.

Definition at line 552 of file otbPolygon.hxx.

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

Member Data Documentation

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

Definition at line 157 of file otbPolygon.h.

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

Definition at line 158 of file otbPolygon.h.

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

Definition at line 156 of file otbPolygon.h.


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