17 #if !defined(OPENNURBS_RTREE_INC_)
18 #define OPENNURBS_RTREE_INC_
57 #define ON_RTree_MIN_NODE_COUNT 2
58 #define ON_RTree_MAX_NODE_COUNT 6
186 struct Blk* m_list_nodes;
189 unsigned char* m_buffer;
190 std::size_t m_buffer_capacity;
192 struct Blk* m_blk_list;
193 std::size_t m_sizeof_blk;
195 ON_MEMORY_POOL* m_heap;
196 std::size_t m_sizeof_heap;
362 enum { MAX_STACK = 32 };
370 bool PushChildren(
struct StackElement* sp,
bool bFirstChild);
372 StackElement m_stack[MAX_STACK];
381 ON_RTree( ON_MEMORY_POOL* heap = 0, std::size_t leaf_count = 0 );
414 bool Insert(
const double a_min[3],
const double a_max[3],
void* a_element_id);
415 bool Insert(
const double a_min[3],
const double a_max[3],
int a_element_id);
416 bool Insert2d(
const double a_min[2],
const double a_max[2],
void* a_element_id);
417 bool Insert2d(
const double a_min[2],
const double a_max[2],
int a_element_id);
438 bool Remove(
const double a_min[3],
const double a_max[3],
void* a_elementId);
439 bool Remove(
const double a_min[3],
const double a_max[3],
int a_elementId);
440 bool Remove2d(
const double a_min[2],
const double a_max[2],
void* a_elementId);
441 bool Remove2d(
const double a_min[2],
const double a_max[2],
int a_elementId);
495 bool ON_MSC_CDECL resultCallback(
void* a_context, ON__INT_PTR a_id),
501 bool ON_MSC_CDECL resultCallback(
void* a_context, ON__INT_PTR a_id),
507 bool ON_MSC_CDECL resultCallback(
void* a_context, ON__INT_PTR a_id),
533 const double a_plane_eqn[4],
536 bool ON_MSC_CDECL resultCallback(
void* a_context, ON__INT_PTR a_id),
540 bool Search(
const double a_min[3],
const double a_max[3],
541 bool ON_MSC_CDECL resultCallback(
void* a_context, ON__INT_PTR a_id),
void* a_context
544 bool Search(
const double a_min[3],
const double a_max[3],
548 bool Search(
const double a_min[3],
const double a_max[3],
552 bool Search(
const double a_min[3],
const double a_max[3],
556 bool Search(
const double a_min[3],
const double a_max[3],
560 bool Search2d(
const double a_min[2],
const double a_max[2],
561 bool ON_MSC_CDECL resultCallback(
void* a_context, ON__INT_PTR a_id),
void* a_context
564 bool Search2d(
const double a_min[2],
const double a_max[2],
568 bool Search2d(
const double a_min[2],
const double a_max[2],
572 bool Search2d(
const double a_min[2],
const double a_max[2],
576 bool Search2d(
const double a_min[2],
const double a_max[2],
620 void ON_MSC_CDECL resultCallback(
void* a_context, ON__INT_PTR a_idA, ON__INT_PTR a_idB),
644 bool ON_MSC_CDECL resultCallback(
void* a_context, ON__INT_PTR a_idA, ON__INT_PTR a_idB),
683 void ReInsert(
ON_RTreeNode*,
struct ON_RTreeListNode**);
686 std::size_t m_reserved;
bool Search2d(const double a_min[2], const double a_max[2], bool ON_MSC_CDECL resultCallback(void *a_context, ON__INT_PTR a_id), void *a_context) const
bool Search(const double a_min[3], const double a_max[3], ON_RTreeSearchResult &a_result) const
bool Search2d(const double a_min[2], const double a_max[2], ON_RTreeSearchResult &a_result) const
bool Search(ON_RTreeCapsule *a_capsule, bool ON_MSC_CDECL resultCallback(void *a_context, ON__INT_PTR a_id), void *a_context) const
bool Search2d(const double a_min[2], const double a_max[2], ON_SimpleArray< int > &a_result) const
std::size_t SizeOf() const
ON_RTree(ON_MEMORY_POOL *heap=0, std::size_t leaf_count=0)
bool Search(ON_RTreeBBox *a_rect, bool ON_MSC_CDECL resultCallback(void *a_context, ON__INT_PTR a_id), void *a_context) const
static bool Search(const ON_RTree &a_rtreeA, const ON_RTree &a_rtreeB, double tolerance, bool ON_MSC_CDECL resultCallback(void *a_context, ON__INT_PTR a_idA, ON__INT_PTR a_idB), void *a_context)
bool Insert2d(const double a_min[2], const double a_max[2], int a_element_id)
bool Search(const double a_plane_eqn[4], double a_min, double a_max, bool ON_MSC_CDECL resultCallback(void *a_context, ON__INT_PTR a_id), void *a_context) const
bool Search(const double a_min[3], const double a_max[3], ON_SimpleArray< void * > &a_result) const
static bool Search(const ON_RTree &a_rtreeA, const ON_RTree &a_rtreeB, double tolerance, ON_SimpleArray< ON_2dex > &a_result)
bool Search(const double a_min[3], const double a_max[3], bool ON_MSC_CDECL resultCallback(void *a_context, ON__INT_PTR a_id), void *a_context) const
bool Insert(const double a_min[3], const double a_max[3], int a_element_id)
bool Insert2d(const double a_min[2], const double a_max[2], void *a_element_id)
bool Insert(const double a_min[3], const double a_max[3], void *a_element_id)
bool Remove(const double a_min[3], const double a_max[3], void *a_elementId)
bool Remove2d(const double a_min[2], const double a_max[2], void *a_elementId)
bool Search(ON_RTreeSphere *a_sphere, bool ON_MSC_CDECL resultCallback(void *a_context, ON__INT_PTR a_id), void *a_context) const
static bool Search(const ON_RTree &a_rtreeA, const ON_RTree &a_rtreeB, double tolerance, void ON_MSC_CDECL resultCallback(void *a_context, ON__INT_PTR a_idA, ON__INT_PTR a_idB), void *a_context)
bool Search(const double a_min[3], const double a_max[3], ON_SimpleArray< ON_RTreeLeaf > &a_result) const
bool Search2d(const double a_min[2], const double a_max[2], ON_SimpleArray< ON_RTreeLeaf > &a_result) const
ON_BoundingBox BoundingBox() const
const ON_RTreeNode * Root() const
bool Search(const double a_min[3], const double a_max[3], ON_SimpleArray< int > &a_result) const
bool Remove2d(const double a_min[2], const double a_max[2], int a_elementId)
bool CreateMeshFaceTree(const class ON_Mesh *mesh)
bool Search2d(const double a_min[2], const double a_max[2], ON_SimpleArray< void * > &a_result) const
bool Remove(const double a_min[3], const double a_max[3], int a_elementId)
bool Initialize(const struct ON_RTreeNode *a_node)
ON_RTreeIterator(const class ON_RTree &a_rtree)
bool Initialize(const class ON_RTree &a_rtree)
const ON_RTreeBranch * Value() const
ON_RTreeMemPool(ON_MEMORY_POOL *heap, std::size_t leaf_count)
struct ON_RTreeListNode * AllocListNode()
void FreeListNode(struct ON_RTreeListNode *list_node)
std::size_t SizeOf() const
ON_RTreeNode * AllocNode()
std::size_t SizeOfUnusedBuffer() const
void FreeNode(ON_RTreeNode *node)
struct ON_RTreeNode * m_child
ON_RTreeBranch m_branch[ON_RTree_MAX_NODE_COUNT]
bool IsInternalNode() const