____                _       __
    / __ )____  _____   | |     / /___ ___________
   / __  / __ \/ ___/   | | /| / / __ `/ ___/ ___/
  / /_/ / /_/ (__  )    | |/ |/ / /_/ / /  (__  )
 /_____/\____/____/     |__/|__/\__,_/_/  /____/

       A futuristic real-time strategy game.
          This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project. Distributed under the "GNU General Public License"

gcn::Rectangle Class Reference

#include <rectangle.h>

Inheritance diagram for gcn::Rectangle:

gcn::ClipRectangle

List of all members.

Public Member Functions

 Rectangle ()
 Rectangle (int x, int y, int width, int height)
void setAll (int x, int y, int width, int height)
bool intersect (const Rectangle &rectangle)
bool isPointInRect (int x, int y) const

Public Attributes

int x
int y
int width
int height


Detailed Description

Represents a rectangle.

Definition at line 65 of file rectangle.h.


Constructor & Destructor Documentation

gcn::Rectangle::Rectangle (  ) 

Constructor. Resets member variables.

Definition at line 63 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 71 of file rectangle.cpp.


Member Function Documentation

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 79 of file rectangle.cpp.

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

Checks if another Rectangle intersects with the Rectangle.

Parameters:
rectangle another Rectangle.

Definition at line 87 of file rectangle.cpp.

References height, width, x, and y.

Referenced by MyOpenGLGraphics::drawRectangle(), MyOpenGLGraphics::fillRectangle(), 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 128 of file rectangle.cpp.

References height, and width.

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


Member Data Documentation


The documentation for this class was generated from the following files:

Generated on Sat Feb 21 00:28:26 2009 for Bos Wars by  doxygen 1.5.6