# HG changeset patch # User alpar # Date 1181064586 0 # Node ID d7b7048e045b3113ebc25edddcdb76b8bea1f0dc # Parent 719220885b901328fea6aac28357c21ade7f1864 Two new constructors added to dim2::BoundingBox diff -r 719220885b90 -r d7b7048e045b lemon/dim2.h --- a/lemon/dim2.h Tue Jun 05 17:27:54 2007 +0000 +++ b/lemon/dim2.h Tue Jun 05 17:29:46 2007 +0000 @@ -272,7 +272,7 @@ /// A class to calculate or store the bounding box of plainvectors. /// ///\author Attila Bernath - template + template class BoundingBox { Point bottom_left, top_right; bool _empty; @@ -283,12 +283,36 @@ ///Construct an instance from one point BoundingBox(Point 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 a,Point 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(l,b); + top_right=Point(r,t); + _empty = false; + } + ///Were any points added? bool empty() const { return _empty; } - + ///Make the BoundingBox empty void clear() { _empty=1;