Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

DRect Class Reference

Rectangle containing coordinates in double format. More...

#include <DRect.h>

List of all members.

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.


Detailed Description

Rectangle containing coordinates in double format.


Constructor & Destructor Documentation

DRect::DRect
 

Standard contructor.

Sets all coordinates to 0.

DRect::DRect double dx1,
double dy1,
double dx2,
double dy2
 

Contructor.

Parameters:
dx1   x coordinate of first point
dy1   y coordinate of first point
dx2   x coordinate of second point
dy2   y coordinate of second point


Member Function Documentation

void DRect::normalize
 

Normalizes rectangle.

Changes coordinates so that the first point is the upper left an the second the lower right one.


The documentation for this class was generated from the following files:
Generated at Fri Apr 11 22:37:15 2003 for Qfsm by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001