dim2::Box
Declared in lemon/dim2.h, in the group Geometric Data Structures; the same class on the Doxygen site.
-
template< typename T >
class Box Bounding box of plain vectors (points).
A class to calculate or store the bounding box of plain vectors (points).
Public Functions
-
inline Box()
Default constructor: creates an empty box.
-
inline Box(Point< T > a, Point< T > b)
Construct a box from two points.
Warning
The coordinates of the bottom left corner must be no more than those of the top right one.
- Parameters:
a – The bottom left corner.
b – The top right corner.
-
inline Box( T l , T b , T r , T t )
Construct a box from four numbers.
Warning
The left side must be no more than the right side and bottom must be no more than the top.
- Parameters:
l – The left side of the box.
b – The bottom of the box.
r – The right side of the box.
t – The top of the box.
-
inline bool empty() const
Return
trueif the box is empty.Return
trueif the box is empty (i.e. returnfalseif at least one point was added to the box or the coordinates of the box were set).The coordinates of an empty box are not defined.
-
inline void clear()
Make the box empty.
-
inline Point< T > bottomLeft() const
Give back the bottom left corner of the box. If the box is empty, then the return value is not defined.
-
inline void bottomLeft(Point< T > p)
Set the bottom left corner of the box.
- Pre:
The box must not be empty.
-
inline Point< T > topRight() const
Give back the top right corner of the box. If the box is empty, then the return value is not defined.
-
inline void topRight(Point< T > p)
Set the top right corner of the box.
- Pre:
The box must not be empty.
-
inline Point< T > bottomRight() const
Give back the bottom right corner of the box. If the box is empty, then the return value is not defined.
-
inline void bottomRight(Point< T > p)
Set the bottom right corner of the box.
- Pre:
The box must not be empty.
-
inline Point< T > topLeft() const
Give back the top left corner of the box. If the box is empty, then the return value is not defined.
-
inline void topLeft(Point< T > p)
Set the top left corner of the box.
- Pre:
The box must not be empty.
-
inline T bottom() const
Give back the bottom of the box. If the box is empty, then the return value is not defined.
-
inline T top() const
Give back the top of the box. If the box is empty, then the return value is not defined.
-
inline T left() const
Give back the left side of the box. If the box is empty, then the return value is not defined.
-
inline T right() const
Give back the right side of the box. If the box is empty, then the return value is not defined.
-
inline T height() const
Give back the height of the box. If the box is empty, then the return value is not defined.
-
inline Box()