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

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


Author: alpar
Date: Tue Jan  4 18:06:20 2005
New Revision: 1439

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

Log:
Several new member functions added to BoundingBox

Modified: hugo/trunk/src/lemon/xy.h
==============================================================================
--- hugo/trunk/src/lemon/xy.h	(original)
+++ hugo/trunk/src/lemon/xy.h	Tue Jan  4 18:06:20 2005
@@ -195,6 +195,36 @@
 	return top_right;
       };
 
+      ///Gives back the bottom right corner (if the bounding box is empty, then the return value is not defined) 
+      xy<T> bottomRight() const {
+	return xy<T>(top_right.x,bottom_left.y);
+      };
+
+      ///Gives back the top left corner (if the bounding box is empty, then the return value is not defined) 
+      xy<T> topLeft() const {
+	return xy<T>(bottom_left.x,top_right.y);
+      };
+
+      ///Gives back the bottom of the box (if the bounding box is empty, then the return value is not defined) 
+      T bottom() const {
+	return bottom_left.y;
+      };
+
+      ///Gives back the top of the box (if the bounding box is empty, then the return value is not defined) 
+      T top() const {
+	return top_right.y;
+      };
+
+      ///Gives back the left side of the box (if the bounding box is empty, then the return value is not defined) 
+      T left() const {
+	return bottom_left.x;
+      };
+
+      ///Gives back the right side of the box (if the bounding box is empty, then the return value is not defined) 
+      T right() const {
+	return top_right.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