LBIBCell
 All Classes Functions Variables Friends Pages
UtilLib::geometry::Rectangle Class Reference

a class representing a rectangle More...

#include <Rectangle.hpp>

Public Member Functions

 Rectangle (double ymax, double ymin, double xmin, double xmax)
 Rectangle Constructs a rectangle. More...
 
 Rectangle (double x, double y, double size)
 Rectangle Constructs a rectangle around a point with lenght and hight size. More...
 
bool within (const Rectangle &rect) const
 within Is rect contained inside this rect More...
 
bool within (double n, double s, double w, double e) const
 within Is rect contained inside this rect More...
 
bool pointWithinBounds (double x, double y) const
 pointWithinBounds Checks if point is contained inside this rectangle More...
 

Public Attributes

const double north
 the north border
 
const double south
 the north border
 
const double west
 the north border
 
const double east
 the north border
 

Detailed Description

a class representing a rectangle

Definition at line 30 of file Rectangle.hpp.

Constructor & Destructor Documentation

UtilLib::geometry::Rectangle::Rectangle ( double  ymax,
double  ymin,
double  xmin,
double  xmax 
)
explicit

Rectangle Constructs a rectangle.

Parameters
ymaxThe top border.
yminThe bottom border.
xminThe left border.
xmaxThe right border.

Definition at line 25 of file Rectangle.cpp.

UtilLib::geometry::Rectangle::Rectangle ( double  x,
double  y,
double  size 
)
explicit

Rectangle Constructs a rectangle around a point with lenght and hight size.

Parameters
xThe x position
yThe y position
sizethe lenght and height of the rectagle

Definition at line 35 of file Rectangle.cpp.

Member Function Documentation

bool UtilLib::geometry::Rectangle::pointWithinBounds ( double  x,
double  y 
) const

pointWithinBounds Checks if point is contained inside this rectangle

Parameters
xThe x pos of the point
yThe y pos if the point
Returns
True of they overlap

Definition at line 63 of file Rectangle.cpp.

bool UtilLib::geometry::Rectangle::within ( const Rectangle rect) const

within Is rect contained inside this rect

Parameters
rectAnother rectangele
Returns
True if they overlap

Definition at line 43 of file Rectangle.cpp.

bool UtilLib::geometry::Rectangle::within ( double  n,
double  s,
double  w,
double  e 
) const

within Is rect contained inside this rect

Parameters
nThe north border of another rectangle
sThe south border of another rectangle
wThe west border of another rectangle
eThe east border of another rectangle
Returns
True if they overlap

Definition at line 47 of file Rectangle.cpp.


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