Rectangles with real coordinates. More...
#include <ogdf/basic/geometry.h>
Public Member Functions | |
| DRect () | |
| Creates a rectangle with lower left and upper right point (0,0). | |
| DRect (const DPoint &p1, const DPoint &p2) | |
| Creates a rectangle with lower left point p1 and upper right point p2. | |
| DRect (double x1, double y1, double x2, double y2) | |
| Creates a rectangle with lower left point (x1,y1) and upper right point (x1,y2). | |
| DRect (const DLine &dl) | |
| Creates a rectangle defined by the end points of line dl. | |
| DRect (const DRect &dr) | |
| Copy constructor. | |
| const DLine | bottomLine () const |
| Returns the bottom side of the rectangle. | |
| bool | contains (const DPoint &p) const |
| Returns true iff p lies within this rectangle. | |
| double | height () const |
| Returns the height of the rectangle. | |
| const DLine | leftLine () const |
| Returns the left side of the rectangle. | |
| void | normalize () |
| Normalizes the rectangle. | |
| bool | operator!= (const DRect &dr) const |
| Inequality operator. | |
| DRect & | operator= (const DRect &dr) |
| Assignment operator. | |
| bool | operator== (const DRect &dr) const |
| Equality operator. | |
| const DPoint & | p1 () const |
| Returns the lower left point of the rectangle. | |
| const DPoint & | p2 () const |
| Returns the upper right point of the rectangle. | |
| const DLine | rightLine () const |
| Returns the right side of the rectangle. | |
| const DLine | topLine () const |
| Returns the top side of the rectangle. | |
| double | width () const |
| Returns the width of the rectangle. | |
| void | xInvert () |
| Swaps the x-coordinates of the two points. | |
| void | yInvert () |
| Swaps the y-coordinates of the two points. | |
Private Attributes | |
| DPoint | m_p1 |
| The lower left point of the rectangle. | |
| DPoint | m_p2 |
| The upper right point of the rectangle. | |
Rectangles with real coordinates.
Definition at line 497 of file geometry.h.
|
inline |
Creates a rectangle with lower left and upper right point (0,0).
Definition at line 505 of file geometry.h.
Creates a rectangle with lower left point p1 and upper right point p2.
Definition at line 508 of file geometry.h.
|
inline |
Creates a rectangle with lower left point (x1,y1) and upper right point (x1,y2).
Definition at line 512 of file geometry.h.
|
inline |
Creates a rectangle defined by the end points of line dl.
Definition at line 518 of file geometry.h.
|
inline |
Copy constructor.
Definition at line 522 of file geometry.h.
|
inline |
Returns the bottom side of the rectangle.
Definition at line 587 of file geometry.h.
|
inline |
Returns true iff p lies within this rectangle.
Definition at line 598 of file geometry.h.
|
inline |
Returns the height of the rectangle.
Definition at line 550 of file geometry.h.
|
inline |
Returns the left side of the rectangle.
Definition at line 582 of file geometry.h.
|
inline |
Normalizes the rectangle.
Makes sure that the lower left point lies below and left of the upper right point.
Definition at line 560 of file geometry.h.
|
inline |
Inequality operator.
Definition at line 531 of file geometry.h.
Assignment operator.
Definition at line 536 of file geometry.h.
|
inline |
Equality operator.
Definition at line 526 of file geometry.h.
|
inline |
Returns the lower left point of the rectangle.
Definition at line 566 of file geometry.h.
|
inline |
Returns the upper right point of the rectangle.
Definition at line 569 of file geometry.h.
|
inline |
Returns the right side of the rectangle.
Definition at line 577 of file geometry.h.
|
inline |
Returns the top side of the rectangle.
Definition at line 572 of file geometry.h.
|
inline |
Returns the width of the rectangle.
Definition at line 545 of file geometry.h.
|
inline |
Swaps the x-coordinates of the two points.
Definition at line 595 of file geometry.h.
|
inline |
Swaps the y-coordinates of the two points.
Definition at line 592 of file geometry.h.
|
private |
The lower left point of the rectangle.
Definition at line 500 of file geometry.h.
|
private |
The upper right point of the rectangle.
Definition at line 501 of file geometry.h.