GUI::Rectangle Class Reference

Wrap a rectangle. More...

#include <Rectangle.h>

List of all members.

Public Member Functions

 Rectangle ()
 Construct an empty rectangle.
 Rectangle (const Point &top_left, const Point &bottom_right)
 Construct a rectangle from two vertex.
 Rectangle (int x1, int y1, int x2, int y2)
 Construct a rectangle from coordinates.
PointgetTopLeft ()
 Return the top left vertex.
void setTopLeft (const Point &value)
 Set the new top left vertex.
PointgetBottomRight ()
 Return the bottom right vertex.
void setBottomRight (const Point &value)
 Set the new bottom right vertex.
int getWidth () const
 Return the width of the rectangle.
int getHeight () const
 Return the height of the rectangle.
void move (const Point &position)
 Move the rectangle at gived position.
void setCoord (int x1, int y1, int x2, int y2)
 Set new rectangle vertex from coordinates.
void setSize (const Size &size)
 Set rectangle width and height.

Friends

std::ostream & operator<< (std::ostream &os, const Rectangle &obj)
 Overload std::ostream::operator<< for use in the model.
std::istream & operator>> (std::istream &os, const Rectangle &obj)
 Overload std::istream::operator>> for use in the model.


Detailed Description

Wrap a rectangle.


Constructor & Destructor Documentation

GUI::Rectangle::Rectangle ( const Point top_left,
const Point bottom_right 
)

Construct a rectangle from two vertex.

Parameters:
top_left the top left vertex
bottom_right the bottom right vertex

GUI::Rectangle::Rectangle ( int  x1,
int  y1,
int  x2,
int  y2 
)

Construct a rectangle from coordinates.

Parameters:
x1 x coordinate of the top left vertex
y1 y coordinate of the top left vertex
x2 x coordinate of the bottom right vertex
y2 y coordinate of the bottom right vertex


Member Function Documentation

Point & GUI::Rectangle::getBottomRight (  ) 

Return the bottom right vertex.

Returns:
the bottom right vertex

int GUI::Rectangle::getHeight (  )  const

Return the height of the rectangle.

Returns:
the height of the rectangle

Point & GUI::Rectangle::getTopLeft (  ) 

Return the top left vertex.

Returns:
the top left vertex

int GUI::Rectangle::getWidth (  )  const

Return the width of the rectangle.

Returns:
the width of the rectangle

void GUI::Rectangle::move ( const Point position  ) 

Move the rectangle at gived position.

Parameters:
position the new position

void GUI::Rectangle::setBottomRight ( const Point value  ) 

Set the new bottom right vertex.

Parameters:
value the bottom right vertex

void GUI::Rectangle::setCoord ( int  x1,
int  y1,
int  x2,
int  y2 
)

Set new rectangle vertex from coordinates.

Parameters:
x1 x coordinate of the top left vertex
y1 y coordinate of the top left vertex
x2 x coordinate of the bottom right vertex
y2 y coordinate of the bottom right vertex

void GUI::Rectangle::setSize ( const Size size  ) 

Set rectangle width and height.

Parameters:
size the new rectangle size

void GUI::Rectangle::setTopLeft ( const Point value  ) 

Set the new top left vertex.

Parameters:
value the top left vertex


The documentation for this class was generated from the following files:
Generated on Wed Nov 15 22:21:10 2006 for Win32 by  doxygen 1.4.7