# HG changeset patch # User Sebastien Jodogne # Date 1519986072 -3600 # Node ID 62964bfbbc0024ad97b60f03e0a6fbf5db5d2c09 # Parent 0ee144f8f75a58cfc1186936182edd8970747418 Extent2D::Contains diff -r 0ee144f8f75a -r 62964bfbbc00 Framework/Toolbox/Extent2D.cpp --- a/Framework/Toolbox/Extent2D.cpp Thu Mar 01 16:27:10 2018 +0100 +++ b/Framework/Toolbox/Extent2D.cpp Fri Mar 02 11:21:12 2018 +0100 @@ -121,4 +121,19 @@ y2_ <= y1_ + 10 * std::numeric_limits::epsilon()); } } + + + bool Extent2D::Contains(double x, + double y) const + { + if (empty_) + { + return false; + } + else + { + return (x >= x1_ && x <= x2_ && + y >= y1_ && y <= y2_); + } + } } diff -r 0ee144f8f75a -r 62964bfbbc00 Framework/Toolbox/Extent2D.h --- a/Framework/Toolbox/Extent2D.h Thu Mar 01 16:27:10 2018 +0100 +++ b/Framework/Toolbox/Extent2D.h Fri Mar 02 11:21:12 2018 +0100 @@ -91,5 +91,8 @@ { return (y1_ + y2_) / 2.0; } + + bool Contains(double x, + double y) const; }; }