Board  0.9.4
Public Member Functions | Public Attributes | List of all members
LibBoard::Rect Struct Reference

Struct representing a rectangle on the plane. More...

#include <Rect.h>

Public Member Functions

 Rect (double left=0.0f, double top=0.0f, double width=0.0f, double height=0.0f)
 
 Rect (Point topLeft, double width=0.0f, double height=0.0f)
 
 Rect (Point topLeft, Point bottomRight)
 
Point topLeft () const
 
Point topRight () const
 
Point bottomLeft () const
 
Point bottomRight () const
 
Point center () const
 
Point centerLeft () const
 
Point centerRight () const
 
Point centerTop () const
 
Point centerBottom () const
 
double bottom () const
 
double right () const
 
void growToContain (Point)
 
bool contains (Point) const
 
Rectgrow (double margin)
 

Public Attributes

double left
 
double top
 
double width
 
double height
 

Detailed Description

Struct representing a rectangle on the plane.

The Rectangle structure.

Examples:
examples/arrows.cpp, and examples/tilings.cpp.

Constructor & Destructor Documentation

LibBoard::Rect::Rect ( double  left = 0.0f,
double  top = 0.0f,
double  width = 0.0f,
double  height = 0.0f 
)
inline

Rect constructor.

Parameters
left
top
width
height
LibBoard::Rect::Rect ( Point  topLeft,
double  width = 0.0f,
double  height = 0.0f 
)
inline

Rect constructor.

Parameters
topLeftThe top-left point of the rectangle.
width
height
LibBoard::Rect::Rect ( Point  topLeft,
Point  bottomRight 
)
inline

Rect constructor.

Parameters
topLeftThe top-left point of the rectangle.
bottomRightThe bottom-right point of the rectangle.

Member Data Documentation

double LibBoard::Rect::height
double LibBoard::Rect::left
double LibBoard::Rect::top
double LibBoard::Rect::width

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