gcn::Rectangle Class Reference

#include <rectangle.hpp>

Inheritance diagram for gcn::Rectangle:

gcn::ClipRectangle List of all members.

Detailed Description

Represents a rectangle.

Definition at line 67 of file rectangle.hpp.

Public Member Functions

 Rectangle ()
 Constructor.
 Rectangle (int x, int y, int width, int height)
 Constructor.
void setAll (int x, int y, int width, int height)
 Sets the dimension of a rectangle.
bool intersect (const Rectangle &rectangle)
 Checks if another Rectangle intersects with the Rectangle.
bool isPointInRect (int x, int y) const
 Checks if a point is inside the Rectangle.

Public Attributes

int x
int y
int width
int height


Constructor & Destructor Documentation

gcn::Rectangle::Rectangle (  ) 

Constructor.

Resets member variables.

Definition at line 65 of file rectangle.cpp.

References height, width, x, and y.

gcn::Rectangle::Rectangle ( int  x,
int  y,
int  width,
int  height 
)

Constructor.

Parameters:
x the Rectangle x coordinate.
y the Rectangle y coordinate.
width the Rectangle width.
height the Rectangle height.

Definition at line 73 of file rectangle.cpp.


Member Function Documentation

bool gcn::Rectangle::intersect ( const Rectangle rectangle  ) 

Checks if another Rectangle intersects with the Rectangle.

Parameters:
rectangle another Rectangle.

Definition at line 89 of file rectangle.cpp.

References height, width, x, and y.

Referenced by gcn::SDLGraphics::fillRectangle(), and gcn::Graphics::pushClipArea().

bool gcn::Rectangle::isPointInRect ( int  x,
int  y 
) const

Checks if a point is inside the Rectangle.

Parameters:
x the point x coordinate.
y the point y coordinate.

Definition at line 130 of file rectangle.cpp.

Referenced by gcn::SDLGraphics::drawLine(), gcn::SDLGraphics::drawPoint(), gcn::BasicContainer::getWidgetAt(), and gcn::Gui::logic().

void gcn::Rectangle::setAll ( int  x,
int  y,
int  width,
int  height 
)

Sets the dimension of a rectangle.

Parameters:
x the Rectangle x coordinate.
y the Rectangle y coordinate.
width the Rectangle width.
height the Rectangle height.

Definition at line 81 of file rectangle.cpp.


The documentation for this class was generated from the following files:
Generated on Sat Jul 29 19:38:49 2006 for Guichan by  doxygen 1.4.7