SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NamedRTree Class Reference

A RT-tree for efficient storing of SUMO's Named objects. More...

#include <NamedRTree.h>

Inheritance diagram for NamedRTree:
RTree< Named *, Named, float, 2, Named::StoringVisitor >

Public Member Functions

void Insert (const float a_min[2], const float a_max[2], Named *a_data)
 Insert entry. More...
 
 NamedRTree ()
 Constructor. More...
 
void Remove (const float a_min[2], const float a_max[2], Named *a_data)
 Remove entry. More...
 
void RemoveAll ()
 Remove all enrties. More...
 
int Search (const float a_min[2], const float a_max[2], const Named::StoringVisitor &c) const
 Find all within search rectangle. More...
 
 ~NamedRTree ()
 Destructor. More...
 

Private Types

enum  
 
typedef void(Named::* Operation )(const Named::StoringVisitor &) const
 

Private Member Functions

bool AddBranch (Branch *a_branch, Node *a_node, Node **a_newNode)
 
ListNode * AllocListNode ()
 
Node * AllocNode ()
 
ELEMTYPEREAL CalcRectVolume (Rect *a_rect)
 
void ChoosePartition (PartitionVars *a_parVars, int a_minFill)
 
void Classify (int a_index, int a_group, PartitionVars *a_parVars)
 
Rect CombineRect (Rect *a_rectA, Rect *a_rectB)
 
int Count ()
 Count the data elements in this container. This is slow as no internal counter is maintained. More...
 
void CountRec (Node *a_node, int &a_count)
 
void DisconnectBranch (Node *a_node, int a_index)
 
void FreeListNode (ListNode *a_listNode)
 
void FreeNode (Node *a_node)
 
Named *& GetAt (Iterator &a_it)
 Get object at iterator position. More...
 
void GetBranches (Node *a_node, Branch *a_branch, PartitionVars *a_parVars)
 
void GetFirst (Iterator &a_it)
 Get 'first' for iteration. More...
 
void GetNext (Iterator &a_it)
 Get Next for iteration. More...
 
void InitNode (Node *a_node)
 
void InitParVars (PartitionVars *a_parVars, int a_maxRects, int a_minFill)
 
void InitRect (Rect *a_rect)
 
virtual void Insert (const floata_min[NUMDIMS], const floata_max[NUMDIMS], const Named *&a_dataId)
 
bool InsertRect (Rect *a_rect, const Named *&a_id, Node **a_root, int a_level)
 
bool InsertRectRec (Rect *a_rect, const Named *&a_id, Node *a_node, Node **a_newNode, int a_level)
 
bool IsNull (Iterator &a_it)
 Is iterator NULL, or at end? More...
 
void LoadNodes (Node *a_nodeA, Node *a_nodeB, PartitionVars *a_parVars)
 
Rect NodeCover (Node *a_node)
 
bool Overlap (Rect *a_rectA, Rect *a_rectB) const
 
int PickBranch (Rect *a_rect, Node *a_node)
 
void PickSeeds (PartitionVars *a_parVars)
 
ELEMTYPEREAL RectSphericalVolume (Rect *a_rect)
 
ELEMTYPEREAL RectVolume (Rect *a_rect)
 
void ReInsert (Node *a_node, ListNode **a_listNode)
 
virtual void Remove (const floata_min[NUMDIMS], const floata_max[NUMDIMS], const Named *&a_dataId)
 
void RemoveAllRec (Node *a_node)
 
bool RemoveRect (Rect *a_rect, const Named *&a_id, Node **a_root)
 
bool RemoveRectRec (Rect *a_rect, const Named *&a_id, Node *a_node, ListNode **a_listNode)
 
void Reset ()
 
virtual int Search (const floata_min[NUMDIMS], const floata_max[NUMDIMS], const Named::StoringVisitor &c) const
 DK 15.10.2008 - begin. More...
 
bool Search (Node *a_node, Rect *a_rect, int &a_foundCount, const Named::StoringVisitor &c) const
 
void SplitNode (Node *a_node, Branch *a_branch, Node **a_newNode)
 

Private Attributes

Node * m_root
 Root of tree. More...
 
ELEMTYPEREAL m_unitSphereVolume
 Unit sphere constant for required number of dimensions. More...
 
Operation myOperation
 

Detailed Description

A RT-tree for efficient storing of SUMO's Named objects.

This class specialises the used RT-tree implementation from "rttree.h". It stores names of "Named"-objects.

See also
Named

Definition at line 72 of file NamedRTree.h.

Member Typedef Documentation

typedef void(Named ::* RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::Operation)(const Named::StoringVisitor &) const
inherited

Definition at line 79 of file RTree.h.

Member Enumeration Documentation

anonymous enum
inherited

Definition at line 71 of file RTree.h.

Constructor & Destructor Documentation

NamedRTree::NamedRTree ( )
inline

Constructor.

Definition at line 75 of file NamedRTree.h.

NamedRTree::~NamedRTree ( )
inline

Destructor.

Definition at line 81 of file NamedRTree.h.

Member Function Documentation

bool RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::AddBranch ( Branch *  a_branch,
Node *  a_node,
Node **  a_newNode 
)
protectedinherited
ListNode* RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::AllocListNode ( )
protectedinherited
Node* RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::AllocNode ( )
protectedinherited
ELEMTYPEREAL RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::CalcRectVolume ( Rect *  a_rect)
protectedinherited
void RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::ChoosePartition ( PartitionVars *  a_parVars,
int  a_minFill 
)
protectedinherited
void RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::Classify ( int  a_index,
int  a_group,
PartitionVars *  a_parVars 
)
protectedinherited
Rect RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::CombineRect ( Rect *  a_rectA,
Rect *  a_rectB 
)
protectedinherited
int RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::Count ( )
inherited

Count the data elements in this container. This is slow as no internal counter is maintained.

void RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::CountRec ( Node *  a_node,
int a_count 
)
protectedinherited
void RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::DisconnectBranch ( Node *  a_node,
int  a_index 
)
protectedinherited
void RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::FreeListNode ( ListNode *  a_listNode)
protectedinherited
void RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::FreeNode ( Node *  a_node)
protectedinherited
Named * & RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::GetAt ( Iterator &  a_it)
inlineinherited

Get object at iterator position.

Definition at line 263 of file RTree.h.

void RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::GetBranches ( Node *  a_node,
Branch *  a_branch,
PartitionVars *  a_parVars 
)
protectedinherited
void RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::GetFirst ( Iterator &  a_it)
inlineinherited
void RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::GetNext ( Iterator &  a_it)
inlineinherited

Get Next for iteration.

Definition at line 257 of file RTree.h.

void RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::InitNode ( Node *  a_node)
protectedinherited
void RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::InitParVars ( PartitionVars *  a_parVars,
int  a_maxRects,
int  a_minFill 
)
protectedinherited
void RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::InitRect ( Rect *  a_rect)
protectedinherited
virtual void RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::Insert ( const float  a_min[NUMDIMS],
const float  a_max[NUMDIMS],
const Named * &  a_dataId 
)
virtualinherited

Insert entry

Parameters
a_minMin of bounding rect
a_maxMax of bounding rect
a_dataIdPositive Id of data. Maybe zero, but negative numbers not allowed.
void NamedRTree::Insert ( const float  a_min[2],
const float  a_max[2],
Named a_data 
)
inline

Insert entry.

Parameters
a_minMin of bounding rect
a_maxMax of bounding rect
a_dataThe instance of a Named-object to add (the ID is added)
See also
RTree::Insert

Definition at line 91 of file NamedRTree.h.

References RTree< DATATYPE, DATATYPENP, ELEMTYPE, NUMDIMS, CONTEXT, ELEMTYPEREAL, TMAXNODES, TMINNODES >::Insert().

Referenced by MSDevice_BTreceiver::BTreceiverUpdate::execute(), TraCIServerAPI_Junction::getTree(), TraCIServerAPI_InductionLoop::getTree(), TraCIServerAPI_POI::getTree(), TraCIServerAPI_Polygon::getTree(), and NBNodeCont::insert().

bool RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::InsertRect ( Rect *  a_rect,
const Named * &  a_id,
Node **  a_root,
int  a_level 
)
protectedinherited
bool RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::InsertRectRec ( Rect *  a_rect,
const Named * &  a_id,
Node *  a_node,
Node **  a_newNode,
int  a_level 
)
protectedinherited
bool RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::IsNull ( Iterator &  a_it)
inlineinherited

Is iterator NULL, or at end?

Definition at line 260 of file RTree.h.

void RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::LoadNodes ( Node *  a_nodeA,
Node *  a_nodeB,
PartitionVars *  a_parVars 
)
protectedinherited
Rect RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::NodeCover ( Node *  a_node)
protectedinherited
bool RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::Overlap ( Rect *  a_rectA,
Rect *  a_rectB 
) const
protectedinherited
int RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::PickBranch ( Rect *  a_rect,
Node *  a_node 
)
protectedinherited
void RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::PickSeeds ( PartitionVars *  a_parVars)
protectedinherited
ELEMTYPEREAL RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::RectSphericalVolume ( Rect *  a_rect)
protectedinherited
ELEMTYPEREAL RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::RectVolume ( Rect *  a_rect)
protectedinherited
void RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::ReInsert ( Node *  a_node,
ListNode **  a_listNode 
)
protectedinherited
virtual void RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::Remove ( const float  a_min[NUMDIMS],
const float  a_max[NUMDIMS],
const Named * &  a_dataId 
)
virtualinherited

Remove entry

Parameters
a_minMin of bounding rect
a_maxMax of bounding rect
a_dataIdPositive Id of data. Maybe zero, but negative numbers not allowed.
void NamedRTree::Remove ( const float  a_min[2],
const float  a_max[2],
Named a_data 
)
inline

Remove entry.

Parameters
a_minMin of bounding rect
a_maxMax of bounding rect
a_dataThe instance of a Named-object to remove
See also
RTree::Remove

Definition at line 102 of file NamedRTree.h.

References RTree< DATATYPE, DATATYPENP, ELEMTYPE, NUMDIMS, CONTEXT, ELEMTYPEREAL, TMAXNODES, TMINNODES >::Remove().

Referenced by NBNodeCont::extract().

void NamedRTree::RemoveAll ( )
inline
void RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::RemoveAllRec ( Node *  a_node)
protectedinherited
bool RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::RemoveRect ( Rect *  a_rect,
const Named * &  a_id,
Node **  a_root 
)
protectedinherited
bool RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::RemoveRectRec ( Rect *  a_rect,
const Named * &  a_id,
Node *  a_node,
ListNode **  a_listNode 
)
protectedinherited
void RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::Reset ( )
protectedinherited
virtual int RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::Search ( const float  a_min[NUMDIMS],
const float  a_max[NUMDIMS],
const Named::StoringVisitor c 
) const
virtualinherited

DK 15.10.2008 - begin.

Find all within search rectangle

Parameters
a_minMin of search bounding rect
a_maxMax of search bounding rect
a_searchResultSearch result array. Caller should set grow size. Function will reset, not append to array.
a_resultCallbackCallback function to return result. Callback should return 'true' to continue searching
a_contextUser context to pass as parameter to a_resultCallback
Returns
Returns the number of entries found
int NamedRTree::Search ( const float  a_min[2],
const float  a_max[2],
const Named::StoringVisitor c 
) const
inline

Find all within search rectangle.

Parameters
a_minMin of search bounding rect
a_maxMax of search bounding rect
a_searchResultSearch result array. Caller should set grow size. Function will reset, not append to array.
a_resultCallbackCallback function to return result. Callback should return 'true' to continue searching
a_contextUser context to pass as parameter to a_resultCallback
Returns
Returns the number of entries found
See also
RTree::Search

Definition at line 124 of file NamedRTree.h.

References RTree< DATATYPE, DATATYPENP, ELEMTYPE, NUMDIMS, CONTEXT, ELEMTYPEREAL, TMAXNODES, TMINNODES >::Search().

Referenced by MSDevice_BTreceiver::BTreceiverUpdate::execute(), and NBNodeCont::retrieve().

bool RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::Search ( Node *  a_node,
Rect *  a_rect,
int a_foundCount,
const Named::StoringVisitor c 
) const
protectedinherited
void RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::SplitNode ( Node *  a_node,
Branch *  a_branch,
Node **  a_newNode 
)
protectedinherited

Field Documentation

Node* RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::m_root
protectedinherited

Root of tree.

Definition at line 359 of file RTree.h.

ELEMTYPEREAL RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::m_unitSphereVolume
protectedinherited

Unit sphere constant for required number of dimensions.

Definition at line 360 of file RTree.h.

Operation RTree< Named * , Named , float , NUMDIMS, Named::StoringVisitor , ELEMTYPEREAL, TMAXNODES, TMINNODES >::myOperation
protectedinherited

Definition at line 361 of file RTree.h.


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