[Lemon-commits] [lemon_svn] alpar: r1501 - hugo/trunk/src/lemon

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:45:54 CET 2006


Author: alpar
Date: Fri Jan 28 10:04:34 2005
New Revision: 1501

Modified:
   hugo/trunk/src/lemon/xy.h

Log:
Functions to query height/width of a BoundingBox.


Modified: hugo/trunk/src/lemon/xy.h
==============================================================================
--- hugo/trunk/src/lemon/xy.h	(original)
+++ hugo/trunk/src/lemon/xy.h	Fri Jan 28 10:04:34 2005
@@ -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<T>& u){
 	if (_empty)



More information about the Lemon-commits mailing list