diff Framework/Scene2D/Scene2D.cpp @ 632:500c3f70b6c2

- Added a ClearAllChains method to PolylineSceneLayer --> revision must change when calling it ==> BumpRevision has been added to base class - Added some docs = Added GetMinDepth + GetMaxDepth to Scene2D (to alleviate the need for app- specific "Z depth registry" : clients may simply add a new layer on top or at the bottom of the existing layer set. - Added the line tracker measurement tools, commands and trackers. Generic base classes + Line measure - started work on the line measure handles
author Benjamin Golinvaux <bgo@osimis.io>
date Thu, 09 May 2019 10:41:31 +0200
parents d9c0a66304cb
children f939f449482c
line wrap: on
line diff
--- a/Framework/Scene2D/Scene2D.cpp	Thu May 02 18:58:46 2019 +0200
+++ b/Framework/Scene2D/Scene2D.cpp	Thu May 09 10:41:31 2019 +0200
@@ -102,6 +102,8 @@
   void Scene2D::SetLayer(int depth,
                          ISceneLayer* layer)  // Takes ownership
   {
+    LOG(INFO) << "SetLayer(" << depth << ", " <<
+      reinterpret_cast<intptr_t>(layer) << ")";
     std::auto_ptr<Item> item(new Item(layer, layerCounter_++));
 
     if (layer == NULL)
@@ -126,10 +128,12 @@
 
   void Scene2D::DeleteLayer(int depth)
   {
+
     Content::iterator found = content_.find(depth);
 
     if (found != content_.end())
     {
+      LOG(INFO) << "DeleteLayer --found-- (" << depth << ")";
       assert(found->second != NULL);
       delete found->second;
       content_.erase(found);
@@ -159,6 +163,23 @@
   }
 
   
+  int Scene2D::GetMinDepth() const
+  {
+    if (content_.size() == 0)
+      return 0;
+    else
+      return content_.begin()->first;
+  }
+
+
+  int Scene2D::GetMaxDepth() const
+  {
+    if (content_.size() == 0)
+      return 0;
+    else
+      return content_.rbegin()->first;
+  }
+
   ISceneLayer* Scene2D::ReleaseLayer(int depth)
   {
     Content::iterator found = content_.find(depth);