26 #ifndef _BOARD_RECT_H_
27 #define _BOARD_RECT_H_
54 Rect(
double left = 0.0f,
double top = 0.0f,
55 double width = 0.0f,
double height = 0.0f )
56 :left( left ), top( top ), width( width ), height( height ) { }
58 Point topLeft()
const {
return Point( left, top ); }
59 Point topRight()
const {
return Point( left + width, top ); }
60 Point bottomLeft()
const {
return Point( left, top - height ); }
61 Point bottomRight()
const {
return Point( left + width, top - height ); }
62 Point center()
const {
return Point(left+width/2.0,top-height/2.0); }
63 double bottom()
const {
return top -
height; }
64 double right()
const {
return left +
width; }
75 Rect operator||(
const Rect & rectA,
const Rect & rectB );
85 Rect operator&&(
const Rect & rectA,
const Rect & rectB );
The Point structure. @copyright This source code is part of the Board project, a C++ library whose pu...
double top
Definition: Rect.h:40
Rect(double left=0.0f, double top=0.0f, double width=0.0f, double height=0.0f)
Definition: Rect.h:54
double left
Definition: Rect.h:39
Struct representing a 2D point.
Definition: Point.h:38
std::ostream & operator<<(std::ostream &out, const LibBoard::Rect &rect)
Definition: Rect.cpp:69
double height
Definition: Rect.h:42
Struct representing a rectangle on the plane.
Definition: Rect.h:38
double width
Definition: Rect.h:41