CEGUI::Rect Class Reference

Class encapsulating operations on a Rectangle. More...

List of all members.

Public Member Functions

 Rect (float left, float top, float right, float bottom)
 Constructor for a Rect.
 Rect (Point pos, Size sz)
Point getPosition (void) const
 Return top-left postion of Rect as a Point.
float getWidth (void) const
 return width of Rect area
float getHeight (void) const
 return height of Rect area
Size getSize (void) const
 return the size of the Rect area
void setPosition (const Point &pt)
 set the position of the Rect (leaves size in tact)
void setWidth (float width)
 set the width of the Rect object
void setHeight (float height)
 set the height of the Rect object
void setSize (const Size &sze)
 set the size of the Rect area
Rect getIntersection (const Rect &rect) const
 return a Rect that is the intersection of 'this' Rect with the Rect 'rect'
Rectoffset (const Point &pt)
 Applies an offset the Rect object.
bool isPointInRect (const Point &pt) const
 Return true if the given Point falls within this Rect.
RectconstrainSizeMax (const Size &sz)
 check the size of the Rect object and if it is bigger than sz, resize it so it isn't.
RectconstrainSizeMin (const Size &sz)
 check the size of the Rect object and if it is smaller than sz, resize it so it isn't.
RectconstrainSize (const Size &max_sz, const Size &min_sz)
 check the size of the Rect object and if it is bigger than max_sz or smaller than min_sz, resize it so it isn't.
bool operator== (const Rect &rhs) const
bool operator!= (const Rect &rhs) const
Rectoperator= (const Rect &rhs)
Rect operator* (float scalar) const
const Rectoperator*= (float scalar)

Public Attributes

float d_top
float d_bottom
float d_left
float d_right


Detailed Description

Class encapsulating operations on a Rectangle.

Member Function Documentation

Rect & CEGUI::Rect::constrainSize ( const Size max_sz,
const Size min_sz 
)

check the size of the Rect object and if it is bigger than max_sz or smaller than min_sz, resize it so it isn't.

Parameters:
max_sz Size object that describes the maximum dimensions that this Rect should be limited to.
min_sz Size object that describes the minimum dimensions that this Rect should be limited to.
Returns:
'this' Rect object after the constrain operation

References CEGUI::Size::d_height, CEGUI::Size::d_width, getSize(), setHeight(), and setWidth().

Rect & CEGUI::Rect::constrainSizeMax ( const Size sz  ) 

check the size of the Rect object and if it is bigger than sz, resize it so it isn't.

Parameters:
sz Size object that describes the maximum dimensions that this Rect should be limited to.
Returns:
'this' Rect object after the constrain operation

References CEGUI::Size::d_height, CEGUI::Size::d_width, getHeight(), getWidth(), setHeight(), and setWidth().

Rect & CEGUI::Rect::constrainSizeMin ( const Size sz  ) 

check the size of the Rect object and if it is smaller than sz, resize it so it isn't.

Parameters:
sz Size object that describes the minimum dimensions that this Rect should be limited to.
Returns:
'this' Rect object after the constrain operation

References CEGUI::Size::d_height, CEGUI::Size::d_width, getHeight(), getWidth(), setHeight(), and setWidth().

Rect CEGUI::Rect::getIntersection ( const Rect rect  )  const

bool CEGUI::Rect::isPointInRect ( const Point pt  )  const

Return true if the given Point falls within this Rect.

Parameters:
pt Point object describing the position to test.
Returns:
true if position pt is within this Rect's area, else false

References CEGUI::Vector2::d_x, and CEGUI::Vector2::d_y.

Referenced by CEGUI::Tree::getItemAtPoint(), CEGUI::Listbox::getItemAtPoint(), CEGUI::FrameWindow::getSizingBorderAtPoint(), CEGUI::System::injectMouseButtonDown(), CEGUI::System::injectMouseButtonUp(), and CEGUI::Window::isHit().

Rect & CEGUI::Rect::offset ( const Point pt  ) 


Generated on Thu Nov 27 20:34:31 2008 for Crazy Eddies GUI System by  doxygen 1.5.7.1