Board  0.9.5
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.0, double top=0.0, double width=0.0, double height=0.0)
 
 Rect (Point topLeft, double width=0.0, double height=0.0)
 
 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 clear ()
 
void growToContain (const Point &)
 
void growToContain (const std::vector< Point > &points)
 
bool contains (Point) const
 
bool strictlyContains (Point) const
 
bool intersects (const Rect &) const
 
bool strictlyIntersects (const Rect &) const
 
Rectgrow (double margin)
 
bool isNull () const
 

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, examples/ellipse.cpp, examples/tilings.cpp, and examples/traversal.cpp.

Constructor & Destructor Documentation

◆ Rect() [1/3]

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

Rect constructor.

Parameters
left
top
width
height

◆ Rect() [2/3]

LibBoard::Rect::Rect ( Point  topLeft,
double  width = 0.0,
double  height = 0.0 
)
inline

Rect constructor.

Parameters
topLeftThe top-left point of the rectangle.
width
height

◆ Rect() [3/3]

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

◆ height

double LibBoard::Rect::height

◆ left

double LibBoard::Rect::left

◆ top

double LibBoard::Rect::top

◆ width

double LibBoard::Rect::width

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