# HG changeset patch # User alpar # Date 1106903074 0 # Node ID 100c8d5ee36bebf20fc38a8226d7ddddc10ce000 # Parent 9286569c374992b635b8c39d611f46f850e64e6c Functions to query height/width of a BoundingBox. diff -r 9286569c3749 -r 100c8d5ee36b src/lemon/xy.h --- a/src/lemon/xy.h Fri Jan 28 08:53:48 2005 +0000 +++ b/src/lemon/xy.h Fri Jan 28 09:04:34 2005 +0000 @@ -243,6 +243,16 @@ return top_right.x; }; + ///Gives back the height of the box (if the bounding box is empty, then the return value is not defined) + T height() const { + return top_right.y-bottom_left.y; + }; + + ///Gives back the width of the box (if the bounding box is empty, then the return value is not defined) + T width() const { + return top_right.x-bottom_left.x; + }; + ///Checks whether a point is inside a bounding box bool inside(const xy& u){ if (_empty)