From bb558b51af956b8b69d6014e71ee9acdf0cd80c3 Mon Sep 17 00:00:00 2001
From: jpan <jpan@253336fb-580f-4252-a368-f3cef5a2a82b>
Date: Mon, 6 Aug 2012 18:18:47 +0000
Subject: [PATCH] change octree shared_ptr to octomap as const, and remove
 non-const function

git-svn-id: https://kforge.ros.org/fcl/fcl_ros@154 253336fb-580f-4252-a368-f3cef5a2a82b
---
 trunk/fcl/include/fcl/octree.h | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/trunk/fcl/include/fcl/octree.h b/trunk/fcl/include/fcl/octree.h
index 48269add..6a4db448 100644
--- a/trunk/fcl/include/fcl/octree.h
+++ b/trunk/fcl/include/fcl/octree.h
@@ -53,7 +53,7 @@ namespace fcl
 class OcTree : public CollisionGeometry
 {
 private:
-  boost::shared_ptr<octomap::OcTree> tree;
+  boost::shared_ptr<const octomap::OcTree> tree;
 public:
 
   /// @brief OcTreeNode must implement the following interfaces:
@@ -63,10 +63,10 @@ public:
   typedef octomap::OcTreeNode OcTreeNode;
 
   /// @brief construct octree with a given resolution
-  OcTree(FCL_REAL resolution) : tree(boost::shared_ptr<octomap::OcTree>(new octomap::OcTree(resolution))) {}
+  OcTree(FCL_REAL resolution) : tree(boost::shared_ptr<const octomap::OcTree>(new octomap::OcTree(resolution))) {}
 
   /// @brief construct octree from octomap
-  OcTree(const boost::shared_ptr<octomap::OcTree>& tree_) : tree(tree_) {}
+  OcTree(const boost::shared_ptr<const octomap::OcTree>& tree_) : tree(tree_) {}
 
   /// @brief compute the AABB for the octree in its local coordinate system
   void computeLocalAABB() 
@@ -107,12 +107,6 @@ public:
     return (!isNodeOccupied(node)) && (!isNodeFree(node));
   }
 
-  /// @brief update the occupied information for a cell
-  inline void updateNode(FCL_REAL x, FCL_REAL y, FCL_REAL z, bool occupied)
-  {
-    tree->updateNode(octomap::point3d(x, y, z), occupied);
-  }
-
   /// @brief transform the octree into a bunch of boxes; uncertainty information is kept in the boxes. However, we
   /// only keep the occupied boxes (i.e., the boxes whose occupied probability is higher enough).
   inline std::vector<boost::array<FCL_REAL, 6> > toBoxes() const
-- 
GitLab