Ipelib
Public Member Functions | Related Functions
ipe::Rect Class Reference

#include <ipegeo.h>

List of all members.

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
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.)

Streamoperator<< (Stream &stream, const Rect &rhs)

Detailed Description

Axis-parallel rectangle (which can be empty)


Constructor & Destructor Documentation

ipe::Rect::Rect ( )
inlineexplicit

Create empty rectangle.

ipe::Rect::Rect ( const Vector c)
inlineexplicit

Create rectangle containing just the point c.

Rect::Rect ( const Vector c1,
const Vector c2 
)
explicit

Create rectangle containing points c1 and c2.


Member Function Documentation

void ipe::Rect::clear ( )
inline

Make rectangle empty.

int ipe::Rect::isEmpty ( ) const
inline

True if rectangle is empty.

double ipe::Rect::left ( ) const
inline

Return left side.

double ipe::Rect::right ( ) const
inline

Return right side.

double ipe::Rect::bottom ( ) const
inline

Return bottom side.

double ipe::Rect::top ( ) const
inline

Return top side.

Vector ipe::Rect::topRight ( ) const
inline

Return top right corner.

Vector ipe::Rect::bottomLeft ( ) const
inline

Return bottom left corner.

Vector ipe::Rect::topLeft ( ) const
inline

Return top left corner.

Vector ipe::Rect::bottomRight ( ) const
inline

Return bottom right corner.

double ipe::Rect::width ( ) const
inline

Return width.

double ipe::Rect::height ( ) const
inline

Return height.

void Rect::addPoint ( const Vector rhs)

Enlarge rectangle to contain point.

void Rect::addRect ( const Rect rhs)

Enlarge rectangle to contain rhs rectangle.

Does nothing if rhs is empty.

void Rect::clipTo ( const Rect cbox)

Clip rectangle to fit inside cbox.

Does nothing if either rectangle is empty.

bool Rect::contains ( const Vector rhs) const

Does (closed) rectangle contain the point?

bool Rect::contains ( const Rect rhs) const

Does rectangle contain other rectangle?

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.

bool Rect::intersects ( const Rect rhs) const

Does rectangle intersect other rectangle?


Friends And Related Function Documentation

Stream & operator<< ( Stream stream,
const Rect rhs 
)
related

The documentation for this class was generated from the following files: