pagarcia
(Pablo Garcia-Amorena)
August 30, 2017, 2:01pm
1
Hello,
With ON_RTree::Insert
I manage to insert elements into an RTree, only one level below the root node.
How can I put them into different levels, as children of upper level leaves?
I tried using ON_RTree::InsertRect(ON_RTreeBBox* a_rect, ON__INT_PTR a_id, ON_RTreeNode** a_root, int a_level)
but this method is inaccessible for me.
Any hint or example will be greatly appreciated.
Pablo
menno
(Menno Deij - van Rijswijk)
August 30, 2017, 5:03pm
2
I think that ON_RTree is self-balancing, that is, if you add enough items it will start creating more levels. For more details, please consult the code which is conveniently forked by PCL
/* $NoKeywords: $ */
/*
//
// Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
// OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
// McNeel & Associates.
//
// THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
// ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
// MERCHANTABILITY ARE HEREBY DISCLAIMED.
//
// For complete openNURBS copyright information see <http://www.opennurbs.org>.
//
////////////////////////////////////////////////////////////////
*/
#include "pcl/surface/3rdparty/opennurbs/opennurbs.h"
// Dimension of tree bounding boxes
#define ON_RTree_NODE_DIM 3
This file has been truncated. show original
pagarcia
(Pablo Garcia-Amorena)
August 31, 2017, 12:28pm
3
Ok, I see. They are inherently created via rectangle inclusion into existing nodes.
I was looking for a quadtree-like data structure in ON library, but I think there isn’t…
Many thanks,
Pablo
menno
(Menno Deij - van Rijswijk)
August 31, 2017, 12:40pm
4
No, there is no quad-tree or octree in OpenNurbs. I think that for most purposes an R-Tree is superior to an octree.