#include <DRect.h>
Public Methods | |
| DRect () | |
| Standard contructor. More... | |
| DRect (double, double, double, double) | |
| Contructor. More... | |
| void | moveBy (double, double) |
| Moves rectangle by x rightwards and y downwards. | |
| void | normalize () |
| Normalizes rectangle. More... | |
| bool | contains (double, double) |
| Checks if the point with the coordinates x and y lies in the rectangle. | |
| void | setCoords (double, double, double, double) |
| Sets the coordinates. | |
| double | left () |
| Returns x coordinate of left border. | |
| double | top () |
| Returns y coordinate of top border. | |
| double | right () |
| Returns x coordinate of right border. | |
| double | bottom () |
| Returns y coordinate of bottom border. | |
| QRect | getQRect () |
| Returns a QRect object with the rounded coordinates of the rectangle. | |
| QRect | getQRect (double) |
| Returns a QRect object with the coordinates adapted to the current scale. | |
Private Attributes | |
| double | x1 |
| X coordinate of the first point. | |
| double | x2 |
| X coordinate of the second point. | |
| double | y1 |
| Y coordinate of the first point. | |
| double | y2 |
| Y coordinate of the second point. | |
|
|
Standard contructor. Sets all coordinates to 0. |
|
|||||||||||||||||||||||||||||
|
Contructor.
|
|
|
Normalizes rectangle. Changes coordinates so that the first point is the upper left an the second the lower right one. |
1.2.9.1 written by Dimitri van Heesch,
© 1997-2001