Functions to query height/width of a BoundingBox.
authoralpar
Fri, 28 Jan 2005 09:04:34 +0000
changeset 1102100c8d5ee36b
parent 1101 9286569c3749
child 1103 f196dc4f1b31
Functions to query height/width of a BoundingBox.
src/lemon/xy.h
     1.1 --- a/src/lemon/xy.h	Fri Jan 28 08:53:48 2005 +0000
     1.2 +++ b/src/lemon/xy.h	Fri Jan 28 09:04:34 2005 +0000
     1.3 @@ -243,6 +243,16 @@
     1.4  	return top_right.x;
     1.5        };
     1.6  
     1.7 +      ///Gives back the height of the box (if the bounding box is empty, then the return value is not defined) 
     1.8 +      T height() const {
     1.9 +	return top_right.y-bottom_left.y;
    1.10 +      };
    1.11 +
    1.12 +      ///Gives back the width of the box (if the bounding box is empty, then the return value is not defined) 
    1.13 +      T width() const {
    1.14 +	return top_right.x-bottom_left.x;
    1.15 +      };
    1.16 +
    1.17        ///Checks whether a point is inside a bounding box
    1.18        bool inside(const xy<T>& u){
    1.19  	if (_empty)