[Lemon-commits] [lemon_svn] alpar: r2502 - hugo/trunk/lemon
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:53:08 CET 2006
Author: alpar
Date: Mon Jan 30 10:31:15 2006
New Revision: 2502
Modified:
hugo/trunk/lemon/xy.h
Log:
Functions added to set the edges/corners of the bounding box directly.
Modified: hugo/trunk/lemon/xy.h
==============================================================================
--- hugo/trunk/lemon/xy.h (original)
+++ hugo/trunk/lemon/xy.h Mon Jan 30 10:31:15 2006
@@ -245,52 +245,112 @@
_empty=1;
}
- ///Gives back the bottom left corner (if the bounding box is empty, then the return value is not defined)
+ ///\brief Gives back the bottom left corner
+ ///(if the bounding box is empty, then the return value is not defined)
xy<T> bottomLeft() const {
return bottom_left;
}
- ///Gives back the top right corner (if the bounding box is empty, then the return value is not defined)
+ ///\brief Sets the bottom left corner
+ ///(should only bee used for non-empty box)
+ void bottomLeft(xy<T> p) {
+ bottom_left = p;
+ }
+
+ ///\brief Gives back the top right corner
+ ///(if the bounding box is empty, then the return value is not defined)
xy<T> topRight() const {
return top_right;
}
- ///Gives back the bottom right corner (if the bounding box is empty, then the return value is not defined)
+ ///\brief Sets the top right corner
+ ///(should only bee used for non-empty box)
+ void topRight(xy<T> p) {
+ top_right = p;
+ }
+
+ ///\brief 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)
+ ///\brief Sets the bottom right corner
+ ///(should only bee used for non-empty box)
+ void bottomRight(xy<T> p) {
+ top_right.x = p.x;
+ bottom_left.y = p.y;
+ }
+
+ ///\brief 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)
+ ///\brief Sets the top left corner
+ ///(should only bee used for non-empty box)
+ void topLeft(xy<T> p) {
+ top_right.y = p.y;
+ bottom_left.x = p.x;
+ }
+
+ ///\brief 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)
+ ///\brief Sets the bottom of the box
+ ///(should only bee used for non-empty box)
+ void bottom(T t) {
+ bottom_left.y = t;
+ }
+
+ ///\brief 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)
+ ///\brief Sets the top of the box
+ ///(should only bee used for non-empty box)
+ void top(T t) {
+ top_right.y = t;
+ }
+
+ ///\brief 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)
+ ///\brief Sets the left side of the box
+ ///(should only bee used for non-empty box)
+ void left(T t) {
+ bottom_left.x = t;
+ }
+
+ ///\brief 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;
}
- ///Gives back the height of the box (if the bounding box is empty, then the return value is not defined)
+ ///\brief Sets the right side of the box
+ ///(should only bee used for non-empty box)
+ void right(T t) {
+ top_right.x = t;
+ }
+
+ ///\brief 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)
+ ///\brief 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;
}
More information about the Lemon-commits
mailing list