Ipelib
|
#include <ipegeo.h>
Public Member Functions | |
Rect () | |
Rect (const Vector &c) | |
Rect (const Vector &c1, const Vector &c2) | |
void | clear () |
int | isEmpty () const |
double | left () const |
double | right () const |
double | bottom () const |
double | top () const |
Vector | topRight () const |
Vector | bottomLeft () const |
Vector | topLeft () const |
Vector | bottomRight () const |
Vector | center () const |
double | width () const |
double | height () const |
void | addPoint (const Vector &rhs) |
void | addRect (const Rect &rhs) |
void | clipTo (const Rect &rhs) |
bool | contains (const Vector &rhs) const |
bool | contains (const Rect &rhs) const |
bool | certainClearance (const Vector &v, double bound) const |
bool | intersects (const Rect &rhs) const |
Related Functions | |
(Note that these are not member functions.) | |
Stream & | operator<< (Stream &stream, const Rect &rhs) |
Axis-parallel rectangle (which can be empty)
|
inlineexplicit |
Create empty rectangle.
|
inlineexplicit |
Create rectangle containing just the point c.
Create rectangle containing points c1 and c2.
References addPoint().
|
inline |
Make rectangle empty.
References ipe::Vector::x, and ipe::Vector::y.
Referenced by ipe::BBoxPainter::doNewPath().
|
inline |
True if rectangle is empty.
References ipe::Vector::x.
Referenced by addPoint(), addRect(), clipTo(), contains(), ipe::PdfWriter::createPageView(), ipe::BBoxPainter::doDrawPath(), ipe::PdfViewBase::drawPaper(), and intersects().
|
inline |
Return left side.
References ipe::Vector::x.
Referenced by ipe::PdfViewBase::drawPaper(), and ipe::Thumbnail::saveRender().
|
inline |
Return right side.
References ipe::Vector::x.
|
inline |
|
inline |
|
inline |
Return top right corner.
Referenced by ipe::Image::addToBBox(), ipe::Bezier::bbox(), ipe::Image::distance(), ipe::BBoxPainter::doCurveTo(), ipe::BBoxPainter::doDrawPath(), ipe::BBoxPainter::doDrawText(), ipe::Painter::rect(), ipe::Shape::Shape(), ipe::Image::snapCtl(), ipe::CanvasBase::snapToPaperAndFrame(), and ipe::TransformTool::TransformTool().
|
inline |
Return bottom left corner.
Referenced by ipe::Image::addToBBox(), ipe::Bezier::bbox(), ipe::Image::distance(), ipe::BBoxPainter::doCurveTo(), ipe::BBoxPainter::doDrawPath(), ipe::BBoxPainter::doDrawText(), ipe::Image::draw(), ipe::Painter::rect(), ipe::Shape::Shape(), ipe::Image::snapCtl(), ipe::CanvasBase::snapToPaperAndFrame(), and ipe::TransformTool::TransformTool().
|
inline |
Return top left corner.
References ipe::Vector::x, and ipe::Vector::y.
Referenced by ipe::Image::addToBBox(), ipe::Image::distance(), ipe::Painter::rect(), ipe::Thumbnail::render(), ipe::Thumbnail::saveRender(), ipe::Shape::Shape(), ipe::Image::snapCtl(), and ipe::CanvasBase::snapToPaperAndFrame().
|
inline |
Return bottom right corner.
References ipe::Vector::x, and ipe::Vector::y.
Referenced by ipe::Image::addToBBox(), ipe::Image::distance(), ipe::Painter::rect(), ipe::Shape::Shape(), ipe::Image::snapCtl(), and ipe::CanvasBase::snapToPaperAndFrame().
|
inline |
Return center of rectangle.
Referenced by ipe::Group::draw().
|
inline |
Return width.
References ipe::Vector::x.
Referenced by ipe::Group::draw(), ipe::Image::draw(), ipe::PdfViewBase::drawPaper(), ipe::PdfThumbnail::PdfThumbnail(), ipe::PdfThumbnail::render(), ipe::Thumbnail::saveRender(), ipe::Text::setXForm(), and ipe::Thumbnail::Thumbnail().
|
inline |
Return height.
References ipe::Vector::y.
Referenced by ipe::Group::draw(), ipe::Image::draw(), ipe::PdfViewBase::drawPaper(), ipe::PdfThumbnail::PdfThumbnail(), ipe::Thumbnail::saveRender(), ipe::Text::setXForm(), and ipe::Thumbnail::Thumbnail().
void Rect::addPoint | ( | const Vector & | rhs | ) |
Enlarge rectangle to contain point.
References isEmpty(), ipe::Vector::x, and ipe::Vector::y.
Referenced by ipe::Reference::addToBBox(), ipe::CurveSegment::addToBBox(), ipe::ClosedSpline::addToBBox(), ipe::Text::addToBBox(), ipe::Image::addToBBox(), ipe::Bezier::bbox(), ipe::Arc::bbox(), ipe::Image::distance(), ipe::Bezier::distance(), ipe::BBoxPainter::doCurveTo(), ipe::BBoxPainter::doDrawBitmap(), ipe::BBoxPainter::doDrawPath(), ipe::BBoxPainter::doDrawText(), ipe::BBoxPainter::doLineTo(), ipe::BBoxPainter::doMoveTo(), ipe::Arc::intersect(), ipe::PdfFile::mediaBox(), Rect(), ipe::Thumbnail::saveRender(), and ipe::Bezier::snap().
void Rect::addRect | ( | const Rect & | rhs | ) |
Enlarge rectangle to contain rhs rectangle.
Does nothing if rhs is empty.
References isEmpty(), ipe::Vector::x, and ipe::Vector::y.
Referenced by ipe::Group::addToBBox(), ipe::CurveSegment::addToBBox(), ipe::Ellipse::addToBBox(), ipe::ClosedSpline::addToBBox(), ipe::BBoxPainter::doDrawBitmap(), ipe::BBoxPainter::doDrawText(), and ipe::TransformTool::TransformTool().
void Rect::clipTo | ( | const Rect & | cbox | ) |
Clip rectangle to fit inside cbox.
Does nothing if either rectangle is empty.
References intersects(), isEmpty(), ipe::Vector::x, and ipe::Vector::y.
Referenced by ipe::Group::addToBBox(), ipe::BBoxPainter::doDrawBitmap(), ipe::BBoxPainter::doDrawPath(), and ipe::BBoxPainter::doDrawText().
bool Rect::contains | ( | const Vector & | rhs | ) | const |
Does (closed) rectangle contain the point?
References ipe::Vector::x, and ipe::Vector::y.
Referenced by ipe::SelectTool::mouseButton().
bool Rect::contains | ( | const Rect & | rhs | ) | const |
Does rectangle contain other rectangle?
References isEmpty(), ipe::Vector::x, and ipe::Vector::y.
bool Rect::certainClearance | ( | const Vector & | v, |
double | bound | ||
) | const |
Returns false if the distance between the box and v is smaller than bound. Often returns true if their distance is larger than bound.
References ipe::Vector::x, and ipe::Vector::y.
Referenced by ipe::Image::distance(), ipe::Bezier::distance(), and ipe::Bezier::snap().
bool Rect::intersects | ( | const Rect & | rhs | ) | const |
Does rectangle intersect other rectangle?
References isEmpty(), ipe::Vector::x, and ipe::Vector::y.
Referenced by clipTo(), and ipe::SelectTool::mouseButton().