DGtal 2.0.0
Loading...
Searching...
No Matches
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

  • X : A type that is a model of CPolarPointComparator2D
  • x : object of type X
  • P : type of points
  • p, p1, p2 : objects type P

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()

◆ checkConstConstraints()

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

Definition at line 109 of file CPolarPointComparator2D.h.

110 {
111 // const method dummyConst should take parameter myA of type A and return
112 // something of type B
114 }
void sameType(const T &, const T &)

References myB, myP, myX, and DGtal::concepts::ConceptUtils::sameType().

Referenced by BOOST_CONCEPT_USAGE().

Field Documentation

◆ myB

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

Definition at line 119 of file CPolarPointComparator2D.h.

Referenced by checkConstConstraints().

◆ myP

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

Definition at line 118 of file CPolarPointComparator2D.h.

Referenced by BOOST_CONCEPT_USAGE(), and checkConstConstraints().

◆ myX

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

Definition at line 117 of file CPolarPointComparator2D.h.

Referenced by BOOST_CONCEPT_USAGE(), and checkConstConstraints().


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