Represents a box given by the upper-left and lower-right corner. More...
#include <Box2D.h>
Public Member Functions | |
T | area () |
area covered by the box | |
Box2D (T minX=0, T minY=0, T maxX=0, T maxY=0) | |
Creates a box given by top-left (minX,minY) and lower-right (maxX,maxY) coordinates. | |
Point2D | centerPoint () |
void | clip (Box2D< T > clipArea) |
Clip the box to fit into clipArea. | |
bool | contains (T x, T y) |
void | enclose (Point2D point) |
expand the box so that it contains the given point | |
void | enclose (T x, T y) |
template<class OtherT > | |
void | enclose (Box2D< OtherT > box) |
void | expand (T size) |
enlarge the box by 'size' units in all directions | |
T | height () const |
T | maxX () const |
T | maxY () const |
T | minX () const |
T | minY () const |
Box2D< T > & | operator*= (T div) |
Box2D< T > & | operator/= (T div) |
void | setMaxX (T value) |
void | setMaxY (T value) |
void | setMinX (T value) |
void | setMinY (T value) |
void | shrink (T size) |
shrink the box by 'size' units in all directions | |
std::vector< Point2D > | vertices () |
T | width () const |
~Box2D () | |
The destructor. | |
Private Attributes | |
T | m_MaxX |
T | m_MaxY |
T | m_MinX |
T | m_MinY |
Represents a box given by the upper-left and lower-right corner.
Point2D Box2D< T >::centerPoint | ( | ) | [inline] |