Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

CEGUI::Rect Class Reference

Class encapsulating operations on a Rectangle. More...

#include <CEGUIRect.h>

List of all members.

Public Member Functions

 Rect (void)
 Rect (float left, float top, float right, float bottom)
 Constructor for a Rect.
 ~Rect (void)
 Destructor for Rect objects.
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)

Public Attributes

float d_top
float d_bottom
float d_left
float d_right


Detailed Description

Class encapsulating operations on a Rectangle.

Definition at line 40 of file CEGUIRect.h.


Constructor & Destructor Documentation

CEGUI::Rect::Rect void   )  [inline]
 

Definition at line 43 of file CEGUIRect.h.

Referenced by getIntersection().

CEGUI::Rect::Rect float  left,
float  top,
float  right,
float  bottom
 

Constructor for a Rect.

Definition at line 34 of file CEGUIRect.cpp.

CEGUI::Rect::~Rect void   )  [inline]
 

Destructor for Rect objects.

Definition at line 57 of file CEGUIRect.h.


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

Definition at line 156 of file CEGUIRect.cpp.

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

Referenced by CEGUI::Window::onParentSized(), CEGUI::Window::setPosition(), CEGUI::Window::setRect(), and CEGUI::Window::setSize().

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

Definition at line 116 of file CEGUIRect.cpp.

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

Referenced by CEGUI::Window::setMaximumSize().

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

Definition at line 136 of file CEGUIRect.cpp.

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

Referenced by CEGUI::Window::setMinimumSize().

float CEGUI::Rect::getHeight void   )  const [inline]
 

return height of Rect area

Definition at line 77 of file CEGUIRect.h.

Referenced by CEGUI::StaticText::configureScrollbars(), CEGUI::MultiLineEditbox::configureScrollbars(), CEGUI::MultiColumnList::configureScrollbars(), CEGUI::Listbox::configureScrollbars(), constrainSizeMax(), constrainSizeMin(), CEGUI::Imageset::draw(), CEGUI::RenderableImage::draw_impl(), CEGUI::RenderableFrame::draw_impl(), CEGUI::StaticText::drawSelf(), CEGUI::MultiLineEditbox::ensureCaratIsVisible(), CEGUI::Listbox::ensureItemIsVisible(), CEGUI::Window::getHeight(), CEGUI::Window::getParentHeight(), CEGUI::Window::getUnclippedPixelRect(), CEGUI::StaticText::layoutComponentWidgets(), CEGUI::MouseCursor::MouseCursor(), CEGUI::FrameWindow::moveBottomEdge(), CEGUI::FrameWindow::moveTopEdge(), CEGUI::Window::screenToWindow(), CEGUI::Window::screenToWindowY(), and CEGUI::Window::windowToScreen().

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

return a Rect that is the intersection of 'this' Rect with the Rect 'rect'

Note:
It can be assumed that if d_left == d_right, or d_top == d_bottom, or getWidth() == 0, or getHeight() == 0, then 'this' rect was totally outside 'rect'.

Definition at line 45 of file CEGUIRect.cpp.

References d_bottom, d_left, d_right, d_top, and Rect().

Referenced by CEGUI::Imageset::draw(), CEGUI::RenderableImage::draw_impl(), CEGUI::StaticText::drawSelf(), CEGUI::Static::drawSelf(), CEGUI::MultiLineEditbox::drawSelf(), CEGUI::MultiColumnList::drawSelf(), CEGUI::Listbox::drawSelf(), CEGUI::Window::getInnerRect(), CEGUI::Window::getPixelRect(), CEGUI::Titlebar::onMouseButtonDown(), and CEGUI::MouseCursor::setConstraintArea().

Point CEGUI::Rect::getPosition void   )  const [inline]
 

Return top-left postion of Rect as a Point.

Definition at line 64 of file CEGUIRect.h.

References CEGUI::Point.

Referenced by CEGUI::Window::getPosition(), CEGUI::FrameWindow::offsetPixelPosition(), and CEGUI::Thumb::onMouseMove().

Size CEGUI::Rect::getSize void   )  const [inline]
 

return the size of the Rect area

Definition at line 84 of file CEGUIRect.h.

Referenced by constrainSize(), CEGUI::RenderableImage::draw_impl(), CEGUI::Window::getSize(), CEGUI::Window::getWindowSize_impl(), CEGUI::FrameWindow::onSized(), CEGUI::DirectX81Renderer::setDisplaySize(), CEGUI::DirectX9Renderer::setDisplaySize(), setPosition(), and CEGUI::FrameWindow::toggleRollup().

float CEGUI::Rect::getWidth void   )  const [inline]
 

return width of Rect area

Definition at line 70 of file CEGUIRect.h.

Referenced by CEGUI::StaticText::configureScrollbars(), CEGUI::MultiLineEditbox::configureScrollbars(), CEGUI::MultiColumnList::configureScrollbars(), CEGUI::Listbox::configureScrollbars(), constrainSizeMax(), constrainSizeMin(), CEGUI::ListHeaderSegment::doDragSizing(), CEGUI::Imageset::draw(), CEGUI::RenderableImage::draw_impl(), CEGUI::RenderableFrame::draw_impl(), CEGUI::Static::drawSelf(), CEGUI::MultiColumnList::drawSelf(), CEGUI::Listbox::drawSelf(), CEGUI::MultiLineEditbox::ensureCaratIsVisible(), CEGUI::MultiLineEditbox::formatText(), CEGUI::Font::getFormattedLineCount(), CEGUI::Font::getFormattedTextExtent(), CEGUI::Window::getParentWidth(), CEGUI::Window::getUnclippedPixelRect(), CEGUI::Window::getWidth(), CEGUI::Window::isHit(), CEGUI::StaticText::layoutComponentWidgets(), CEGUI::MouseCursor::MouseCursor(), CEGUI::FrameWindow::moveLeftEdge(), CEGUI::FrameWindow::moveRightEdge(), CEGUI::Window::screenToWindow(), CEGUI::Window::screenToWindowX(), and CEGUI::Window::windowToScreen().

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

Definition at line 86 of file CEGUIRect.cpp.

References d_bottom, d_left, d_right, d_top, CEGUI::Vector2::d_x, CEGUI::Vector2::d_y, and CEGUI::Point.

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

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

Applies an offset the Rect object.

Parameters:
pt Point object containing the offsets to be applied to the Rect.
Returns:
this Rect after the offset is performed

Definition at line 73 of file CEGUIRect.cpp.

References d_bottom, d_left, d_right, d_top, CEGUI::Vector2::d_x, CEGUI::Vector2::d_y, and CEGUI::Point.

Referenced by CEGUI::Image::draw(), CEGUI::StaticText::drawSelf(), CEGUI::MultiLineEditbox::drawSelf(), CEGUI::MultiColumnList::drawSelf(), CEGUI::Listbox::drawSelf(), CEGUI::System::injectMouseButtonDown(), and CEGUI::Window::windowToScreen().

bool CEGUI::Rect::operator!= const Rect rhs  )  const [inline]
 

Definition at line 201 of file CEGUIRect.h.

References CEGUI::operator==().

Rect & CEGUI::Rect::operator= const Rect rhs  ) 
 

Definition at line 181 of file CEGUIRect.cpp.

References d_bottom, d_left, d_right, and d_top.

bool CEGUI::Rect::operator== const Rect rhs  )  const [inline]
 

Definition at line 196 of file CEGUIRect.h.

References d_bottom, d_left, d_right, and d_top.

void CEGUI::Rect::setHeight float  height  )  [inline]
 

set the height of the Rect object

Definition at line 104 of file CEGUIRect.h.

Referenced by constrainSize(), constrainSizeMax(), constrainSizeMin(), and CEGUI::Imageset_xmlHandler::startElement().

void CEGUI::Rect::setPosition const Point pt  ) 
 

set the position of the Rect (leaves size in tact)

Definition at line 102 of file CEGUIRect.cpp.

References d_left, d_top, CEGUI::Vector2::d_x, CEGUI::Vector2::d_y, getSize(), CEGUI::Point, and setSize().

Referenced by CEGUI::System::injectMouseButtonDown(), CEGUI::FrameWindow::offsetPixelPosition(), and CEGUI::Window::setPosition().

void CEGUI::Rect::setSize const Size sze  )  [inline]
 

set the size of the Rect area

Definition at line 111 of file CEGUIRect.h.

References CEGUI::Size::d_height, and CEGUI::Size::d_width.

Referenced by CEGUI::MultiColumnList::drawSelf(), CEGUI::Listbox::drawSelf(), CEGUI::System::injectMouseButtonDown(), CEGUI::FrameWindow::onParentSized(), CEGUI::FrameWindow::onSized(), CEGUI::DirectX81Renderer::setDisplaySize(), CEGUI::DirectX9Renderer::setDisplaySize(), setPosition(), and CEGUI::Window::setSize().

void CEGUI::Rect::setWidth float  width  )  [inline]
 

set the width of the Rect object

Definition at line 98 of file CEGUIRect.h.

Referenced by constrainSize(), constrainSizeMax(), constrainSizeMin(), CEGUI::StaticText::drawSelf(), and CEGUI::Imageset_xmlHandler::startElement().


Member Data Documentation

float CEGUI::Rect::d_bottom
 

Definition at line 209 of file CEGUIRect.h.

Referenced by CEGUI::Window::absoluteToRelative_impl(), CEGUI::OpenGLRenderer::addQuad(), CEGUI::IrrlichtRenderer::addQuad(), CEGUI::OpenGLRenderer::doRender(), CEGUI::Imageset::draw(), CEGUI::StaticText::drawSelf(), CEGUI::Static::drawSelf(), CEGUI::Font::drawText(), getIntersection(), CEGUI::FrameWindow::getSizingBorderAtPoint(), CEGUI::StaticText::getTextRenderArea(), CEGUI::Static::getUnclippedInnerRect(), isPointInRect(), CEGUI::FrameWindow::moveBottomEdge(), offset(), CEGUI::OpenGLRenderer::OpenGLRenderer(), operator=(), operator==(), CEGUI::PropertyHelper::rectToString(), CEGUI::Window::relativeToAbsolute_impl(), CEGUI::MultiLineEditbox::renderTextLines(), CEGUI::Window::screenToWindow(), CEGUI::Window::setRect(), and CEGUI::PropertyHelper::stringToRect().

float CEGUI::Rect::d_left
 

Definition at line 209 of file CEGUIRect.h.

Referenced by CEGUI::Window::absoluteToRelative_impl(), CEGUI::IrrlichtRenderer::addQuad(), CEGUI::OpenGLRenderer::doRender(), CEGUI::RenderableElement::draw(), CEGUI::Imageset::draw(), CEGUI::StaticImage::drawSelf(), CEGUI::Static::drawSelf(), CEGUI::MultiLineEditbox::drawSelf(), CEGUI::MultiColumnList::drawSelf(), CEGUI::Listbox::drawSelf(), CEGUI::Font::drawText(), getIntersection(), CEGUI::MultiColumnList::getItemAtPoint(), CEGUI::FrameWindow::getSizingBorderAtPoint(), CEGUI::MultiLineEditbox::getTextIndexFromPosition(), CEGUI::StaticText::getTextRenderArea(), CEGUI::Static::getUnclippedInnerRect(), CEGUI::Window::getXPosition(), isPointInRect(), CEGUI::FrameWindow::moveLeftEdge(), offset(), CEGUI::OpenGLRenderer::OpenGLRenderer(), operator=(), operator==(), CEGUI::PropertyHelper::rectToString(), CEGUI::Window::relativeToAbsolute_impl(), CEGUI::MultiLineEditbox::renderTextLines(), CEGUI::Window::screenToWindow(), setPosition(), CEGUI::Window::setRect(), CEGUI::Imageset_xmlHandler::startElement(), CEGUI::PropertyHelper::stringToRect(), CEGUI::Window::windowToScreen(), and CEGUI::Window::windowToScreenX().

float CEGUI::Rect::d_right
 

Definition at line 209 of file CEGUIRect.h.

Referenced by CEGUI::Window::absoluteToRelative_impl(), CEGUI::IrrlichtRenderer::addQuad(), CEGUI::ListHeaderSegment::doDragSizing(), CEGUI::OpenGLRenderer::doRender(), CEGUI::Imageset::draw(), CEGUI::Static::drawSelf(), CEGUI::Font::drawText(), getIntersection(), CEGUI::FrameWindow::getSizingBorderAtPoint(), CEGUI::StaticText::getTextRenderArea(), CEGUI::Static::getUnclippedInnerRect(), isPointInRect(), CEGUI::FrameWindow::moveRightEdge(), offset(), CEGUI::OpenGLRenderer::OpenGLRenderer(), operator=(), operator==(), CEGUI::PropertyHelper::rectToString(), CEGUI::Window::relativeToAbsolute_impl(), CEGUI::MultiLineEditbox::renderTextLines(), CEGUI::Window::screenToWindow(), CEGUI::Window::setRect(), and CEGUI::PropertyHelper::stringToRect().

float CEGUI::Rect::d_top
 

Definition at line 209 of file CEGUIRect.h.

Referenced by CEGUI::Window::absoluteToRelative_impl(), CEGUI::OpenGLRenderer::addQuad(), CEGUI::IrrlichtRenderer::addQuad(), CEGUI::OpenGLRenderer::doRender(), CEGUI::RenderableElement::draw(), CEGUI::Imageset::draw(), CEGUI::StaticText::drawSelf(), CEGUI::StaticImage::drawSelf(), CEGUI::Static::drawSelf(), CEGUI::MultiLineEditbox::drawSelf(), CEGUI::MultiColumnList::drawSelf(), CEGUI::Listbox::drawSelf(), CEGUI::Font::drawText(), getIntersection(), CEGUI::MultiColumnList::getItemAtPoint(), CEGUI::Listbox::getItemAtPoint(), CEGUI::FrameWindow::getSizingBorderAtPoint(), CEGUI::MultiLineEditbox::getTextIndexFromPosition(), CEGUI::StaticText::getTextRenderArea(), CEGUI::Static::getUnclippedInnerRect(), CEGUI::Window::getYPosition(), isPointInRect(), CEGUI::FrameWindow::moveTopEdge(), offset(), CEGUI::OpenGLRenderer::OpenGLRenderer(), operator=(), operator==(), CEGUI::PropertyHelper::rectToString(), CEGUI::Window::relativeToAbsolute_impl(), CEGUI::MultiLineEditbox::renderTextLines(), CEGUI::Window::screenToWindow(), setPosition(), CEGUI::Window::setRect(), CEGUI::Imageset_xmlHandler::startElement(), CEGUI::PropertyHelper::stringToRect(), CEGUI::Window::windowToScreen(), and CEGUI::Window::windowToScreenY().


The documentation for this class was generated from the following files:
Generated on Wed Feb 16 12:41:10 2005 for Crazy Eddies GUI System by  doxygen 1.3.9.1