NAME
QwtDoubleRect -
SYNOPSIS
Detailed Description
The QwtDoubleRect class defines a size in double coordinates.
Definition at line 108 of file qwt_double_rect.h.
Public Member Functions
QwtDoubleRect ()
QwtDoubleRect (double x1, double x2, double y1, double y2)
QwtDoubleRect (double x, double y, const QwtDoubleSize &)
bool isNull () const
bool isEmpty () const
bool isValid () const
QwtDoubleRect normalize () const
double x1 () const
double x2 () const
double y1 () const
double y2 () const
double & rx1 ()
double & rx2 ()
double & ry1 ()
double & ry2 ()
void setX1 (double)
void setX2 (double)
void setY1 (double)
void setY2 (double)
QwtDoublePoint center () const
void moveX (double x)
void moveY (double y)
void move (double x, double y)
void moveBy (double dx, double dy)
void moveCenter (const QwtDoublePoint &)
void moveCenter (double dx, double dy)
void setRect (double x1, double x2, double y1, double y2)
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
QwtDoubleRect & operator|= (const QwtDoubleRect &r)
QwtDoubleRect & operator &= (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 295 of file qwt_double_rect.cpp.
Referenced by operator &(), and operator|().
QwtDoubleRect::QwtDoubleRect (double x1, double x2, double y1, double y2)
Constructs an rectangle with x1 to x2 as x-range and, y1 to y2 as y-
range. Definition at line 308 of file qwt_double_rect.cpp.
QwtDoubleRect::QwtDoubleRect (double x, double y, const QwtDoubleSize &
size)
Constructs an rectangle with x1 to x1 + size.width() as x-range and, y1
to y1 + size.height() as y-range. Definition at line 322 of file
qwt_double_rect.cpp.
Member Function Documentation
QwtDoublePoint QwtDoubleRect::center () const
Returns the center point of the rectangle.
Definition at line 478 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 521 of file
qwt_double_rect.cpp.
References contains(), d_x1, d_x2, d_y1, and d_y2.
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 492 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 508 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 397 of file qwt_double_rect.h.
Referenced by moveCenter(), moveY(), 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 400 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 410 of file
qwt_double_rect.cpp.
References d_x1, d_x2, d_y1, and d_y2.
bool QwtDoubleRect::isEmpty () const
Returns TRUE if the rectangle is a empty rectangle; otherwise returns
FALSE.
A rect is null when x1() >= x2() && y1() >= y2(). Definition at line
302 of file qwt_double_rect.h.
bool QwtDoubleRect::isNull () const
Returns TRUE if the rectangle is a null rectangle; otherwise returns
FALSE.
A rect is null when x1() == x2() && y1() == y2(). Definition at line
291 of file qwt_double_rect.h.
bool QwtDoubleRect::isValid () const
Returns TRUE if the rectangle is a valid rectangle; otherwise returns
FALSE.
A rect is valid when x1() <= x2() && y1() <= y2(). Definition at line
313 of file qwt_double_rect.h.
Referenced by operator|(), and QwtPlot::updateAxes().
void QwtDoubleRect::move (double x, double y)
moves x1() to x and y1() to y, leaving the size unchanged
Definition at line 547 of file qwt_double_rect.cpp.
References moveX(), and moveY().
Referenced by moveCenter().
void QwtDoubleRect::moveBy (double dx, double dy)
moves x1() by dx and y1() by dy. leaving the size unchanged
Definition at line 555 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 572 of file qwt_double_rect.cpp.
References height(), move(), and width().
void QwtDoubleRect::moveCenter (const QwtDoublePoint &)
moves the center to pos, leaving the size unchanged
Definition at line 565 of file qwt_double_rect.cpp.
References QwtDoublePoint::x(), and QwtDoublePoint::y().
Referenced by QwtPlotZoomer::end().
void QwtDoubleRect::moveX (double x)
moves x1() to x, leaving the size unchanged
Definition at line 529 of file qwt_double_rect.cpp.
References width().
Referenced by move().
void QwtDoubleRect::moveY (double y)
moves y1() to y, leaving the size unchanged
Definition at line 538 of file qwt_double_rect.cpp.
References height().
Referenced by move().
QwtDoubleRect QwtDoubleRect::normalize () 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 359 of file qwt_double_rect.cpp.
References d_x1, d_x2, d_y1, and d_y2.
Referenced by QwtPlotZoomer::end(), 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 454
of file qwt_double_rect.cpp.
References d_x1, d_x2, d_y1, d_y2, and QwtDoubleRect().
QwtDoubleRect & QwtDoubleRect::operator &= (const QwtDoubleRect & r)
Intersects this rectangle with rectangle other.
Definition at line 470 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 426 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_x1, d_x2, d_y1, and d_y2.
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
437 of file qwt_double_rect.cpp.
References d_x1, d_x2, d_y1, d_y2, isValid(), and QwtDoubleRect().
QwtDoubleRect & QwtDoubleRect::operator|= (const QwtDoubleRect & r)
Unites this rectangle with rectangle other.
Definition at line 462 of file qwt_double_rect.cpp.
double & QwtDoubleRect::rx1 ()
Returns a reference to x1.
Definition at line 343 of file qwt_double_rect.h.
double & QwtDoubleRect::rx2 ()
Returns a reference to x2.
Definition at line 349 of file qwt_double_rect.h.
double & QwtDoubleRect::ry1 ()
Returns a reference to y1.
Definition at line 355 of file qwt_double_rect.h.
double & QwtDoubleRect::ry2 ()
Returns a reference to y2.
Definition at line 361 of file qwt_double_rect.h.
void QwtDoubleRect::setHeight (double h)
Set the height, by y2 = y1 + h;.
Definition at line 415 of file qwt_double_rect.h.
Referenced by setSize().
void QwtDoubleRect::setRect (double x1, double x2, double y1, double y2)
Set the x-range from x1 to x2 and the y-range from y1 to y2. Definition
at line 333 of file qwt_double_rect.cpp.
void QwtDoubleRect::setSize (const QwtDoubleSize & size)
Sets the size of the rectangle to size. Changes x2 and y2 only.
Definition at line 346 of file qwt_double_rect.cpp.
References QwtDoubleSize::height(), setHeight(), setWidth(), and
QwtDoubleSize::width().
Referenced by QwtPlotZoomer::end().
void QwtDoubleRect::setWidth (double w)
Set the width, by x2 = x1 + w;.
Definition at line 409 of file qwt_double_rect.h.
Referenced by setSize().
void QwtDoubleRect::setX1 (double)
Set x1.
Definition at line 367 of file qwt_double_rect.h.
void QwtDoubleRect::setX2 (double)
Set x2.
Definition at line 373 of file qwt_double_rect.h.
void QwtDoubleRect::setY1 (double)
Set y1.
Definition at line 379 of file qwt_double_rect.h.
void QwtDoubleRect::setY2 (double)
Set y2.
Definition at line 385 of file qwt_double_rect.h.
QwtDoubleSize QwtDoubleRect::size () const
Returns the size.
Definition at line 403 of file qwt_double_rect.h.
References height(), and width().
Referenced by QwtPlotZoomer::end().
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 390 of file
qwt_double_rect.cpp.
double QwtDoubleRect::width () const
Returns the width.
Definition at line 391 of file qwt_double_rect.h.
Referenced by moveCenter(), moveX(), and size().
double QwtDoubleRect::x1 () const
Returns x1.
Definition at line 319 of file qwt_double_rect.h.
Referenced by QwtPlotZoomer::move(), QwtPlotZoomer::moveBy(),
QwtPlotZoomer::rescale(), QwtPlotPicker::transform(), and
QwtPlot::updateAxes().
double QwtDoubleRect::x2 () const
Returns x2.
Definition at line 325 of file qwt_double_rect.h.
Referenced by QwtPlotZoomer::rescale(), QwtPlotPicker::transform(), and
QwtPlot::updateAxes().
double QwtDoubleRect::y1 () const
Returns y1.
Definition at line 331 of file qwt_double_rect.h.
Referenced by QwtPlotZoomer::move(), QwtPlotZoomer::moveBy(),
QwtPlotZoomer::rescale(), QwtPlotPicker::transform(), and
QwtPlot::updateAxes().
double QwtDoubleRect::y2 () const
Returns y2.
Definition at line 337 of file qwt_double_rect.h.
Referenced by QwtPlotZoomer::rescale(), QwtPlotPicker::transform(), and
QwtPlot::updateAxes().
Author
Generated automatically by Doxygen for Qwt User’s Guide from the source
code.