Parameterized base class for points. More...
#include <ogdf/basic/geometry.h>
Public Types | |
| using | numberType = T |
| The type for coordinates of the point. More... | |
Public Member Functions | |
| GenericPoint (T x=0, T y=0) | |
Creates a generic point (x,y). More... | |
| GenericPoint (const GenericPoint< T > &p) | |
| Copy constructor. More... | |
| double | angle (GenericPoint< T > q, GenericPoint< T > r) const |
| Compute angle (in radians) between vectors. More... | |
| double | angleDegrees (GenericPoint< T > q, GenericPoint< T > r) const |
| Compute angle (in degrees) between vectors. More... | |
| T | determinant (const GenericPoint< T > &dv) const |
Returns the determinant of the matrix (this, dv). More... | |
| double | distance (const GenericPoint< T > &p) const |
Returns the Euclidean distance between p and this point. More... | |
| double | norm () const |
| Returns the norm of the point. More... | |
| bool | operator!= (const GenericPoint< T > &p) const |
| Inequality operator. More... | |
| T | operator* (const GenericPoint< T > &dv) const |
Returns the scalar product of this and dv. More... | |
| GenericPoint< T > & | operator*= (T c) |
Point-wise multiplies this with c. More... | |
| GenericPoint< T > | operator+ (const GenericPoint< T > &p) const |
| Addition of points. More... | |
| GenericPoint< T > & | operator+= (const GenericPoint< T > &p) |
Adds p to this. More... | |
| GenericPoint< T > | operator- (const GenericPoint< T > &p) const |
| Subtraction of points. More... | |
| GenericPoint< T > & | operator-= (const GenericPoint< T > &p) |
Subtracts p from this. More... | |
| GenericPoint< T > & | operator/= (T c) |
Point-wise divide this by c. More... | |
| bool | operator< (const GenericPoint< T > &p) const |
Operator 'less'. Returns true iff the x coordinate of this is less than the x coordinate of p or, if they are equal, the same check is done for the y coordinate. More... | |
| GenericPoint< T > & | operator= (const GenericPoint< T > &p) |
| Assignment operator. More... | |
| bool | operator== (const GenericPoint< T > &dp) const |
| Equality operator. More... | |
| bool | operator> (const GenericPoint< T > &p) const |
Operator 'greater'. Returns true iff p is less than this. More... | |
| GenericPoint< T > | orthogonal () const |
| Returns a vector that is orthogonal to this vector. More... | |
Public Attributes | |
| T | m_x |
| The x-coordinate. More... | |
| T | m_y |
| The y-coordinate. More... | |
Friends | |
| GenericPoint< T > | operator* (T c, const GenericPoint< T > &p) |
Point-wise multiplies p with c. More... | |
| GenericPoint< T > | operator* (const GenericPoint< T > &p, T c) |
Point-wise multiplies p with c. More... | |
| GenericPoint< T > | operator/ (const GenericPoint< T > &p, double c) |
Point-wise divide p by c. More... | |
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 T is the type for the coordinates of the point and has to support assignment and equality/inequality operators.
This class also provides vector operations, e.g., computing an orthogonal vector.
Definition at line 72 of file geometry.h.
| using ogdf::GenericPoint< T >::numberType = T |
The type for coordinates of the point.
Definition at line 76 of file geometry.h.
|
inlineexplicit |
Creates a generic point (x,y).
Definition at line 82 of file geometry.h.
|
inline |
Copy constructor.
Definition at line 85 of file geometry.h.
|
inline |
Compute angle (in radians) between vectors.
Definition at line 131 of file geometry.h.
|
inline |
Compute angle (in degrees) between vectors.
Definition at line 147 of file geometry.h.
|
inline |
Returns the determinant of the matrix (this, dv).
Definition at line 207 of file geometry.h.
|
inline |
Returns the Euclidean distance between p and this point.
Definition at line 152 of file geometry.h.
|
inline |
Returns the norm of the point.
Definition at line 159 of file geometry.h.
|
inline |
Inequality operator.
Definition at line 103 of file geometry.h.
|
inline |
Returns the scalar product of this and dv.
Definition at line 212 of file geometry.h.
|
inline |
Point-wise multiplies this with c.
Definition at line 178 of file geometry.h.
|
inline |
Addition of points.
Definition at line 121 of file geometry.h.
|
inline |
Adds p to this.
Definition at line 164 of file geometry.h.
|
inline |
Subtraction of points.
Definition at line 126 of file geometry.h.
|
inline |
Subtracts p from this.
Definition at line 171 of file geometry.h.
|
inline |
Point-wise divide this by c.
Definition at line 195 of file geometry.h.
|
inline |
Operator 'less'. Returns true iff the x coordinate of this is less than the x coordinate of p or, if they are equal, the same check is done for the y coordinate.
Definition at line 109 of file geometry.h.
|
inline |
Assignment operator.
Definition at line 88 of file geometry.h.
|
inline |
Equality operator.
Definition at line 97 of file geometry.h.
|
inline |
Operator 'greater'. Returns true iff p is less than this.
Definition at line 116 of file geometry.h.
|
inline |
Returns a vector that is orthogonal to this vector.
Returns the vector (y/x,1) if x != 0, or (1,0) otherwise, where (x,y) is this vector.
Definition at line 222 of file geometry.h.
|
friend |
Point-wise multiplies p with c.
Definition at line 185 of file geometry.h.
|
friend |
Point-wise multiplies p with c.
Definition at line 190 of file geometry.h.
|
friend |
Point-wise divide p by c.
Definition at line 202 of file geometry.h.
| T ogdf::GenericPoint< T >::m_x |
The x-coordinate.
Definition at line 78 of file geometry.h.
| T ogdf::GenericPoint< T >::m_y |
The y-coordinate.
Definition at line 79 of file geometry.h.