HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_RTreeGeneric< MAX_ORDER > Class Template Reference

#include <UT_RTree.h>

Public Member Functions

template<typename BOXTYPE >
 UT_RTreeGeneric (const BOXTYPE item_boxes[], const int size)
 
 ~UT_RTreeGeneric ()
 
int getNumItems () const
 
exint getMemoryUsage () const
 
template<typename T >
void createBoxAssignment (UT_RTreeBoxAssignmentT< T > &assignment, const UT_BoxT< T > item_boxes[]) const
 
template<typename BOXTYPE >
void createAssignment (UT_RTreeAssignmentT< BOXTYPE > &assignment, const BOXTYPE item_boxes[]) const
 
template<typename QUERY_SHAPE , typename RESULT_ACCEPTOR , typename BOXTYPE >
void getIntersectingItems (RESULT_ACCEPTOR &result_acceptor, const QUERY_SHAPE &query_box, const UT_RTreeAssignmentT< BOXTYPE > &assignment) const
 
template<typename QUERY_SHAPE , typename RESULT_ACCEPTOR , typename BOXTYPE , int BATCH_SIZE>
void getIntersectingItemsBatch (RESULT_ACCEPTOR &batch_result_acceptor, const QUERY_SHAPE *query_box, const UT_RTreeAssignmentT< BOXTYPE > &assignment) const
 
template<typename BOXTYPE >
BOXTYPE boundingBox (const UT_RTreeAssignmentT< BOXTYPE > &assignment) const
 
int getNumNodes () const
 
template<typename LOCAL_DATA , typename PRE_FUNCTOR , typename ITEM_FUNCTOR , typename POST_FUNCTOR >
void traverse (PRE_FUNCTOR &pre_functor, ITEM_FUNCTOR &item_functor, POST_FUNCTOR &post_functor, LOCAL_DATA *data_for_parent=nullptr) const
 

Detailed Description

template<int MAX_ORDER>
class UT_RTreeGeneric< MAX_ORDER >

Definition at line 210 of file UT_RTree.h.

Constructor & Destructor Documentation

template<int MAX_ORDER>
template<typename BOXTYPE >
UT_RTreeGeneric< MAX_ORDER >::UT_RTreeGeneric ( const BOXTYPE  item_boxes[],
const int  size 
)
inline

Definition at line 1093 of file UT_RTree.C.

template<int MAX_ORDER>
UT_RTreeGeneric< MAX_ORDER >::~UT_RTreeGeneric ( )
inline

Definition at line 1146 of file UT_RTree.C.

Member Function Documentation

template<int MAX_ORDER>
template<typename BOXTYPE >
BOXTYPE UT_RTreeGeneric< MAX_ORDER >::boundingBox ( const UT_RTreeAssignmentT< BOXTYPE > &  assignment) const

Definition at line 1365 of file UT_RTree.C.

template<int MAX_ORDER>
template<typename BOXTYPE >
void UT_RTreeGeneric< MAX_ORDER >::createAssignment ( UT_RTreeAssignmentT< BOXTYPE > &  assignment,
const BOXTYPE  item_boxes[] 
) const
inline

Definition at line 1155 of file UT_RTree.C.

template<int MAX_ORDER>
template<typename T >
void UT_RTreeGeneric< MAX_ORDER >::createBoxAssignment ( UT_RTreeBoxAssignmentT< T > &  assignment,
const UT_BoxT< T item_boxes[] 
) const
inline

Definition at line 276 of file UT_RTree.h.

template<int MAX_ORDER>
template<typename QUERY_SHAPE , typename RESULT_ACCEPTOR , typename BOXTYPE >
void UT_RTreeGeneric< MAX_ORDER >::getIntersectingItems ( RESULT_ACCEPTOR &  result_acceptor,
const QUERY_SHAPE &  query_box,
const UT_RTreeAssignmentT< BOXTYPE > &  assignment 
) const

For each item i for which item_boxes[i] intersects query_box, call result_acceptor(i). This assumes that RESULT_ACCEPTOR is a function or a functor. A further generlaization of getIntersectingItems that takes a queryshape. It is assumed to have an .intersects() method which takes a UT_Box<T> It is very important that the intersects() method will return false for empty nodes.

Definition at line 1191 of file UT_RTree.C.

template<int MAX_ORDER>
template<typename QUERY_SHAPE , typename RESULT_ACCEPTOR , typename BOXTYPE , int BATCH_SIZE>
void UT_RTreeGeneric< MAX_ORDER >::getIntersectingItemsBatch ( RESULT_ACCEPTOR &  batch_result_acceptor,
const QUERY_SHAPE *  query_box,
const UT_RTreeAssignmentT< BOXTYPE > &  assignment 
) const

Definition at line 1211 of file UT_RTree.C.

template<int MAX_ORDER>
exint UT_RTreeGeneric< MAX_ORDER >::getMemoryUsage ( ) const
inline

Definition at line 267 of file UT_RTree.h.

template<int MAX_ORDER>
int UT_RTreeGeneric< MAX_ORDER >::getNumItems ( void  ) const
inline

Definition at line 879 of file UT_RTree.C.

template<int MAX_ORDER>
int UT_RTreeGeneric< MAX_ORDER >::getNumNodes ( ) const
inline

Returns the number of nodes in the tree. NOTE: This does not count the items themselves as nodes, because they don't have nodes allocated for them.

Definition at line 318 of file UT_RTree.h.

template<int MAX_ORDER>
template<typename LOCAL_DATA , typename PRE_FUNCTOR , typename ITEM_FUNCTOR , typename POST_FUNCTOR >
void UT_RTreeGeneric< MAX_ORDER >::traverse ( PRE_FUNCTOR &  pre_functor,
ITEM_FUNCTOR &  item_functor,
POST_FUNCTOR &  post_functor,
LOCAL_DATA *  data_for_parent = nullptr 
) const

For each node, this effectively does: LOCAL_DATA local_data[MAX_ORDER]; bool descend = pre_functor(nodei, parent_data); if (!descend) return; for each child { if (isitem(child)) item_functor(getitemi(child), nodei, local_data[child]); else if (isnode(child)) recurse(getnodei(child), local_data); } post_functor(nodei, parent_nodei, data_for_parent, num_children, local_data);

Definition at line 1393 of file UT_RTree.C.


The documentation for this class was generated from the following files: