Changeset 1588:b79bcba43661 in lemon0.x for lemon/xy.h
 Timestamp:
 07/26/05 16:31:29 (14 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@2092
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

lemon/xy.h
r1435 r1588 307 307 308 308 ///Increments a bounding box with a point 309 BoundingBox& operator +=(const xy<T>& u){309 BoundingBox& add(const xy<T>& u){ 310 310 if (_empty){ 311 311 bottom_left=top_right=u; … … 321 321 } 322 322 323 ///Sums a bounding box and a point324 BoundingBox operator +(const xy<T>& u){325 BoundingBox b = *this;326 return b += u;327 }323 // ///Sums a bounding box and a point 324 // BoundingBox operator +(const xy<T>& u){ 325 // BoundingBox b = *this; 326 // return b += u; 327 // } 328 328 329 329 ///Increments a bounding box with an other bounding box 330 BoundingBox& operator +=(const BoundingBox &u){330 BoundingBox& add(const BoundingBox &u){ 331 331 if ( !u.empty() ){ 332 *this += u.bottomLeft();333 *this += u.topRight();332 this>add(u.bottomLeft()); 333 this>add(u.topRight()); 334 334 } 335 335 return *this; … … 339 339 BoundingBox operator +(const BoundingBox& u){ 340 340 BoundingBox b = *this; 341 return b += u; 341 return b.add(u); 342 } 343 344 345 ///Intersection of two bounding boxes 346 BoundingBox operator &(const BoundingBox& u){ 347 BoundingBox b; 348 b.bottom_left.x=std::max(this>bottom_left.x,u.bottom_left.x); 349 b.bottom_left.y=std::max(this>bottom_left.y,u.bottom_left.y); 350 b.top_right.x=std::min(this>top_right.x,u.top_right.x); 351 b.top_right.y=std::min(this>top_right.y,u.top_right.y); 352 b._empty = this>_empty  u._empty  353 b.bottom_left.x>top_right.x && b.bottom_left.y>top_right.y; 354 return b; 342 355 } 343 356
Note: See TracChangeset
for help on using the changeset viewer.