opennurbs_rtree.h
Go to the documentation of this file.
00001 /* $NoKeywords: $ */
00002 /*
00003 //
00004 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
00005 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
00006 // McNeel & Associates.
00007 //
00008 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
00009 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
00010 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
00011 //                              
00012 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
00013 //
00015 */
00016 
00017 #if !defined(OPENNURBS_RTREE_INC_)
00018 #define OPENNURBS_RTREE_INC_
00019 
00020 /*
00021 The opennurbs rtree code is a modifed version of the
00022 free and unrestricted R-tree implementation obtianed from 
00023 http://www.superliminal.com/sources/sources.htm
00024 
00025 The first lines on the website indicate the code is free and unrestricted:
00026 
00027   Free Source Code
00028   Here are a few useful bits of free source code. 
00029   You're completely free to use them for any purpose whatsoever.
00030   All I ask is that if you find one to be particularly valuable, 
00031   then consider sending feedback. Please send bugs and suggestions too. 
00032   Enjoy 
00033 
00034 The readme.txt file included with the R-tree source says
00035 
00036   LICENSE:
00037     Entirely free for all uses. Enjoy!
00038 
00039 The original authors are 
00040 
00041 AUTHORS
00042  * 1983 Original algorithm and test code by Antonin Guttman and Michael Stonebraker, UC Berkely
00043  * 1994 ANCI C ported from original test code by Melinda Green - melinda@superliminal.com
00044  * 1995 Sphere volume fix for degeneracy problem submitted by Paul Brook
00045  * 2004 Templated C++ port by Greg Douglas
00046 
00047 The opennurbs version adds some custom memory allocation and replaces
00048 the leaf iterator.  The rest of the changes are cosmetic.
00049 
00050 */
00051 
00052 
00053 
00054 // Minimum and maximum number of elements 
00055 // in ON_RTreeNode::m_branch[].
00056 // must have ON_RTree_MAX_NODE_COUNT > ON_RTree_MIN_NODE_COUNT
00057 #define ON_RTree_MIN_NODE_COUNT 2
00058 #define ON_RTree_MAX_NODE_COUNT 6
00059 
00060 /*
00061 In a test of a sphere mesh with mesh: 8385 vertices, 8192 polygons
00062 and ON_RTree_MAX_NODE_COUNT = 3, 4, 5, and 6, the memory use was 
00063 most efficient with ON_RTree_MAX_NODE_COUNT=6
00064 
00065 Memory Usage MAX_NODE_COUNT = 3
00066   ON_RTree: 1212 KB (1241136) (352 wasted)
00067   ON_RTree: 7036 nodes, 5881 unused branches (321 KB) 0.835844 per node
00068 
00069 Memory Usage MAX_NODE_COUNT = 4
00070   ON_RTree: 1152 KB (1179720) (5568 wasted)
00071   ON_RTree: 5051 nodes, 6962 unused branches (380 KB) 1.37834 per node
00072 
00073 Memory Usage MAX_NODE_COUNT = 5
00074   ON_RTree: 1040 KB (1065504) (11808 wasted)
00075   ON_RTree: 3655 nodes, 6429 unused branches (351 KB) 1.75896 per node
00076 
00077 Memory Usage MAX_NODE_COUNT = 6
00078   ON_RTree:  995 KB (1019592) (3440 wasted)
00079   ON_RTree: 2951 nodes, 6564 unused branches (358 KB) 2.22433 per node
00080 */
00081 
00082 // This struct is used instead of ON_BoundingBox to avoid calling
00083 // constructors.
00084 struct ON_RTreeBBox
00085 {
00086   double m_min[3];
00087   double m_max[3];
00088 };
00089 
00090 struct ON_RTreeSphere
00091 {
00092   double m_point[3];
00093   double m_radius;
00094 };
00095 
00096 struct ON_RTreeCapsule
00097 {
00098   double m_point[2][3];
00099   double m_radius;
00100   double m_domain[2];
00101 };
00102 
00103 struct ON_RTreeBranch
00104 {
00105   ON_RTreeBBox m_rect;
00106 
00107   // If ON_RTreeNode.m_level > 0, then m_child points to a child node.
00108   // If ON_RTreeNode.m_level == 0, then m_id identifies the leaf element.
00109   union
00110   {
00111     struct ON_RTreeNode* m_child;
00112     ON__INT_PTR m_id;
00113   };
00114 };
00115 
00116 struct ON_RTreeLeaf
00117 {
00118   ON_RTreeBBox m_rect;
00119   ON__INT_PTR m_id;
00120 };
00121 
00122 // The ON_RTreeNode is used at root, branch and leaf nodes.
00123 // When m_level > 0, the node is a branch.
00124 // When m_level = 0, the node is a leaf.
00125 struct ON_RTreeNode
00126 {
00127   inline bool IsInternalNode() const
00128     { return (m_level > 0); }  // internal nodes have m_level > 0
00129   inline bool IsLeaf() const
00130     { return (m_level == 0); } // branch nodes have m_level = 0
00131 
00132   // m_level must be a signed int to insure signed compares work correctly
00133   int m_level;  // =0 at leaf nodes, > 0 at branch nodes
00134 
00135   // The m_branch[] array contains m_count elements
00136   // 0 <= m_count <= ON_RTree_MAX_NODE_COUNT
00137   // m_count must be a signed int to insure signed compares work correctly
00138   int m_count; 
00139   ON_RTreeBranch m_branch[ON_RTree_MAX_NODE_COUNT];
00140 };
00141 
00142 struct ON_RTreeSearchResult
00143 {
00144   int m_capacity;   // m_id[] array capacity (search terminates when m_count == m_capacity)
00145   int m_count;      // number of elements in m_id[]
00146   ON__INT_PTR* m_id; // m_id[] = array of search results.
00147 };
00148 
00149 class ON_CLASS ON_RTreeMemPool
00150 {
00151 public:
00152   ON_RTreeMemPool( ON_MEMORY_POOL* heap, size_t leaf_count );
00153   ~ON_RTreeMemPool();
00154 
00155   ON_RTreeNode* AllocNode();
00156   void FreeNode(ON_RTreeNode* node);
00157 
00158   struct ON_RTreeListNode* AllocListNode();
00159   void FreeListNode(struct ON_RTreeListNode* list_node);
00160 
00161   void DeallocateAll();
00162 
00163   /*
00164   Returns:
00165     Total number of bytes of heap memory allocated.
00166   */
00167   size_t SizeOf() const;
00168 
00169   /*
00170   Returns:
00171     Number of bytes of heap memory not currently in use.
00172   */
00173   size_t SizeOfUnusedBuffer() const;
00174 
00175 private:
00176   void GrowBuffer();
00177 
00178   struct Blk
00179   {
00180     struct Blk* m_next;
00181   };
00182 
00183   // linked list of unused ON_RTreeNode 
00184   struct Blk* m_nodes;
00185   // linked list of unused ON_RTreeListNode
00186   struct Blk* m_list_nodes;
00187 
00188   // buffer for new allocations
00189   unsigned char* m_buffer;
00190   size_t m_buffer_capacity;
00191 
00192   struct Blk* m_blk_list;   // linked list used to free all allocated memory
00193   size_t m_sizeof_blk;      // total amount of memory in each block.
00194 
00195   ON_MEMORY_POOL* m_heap;
00196   size_t m_sizeof_heap; // total amount of heap memory in this rtree
00197 };
00198 
00200 //
00201 // ON_RTreeIterator
00202 //
00203 //   The ON_RTreeIterator class can be used to iterate each leaf 
00204 //   in an ON_RTree.
00205 //
00206 class ON_CLASS ON_RTreeIterator
00207 {
00208 public:
00209   /*
00210   Description:
00211     Construct an empty iterator.  Call Initialize() to attach
00212     the iterator to an R-tree.
00213   Remark:
00214     Any calls to ON_RTree::Insert() or ON_RTree::Remove() that modify
00215     an R-tree being iterated invalidate the iterator.  The iterator
00216     must be re-initialized before being used again.
00217 
00218     There is no connection between the order elements are inserted
00219     in an R-tree and the order the elements are iterated by an
00220     iterator.    
00221   */
00222   ON_RTreeIterator();
00223   ON_RTreeIterator(const class ON_RTree& a_rtree);
00224 
00225   ~ON_RTreeIterator();
00226 
00227   /*
00228   Description:
00229     Initialize an iterator to iterate every leaf in the rtree.
00230   Parameters:
00231     a_rtree - [in]
00232       R-tree to iterate
00233   Example:
00234     See the comment for ON_RTreeIterator::First().
00235   Returns:
00236     True if a_rtree has at least one element.
00237   Remarks:
00238     Any calls to ON_RTree::Insert() or ON_RTree::Remove() that modify
00239     this node or its children will invalidate this iterator and it
00240     must be re-initialized.
00241 
00242     There is no connection between the order elements are inserted
00243     in an R-tree and the order the elements are iterated by an
00244     iterator.    
00245   */
00246   bool Initialize(const class ON_RTree& a_rtree);
00247 
00248   /*
00249   Description:
00250     Initialize an iterator to iterate every leaf on or below a_node.
00251   Parameters:
00252     a_node - [in]
00253       R-tree node to iterate
00254   Example:
00255     See the comment for ON_RTreeIterator::First().
00256   Returns:
00257     True if a_node has at least one element.
00258   Remarks:
00259     Any calls to ON_RTree::Insert() or ON_RTree::Remove() that modify
00260     this node or its children will invalidate this iterator and it
00261     must be re-initialized.
00262 
00263     There is no connection between the order elements are inserted
00264     in an R-tree and the order the elements are iterated by an
00265     iterator.    
00266   */
00267   bool Initialize(const struct ON_RTreeNode* a_node);
00268 
00269   /*
00270   Description:
00271     Get the value of the current leaf element. Calling Value()
00272     does not increment or decrement the iterator.
00273   Example:
00274     See the comment for ON_RTreeIterator::First().
00275   Return:
00276     Null pointer if there are no more leaves to iterate
00277     A pointer to the current R-tree leaf.  When there are no more leaves,
00278     the returned pointer is null.
00279   */
00280   const ON_RTreeBranch* Value() const;
00281 
00282   /*
00283   Description:
00284     Reset the iterator so the current leaf is the first leaf in
00285     the R-tree.  The Initialize() functions automatically do
00286     this, but First() can be called if an iterator needs to be
00287     used more than once or to make code easy to read and understand.
00288   Example:
00289     Iterate every leaf in an R-tree.
00290 
00291           ON_RTree rtree;
00292           ...
00293           ON_RtreeIterator rit(rtree);
00294           const ON_RTreeBranch* rtree_leaf;
00295           for ( rit.First(); 0 != (rtree_leaf = rit.Value()); rit.Next() )
00296           {
00297             // leaf id           = rtree_leaf->m_id
00298             // leaf bounding box = rtree->m_rect
00299           }
00300 
00301   Returns:
00302     True if a call to Value() will return a non-null pointer.
00303   See Also:
00304     ON_RTreeIterator::Last();
00305   */
00306   bool First();
00307 
00308   /*
00309   Description:
00310     Increment the iterator to the next leaf in the R-tree.
00311   Example:
00312     See the comment for ON_RTreeIterator::First()
00313   Returns:
00314     True if a call to Value() will return a non-null pointer.
00315     False if there is not a next leaf and all susequent calls to
00316     Value() will return null.
00317   See Also:
00318     ON_RTreeIterator::Prev();
00319   */
00320   bool Next();
00321 
00322 
00323   /*
00324   Description:
00325     Set the iterator so the current leaf is the last leaf in the R-tree.
00326 
00327   Example:
00328     Iterate an R-tree in reverse order.
00329 
00330           ON_RTree rtree;
00331           ...
00332           ON_RTreeIterator rit(rtree);
00333           const ON_RTreeBranch* rtree_leaf;
00334           for ( rit.Last(); 0 != (rtree_leaf = rit.Value()); rit.Prev() )
00335           {
00336             // leaf id           = rtree_leaf->m_id
00337             // leaf bounding box = rtree->m_rect
00338           }
00339 
00340   Returns:
00341     True if a call to Value() will return a non-null pointer.
00342   See Also:
00343     ON_RTreeIterator::First();
00344   */
00345   bool Last();
00346 
00347   /*
00348   Description:
00349     Decrement the iterator to the previous leaf in the R-tree.
00350   Example:
00351     See the comment for ON_RTreeIterator::Last()
00352   Returns:
00353     True if a call to Value() will return a non-null pointer.
00354     False if there is not a previous leaf and all susequent calls to
00355     Value() will return null.
00356   See Also:
00357     ON_RTreeIterator::Next();
00358   */
00359   bool Prev();
00360 
00361 private:
00362   enum { MAX_STACK = 32 }; //  Max stack size. Allows almost n^32 where n is number of branches in node
00363   
00364   struct StackElement
00365   {
00366     const struct ON_RTreeNode* m_node;
00367     int m_branchIndex; // must be a signed int to insure signed compares work correctly
00368   };
00369 
00370   bool PushChildren(struct StackElement* sp, bool bFirstChild);
00371 
00372   StackElement  m_stack[MAX_STACK]; // stack
00373   StackElement* m_sp;               // stack pointer (null or points into m_stack[])
00374   const ON_RTreeNode* m_root;       // root of tree being iterated
00375 };
00376 
00377 
00378 class ON_CLASS ON_RTree
00379 {
00380 public:
00381   ON_RTree( ON_MEMORY_POOL* heap = 0, size_t leaf_count = 0 );
00382   ~ON_RTree();
00383 
00384   /*
00385   Description:
00386     Create an R-tree with an element for each face in the mesh.
00387     The element id is set to the index of the face.
00388   Parameters:
00389     mesh - [in]
00390   Returns:
00391     True if successful.
00392   */
00393   bool CreateMeshFaceTree( const class ON_Mesh* mesh );
00394   
00395   /*
00396   Description:
00397     Insert an element into the RTree.
00398   Parameters:
00399     a_min - [in]
00400     a_max - [in]
00401       3d bounding box of the element.  The values in a_min[3] and a_max[3]
00402       must satisfy
00403       a_min[0] <= a_max[0], 
00404       a_min[1] <= a_max[1], and
00405       a_min[1] <= a_max[1].
00406     a_dataId - [in]
00407       id of the element.  This can be either a pointer or an integer id.
00408   Returns:
00409     True if element was successfully inserted.
00410   Remarks:
00411     Calling Insert() or Remove() invalidates any ON_RTreeIterator
00412     used to iterate this rtree. 
00413   */
00414   bool Insert(const double a_min[3], const double a_max[3], void* a_element_id);
00415   bool Insert(const double a_min[3], const double a_max[3], int a_element_id);
00416   bool Insert2d(const double a_min[2], const double a_max[2], void* a_element_id);
00417   bool Insert2d(const double a_min[2], const double a_max[2], int a_element_id);
00418   
00419   /*
00420   Description:
00421     Remove an element from the RTree.
00422   Parameters:
00423     a_min - [in]
00424     a_max - [in]
00425       3d bounding box of the element.  The values in a_min[3] and a_max[3]
00426       must satisfy
00427       a_min[0] <= a_max[0], 
00428       a_min[1] <= a_max[1], and
00429       a_min[2] <= a_max[2].
00430     a_dataId - [in]
00431       id of the element.  This can be either a pointer or an integer id.
00432   Returns:
00433     True if element was successfully removed.
00434   Remarks:
00435     Calling Insert() or Remove() invalidates any ON_RTreeIterator
00436     used to iterate this rtree. 
00437   */
00438   bool Remove(const double a_min[3], const double a_max[3], void* a_elementId);
00439   bool Remove(const double a_min[3], const double a_max[3], int a_elementId);
00440   bool Remove2d(const double a_min[2], const double a_max[2], void* a_elementId);
00441   bool Remove2d(const double a_min[2], const double a_max[2], int a_elementId);
00442   
00443   /*
00444   Description:
00445     Remove all elements from the R-tree.
00446   */
00447   void RemoveAll();
00448 
00449   /*
00450   Description:
00451     Search the R-tree for all elements whose bounding boxes overlap
00452     a_rect.
00453   Parameters:
00454     a_rect - [in/out]
00455       The version of search that has ON_RTreeBBox* a_rect as the first
00456       argument, allows you to shrink the a_rect as the search progresses.
00457       This is useful for doing things like searching for closest points.
00458       If you want to shrink a_rect, you must use a_context to pass it
00459       to the resultCallback function and shrink it in the resultCallback
00460       function. In the callback, the modified rect must be contained
00461       in the previous rect.
00462     a_sphere - [in/out]
00463       The version of search that has ON_RTreeSphere* a_sphere as the first
00464       argument, allows you to shrink the a_sphere as the search progresses.
00465       This is useful for doing things like searching for closest points.
00466       If you want to shrink a_sphere, you must use a_context to pass it
00467       to the resultCallback function and shrink it in the resultCallback
00468       function. In the callback, the modified sphere must be contained
00469       in the previous sphere.
00470     a_capsule - [in/out]
00471       The version of search that has ON_RTreeSphere* a_capsule as the first
00472       argument, allows you to shrink the a_capsule as the search progresses.
00473       This is useful for doing things like searching for closest points.
00474       If you want to shrink a_capsule, you must use a_context to pass it
00475       to the resultCallback function and shrink it in the resultCallback
00476       function. In the callback, the modified capsule must be contained
00477       in the previous capsule.
00478     a_min - [in]
00479     a_max - [in]
00480       (a_min,a_max) is the bounding box of the search region.
00481     a_results - [out]
00482       The ids of elements that overlaps the search region.
00483     resultCallback - [in]
00484       A function to call when leaf nodes overlap.
00485     a_context - [in]
00486       pointer passed to the resultCallback() function.
00487   Returns:
00488     True if entire tree was searched.  It is possible no results were found.
00489   Remarks:
00490     If you are using a Search() that uses a resultCallback() function,
00491     then return true to keep searching and false to terminate the search.
00492   */
00493   bool Search( 
00494     ON_RTreeSphere* a_sphere,
00495     bool ON_MSC_CDECL resultCallback(void* a_context, ON__INT_PTR a_id), 
00496     void* a_context
00497     ) const;
00498 
00499   bool Search( 
00500     ON_RTreeCapsule* a_capsule,
00501     bool ON_MSC_CDECL resultCallback(void* a_context, ON__INT_PTR a_id), 
00502     void* a_context
00503     ) const;
00504 
00505   bool Search( 
00506     ON_RTreeBBox* a_rect,
00507     bool ON_MSC_CDECL resultCallback(void* a_context, ON__INT_PTR a_id), 
00508     void* a_context
00509     ) const;
00510 
00511   /*
00512   Description:
00513     Search the R-tree for all elements whose bounding boxes overlap
00514     the set of points between to parallel planes.
00515   Parameters:
00516     a_plane_eqn - [in]
00517     a_min - [in]
00518     a_max - [in]
00519       The region between the parallel planes is the set point points
00520       where the value of the plane equation is >= a_min and <= a_max.
00521     resultCallback - [in]
00522       A function to call when leaf nodes overlap the region between
00523       the parallel planes.
00524     a_context - [in]
00525       pointer passed to the resultCallback() function.
00526   Returns:
00527     True if entire tree was searched.  It is possible no results were found.
00528   Remarks:
00529     If you are using a Search() that uses a resultCallback() function,
00530     then return true to keep searching and false to terminate the search.
00531   */
00532   bool Search(
00533     const double a_plane_eqn[4],
00534     double a_min,
00535     double a_max,
00536     bool ON_MSC_CDECL resultCallback(void* a_context, ON__INT_PTR a_id), 
00537     void* a_context
00538     ) const;
00539 
00540   bool Search(const double a_min[3], const double a_max[3],
00541     bool ON_MSC_CDECL resultCallback(void* a_context, ON__INT_PTR a_id), void* a_context 
00542     ) const;
00543 
00544         bool Search(const double a_min[3], const double a_max[3],
00545     ON_RTreeSearchResult& a_result 
00546     ) const;
00547 
00548         bool Search(const double a_min[3], const double a_max[3],
00549     ON_SimpleArray<ON_RTreeLeaf>& a_result 
00550     ) const;
00551 
00552   bool Search(const double a_min[3], const double a_max[3],
00553     ON_SimpleArray<void*>& a_result 
00554     ) const;
00555 
00556   bool Search(const double a_min[3], const double a_max[3],
00557     ON_SimpleArray<int>& a_result 
00558     ) const;
00559 
00560   bool Search2d(const double a_min[2], const double a_max[2],
00561     bool ON_MSC_CDECL resultCallback(void* a_context, ON__INT_PTR a_id), void* a_context
00562     ) const;
00563 
00564         bool Search2d(const double a_min[2], const double a_max[2],
00565     ON_RTreeSearchResult& a_result
00566     ) const;
00567 
00568         bool Search2d(const double a_min[2], const double a_max[2],
00569     ON_SimpleArray<ON_RTreeLeaf>& a_result
00570     ) const;
00571 
00572   bool Search2d(const double a_min[2], const double a_max[2],
00573     ON_SimpleArray<void*>& a_result
00574     ) const;
00575 
00576   bool Search2d(const double a_min[2], const double a_max[2],
00577     ON_SimpleArray<int>& a_result
00578     ) const;
00579 
00580   /*
00581   Description:
00582     Search two R-trees for all pairs elements whose bounding boxes overlap.
00583   Parameters:
00584     a_rtreeA - [in]
00585     a_rtreeB - [in]
00586     tolerance - [in]
00587       If the distance between a pair of bounding boxes is <= tolerance, 
00588       then the pair is added to a_result[].
00589     a_result - [out]
00590       Pairs of ids of elements who bounding boxes overlap.
00591   Returns:
00592     True if entire tree was searched.  It is possible no results were found.
00593   */
00594   static bool Search( 
00595           const ON_RTree& a_rtreeA,
00596           const ON_RTree& a_rtreeB, 
00597           double tolerance,
00598           ON_SimpleArray<ON_2dex>& a_result
00599           );
00600 
00601   /*
00602   Description:
00603     Search two R-trees for all pairs elements whose bounding boxes overlap.
00604   Parameters:
00605     a_rtreeA - [in]
00606     a_rtreeB - [in]
00607     tolerance - [in]
00608       If the distance between a pair of bounding boxes is <= tolerance, 
00609       then resultCallback() is called.
00610     resultCallback - [out]
00611       callback function
00612     a_context - [in] argument passed through to resultCallback().
00613   Returns:
00614     True if entire tree was searched.  It is possible no results were found.
00615   */
00616   static bool Search( 
00617           const ON_RTree& a_rtreeA,
00618           const ON_RTree& a_rtreeB, 
00619           double tolerance,
00620           void ON_MSC_CDECL resultCallback(void* a_context, ON__INT_PTR a_idA, ON__INT_PTR a_idB),
00621           void* a_context
00622           );
00623 
00624   /*
00625   Description:
00626     Search two R-trees for all pairs elements whose bounding boxes overlap.
00627   Parameters:
00628     a_rtreeA - [in]
00629     a_rtreeB - [in]
00630     tolerance - [in]
00631       If the distance between a pair of bounding boxes is <= tolerance, 
00632       then resultCallback() is called.
00633     resultCallback - [out]
00634       callback function
00635       Return true for the search to continue and false to terminate the search.
00636     a_context - [in] argument passed through to resultCallback().
00637   Returns:
00638     True if entire tree was searched.  It is possible no results were found.
00639   */
00640   static bool Search( 
00641           const ON_RTree& a_rtreeA,
00642           const ON_RTree& a_rtreeB, 
00643           double tolerance,
00644           bool ON_MSC_CDECL resultCallback(void* a_context, ON__INT_PTR a_idA, ON__INT_PTR a_idB),
00645           void* a_context
00646           );
00647   /*
00648   Returns:
00649     Number of elements (leaves).
00650   Remark:
00651     No internal count is maintained, so this function traverses the 
00652     tree to count the leaves.  If efficiency is important, save the
00653     result.
00654   */
00655   int ElementCount();
00656 
00657   /*
00658   Returns:
00659     Pointer to the root node.
00660   */
00661   const ON_RTreeNode* Root() const;
00662   
00663   /*
00664   Returns:
00665     Bounding box of the entire R-tree;
00666   */
00667   ON_BoundingBox BoundingBox() const;
00668 
00669   /*
00670   Returns:
00671     Number of bytes of heap memory used by this R-tree.
00672   */
00673   size_t SizeOf() const;
00674 
00675 private:
00676   void SplitNode(ON_RTreeNode*, ON_RTreeBranch*, ON_RTreeNode**);
00677   bool AddBranch(ON_RTreeBranch*, ON_RTreeNode*, ON_RTreeNode**);
00678   bool InsertRectRec(ON_RTreeBBox*, ON__INT_PTR, ON_RTreeNode*, ON_RTreeNode**, int);
00679   bool InsertRect(ON_RTreeBBox*, ON__INT_PTR, ON_RTreeNode**, int);
00680   void LoadNodes(ON_RTreeNode*, ON_RTreeNode*, struct ON_RTreePartitionVars*);
00681   bool RemoveRect(ON_RTreeBBox*, ON__INT_PTR, ON_RTreeNode**);
00682   bool RemoveRectRec(ON_RTreeBBox*, ON__INT_PTR, ON_RTreeNode*, struct ON_RTreeListNode**);
00683   void ReInsert(ON_RTreeNode*, struct ON_RTreeListNode**);
00684   void RemoveAllRec(ON_RTreeNode*);
00685   ON_RTreeNode* m_root;
00686   size_t m_reserved;
00687   ON_RTreeMemPool m_mem_pool;
00688 };
00689 
00690 #endif


pcl
Author(s): Open Perception
autogenerated on Wed Aug 26 2015 15:27:03