SURectf Class Reference

Representation of a floating point double precision based axis-aligned rectangle.

#include <ShapeUpAPI.h>

List of all members.

Public Member Functions

 SURectf ()
 SURectf (double _x1, double _y1, double _x2, double _y2)
void Normalize ()
double Width () const
double Height () const
void Inflate (const SUSizef &s)
bool Contains (const SUPointf &p)
bool Contains (double x, double y) const
bool Intersects (const SURectf &r) const

Public Attributes

double x1
double y1
double x2
double y2


Constructor & Destructor Documentation

SURectf::SURectf (  )  [inline]

Default constructor.

SURectf::SURectf ( double  _x1,
double  _y1,
double  _x2,
double  _y2 
) [inline]


Member Function Documentation

void SURectf::Normalize (  )  [inline]

Arranges the rectangle to ensure x1 <= x2 and y1 <= y2.

double SURectf::Width (  )  const [inline]

Returns the width of this rectangle.

Returns:
The width of this rectangle which might be negative if not normalized.

double SURectf::Height (  )  const [inline]

Returns the height of this rectangle.

Returns:
The height of this rectangle which might be negative if not normalized.

void SURectf::Inflate ( const SUSizef s  )  [inline]

Increases the size of the rectangle with two times s (each side once).

Postcondition:
The rectangle is normalized.

bool SURectf::Contains ( const SUPointf p  )  [inline]

Returns true if the point p is contained within the rectangle, otherwise false.

bool SURectf::Contains ( double  x,
double  y 
) const [inline]

Returns true if the point at coordinate (x, y) is contained within the rectangle, otherwise false.

bool SURectf::Intersects ( const SURectf r  )  const [inline]

Returns true if the rectangle intersects the rectangle r, otherwise false.


Member Data Documentation

double SURectf::x1

double SURectf::y1

double SURectf::x2

double SURectf::y2


The documentation for this class was generated from the following file:
Generated on Thu Apr 15 10:55:35 2010 for ShapeUp API by  doxygen 1.5.2