From 7d1520f5f8b8435e17fb43a7fd90ba35a0a26b55 Mon Sep 17 00:00:00 2001
From: berenger-bramas <berenger-bramas@2616d619-271b-44dc-8df4-d4a8f33a7222>
Date: Fri, 21 Oct 2011 13:18:32 +0000
Subject: [PATCH] Add a getLeaf method for the octree iterator.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@228 2616d619-271b-44dc-8df4-d4a8f33a7222
---
 Src/Containers/FOctree.hpp    | 7 +++++++
 Src/Containers/FSubOctree.hpp | 3 +++
 2 files changed, 10 insertions(+)

diff --git a/Src/Containers/FOctree.hpp b/Src/Containers/FOctree.hpp
index 0ce24b3a8..4105f608a 100644
--- a/Src/Containers/FOctree.hpp
+++ b/Src/Containers/FOctree.hpp
@@ -513,6 +513,13 @@ public:
                 return this->currentLocalLevel + this->current.tree->getSubOctreePosition();
             }
 
+            /** Get the current pointed leaf
+              * @return current leaf element
+              */
+            LeafClass* getCurrentLeaf() {
+                return this->current.leafTree->getLeaf(this->currentLocalIndex);
+            }
+
             /** To access the current particles list
               * You have to be at the leaf level to call this function!
               * @return current element list
diff --git a/Src/Containers/FSubOctree.hpp b/Src/Containers/FSubOctree.hpp
index 65100aac0..a0f8d1065 100644
--- a/Src/Containers/FSubOctree.hpp
+++ b/Src/Containers/FSubOctree.hpp
@@ -362,6 +362,9 @@ public:
         return (leaf ? leaf->getTargets() : 0);
     }
 
+    LeafClass* getLeaf(const int index){
+        return this->leafs[index];
+    }
 };
 
 
-- 
GitLab