Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Rectangle Class Reference

#include <imgmap.h>

Inheritance diagram for Rectangle:

Inheritance graph
[legend]
List of all members.

Public Methods

 Rectangle (float left, float top, float width, float height)
 Constructor with dimensions.

bool contains (float x, float y) const
 Determines whether the Rectangle contains the given point.


Public Attributes

float left
float top
float width
float height

Constructor & Destructor Documentation

Rectangle::Rectangle float    aleft,
float    atop,
float    awidth,
float    aheight
 

Constructor with dimensions.

Parameters:
aleft  The left position of the Rectangle
atop  The top position of the Rectangle
awidth  The width of the Rectangle
aheight  The height of the Rectangle

00027    :
00028 left(aleft), top(atop), width(awidth), height(aheight)
00029 {}


Member Function Documentation

bool Rectangle::contains float    x,
float    y
const
 

Determines whether the Rectangle contains the given point.

Parameters:
x  The x coordinate
y  The y coordinate

Reimplemented in EntryRect.

00037 {
00038    if (x>=left && y>=top)
00039    {
00040       if(x-left<=width && y-top<=height)
00041          return true;
00042    }
00043    return false;
00044 }


Member Data Documentation

float Rectangle::left
 

float Rectangle::top
 

float Rectangle::width
 

float Rectangle::height
 


The documentation for this class was generated from the following files:
Generated on Mon Apr 7 19:43:25 2003 for DuTree by doxygen1.2.18