Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

ogdf::GenericPoint< NUMBER > Class Template Reference

Parameterized base class for points. More...

#include <ogdf/basic/geometry.h>

Public Types

using numberType = NUMBER
 The type for coordinates of the point. More...
 

Public Member Functions

 GenericPoint ()
 Creates a generic point. More...
 
 GenericPoint (NUMBER x, NUMBER y)
 Creates a generic point (x,y). More...
 
 GenericPoint (const GenericPoint &p)
 Copy constructor. More...
 
double angle (GenericPoint q, GenericPoint r) const
 Compute angle (in radians) between vectors. More...
 
double angleDegrees (GenericPoint q, GenericPoint r) const
 Compute angle (in degrees) between vectors. More...
 
bool operator!= (const GenericPoint &p) const
 Inequality operator. More...
 
bool operator< (const GenericPoint &p)
 
GenericPoint & operator= (const GenericPoint &p)
 Assignment operator. More...
 
bool operator== (const GenericPoint &p) const
 Equality operator. More...
 
bool operator> (const GenericPoint &p)
 

Public Attributes

NUMBER m_x
 The x-coordinate. More...
 
NUMBER m_y
 The y-coordinate. More...
 

Detailed Description

template<class NUMBER>
class ogdf::GenericPoint< NUMBER >

Parameterized base class for points.

This class serves as base class for two-dimensional points with specific coordinate types like integer points (IPoint) and real points (DPoint). The template parameter NUMBER is the type for the coordinates of the point and has to support assignment and equality/inequality operators.

Definition at line 71 of file geometry.h.

Member Typedef Documentation

◆ numberType

template<class NUMBER>
using ogdf::GenericPoint< NUMBER >::numberType = NUMBER

The type for coordinates of the point.

Definition at line 75 of file geometry.h.

Constructor & Destructor Documentation

◆ GenericPoint() [1/3]

template<class NUMBER>
ogdf::GenericPoint< NUMBER >::GenericPoint ( )
inline

Creates a generic point.

Warning
Does not assign something like zero to the coordinates, since we do not require that 0 can be casted to a NUMBER.

Definition at line 85 of file geometry.h.

◆ GenericPoint() [2/3]

template<class NUMBER>
ogdf::GenericPoint< NUMBER >::GenericPoint ( NUMBER  x,
NUMBER  y 
)
inline

Creates a generic point (x,y).

Definition at line 88 of file geometry.h.

◆ GenericPoint() [3/3]

template<class NUMBER>
ogdf::GenericPoint< NUMBER >::GenericPoint ( const GenericPoint< NUMBER > &  p)
inline

Copy constructor.

Definition at line 91 of file geometry.h.

Member Function Documentation

◆ angle()

template<class NUMBER>
double ogdf::GenericPoint< NUMBER >::angle ( GenericPoint< NUMBER >  q,
GenericPoint< NUMBER >  r 
) const
inline

Compute angle (in radians) between vectors.

Definition at line 119 of file geometry.h.

◆ angleDegrees()

template<class NUMBER>
double ogdf::GenericPoint< NUMBER >::angleDegrees ( GenericPoint< NUMBER >  q,
GenericPoint< NUMBER >  r 
) const
inline

Compute angle (in degrees) between vectors.

Definition at line 144 of file geometry.h.

◆ operator!=()

template<class NUMBER>
bool ogdf::GenericPoint< NUMBER >::operator!= ( const GenericPoint< NUMBER > &  p) const
inline

Inequality operator.

Definition at line 106 of file geometry.h.

◆ operator<()

template<class NUMBER>
bool ogdf::GenericPoint< NUMBER >::operator< ( const GenericPoint< NUMBER > &  p)
inline

Definition at line 110 of file geometry.h.

◆ operator=()

template<class NUMBER>
GenericPoint& ogdf::GenericPoint< NUMBER >::operator= ( const GenericPoint< NUMBER > &  p)
inline

Assignment operator.

Definition at line 94 of file geometry.h.

◆ operator==()

template<class NUMBER>
bool ogdf::GenericPoint< NUMBER >::operator== ( const GenericPoint< NUMBER > &  p) const
inline

Equality operator.

Definition at line 101 of file geometry.h.

◆ operator>()

template<class NUMBER>
bool ogdf::GenericPoint< NUMBER >::operator> ( const GenericPoint< NUMBER > &  p)
inline

Definition at line 114 of file geometry.h.

Member Data Documentation

◆ m_x

template<class NUMBER>
NUMBER ogdf::GenericPoint< NUMBER >::m_x

The x-coordinate.

Definition at line 77 of file geometry.h.

◆ m_y

template<class NUMBER>
NUMBER ogdf::GenericPoint< NUMBER >::m_y

The y-coordinate.

Definition at line 78 of file geometry.h.


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