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 (const GenericPoint< T > &p) | |
Copy constructor. More... | |
GenericPoint (T x=0, T y=0) | |
Creates a generic point (x ,y ). 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* (const GenericPoint< T > &p, T c) |
Point-wise multiplies p with c . More... | |
GenericPoint< T > | operator* (T c, const GenericPoint< T > &p) |
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 81 of file geometry.h.
using ogdf::GenericPoint< T >::numberType = T |
The type for coordinates of the point.
Definition at line 84 of file geometry.h.
|
inlineexplicit |
Creates a generic point (x
,y
).
Definition at line 90 of file geometry.h.
|
inline |
Copy constructor.
Definition at line 93 of file geometry.h.
|
inline |
Compute angle (in radians) between vectors.
Definition at line 135 of file geometry.h.
|
inline |
Compute angle (in degrees) between vectors.
Definition at line 153 of file geometry.h.
|
inline |
Returns the determinant of the matrix (this
, dv
).
Definition at line 211 of file geometry.h.
|
inline |
Returns the Euclidean distance between p
and this point.
Definition at line 158 of file geometry.h.
|
inline |
Returns the norm of the point.
Definition at line 165 of file geometry.h.
|
inline |
Inequality operator.
Definition at line 111 of file geometry.h.
|
inline |
Returns the scalar product of this and dv
.
Definition at line 214 of file geometry.h.
|
inline |
Point-wise multiplies this with c
.
Definition at line 182 of file geometry.h.
|
inline |
Addition of points.
Definition at line 125 of file geometry.h.
|
inline |
Adds p
to this.
Definition at line 168 of file geometry.h.
|
inline |
Subtraction of points.
Definition at line 130 of file geometry.h.
|
inline |
Subtracts p
from this.
Definition at line 175 of file geometry.h.
|
inline |
Point-wise divide this by c
.
Definition at line 199 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 115 of file geometry.h.
|
inline |
Assignment operator.
Definition at line 96 of file geometry.h.
|
inline |
Equality operator.
Definition at line 105 of file geometry.h.
|
inline |
Operator 'greater'. Returns true
iff p
is less than this.
Definition at line 122 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 194 of file geometry.h.
|
friend |
Point-wise multiplies p
with c
.
Definition at line 189 of file geometry.h.
|
friend |
Point-wise divide p
by c
.
Definition at line 206 of file geometry.h.
T ogdf::GenericPoint< T >::m_x |
The x-coordinate.
Definition at line 86 of file geometry.h.
T ogdf::GenericPoint< T >::m_y |
The y-coordinate.
Definition at line 87 of file geometry.h.