#include <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. | |
| bool | operator== (const DRect &dr) const |
| Equality operator. | |
| bool | operator!= (const DRect &dr) const |
| Inequality operator. | |
| DRect & | operator= (const DRect &dr) |
| Assignment operator. | |
| double | width () const |
| Returns the width of the rectangle. | |
| double | height () const |
| Returns the height of the rectangle. | |
| void | normalize () |
| Normalizes the rectangle. | |
| 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 | topLine () const |
| Returns the top side of the rectangle. | |
| const DLine | rightLine () const |
| Returns the right side of the rectangle. | |
| const DLine | leftLine () const |
| Returns the left side of the rectangle. | |
| const DLine | bottomLine () const |
| Returns the bottom side of the rectangle. | |
| void | yInvert () |
| Swaps the y-coordinates of the two points. | |
| void | xInvert () |
| Swaps the x-coordinates of the two points. | |
| bool | contains (const DPoint &p) const |
| Returns true iff p lies within this rectangle. | |
Private Attributes | |
| DPoint | m_p1 |
| The lower left point of the rectangle. | |
| DPoint | m_p2 |
| The upper right point of the rectangle. | |
Definition at line 498 of file geometry.h.
| ogdf::DRect::DRect | ( | ) | [inline] |
Creates a rectangle with lower left and upper right point (0,0).
Definition at line 506 of file geometry.h.
Creates a rectangle with lower left point p1 and upper right point p2.
Definition at line 509 of file geometry.h.
| ogdf::DRect::DRect | ( | double | x1, | |
| double | y1, | |||
| double | x2, | |||
| double | y2 | |||
| ) | [inline] |
Creates a rectangle with lower left point (x1,y1) and upper right point (x1,y2).
Definition at line 513 of file geometry.h.
| ogdf::DRect::DRect | ( | const DLine & | dl | ) | [inline] |
Creates a rectangle defined by the end points of line dl.
Definition at line 519 of file geometry.h.
| ogdf::DRect::DRect | ( | const DRect & | dr | ) | [inline] |
| bool ogdf::DRect::operator== | ( | const DRect & | dr | ) | const [inline] |
| bool ogdf::DRect::operator!= | ( | const DRect & | dr | ) | const [inline] |
| double ogdf::DRect::width | ( | ) | const [inline] |
| double ogdf::DRect::height | ( | ) | const [inline] |
| void ogdf::DRect::normalize | ( | ) | [inline] |
Normalizes the rectangle.
Makes sure that the lower left point lies below and left of the upper right point.
Definition at line 561 of file geometry.h.
| const DPoint& ogdf::DRect::p1 | ( | ) | const [inline] |
| const DPoint& ogdf::DRect::p2 | ( | ) | const [inline] |
| const DLine ogdf::DRect::topLine | ( | ) | const [inline] |
| const DLine ogdf::DRect::rightLine | ( | ) | const [inline] |
| const DLine ogdf::DRect::leftLine | ( | ) | const [inline] |
| const DLine ogdf::DRect::bottomLine | ( | ) | const [inline] |
| void ogdf::DRect::yInvert | ( | ) | [inline] |
| void ogdf::DRect::xInvert | ( | ) | [inline] |
| bool ogdf::DRect::contains | ( | const DPoint & | p | ) | const [inline] |
DPoint ogdf::DRect::m_p1 [private] |
DPoint ogdf::DRect::m_p2 [private] |