Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Emma::Box2f Class Reference

#include <EmmaBox2f.h>

List of all members.

Public Member Functions

EMMA_EXPORT Box2f ()
 Default constructor - leaves box totally empty.
EMMA_EXPORT Box2f (float xmin, float ymin, float xmax, float ymax)
 Constructor given bounds.
EMMA_EXPORT Box2f (const Fusion::Vec2f &_min, const Fusion::Vec2f &_max)
 Constructor given minimum and maximum points.
 ~Box2f ()
const Fusion::Vec2fgetMin () const
 Returns the min and max points.
const Fusion::Vec2fgetMax () const
Fusion::Vec2f getCenter () const
 Returns the center of a box.
EMMA_EXPORT void extendBy (const Fusion::Vec2f &pt)
 Extends Box2f (if necessary) to contain given 2D point.
EMMA_EXPORT void extendBy (const Box2f &r)
 Extends Box2f (if necessary) to contain given Box2f.
EMMA_EXPORT bool intersect (const Fusion::Vec2f &pt) const
 Returns TRUE if intersection of given point and Box2f is not empty.
EMMA_EXPORT bool intersect (const Box2f &bb) const
 Returns TRUE if intersection of given Box2f and Box2f is not empty.
void setBounds (float xmin, float ymin, float xmax, float ymax)
 Common get and set functions.
void setBounds (const Fusion::Vec2f &_min, const Fusion::Vec2f &_max)
void getBounds (float &xmin, float &ymin, float &xmax, float &ymax) const
void getBounds (Fusion::Vec2f &_min, Fusion::Vec2f &_max) const
Fusion::Vec2f getClosestPoint (const Fusion::Vec2f &point)
 Returns the closest point on the box to the given point.
void getOrigin (float &originX, float &originY) const
 Returns origin (minimum point) of box.
void getSize (float &sizeX, float &sizeY) const
 Returns size of box.
float getAspectRatio () const
 Returns aspect ratio (ratio of width to height) of box.
EMMA_EXPORT void makeEmpty ()
 Sets rect to contain nothing.
bool isEmpty () const
 Checks if the box is empty (degenerate) note that this relies on boxes being completely degenerate if they are degenerate at all.
bool hasArea () const
 Checks if the box has area; i.e.

Friends

int operator== (const Box2f &b1, const Box2f &b2)
 Equality comparisons.
int operator!= (const Box2f &b1, const Box2f &b2)


Constructor & Destructor Documentation

EMMA_EXPORT Emma::Box2f::Box2f  )  [inline]
 

Default constructor - leaves box totally empty.

EMMA_EXPORT Emma::Box2f::Box2f float  xmin,
float  ymin,
float  xmax,
float  ymax
[inline]
 

Constructor given bounds.

EMMA_EXPORT Emma::Box2f::Box2f const Fusion::Vec2f _min,
const Fusion::Vec2f _max
[inline]
 

Constructor given minimum and maximum points.

Emma::Box2f::~Box2f  )  [inline]
 


Member Function Documentation

EMMA_EXPORT void Emma::Box2f::extendBy const Box2f r  ) 
 

Extends Box2f (if necessary) to contain given Box2f.

EMMA_EXPORT void Emma::Box2f::extendBy const Fusion::Vec2f pt  ) 
 

Extends Box2f (if necessary) to contain given 2D point.

float Emma::Box2f::getAspectRatio  )  const [inline]
 

Returns aspect ratio (ratio of width to height) of box.

void Emma::Box2f::getBounds Fusion::Vec2f _min,
Fusion::Vec2f _max
const [inline]
 

void Emma::Box2f::getBounds float &  xmin,
float &  ymin,
float &  xmax,
float &  ymax
const [inline]
 

Fusion::Vec2f Emma::Box2f::getCenter  )  const
 

Returns the center of a box.

Fusion::Vec2f Emma::Box2f::getClosestPoint const Fusion::Vec2f point  ) 
 

Returns the closest point on the box to the given point.

(Returns the point on the center of the X side if passed the center.)

const Fusion::Vec2f& Emma::Box2f::getMax  )  const [inline]
 

const Fusion::Vec2f& Emma::Box2f::getMin  )  const [inline]
 

Returns the min and max points.

void Emma::Box2f::getOrigin float &  originX,
float &  originY
const [inline]
 

Returns origin (minimum point) of box.

void Emma::Box2f::getSize float &  sizeX,
float &  sizeY
const [inline]
 

Returns size of box.

bool Emma::Box2f::hasArea  )  const [inline]
 

Checks if the box has area; i.e.

, both dimensions have positive size

EMMA_EXPORT bool Emma::Box2f::intersect const Box2f bb  )  const
 

Returns TRUE if intersection of given Box2f and Box2f is not empty.

EMMA_EXPORT bool Emma::Box2f::intersect const Fusion::Vec2f pt  )  const
 

Returns TRUE if intersection of given point and Box2f is not empty.

bool Emma::Box2f::isEmpty  )  const [inline]
 

Checks if the box is empty (degenerate) note that this relies on boxes being completely degenerate if they are degenerate at all.

All member functions preserve this invariant.

EMMA_EXPORT void Emma::Box2f::makeEmpty  ) 
 

Sets rect to contain nothing.

void Emma::Box2f::setBounds const Fusion::Vec2f _min,
const Fusion::Vec2f _max
[inline]
 

void Emma::Box2f::setBounds float  xmin,
float  ymin,
float  xmax,
float  ymax
[inline]
 

Common get and set functions.


Friends And Related Function Documentation

int operator!= const Box2f b1,
const Box2f b2
[friend]
 

int operator== const Box2f b1,
const Box2f b2
[friend]
 

Equality comparisons.


The documentation for this class was generated from the following file:
Generated on Sat Apr 1 06:08:21 2006 for Emma SDK Guide by  doxygen 1.4.3