Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

rect Class Reference

simple class for handling a rectangular zone. More...

#include <rect.h>

Collaboration diagram for rect:

Collaboration graph
[legend]
List of all members.

Public Methods

 rect () throw ()
 rect (int x, int y) throw (std::exception)
 rect (const point &size) throw (std::exception)
 rect (int x1, int y1, int x2, int y2) throw (std::exception)
 rect (const point &topleft, const point &bottomright) throw (std::exception)
 rect (const rect &r) throw ()
rect & operator= (const rect &r) throw ()
bool operator== (const rect &r) const throw ()
point size () const throw ()
int width () const throw ()
int height () const throw ()
int left () const throw ()
int right () const throw ()
int top () const throw ()
int bottom () const throw ()
const pointtopleft () const throw ()
const pointbottomright () const throw ()
bool is_inside (int x, int y) const throw ()
 check if given position is inside the rectangle

bool is_inside (const point &p) const throw ()
 check if given point is inside the rectangle

bool clip (rect &r) const throw (std::exception)

Protected Methods

void check () throw (std::exception)

Private Attributes

point _topleft
 The point at the top left of the rectangle.

point _bottomright
 The point at the bottom right of the rectangle.


Detailed Description

simple class for handling a rectangular zone.

This small class is an helper for rectangles. It is mostly used by the blitter class.

Definition at line 60 of file rect.h.


Constructor & Destructor Documentation

rect::rect   throw ()
 

Definition at line 27 of file rect.cpp.

Referenced by operator=().

rect::rect int    x,
int    y
throw (std::exception)
 

Definition at line 30 of file rect.cpp.

rect::rect const point   size throw (std::exception) [explicit]
 

rect::rect int    x1,
int    y1,
int    x2,
int    y2
throw (std::exception)
 

Definition at line 34 of file rect.cpp.

rect::rect const point   topleft,
const point   bottomright
throw (std::exception)
 

rect::rect const rect &    r throw ()
 

Definition at line 38 of file rect.cpp.


Member Function Documentation

int rect::bottom   const throw () [inline]
 

Definition at line 81 of file rect.h.

References point::get_y().

Referenced by blitter::block_copy(), and operator<<().

const point& rect::bottomright   const throw () [inline]
 

Definition at line 83 of file rect.h.

void rect::check   throw (std::exception) [protected]
 

Definition at line 51 of file rect.cpp.

bool rect::clip rect &    r const throw (std::exception)
 

int rect::height   const throw () [inline]
 

Definition at line 77 of file rect.h.

References point::get_y(), and size().

bool rect::is_inside const point   p const throw ()
 

check if given point is inside the rectangle

Parameters:
p  the point to check
Returns:
true if the given point is inside the rectangle, false otherwise

Definition at line 68 of file rect.cpp.

bool rect::is_inside int    x,
int    y
const throw ()
 

check if given position is inside the rectangle

Parameters:
x  the horizontal position to check
y  the vertical position to check
Returns:
true if the given position is inside the rectangle, false otherwise

Definition at line 64 of file rect.cpp.

int rect::left   const throw () [inline]
 

Definition at line 78 of file rect.h.

References point::get_x().

Referenced by operator<<().

rect::rect & rect::operator= const rect &    r throw ()
 

Definition at line 41 of file rect.cpp.

References _topleft, and rect().

bool rect::operator== const rect &    r const throw ()
 

Definition at line 47 of file rect.cpp.

int rect::right   const throw () [inline]
 

Definition at line 79 of file rect.h.

References point::get_x().

Referenced by blitter::block_copy(), and operator<<().

point rect::size   const throw () [inline]
 

Definition at line 75 of file rect.h.

Referenced by height(), and width().

int rect::top   const throw () [inline]
 

Definition at line 80 of file rect.h.

References point::get_y().

Referenced by operator<<().

const point& rect::topleft   const throw () [inline]
 

Definition at line 82 of file rect.h.

int rect::width   const throw () [inline]
 

Definition at line 76 of file rect.h.

References point::get_x(), and size().


Member Data Documentation

point rect::_bottomright [private]
 

The point at the bottom right of the rectangle.

Definition at line 63 of file rect.h.

point rect::_topleft [private]
 

The point at the top left of the rectangle.

Definition at line 62 of file rect.h.

Referenced by operator=().


The documentation for this class was generated from the following files:
Generated on Fri Aug 9 22:54:32 2002 for san_player by doxygen1.2.16