DGtal  1.2.0
Public Types | Public Member Functions | Private Attributes
DGtal::concepts::CPolarPointComparator2D< T > Struct Template Reference

Aim: This concept gathers classes that are able to compare the position of two given points \( P, Q \) around a pole \( O \). More precisely, they compare the oriented angles lying between the horizontal line passing by \( O \) and the rays \( [OP) \) and \( [OQ) \) (in a counter-clockwise orientation). This is equivalent to compare the angle in radians from 0 (included) to 2 π (excluded). More...

#include <DGtal/geometry/tools/CPolarPointComparator2D.h>

Inheritance diagram for DGtal::concepts::CPolarPointComparator2D< T >:
[legend]

Public Types

typedef T::Point Point
 

Public Member Functions

 BOOST_CONCEPT_USAGE (CPolarPointComparator2D)
 
void checkConstConstraints () const
 

Private Attributes

myX
 
Point myP
 
bool myB
 

Detailed Description

template<typename T>
struct DGtal::concepts::CPolarPointComparator2D< T >

Aim: This concept gathers classes that are able to compare the position of two given points \( P, Q \) around a pole \( O \). More precisely, they compare the oriented angles lying between the horizontal line passing by \( O \) and the rays \( [OP) \) and \( [OQ) \) (in a counter-clockwise orientation). This is equivalent to compare the angle in radians from 0 (included) to 2 π (excluded).

Description of concept 'CPolarPointComparator2D'

The main method is the operator() applied on two points. It returns 'true' if the first point is located strictly before the second one, 'false' otherwise. A point \( P \) is located strictly before a point \( Q \) iff the oriented angle done by \( P \) is smaller than the one of \( Q \) or its euclidean norm is shorter if \( O, P, Q \) are aligned. Note that it returns 'false' if \( P = Q \).

Refinement of default constructible, copy constructible, assignable

Associated types

Notation

Definitions

Valid expressions and semantics

| Name | Expression | Type requirements | Return type | Precondition | Semantics | Post condition | Complexity | |------------------—+-----------—+-------------------—+----------—+-----------—+----------------------------------------------------—+-------------—+--------------—| | pole setter | x.setPole(p) | p is of type P | | | the pole is set to p | | O(1) | | comparison function | x(p1, p2) | p1, p2 are of type P | bool | | tells whether p1 is located strictly before p2 or not | | model-dependant |

Models

PolarPointComparator2DBy2x2DetComputer.

Template Parameters
Tthe type that should be a model of CPolarPointComparator2D.

Definition at line 96 of file CPolarPointComparator2D.h.

Member Typedef Documentation

◆ Point

template<typename T >
typedef T::Point DGtal::concepts::CPolarPointComparator2D< T >::Point

Definition at line 101 of file CPolarPointComparator2D.h.

Member Function Documentation

◆ BOOST_CONCEPT_USAGE()

template<typename T >
DGtal::concepts::CPolarPointComparator2D< T >::BOOST_CONCEPT_USAGE ( CPolarPointComparator2D< T >  )
inline

◆ checkConstConstraints()

template<typename T >
void DGtal::concepts::CPolarPointComparator2D< T >::checkConstConstraints ( ) const
inline

Field Documentation

◆ myB

template<typename T >
bool DGtal::concepts::CPolarPointComparator2D< T >::myB
private

◆ myP

template<typename T >
Point DGtal::concepts::CPolarPointComparator2D< T >::myP
private

◆ myX

template<typename T >
T DGtal::concepts::CPolarPointComparator2D< T >::myX
private

The documentation for this struct was generated from the following file: