[Lemon-commits] alpar: r3289 - lemon/trunk/lemon
Lemon SVN
svn at lemon.cs.elte.hu
Tue Jun 5 19:29:48 CEST 2007
Author: alpar
Date: Tue Jun 5 19:29:46 2007
New Revision: 3289
Modified:
lemon/trunk/lemon/dim2.h
Log:
Two new constructors added to dim2::BoundingBox
Modified: lemon/trunk/lemon/dim2.h
==============================================================================
--- lemon/trunk/lemon/dim2.h (original)
+++ lemon/trunk/lemon/dim2.h Tue Jun 5 19:29:46 2007
@@ -272,7 +272,7 @@
/// A class to calculate or store the bounding box of plainvectors.
///
///\author Attila Bernath
- template<typename T>
+ template<typename T>
class BoundingBox {
Point<T> bottom_left, top_right;
bool _empty;
@@ -283,12 +283,36 @@
///Construct an instance from one point
BoundingBox(Point<T> a) { bottom_left=top_right=a; _empty = false; }
+
+ ///Construct an instance from two points
+
+ ///Construct an instance from two points
+ ///\warning The coordinates of the bottom-left corner must be no more
+ ///than those of the top-right one
+ BoundingBox(Point<T> a,Point<T> b)
+ {
+ bottom_left=a;
+ top_right=b;
+ _empty = false;
+ }
+
+ ///Construct an instance from four numbers
+ ///Construct an instance from four numbers
+ ///\warning The coordinates of the bottom-left corner must be no more
+ ///than those of the top-right one
+ BoundingBox(T l,T b,T r,T t)
+ {
+ bottom_left=Point<T>(l,b);
+ top_right=Point<T>(r,t);
+ _empty = false;
+ }
+
///Were any points added?
bool empty() const {
return _empty;
}
-
+
///Make the BoundingBox empty
void clear() {
_empty=1;
More information about the Lemon-commits
mailing list