Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrachytski <siarhei.rachytski@gmail.com>2011-06-12 19:48:45 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:19:37 +0300
commit9e73efd60264e878375ae08b8767307d17544d27 (patch)
treef763ff6e5c2859643f922c7082acff3e567329da /geometry
parenta081d2e5c2d5a24c4e8822f3cdd06e2ac09cfbca (diff)
introduced separate information layer class, which will perform all POI and Text layout.
Diffstat (limited to 'geometry')
-rw-r--r--geometry/point2d.hpp9
-rw-r--r--geometry/tree4d.hpp13
2 files changed, 20 insertions, 2 deletions
diff --git a/geometry/point2d.hpp b/geometry/point2d.hpp
index 503b52bd55..0d5fe6e3f2 100644
--- a/geometry/point2d.hpp
+++ b/geometry/point2d.hpp
@@ -192,6 +192,15 @@ namespace m2
}
template <typename T>
+ Point<T> const Floor(Point<T> const & pt)
+ {
+ Point<T> res;
+ res.x = floor(pt.x);
+ res.y = floor(pt.y);
+ return res;
+ }
+
+ template <typename T>
bool IsPointStrictlyInsideTriangle(Point<T> const & p,
Point<T> const & a, Point<T> const & b, Point<T> const & c)
{
diff --git a/geometry/tree4d.hpp b/geometry/tree4d.hpp
index fa3c9de3b7..ed3666cb2a 100644
--- a/geometry/tree4d.hpp
+++ b/geometry/tree4d.hpp
@@ -10,7 +10,16 @@
namespace m4
{
- template <class T>
+ template <typename T>
+ struct Traits
+ {
+ m2::RectD const LimitRect(T const & t)
+ {
+ return t.GetLimitRect();
+ }
+ };
+
+ template <class T, typename Traits = Traits<T> >
class Tree
{
struct value_t
@@ -139,7 +148,7 @@ namespace m4
template <class TCompare>
void ReplaceIf(T const & obj, TCompare comp)
{
- ReplaceIf(obj, obj.GetLimitRect(), comp);
+ ReplaceIf(obj, Traits::LimitRect(obj), comp);
}
template <class ToDo>