Point Cloud Library (PCL)  1.7.0
/tmp/buildd/pcl-1.7-1.7.0/octree/include/pcl/octree/octree_base.h
00001 /*
00002  * Software License Agreement (BSD License)
00003  *
00004  *  Point Cloud Library (PCL) - www.pointclouds.org
00005  *  Copyright (c) 2010-2012, Willow Garage, Inc.
00006  *
00007  *  All rights reserved.
00008  *
00009  *  Redistribution and use in source and binary forms, with or without
00010  *  modification, are permitted provided that the following conditions
00011  *  are met:
00012  *
00013  *   * Redistributions of source code must retain the above copyright
00014  *     notice, this list of conditions and the following disclaimer.
00015  *   * Redistributions in binary form must reproduce the above
00016  *     copyright notice, this list of conditions and the following
00017  *     disclaimer in the documentation and/or other materials provided
00018  *     with the distribution.
00019  *   * Neither the name of Willow Garage, Inc. nor the names of its
00020  *     contributors may be used to endorse or promote products derived
00021  *     from this software without specific prior written permission.
00022  *
00023  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00024  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00025  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00026  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00027  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00028  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00029  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00030  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00031  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00032  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00033  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00034  *  POSSIBILITY OF SUCH DAMAGE.
00035  *
00036  * $Id$
00037  */
00038 
00039 #ifndef PCL_OCTREE_TREE_BASE_H
00040 #define PCL_OCTREE_TREE_BASE_H
00041 
00042 #include <cstddef>
00043 #include <vector>
00044 
00045 #include "octree_nodes.h"
00046 #include "octree_container.h"
00047 #include "octree_key.h"
00048 #include "octree_iterator.h"
00049 
00050 namespace pcl
00051 {
00052   namespace octree
00053   {
00054     /** \brief Octree class
00055       * \note The tree depth defines the maximum amount of octree voxels / leaf nodes (should be initially defined).
00056       * \note All leaf nodes are addressed by integer indices.
00057       * \note Note: The tree depth equates to the bit length of the voxel indices.
00058      * \ingroup octree
00059      * \author Julius Kammerl (julius@kammerl.de)
00060      */
00061     template<typename LeafContainerT = int,
00062         typename BranchContainerT = OctreeContainerEmpty >
00063     class OctreeBase
00064     {
00065 
00066       public:
00067 
00068         typedef OctreeBase<LeafContainerT, BranchContainerT> OctreeT;
00069 
00070         typedef OctreeBranchNode<BranchContainerT> BranchNode;
00071         typedef OctreeLeafNode<LeafContainerT> LeafNode;
00072 
00073         typedef BranchContainerT BranchContainer;
00074         typedef LeafContainerT LeafContainer;
00075 
00076         // iterators are friends
00077         friend class OctreeIteratorBase<OctreeT> ;
00078         friend class OctreeDepthFirstIterator<OctreeT> ;
00079         friend class OctreeBreadthFirstIterator<OctreeT> ;
00080         friend class OctreeLeafNodeIterator<OctreeT> ;
00081 
00082         // Octree default iterators
00083         typedef OctreeDepthFirstIterator<OctreeT> Iterator;
00084         typedef const OctreeDepthFirstIterator<OctreeT> ConstIterator;
00085         Iterator begin(unsigned int max_depth_arg = 0) {return Iterator(this, max_depth_arg);};
00086         const Iterator end() {return Iterator();};
00087 
00088         // Octree leaf node iterators
00089         typedef OctreeLeafNodeIterator<OctreeT> LeafNodeIterator;
00090         typedef const OctreeLeafNodeIterator<OctreeT> ConstLeafNodeIterator;
00091         LeafNodeIterator leaf_begin(unsigned int max_depth_arg = 0) {return LeafNodeIterator(this, max_depth_arg);};
00092         const LeafNodeIterator leaf_end() {return LeafNodeIterator();};
00093 
00094         // Octree depth-first iterators
00095         typedef OctreeDepthFirstIterator<OctreeT> DepthFirstIterator;
00096         typedef const OctreeDepthFirstIterator<OctreeT> ConstDepthFirstIterator;
00097         DepthFirstIterator depth_begin(unsigned int max_depth_arg = 0) {return DepthFirstIterator(this, max_depth_arg);};
00098         const DepthFirstIterator depth_end() {return DepthFirstIterator();};
00099 
00100         // Octree breadth-first iterators
00101         typedef OctreeBreadthFirstIterator<OctreeT> BreadthFirstIterator;
00102         typedef const OctreeBreadthFirstIterator<OctreeT> ConstBreadthFirstIterator;
00103         BreadthFirstIterator breadth_begin(unsigned int max_depth_arg = 0) {return BreadthFirstIterator(this, max_depth_arg);};
00104         const BreadthFirstIterator breadth_end() {return BreadthFirstIterator();};
00105 
00106 
00107         /** \brief Empty constructor. */
00108         OctreeBase ();
00109 
00110         /** \brief Empty deconstructor. */
00111         virtual
00112         ~OctreeBase ();
00113 
00114         /** \brief Copy constructor. */
00115         OctreeBase (const OctreeBase& source) :
00116           leaf_count_ (source.leaf_count_),
00117           branch_count_ (source.branch_count_),
00118           root_node_ (new (BranchNode) (*(source.root_node_))),
00119           depth_mask_ (source.depth_mask_),
00120           octree_depth_ (source.octree_depth_),
00121           dynamic_depth_enabled_(source.dynamic_depth_enabled_),
00122           max_key_ (source.max_key_)
00123         {
00124         }
00125 
00126         /** \brief Copy operator. */
00127         OctreeBase&
00128         operator = (const OctreeBase &source)
00129         {
00130           leaf_count_ = source.leaf_count_;
00131           branch_count_ = source.branch_count_;
00132           root_node_ = new (BranchNode) (*(source.root_node_));
00133           depth_mask_ = source.depth_mask_;
00134           max_key_ = source.max_key_;
00135           octree_depth_ = source.octree_depth_;
00136           return (*this);
00137         }
00138 
00139         /** \brief Set the maximum amount of voxels per dimension.
00140           * \param[in] max_voxel_index_arg maximum amount of voxels per dimension
00141           */
00142         void
00143         setMaxVoxelIndex (unsigned int max_voxel_index_arg);
00144 
00145         /** \brief Set the maximum depth of the octree.
00146          *  \param max_depth_arg: maximum depth of octree
00147          * */
00148         void
00149         setTreeDepth (unsigned int max_depth_arg);
00150 
00151         /** \brief Get the maximum depth of the octree.
00152          *  \return depth_arg: maximum depth of octree
00153          * */
00154         unsigned int
00155         getTreeDepth () const
00156         {
00157           return this->octree_depth_;
00158         }
00159 
00160         /** \brief Create new leaf node at (idx_x_arg, idx_y_arg, idx_z_arg).
00161          *  \note If leaf node already exist, this method returns the existing node
00162          *  \param idx_x_arg: index of leaf node in the X axis.
00163          *  \param idx_y_arg: index of leaf node in the Y axis.
00164          *  \param idx_z_arg: index of leaf node in the Z axis.
00165          *  \return pointer to new leaf node container.
00166          * */
00167         LeafContainerT*
00168         createLeaf (unsigned int idx_x_arg, unsigned int idx_y_arg, unsigned int idx_z_arg);
00169 
00170         /** \brief Find leaf node at (idx_x_arg, idx_y_arg, idx_z_arg).
00171          *  \note If leaf node already exist, this method returns the existing node
00172          *  \param idx_x_arg: index of leaf node in the X axis.
00173          *  \param idx_y_arg: index of leaf node in the Y axis.
00174          *  \param idx_z_arg: index of leaf node in the Z axis.
00175          *  \return pointer to leaf node container if found, null pointer otherwise.
00176          * */
00177         LeafContainerT*
00178         findLeaf (unsigned int idx_x_arg, unsigned int idx_y_arg, unsigned int idx_z_arg);
00179 
00180         /** \brief idx_x_arg for the existence of leaf node at (idx_x_arg, idx_y_arg, idx_z_arg).
00181          *  \param idx_x_arg: index of leaf node in the X axis.
00182          *  \param idx_y_arg: index of leaf node in the Y axis.
00183          *  \param idx_z_arg: index of leaf node in the Z axis.
00184          *  \return "true" if leaf node search is successful, otherwise it returns "false".
00185          * */
00186         bool
00187         existLeaf (unsigned int idx_x_arg, unsigned int idx_y_arg, unsigned int idx_z_arg) const ;
00188 
00189         /** \brief Remove leaf node at (idx_x_arg, idx_y_arg, idx_z_arg).
00190          *  \param idx_x_arg: index of leaf node in the X axis.
00191          *  \param idx_y_arg: index of leaf node in the Y axis.
00192          *  \param idx_z_arg: index of leaf node in the Z axis.
00193          * */
00194         void
00195         removeLeaf (unsigned int idx_x_arg, unsigned int idx_y_arg, unsigned int idx_z_arg);
00196 
00197         /** \brief Return the amount of existing leafs in the octree.
00198          *  \return amount of registered leaf nodes.
00199          * */
00200         std::size_t
00201         getLeafCount () const
00202         {
00203           return leaf_count_;
00204         }
00205 
00206         /** \brief Return the amount of existing branch nodes in the octree.
00207          *  \return amount of branch nodes.
00208          * */
00209         std::size_t
00210         getBranchCount () const
00211         {
00212           return branch_count_;
00213         }
00214 
00215         /** \brief Delete the octree structure and its leaf nodes.
00216          * */
00217         void
00218         deleteTree ( );
00219 
00220         /** \brief Serialize octree into a binary output vector describing its branch node structure.
00221          *  \param binary_tree_out_arg: reference to output vector for writing binary tree structure.
00222          * */
00223         void
00224         serializeTree (std::vector<char>& binary_tree_out_arg);
00225 
00226         /** \brief Serialize octree into a binary output vector describing its branch node structure and push all LeafContainerT elements stored in the octree to a vector.
00227          * \param binary_tree_out_arg: reference to output vector for writing binary tree structure.
00228          * \param leaf_container_vector_arg: pointer to all LeafContainerT objects in the octree
00229          * */
00230         void
00231         serializeTree (std::vector<char>& binary_tree_out_arg, std::vector<LeafContainerT*>& leaf_container_vector_arg);
00232 
00233         /** \brief Outputs a vector of all LeafContainerT elements that are stored within the octree leaf nodes.
00234          *  \param leaf_container_vector_arg: pointers to LeafContainerT vector that receives a copy of all LeafContainerT objects in the octree.
00235          * */
00236         void
00237         serializeLeafs (std::vector<LeafContainerT*>& leaf_container_vector_arg);
00238 
00239         /** \brief Deserialize a binary octree description vector and create a corresponding octree structure. Leaf nodes are initialized with getDataTByKey(..).
00240          *  \param binary_tree_input_arg: reference to input vector for reading binary tree structure.
00241          * */
00242         void
00243         deserializeTree (std::vector<char>& binary_tree_input_arg);
00244 
00245         /** \brief Deserialize a binary octree description and create a corresponding octree structure. Leaf nodes are initialized with LeafContainerT elements from the dataVector.
00246          *  \param binary_tree_input_arg: reference to input vector for reading binary tree structure.
00247          *  \param leaf_container_vector_arg: pointer to container vector.
00248          * */
00249         void
00250         deserializeTree (std::vector<char>& binary_tree_input_arg, std::vector<LeafContainerT*>& leaf_container_vector_arg);
00251 
00252       protected:
00253         
00254         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
00255         // Protected octree methods based on octree keys
00256         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
00257 
00258         /** \brief Create a leaf node
00259          *  \param key_arg: octree key addressing a leaf node.
00260          *  \return pointer to leaf node
00261          * */
00262         LeafContainerT*
00263         createLeaf (const OctreeKey& key_arg)
00264         {
00265 
00266           LeafNode* leaf_node;
00267           BranchNode* leaf_node_parent;
00268 
00269           createLeafRecursive (key_arg, depth_mask_ ,root_node_, leaf_node, leaf_node_parent);
00270 
00271           LeafContainerT* ret = leaf_node->getContainerPtr();
00272 
00273           return ret;
00274         }
00275 
00276         /** \brief Find leaf node
00277          *  \param key_arg: octree key addressing a leaf node.
00278          *  \return pointer to leaf node. If leaf node is not found, this pointer returns 0.
00279          * */
00280         LeafContainerT*
00281         findLeaf (const OctreeKey& key_arg) const
00282         {
00283           LeafContainerT* result = 0;
00284           findLeafRecursive (key_arg, depth_mask_, root_node_, result);
00285           return result;
00286         }
00287 
00288         /** \brief Check for existance of a leaf node in the octree
00289          *  \param key_arg: octree key addressing a leaf node.
00290          *  \return "true" if leaf node is found; "false" otherwise
00291          * */
00292         bool
00293         existLeaf (const OctreeKey& key_arg) const
00294         {
00295           return (findLeaf(key_arg) != 0);
00296         }
00297 
00298         /** \brief Remove leaf node from octree
00299          *  \param key_arg: octree key addressing a leaf node.
00300          * */
00301         void
00302         removeLeaf (const OctreeKey& key_arg)
00303         {
00304           if (key_arg <= max_key_)
00305             deleteLeafRecursive (key_arg, depth_mask_, root_node_);
00306         }
00307 
00308         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
00309         // Branch node access functions
00310         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
00311 
00312         /** \brief Retrieve root node */
00313         OctreeNode*
00314         getRootNode () const
00315         {
00316           return this->root_node_;
00317         }
00318 
00319         /** \brief Check if branch is pointing to a particular child node
00320          *  \param branch_arg: reference to octree branch class
00321          *  \param child_idx_arg: index to child node
00322          *  \return "true" if pointer to child node exists; "false" otherwise
00323          * */
00324         bool
00325         branchHasChild (const BranchNode& branch_arg,
00326                         unsigned char child_idx_arg) const
00327         {
00328           // test occupancyByte for child existence
00329           return (branch_arg.getChildPtr(child_idx_arg) != 0);
00330         }
00331 
00332         /** \brief Retrieve a child node pointer for child node at child_idx.
00333          * \param branch_arg: reference to octree branch class
00334          * \param child_idx_arg: index to child node
00335          * \return pointer to octree child node class
00336          */
00337         OctreeNode*
00338         getBranchChildPtr (const BranchNode& branch_arg,
00339                            unsigned char child_idx_arg) const
00340         {
00341           return branch_arg.getChildPtr(child_idx_arg);
00342         }
00343 
00344         /** \brief Assign new child node to branch
00345          *  \param branch_arg: reference to octree branch class
00346          *  \param child_idx_arg: index to child node
00347          *  \param new_child_arg: pointer to new child node
00348          * */
00349         void setBranchChildPtr (BranchNode& branch_arg,
00350                                 unsigned char child_idx_arg,
00351                                 OctreeNode* new_child_arg)
00352         {
00353           branch_arg[child_idx_arg] = new_child_arg;
00354         }
00355 
00356         /** \brief Generate bit pattern reflecting the existence of child node pointers
00357          *  \param branch_arg: reference to octree branch class
00358          *  \return a single byte with 8 bits of child node information
00359          * */
00360         char
00361         getBranchBitPattern (const BranchNode& branch_arg) const
00362         {
00363           unsigned char i;
00364           char node_bits;
00365 
00366           // create bit pattern
00367           node_bits = 0;
00368           for (i = 0; i < 8; i++) {
00369             const OctreeNode* child = branch_arg.getChildPtr(i);
00370             node_bits |= static_cast<char> ((!!child) << i);
00371           }
00372 
00373           return (node_bits);
00374         }
00375 
00376         /** \brief Delete child node and all its subchilds from octree
00377          *  \param branch_arg: reference to octree branch class
00378          *  \param child_idx_arg: index to child node
00379          * */
00380         void
00381         deleteBranchChild (BranchNode& branch_arg, unsigned char child_idx_arg)
00382         {
00383           if (branch_arg.hasChild(child_idx_arg))
00384           {
00385             OctreeNode* branch_child = branch_arg[child_idx_arg];
00386             
00387             switch (branch_child->getNodeType ())
00388             {
00389               case BRANCH_NODE:
00390               {
00391                 // free child branch recursively
00392                 deleteBranch (*static_cast<BranchNode*> (branch_child));
00393                 // delete branch node
00394                 delete branch_child;
00395               }
00396                 break;
00397 
00398               case LEAF_NODE:
00399               {
00400                 // delete leaf node
00401                 delete branch_child;
00402                 break;
00403               }
00404               default:
00405                 break;
00406             }
00407 
00408             // set branch child pointer to 0
00409             branch_arg[child_idx_arg] = 0;
00410           }
00411         }
00412 
00413         /** \brief Delete branch and all its subchilds from octree
00414          *  \param branch_arg: reference to octree branch class
00415          * */
00416         void
00417         deleteBranch (BranchNode& branch_arg)
00418         {
00419           char i;
00420 
00421           // delete all branch node children
00422           for (i = 0; i < 8; i++)
00423             deleteBranchChild (branch_arg, i);
00424         }
00425 
00426         /** \brief Create and add a new branch child to a branch class
00427          *  \param branch_arg: reference to octree branch class
00428          *  \param child_idx_arg: index to child node
00429          *  \return pointer of new branch child to this reference
00430          * */
00431         BranchNode* createBranchChild (BranchNode& branch_arg,
00432                                        unsigned char child_idx_arg)
00433         {
00434           BranchNode* new_branch_child = new BranchNode();
00435           branch_arg[child_idx_arg] = static_cast<OctreeNode*> (new_branch_child);
00436 
00437           return new_branch_child;
00438         }
00439 
00440         /** \brief Create and add a new leaf child to a branch class
00441          *  \param branch_arg: reference to octree branch class
00442          *  \param child_idx_arg: index to child node
00443          *  \return pointer of new leaf child to this reference
00444          * */
00445         LeafNode*
00446         createLeafChild (BranchNode& branch_arg, unsigned char child_idx_arg)
00447         {
00448           LeafNode* new_leaf_child = new LeafNode();
00449           branch_arg[child_idx_arg] = static_cast<OctreeNode*> (new_leaf_child);
00450 
00451           return new_leaf_child;
00452         }
00453 
00454         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
00455         // Recursive octree methods
00456         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
00457 
00458         /** \brief Create a leaf node at octree key. If leaf node does already exist, it is returned.
00459          *  \param key_arg: reference to an octree key
00460          *  \param depth_mask_arg: depth mask used for octree key analysis and for branch depth indicator
00461          *  \param branch_arg: current branch node
00462          *  \param return_leaf_arg: return pointer to leaf node
00463          *  \param parent_of_leaf_arg: return pointer to parent of leaf node
00464          *  \return depth mask at which leaf node was created
00465          **/
00466         unsigned int
00467         createLeafRecursive (const OctreeKey& key_arg,
00468                              unsigned int depth_mask_arg,
00469                              BranchNode* branch_arg,
00470                              LeafNode*& return_leaf_arg,
00471                              BranchNode*& parent_of_leaf_arg);
00472 
00473         /** \brief Recursively search for a given leaf node and return a pointer.
00474          *  \note  If leaf node does not exist, a 0 pointer is returned.
00475          *  \param key_arg: reference to an octree key
00476          *  \param depth_mask_arg: depth mask used for octree key analysis and for branch depth indicator
00477          *  \param branch_arg: current branch node
00478          *  \param result_arg: pointer to leaf node class
00479          **/
00480         void
00481         findLeafRecursive (const OctreeKey& key_arg,
00482                            unsigned int depth_mask_arg,
00483                            BranchNode* branch_arg,
00484                            LeafContainerT*& result_arg) const;
00485 
00486         /** \brief Recursively search and delete leaf node
00487          *  \param key_arg: reference to an octree key
00488          *  \param depth_mask_arg: depth mask used for octree key analysis and branch depth indicator
00489          *  \param branch_arg: current branch node
00490          *  \return "true" if branch does not contain any childs; "false" otherwise. This indicates if current branch can be deleted, too.
00491          **/
00492         bool
00493         deleteLeafRecursive (const OctreeKey& key_arg,
00494                              unsigned int depth_mask_arg,
00495                              BranchNode* branch_arg);
00496 
00497         /** \brief Recursively explore the octree and output binary octree description together with a vector of leaf node LeafContainerTs.
00498          *  \param branch_arg: current branch node
00499          *  \param key_arg: reference to an octree key
00500          *  \param binary_tree_out_arg: binary output vector
00501          *  \param leaf_container_vector_arg: writes LeafContainerT pointers to this LeafContainerT* vector.
00502          **/
00503         void
00504         serializeTreeRecursive (const BranchNode* branch_arg,
00505                                 OctreeKey& key_arg,
00506                                 std::vector<char>* binary_tree_out_arg,
00507                                 typename std::vector<LeafContainerT*>* leaf_container_vector_arg) const;
00508 
00509          /** \brief Recursive method for deserializing octree structure
00510           *  \param branch_arg: current branch node
00511           *  \param depth_mask_arg: depth mask used for octree key analysis and branch depth indicator
00512           *  \param key_arg: reference to an octree key
00513           *  \param binary_tree_input_it_arg: iterator to binary input vector
00514           *  \param binary_tree_input_it_end_arg: end iterator of binary input vector
00515           *  \param leaf_container_vector_it_arg: iterator pointing to current LeafContainerT object to be added to a leaf node
00516           *  \param leaf_container_vector_it_end_arg: iterator pointing to last object in LeafContainerT input vector.
00517          **/
00518         void
00519         deserializeTreeRecursive (BranchNode* branch_arg, unsigned int depth_mask_arg, OctreeKey& key_arg,
00520                                   typename std::vector<char>::const_iterator& binary_tree_input_it_arg,
00521                                   typename std::vector<char>::const_iterator& binary_tree_input_it_end_arg,
00522                                   typename std::vector<LeafContainerT*>::const_iterator* leaf_container_vector_it_arg,
00523                                   typename std::vector<LeafContainerT*>::const_iterator* leaf_container_vector_it_end_arg);
00524 
00525 
00526          //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
00527         // Serialization callbacks
00528         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
00529 
00530         /** \brief Callback executed for every leaf node during serialization
00531          **/
00532         virtual void
00533         serializeTreeCallback (LeafContainerT&, const OctreeKey &) const
00534         {
00535 
00536         }
00537 
00538         /** \brief Callback executed for every leaf node during deserialization
00539          **/
00540         virtual void
00541         deserializeTreeCallback (LeafContainerT&, const OctreeKey&)
00542         {
00543 
00544         }
00545 
00546         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
00547         // Helpers
00548         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
00549 
00550         /** \brief Helper function to calculate the binary logarithm
00551          * \param n_arg: some value
00552          * \return binary logarithm (log2) of argument n_arg
00553          */
00554         double
00555         Log2 (double n_arg)
00556         {
00557           return log( n_arg ) / log( 2.0 );
00558         }
00559 
00560         /** \brief Test if octree is able to dynamically change its depth. This is required for adaptive bounding box adjustment.
00561          *  \return "true"
00562          **/
00563         bool
00564         octreeCanResize ()
00565         {
00566           return (true);
00567         }
00568 
00569         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
00570         // Globals
00571         //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
00572 
00573         /** \brief Amount of leaf nodes   **/
00574         std::size_t leaf_count_;
00575 
00576         /** \brief Amount of branch nodes   **/
00577         std::size_t branch_count_;
00578 
00579         /** \brief Pointer to root branch node of octree   **/
00580         BranchNode* root_node_;
00581 
00582         /** \brief Depth mask based on octree depth   **/
00583         unsigned int depth_mask_;
00584 
00585         /** \brief Octree depth */
00586         unsigned int octree_depth_;
00587 
00588         /** \brief Enable dynamic_depth **/
00589         bool dynamic_depth_enabled_;
00590 
00591         /** \brief key range */
00592         OctreeKey max_key_;
00593     };
00594   }
00595 }
00596 
00597 //#include "impl/octree_base.hpp"
00598 
00599 #endif
00600