Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

QwtDoubleRect Class Reference

List of all members.

Detailed Description

The QwtDoubleRect class defines a size in double coordinates.

Definition at line 134 of file qwt_double_rect.h.

Public Member Functions

 QwtDoubleRect ()
 QwtDoubleRect (double left, double top, double width, double height)
 QwtDoubleRect (const QwtDoublePoint &, const QwtDoubleSize &)
bool isNull () const
bool isEmpty () const
bool isValid () const
QwtDoubleRect normalized () const
double left () const
double right () const
double top () const
double bottom () const
void setLeft (double)
void setRight (double)
void setTop (double)
void setBottom (double)
QwtDoublePoint center () const
void moveLeft (double x)
void moveRight (double x)
void moveTop (double y)
void moveBottom (double y)
void moveTo (double x, double y)
void moveTo (const QwtDoublePoint &)
void moveBy (double dx, double dy)
void moveCenter (const QwtDoublePoint &)
void moveCenter (double dx, double dy)
void setRect (double x1, double x2, double width, double height)
double width () const
double height () const
QwtDoubleSize size () const
void setWidth (double w)
void setHeight (double h)
void setSize (const QwtDoubleSize &)
QwtDoubleRect operator| (const QwtDoubleRect &r) const
QwtDoubleRect operator & (const QwtDoubleRect &r) const
QwtDoubleRectoperator|= (const QwtDoubleRect &r)
QwtDoubleRectoperator &= (const QwtDoubleRect &r)
bool operator== (const QwtDoubleRect &) const
bool operator!= (const QwtDoubleRect &) const
bool contains (const QwtDoublePoint &p, bool proper=false) const
bool contains (double x, double y, bool proper=false) const
bool contains (const QwtDoubleRect &r, bool proper=false) const
QwtDoubleRect unite (const QwtDoubleRect &) const
QwtDoubleRect intersect (const QwtDoubleRect &) const
bool intersects (const QwtDoubleRect &) const


Constructor & Destructor Documentation

QwtDoubleRect::QwtDoubleRect  ) 
 

Constructs an rectangle with all components set to 0.0.

Definition at line 301 of file qwt_double_rect.cpp.

Referenced by operator &(), and operator|().

QwtDoubleRect::QwtDoubleRect double  left,
double  top,
double  width,
double  height
 

Constructs an rectangle with x1 to x2 as x-range and, y1 to y2 as y-range.

Definition at line 313 of file qwt_double_rect.cpp.

QwtDoubleRect::QwtDoubleRect const QwtDoublePoint p,
const QwtDoubleSize size
 

Constructs a rectangle with topLeft as the top-left corner and size as the rectangle size.

Definition at line 326 of file qwt_double_rect.cpp.


Member Function Documentation

double QwtDoubleRect::bottom  )  const
 

Returns bottom.

Definition at line 364 of file qwt_double_rect.h.

Referenced by QwtPlotCurve::maxYValue(), operator &(), QwtPlotZoomer::rescale(), QwtPlotPicker::transform(), and QwtPlot::updateAxes().

QwtDoublePoint QwtDoubleRect::center  )  const
 

Returns the center point of the rectangle.

Definition at line 486 of file qwt_double_rect.cpp.

Referenced by QwtPlotZoomer::end().

bool QwtDoubleRect::contains const QwtDoubleRect other,
bool  proper = false
const
 

Returns true if the rectangle other is inside this rectangle; otherwise returns false.

If proper is true, this function returns true only if other is entirely inside (not on the edge).

Definition at line 526 of file qwt_double_rect.cpp.

References contains(), d_bottom, d_left, d_right, and d_top.

bool QwtDoubleRect::contains double  x,
double  y,
bool  proper = false
const
 

Returns true if the point (x, y) is inside or on the edge of the rectangle; otherwise returns false.

If proper is true, this function returns true only if p is inside (not on the edge).

Definition at line 499 of file qwt_double_rect.cpp.

bool QwtDoubleRect::contains const QwtDoublePoint p,
bool  proper = false
const
 

Returns true if the point p is inside or on the edge of the rectangle; otherwise returns false.

If proper is true, this function returns true only if p is inside (not on the edge).

Definition at line 514 of file qwt_double_rect.cpp.

References QwtDoublePoint::x(), and QwtDoublePoint::y().

Referenced by contains().

double QwtDoubleRect::height  )  const
 

Returns the height.

Definition at line 400 of file qwt_double_rect.h.

Referenced by moveBottom(), moveCenter(), moveTop(), and size().

QwtDoubleRect QwtDoubleRect::intersect const QwtDoubleRect other  )  const
 

Returns the intersection of this rectangle and rectangle other. r.intersect(s) is equivalent to r&s.

Definition at line 402 of file qwt_double_rect.cpp.

bool QwtDoubleRect::intersects const QwtDoubleRect other  )  const
 

Returns true if this rectangle intersects with rectangle other; otherwise returns false.

Definition at line 411 of file qwt_double_rect.cpp.

References d_bottom, d_left, d_right, d_top, qwtMax, and qwtMin.

bool QwtDoubleRect::isEmpty  )  const
 

Returns true if the rectangle is empty; otherwise returns false. An empty rectangle has a width() <= 0 or height() <= 0. An empty rectangle is not valid. isEmpty() == !isValid()

See also:
QwtDoubleRect::isNull, QwtDoubleRect::isValid

Definition at line 327 of file qwt_double_rect.h.

Referenced by operator|().

bool QwtDoubleRect::isNull  )  const
 

Returns true if the rectangle is a null rectangle; otherwise returns false. A null rectangle has both the width and the height set to 0. A null rectangle is also empty and invalid.

See also:
QwtDoubleRect::isEmpty, QwtDoubleRect::isValid

Definition at line 315 of file qwt_double_rect.h.

Referenced by operator &().

bool QwtDoubleRect::isValid  )  const
 

Returns true if the rectangle is valid; otherwise returns false. A valid rectangle has a width() > 0 and height() > 0. Note that non-trivial operations like intersections are not defined for invalid rectangles. isValid() == !isEmpty()

See also:
isNull(), isEmpty(), and normalized().

Definition at line 340 of file qwt_double_rect.h.

double QwtDoubleRect::left  )  const
 

Returns left.

Definition at line 346 of file qwt_double_rect.h.

Referenced by QwtPlotCurve::minXValue(), QwtPlotZoomer::moveBy(), operator &(), QwtPlotZoomer::rescale(), QwtPlotPicker::transform(), and QwtPlot::updateAxes().

void QwtDoubleRect::moveBottom double  y  ) 
 

moves y1() to y, leaving the size unchanged

Definition at line 557 of file qwt_double_rect.cpp.

References height().

void QwtDoubleRect::moveBy double  dx,
double  dy
 

moves x1() by dx and y1() by dy. leaving the size unchanged

Definition at line 572 of file qwt_double_rect.cpp.

void QwtDoubleRect::moveCenter double  dx,
double  dy
 

moves the center to (x, y), leaving the size unchanged

Definition at line 587 of file qwt_double_rect.cpp.

References height(), moveTo(), and width().

void QwtDoubleRect::moveCenter const QwtDoublePoint  ) 
 

moves the center to pos, leaving the size unchanged

Definition at line 581 of file qwt_double_rect.cpp.

References QwtDoublePoint::x(), and QwtDoublePoint::y().

Referenced by QwtPlotZoomer::end().

void QwtDoubleRect::moveLeft double  x  ) 
 

moves x1() to x, leaving the size unchanged

Definition at line 533 of file qwt_double_rect.cpp.

References width().

Referenced by moveTo().

void QwtDoubleRect::moveRight double  x  ) 
 

moves x1() to x, leaving the size unchanged

Definition at line 541 of file qwt_double_rect.cpp.

References width().

void QwtDoubleRect::moveTo const QwtDoublePoint p  ) 
 

Moves the top left corner of the rectangle to p, without changing the rectangles size.

Definition at line 427 of file qwt_double_rect.h.

References moveTo(), QwtDoublePoint::x(), and QwtDoublePoint::y().

void QwtDoubleRect::moveTo double  x,
double  y
 

moves left() to x and top() to y, leaving the size unchanged

Definition at line 565 of file qwt_double_rect.cpp.

References moveLeft(), and moveTop().

Referenced by moveCenter(), and moveTo().

void QwtDoubleRect::moveTop double  y  ) 
 

moves y1() to y, leaving the size unchanged

Definition at line 549 of file qwt_double_rect.cpp.

References height().

Referenced by moveTo().

QwtDoubleRect QwtDoubleRect::normalized  )  const
 

Returns a normalized rectangle, i.e. a rectangle that has a non-negative width and height.

It swaps x1 and x2 if x1() > x2(), and swaps y1 and y2 if y1() > y2().

Definition at line 363 of file qwt_double_rect.cpp.

References d_bottom, d_left, d_right, and d_top.

Referenced by QwtPlotZoomer::end(), operator &(), QwtPlotPicker::scaleRect(), and QwtPlotZoomer::zoom().

QwtDoubleRect QwtDoubleRect::operator & const QwtDoubleRect other  )  const
 

Returns the intersection of this rectangle and rectangle other. Returns an empty rectangle if there is no intersection.

Definition at line 455 of file qwt_double_rect.cpp.

References bottom(), isNull(), left(), normalized(), QwtDoubleRect(), qwtMax, qwtMin, right(), and top().

QwtDoubleRect & QwtDoubleRect::operator &= const QwtDoubleRect r  ) 
 

Intersects this rectangle with rectangle other.

Definition at line 479 of file qwt_double_rect.cpp.

bool QwtDoubleRect::operator!= const QwtDoubleRect  )  const
 

Returns true if this rect and other are different; otherwise returns false.

Definition at line 425 of file qwt_double_rect.cpp.

References operator==().

bool QwtDoubleRect::operator== const QwtDoubleRect  )  const
 

Returns true if this rect and other are equal; otherwise returns false.

Definition at line 418 of file qwt_double_rect.cpp.

References d_bottom, d_left, d_right, and d_top.

Referenced by operator!=().

QwtDoubleRect QwtDoubleRect::operator| const QwtDoubleRect other  )  const
 

Returns the bounding rectangle of this rectangle and rectangle other. The bounding rectangle of a nonempty rectangle and an empty or invalid rectangle is defined to be the nonempty rectangle.

Definition at line 435 of file qwt_double_rect.cpp.

References d_bottom, d_left, d_right, d_top, isEmpty(), QwtDoubleRect(), qwtMax, and qwtMin.

QwtDoubleRect & QwtDoubleRect::operator|= const QwtDoubleRect r  ) 
 

Unites this rectangle with rectangle other.

Definition at line 472 of file qwt_double_rect.cpp.

double QwtDoubleRect::right  )  const
 

Returns right.

Definition at line 352 of file qwt_double_rect.h.

Referenced by QwtPlotCurve::maxXValue(), operator &(), QwtPlotZoomer::rescale(), QwtPlotPicker::transform(), and QwtPlot::updateAxes().

void QwtDoubleRect::setBottom double   ) 
 

Set bottom.

Definition at line 388 of file qwt_double_rect.h.

void QwtDoubleRect::setHeight double  h  ) 
 

Set the height, by bottom = top + h;.

Definition at line 418 of file qwt_double_rect.h.

Referenced by setSize().

void QwtDoubleRect::setLeft double   ) 
 

Set left.

Definition at line 370 of file qwt_double_rect.h.

void QwtDoubleRect::setRect double  left,
double  top,
double  width,
double  height
 

Set the x-range from x1 to x2 and the y-range from y1 to y2.

Definition at line 338 of file qwt_double_rect.cpp.

void QwtDoubleRect::setRight double   ) 
 

Set right.

Definition at line 376 of file qwt_double_rect.h.

void QwtDoubleRect::setSize const QwtDoubleSize size  ) 
 

Sets the size of the rectangle to size. Changes x2 and y2 only.

Definition at line 351 of file qwt_double_rect.cpp.

References QwtDoubleSize::height(), setHeight(), setWidth(), and QwtDoubleSize::width().

Referenced by QwtPlotZoomer::end().

void QwtDoubleRect::setTop double   ) 
 

Set top.

Definition at line 382 of file qwt_double_rect.h.

void QwtDoubleRect::setWidth double  w  ) 
 

Set the width, by right = left + w;.

Definition at line 412 of file qwt_double_rect.h.

Referenced by setSize().

QwtDoubleSize QwtDoubleRect::size  )  const
 

Returns the size.

Definition at line 406 of file qwt_double_rect.h.

References height(), and width().

Referenced by QwtPlotZoomer::end().

double QwtDoubleRect::top  )  const
 

Returns top.

Definition at line 358 of file qwt_double_rect.h.

Referenced by QwtPlotCurve::minYValue(), QwtPlotZoomer::moveBy(), operator &(), QwtPlotZoomer::rescale(), QwtPlotPicker::transform(), and QwtPlot::updateAxes().

QwtDoubleRect QwtDoubleRect::unite const QwtDoubleRect other  )  const
 

Returns the bounding rectangle of this rectangle and rectangle other. r.unite(s) is equivalent to r|s.

Definition at line 393 of file qwt_double_rect.cpp.

double QwtDoubleRect::width  )  const
 

Returns the width.

Definition at line 394 of file qwt_double_rect.h.

Referenced by moveCenter(), moveLeft(), moveRight(), and size().


Generated on Mon Jan 30 22:17:01 2006 for Qwt User's Guide by  doxygen 1.4.4