diff Framework/Toolbox/Extent2D.cpp @ 168:62964bfbbc00 wasm

Extent2D::Contains
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 02 Mar 2018 11:21:12 +0100
parents e2fe9352f240
children b70e9be013e4
line wrap: on
line diff
--- 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<double>::epsilon());
     }
   }
+
+
+  bool Extent2D::Contains(double x,
+                          double y) const
+  {
+    if (empty_)
+    {
+      return false;
+    }
+    else
+    {
+      return (x >= x1_ && x <= x2_ &&
+              y >= y1_ && y <= y2_);
+    }
+  }
 }