SUMO - Simulation of Urban MObility
|
#include <SUMORTree.h>
Public Types | |
enum | |
typedef void(GUIGlObject::* | Operation )(const GUIVisualizationSettings &) const |
Public Member Functions | |
void | add (SUMOReal x, SUMOReal y) |
Makes the boundary include the given coordinate. | |
void | add (const Position &p) |
Makes the boundary include the given coordinate. | |
void | add (const Boundary &p) |
Makes the boundary include the given boundary. | |
void | addAdditionalGLObject (GUIGlObject *o) |
Adds an additional object (detector/shape/trigger) for visualisation. | |
bool | around (const Position &p, SUMOReal offset=0) const |
Returns whether the boundary contains the given coordinate. | |
int | Count () |
Count the data elements in this container. This is slow as no internal counter is maintained. | |
bool | crosses (const Position &p1, const Position &p2) const |
Returns whether the boundary crosses the given line. | |
void | flipY () |
flips ymin and ymax | |
GUIGlObject *& | GetAt (Iterator &a_it) |
Get object at iterator position. | |
Position | getCenter () const |
Returns the center of the boundary. | |
void | GetFirst (Iterator &a_it) |
Get 'first' for iteration. | |
SUMOReal | getHeight () const |
Returns the height of the boundary. | |
void | GetNext (Iterator &a_it) |
Get Next for iteration. | |
SUMOReal | getWidth () const |
Returns the width of the boudary. | |
Boundary & | grow (SUMOReal by) |
extends the boundary by the given amount | |
void | growHeight (SUMOReal by) |
void | growWidth (SUMOReal by) |
void | Insert (const floata_min[NUMDIMS], const floata_max[NUMDIMS], const GUIGlObject *&a_dataId) |
bool | IsNull (Iterator &a_it) |
Is iterator NULL, or at end? | |
void | moveby (SUMOReal x, SUMOReal y) |
Moves the boundary by the given amount. | |
bool | overlapsWith (const AbstractPoly &poly, SUMOReal offset=0) const |
Returns whether the boundary overlaps with the given polygon. | |
bool | partialWithin (const AbstractPoly &poly, SUMOReal offset=0) const |
Returns whether the boundary is partially within the given polygon. | |
void | Remove (const floata_min[NUMDIMS], const floata_max[NUMDIMS], const GUIGlObject *&a_dataId) |
void | removeAdditionalGLObject (GUIGlObject *o) |
Removes an additional object (detector/shape/trigger) from being visualised. | |
void | RemoveAll () |
DK 15.10.2008 - end. | |
void | reset () |
Resets the boundary. | |
int | Search (const floata_min[NUMDIMS], const floata_max[NUMDIMS], const GUIVisualizationSettings &c) |
DK 15.10.2008 - begin. | |
void | set (SUMOReal xmin, SUMOReal ymin, SUMOReal xmax, SUMOReal ymax) |
Sets the boundary to the given values. | |
SUMORTree () | |
SUMOReal | xmax () const |
Returns maximum x-coordinate. | |
SUMOReal | xmin () const |
Returns minimum x-coordinate. | |
SUMOReal | ymax () const |
Returns maximum y-coordinate. | |
SUMOReal | ymin () const |
Returns minimum y-coordinate. | |
~SUMORTree () |
Protected Member Functions | |
bool | AddBranch (Branch *a_branch, Node *a_node, Node **a_newNode) |
ListNode * | AllocListNode () |
Node * | AllocNode () |
float | 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) |
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) |
void | GetBranches (Node *a_node, Branch *a_branch, PartitionVars *a_parVars) |
void | InitNode (Node *a_node) |
void | InitParVars (PartitionVars *a_parVars, int a_maxRects, int a_minFill) |
void | InitRect (Rect *a_rect) |
bool | InsertRect (Rect *a_rect, const GUIGlObject *&a_id, Node **a_root, int a_level) |
bool | InsertRectRec (Rect *a_rect, const GUIGlObject *&a_id, Node *a_node, Node **a_newNode, int a_level) |
void | LoadNodes (Node *a_nodeA, Node *a_nodeB, PartitionVars *a_parVars) |
Rect | NodeCover (Node *a_node) |
bool | Overlap (Rect *a_rectA, Rect *a_rectB) |
int | PickBranch (Rect *a_rect, Node *a_node) |
void | PickSeeds (PartitionVars *a_parVars) |
float | RectSphericalVolume (Rect *a_rect) |
float | RectVolume (Rect *a_rect) |
void | ReInsert (Node *a_node, ListNode **a_listNode) |
void | RemoveAllRec (Node *a_node) |
bool | RemoveRect (Rect *a_rect, const GUIGlObject *&a_id, Node **a_root) |
bool | RemoveRectRec (Rect *a_rect, const GUIGlObject *&a_id, Node *a_node, ListNode **a_listNode) |
void | Reset () |
bool | Search (Node *a_node, Rect *a_rect, int &a_foundCount, const GUIVisualizationSettings &c) |
void | SplitNode (Node *a_node, Branch *a_branch, Node **a_newNode) |
Protected Attributes | |
Node * | m_root |
Root of tree. | |
float | m_unitSphereVolume |
Unit sphere constant for required number of dimensions. | |
Operation | myOperation |
Definition at line 54 of file SUMORTree.h.
|
inherited |
|
inline |
Definition at line 57 of file SUMORTree.h.
|
inline |
Definition at line 61 of file SUMORTree.h.
Makes the boundary include the given coordinate.
Definition at line 76 of file Boundary.cpp.
References Boundary::myWasInitialised, Boundary::myXmax, Boundary::myXmin, Boundary::myYmax, and Boundary::myYmin.
Referenced by Boundary::add(), NIVissimConnectionCluster::NodeSubCluster::add(), NIVissimConnectionCluster::add(), Boundary::Boundary(), GUIDanielPerspectiveChanger::centerTo(), NIVissimDisturbance::computeBounding(), NIVissimConnection::computeBounding(), GUIEdge::getBoundary(), PositionVector::getBoxBoundary(), GUITrafficLightLogicWrapper::getCenteringBoundary(), GUIPolygon::getCenteringBoundary(), GUIPointOfInterest::getCenteringBoundary(), GUILaneWrapper::getCenteringBoundary(), GUIVehicle::getCenteringBoundary(), GUISUMOAbstractView::getObjectAtPosition(), GUILaneSpeedTrigger::GUILaneSpeedTrigger(), GUITriggeredRerouter::GUITriggeredRerouter(), GUINet::initGUIStructures(), GUIInstantInductLoop::MyWrapper::MyWrapper(), GUIE3Collector::MyWrapper::MyWrapper(), GUI_E2_ZS_CollectorOverLanes::MyWrapper::MyWrapper(), GUIInductLoop::MyWrapper::MyWrapper(), NIVissimConnectionCluster::recomputeBoundary(), NIVissimNodeDef_Edges::searchAndSetConnections(), GUIDanielPerspectiveChanger::setViewport(), and GeoConvHelper::x2cartesian().
|
inherited |
Makes the boundary include the given coordinate.
Definition at line 93 of file Boundary.cpp.
References Boundary::add(), Position::x(), and Position::y().
|
inherited |
Makes the boundary include the given boundary.
Definition at line 99 of file Boundary.cpp.
References Boundary::add(), Boundary::xmax(), Boundary::xmin(), Boundary::ymax(), and Boundary::ymin().
|
inline |
Adds an additional object (detector/shape/trigger) for visualisation.
[in] | o | The object to add |
Definition at line 67 of file SUMORTree.h.
References GUIGlObject::getCenteringBoundary(), RTree< GUIGlObject *, GUIGlObject, float, 2, GUIVisualizationSettings >::Insert(), Boundary::xmax(), Boundary::xmin(), Boundary::ymax(), and Boundary::ymin().
Referenced by GUIShapeContainer::addPoI(), GUIShapeContainer::addPolygon(), GUINet::createTLWrapper(), GUINet::initGUIStructures(), GUIShapeContainer::movePoI(), and GUIShapeContainer::reshapePolygon().
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
Returns whether the boundary contains the given coordinate.
Implements AbstractPoly.
Definition at line 148 of file Boundary.cpp.
References Boundary::myXmax, Boundary::myXmin, Boundary::myYmax, Boundary::myYmin, Position::x(), and Position::y().
Referenced by NIVissimConnectionCluster::around(), PCPolyContainer::insert(), and NIVissimConnectionCluster::recheckEdges().
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
inherited |
Count the data elements in this container. This is slow as no internal counter is maintained.
|
protectedinherited |
Returns whether the boundary crosses the given line.
Implements AbstractPoly.
Definition at line 177 of file Boundary.cpp.
References GeomHelper::intersects(), Boundary::myXmax, Boundary::myXmin, Boundary::myYmax, and Boundary::myYmin.
|
protectedinherited |
|
inherited |
flips ymin and ymax
Definition at line 222 of file Boundary.cpp.
References Boundary::myYmax, Boundary::myYmin, and SUMOReal.
|
protectedinherited |
|
protectedinherited |
|
inlineinherited |
|
protectedinherited |
|
inherited |
Returns the center of the boundary.
Definition at line 106 of file Boundary.cpp.
References Boundary::myXmax, Boundary::myXmin, Boundary::myYmax, Boundary::myYmin, and SUMOReal.
Referenced by GUISUMOAbstractView::centerTo(), GUIDanielPerspectiveChanger::getXPos(), GUIDanielPerspectiveChanger::getYPos(), NIVissimConnectionCluster::liesOnSameEdgesEnd(), GUIVehicle::setFunctionalColor(), and GUIDanielPerspectiveChanger::zoom().
|
inlineinherited |
Get 'first' for iteration.
Definition at line 246 of file RTree.h.
References RTree< DATATYPE, DATATYPENP, ELEMTYPE, NUMDIMS, CONTEXT, ELEMTYPEREAL, TMAXNODES, TMINNODES >::Node::m_count, and RTree< DATATYPE, DATATYPENP, ELEMTYPE, NUMDIMS, CONTEXT, ELEMTYPEREAL, TMAXNODES, TMINNODES >::m_root.
|
inherited |
Returns the height of the boundary.
Definition at line 142 of file Boundary.cpp.
References Boundary::myYmax, and Boundary::myYmin.
Referenced by GUISUMOAbstractView::applyGLTransform(), GUISUMOAbstractView::getGridHeight(), GUISUMOAbstractView::getPositionInformation(), GUIJunctionWrapper::GUIJunctionWrapper(), GUINet::initGUIStructures(), and GUIPerspectiveChanger::patchedViewPort().
|
inlineinherited |
|
inherited |
Returns the width of the boudary.
Definition at line 136 of file Boundary.cpp.
References Boundary::myXmax, and Boundary::myXmin.
Referenced by GUISUMOAbstractView::applyGLTransform(), GUISUMOAbstractView::getGridWidth(), GUISUMOAbstractView::getPositionInformation(), GUIDanielPerspectiveChanger::getZoom(), GUIJunctionWrapper::GUIJunctionWrapper(), GUINet::initGUIStructures(), GUISUMOAbstractView::m2p(), GUISUMOAbstractView::p2m(), and GUIPerspectiveChanger::patchedViewPort().
extends the boundary by the given amount
The method returns a reference to the instance for further use
Definition at line 200 of file Boundary.cpp.
References Boundary::myXmax, Boundary::myXmin, Boundary::myYmax, and Boundary::myYmin.
Referenced by GUIDanielPerspectiveChanger::centerTo(), GUIEdge::getBoundary(), GUITrafficLightLogicWrapper::getCenteringBoundary(), GUIPolygon::getCenteringBoundary(), GUIPointOfInterest::getCenteringBoundary(), GUITriggeredRerouter::getCenteringBoundary(), GUILaneSpeedTrigger::getCenteringBoundary(), GUIJunctionWrapper::getCenteringBoundary(), GUILaneWrapper::getCenteringBoundary(), GUIInstantInductLoop::MyWrapper::getCenteringBoundary(), GUIVehicle::getCenteringBoundary(), GUIE3Collector::MyWrapper::getCenteringBoundary(), GUIBusStop::getCenteringBoundary(), GUI_E2_ZS_Collector::MyWrapper::getCenteringBoundary(), GUIEdge::getCenteringBoundary(), GUIInductLoop::MyWrapper::getCenteringBoundary(), GUISUMOAbstractView::getObjectAtPosition(), NBEdgeCont::ignoreFilterMatch(), and GUINet::initGUIStructures().
|
inherited |
Definition at line 216 of file Boundary.cpp.
References Boundary::myYmax, and Boundary::myYmin.
Referenced by GUIPerspectiveChanger::patchedViewPort(), and GUIDanielPerspectiveChanger::setViewport().
|
inherited |
Definition at line 209 of file Boundary.cpp.
References Boundary::myXmax, and Boundary::myXmin.
Referenced by GUIPerspectiveChanger::patchedViewPort(), and GUIDanielPerspectiveChanger::setViewport().
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
inherited |
Insert entry
a_min | Min of bounding rect |
a_max | Max of bounding rect |
a_dataId | Positive Id of data. Maybe zero, but negative numbers not allowed. |
Referenced by addAdditionalGLObject().
|
protectedinherited |
|
protectedinherited |
|
inlineinherited |
|
protectedinherited |
Moves the boundary by the given amount.
Definition at line 249 of file Boundary.cpp.
References Boundary::myXmax, Boundary::myXmin, Boundary::myYmax, and Boundary::myYmin.
Referenced by GUIDanielPerspectiveChanger::centerTo(), GUIDanielPerspectiveChanger::move(), and GeoConvHelper::moveConvertedBy().
|
protectedinherited |
|
protectedinherited |
|
virtualinherited |
Returns whether the boundary overlaps with the given polygon.
Implements AbstractPoly.
Definition at line 156 of file Boundary.cpp.
References AbstractPoly::crosses(), Boundary::myXmax, Boundary::myXmin, Boundary::myYmax, Boundary::myYmin, AbstractPoly::partialWithin(), and Boundary::partialWithin().
Referenced by NIVissimBoundedClusterObject::crosses(), NBEdgeCont::ignoreFilterMatch(), NIVissimConnectionCluster::overlapsWith(), and NIVissimConnectionCluster::NodeSubCluster::overlapsWith().
|
virtualinherited |
Returns whether the boundary is partially within the given polygon.
Implements AbstractPoly.
Definition at line 190 of file Boundary.cpp.
References AbstractPoly::around(), Boundary::myXmax, Boundary::myXmin, Boundary::myYmax, and Boundary::myYmin.
Referenced by PCPolyContainer::insert(), and Boundary::overlapsWith().
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
inherited |
Remove entry
a_min | Min of bounding rect |
a_max | Max of bounding rect |
a_dataId | Positive Id of data. Maybe zero, but negative numbers not allowed. |
Referenced by removeAdditionalGLObject().
|
inline |
Removes an additional object (detector/shape/trigger) from being visualised.
[in] | o | The object to remove |
Definition at line 77 of file SUMORTree.h.
References GUIGlObject::getCenteringBoundary(), RTree< GUIGlObject *, GUIGlObject, float, 2, GUIVisualizationSettings >::Remove(), Boundary::xmax(), Boundary::xmin(), Boundary::ymax(), and Boundary::ymin().
Referenced by GUIShapeContainer::movePoI(), GUIShapeContainer::removePoI(), GUIShapeContainer::removePolygon(), and GUIShapeContainer::reshapePolygon().
|
inherited |
DK 15.10.2008 - end.
Remove all entries from tree
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
inherited |
Resets the boundary.
Definition at line 66 of file Boundary.cpp.
References Boundary::myWasInitialised, Boundary::myXmax, Boundary::myXmin, Boundary::myYmax, and Boundary::myYmin.
|
protectedinherited |
|
inherited |
DK 15.10.2008 - begin.
Find all within search rectangle
a_min | Min of search bounding rect |
a_max | Max of search bounding rect |
a_searchResult | Search result array. Caller should set grow size. Function will reset, not append to array. |
a_resultCallback | Callback function to return result. Callback should return 'true' to continue searching |
a_context | User context to pass as parameter to a_resultCallback |
|
protectedinherited |
Sets the boundary to the given values.
Definition at line 240 of file Boundary.cpp.
References Boundary::myXmax, Boundary::myXmin, Boundary::myYmax, Boundary::myYmin, Boundary::xmax(), Boundary::xmin(), Boundary::ymax(), and Boundary::ymin().
|
protectedinherited |
|
inherited |
Returns maximum x-coordinate.
Definition at line 118 of file Boundary.cpp.
References Boundary::myXmax.
Referenced by Boundary::add(), NIVissimConnectionCluster::add(), addAdditionalGLObject(), NIVissimConnectionCluster::around(), NIVissimConnection::buildNodeClusters(), GUIDanielPerspectiveChanger::changeCanvassLeft(), NIVissimDisturbance::computeBounding(), NIVissimBoundedClusterObject::crosses(), GeomHelper::crossPoint(), GUIViewTraffic::doPaintGL(), NIVissimConnection::getBoundingBox(), NIVissimConnectionCluster::getPositionForEdge(), GUINet::initGUIStructures(), main(), GUISUMOAbstractView::makeSnapshot(), NIVissimConnectionCluster::NIVissimConnectionCluster(), NIVissimConnectionCluster::overlapsWith(), NIVissimConnectionCluster::NodeSubCluster::overlapsWith(), GUISUMOAbstractView::paintGLGrid(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_GUI::processGet(), NIVissimConnectionCluster::recheckEdges(), NIVissimConnectionCluster::recomputeBoundary(), removeAdditionalGLObject(), Boundary::set(), GUIVehicle::setFunctionalColor(), BinaryFormatter::writeAttr(), and GUIDanielPerspectiveChanger::zoom().
|
inherited |
Returns minimum x-coordinate.
Definition at line 112 of file Boundary.cpp.
References Boundary::myXmin.
Referenced by Boundary::add(), NIVissimConnectionCluster::add(), addAdditionalGLObject(), GUISUMOAbstractView::applyGLTransform(), NIVissimConnectionCluster::around(), NIVissimConnection::buildNodeClusters(), GUIDanielPerspectiveChanger::changeCanvassLeft(), NBNetBuilder::compute(), NIVissimDisturbance::computeBounding(), NIVissimBoundedClusterObject::crosses(), GeomHelper::crossPoint(), GUIViewTraffic::doPaintGL(), NIVissimConnection::getBoundingBox(), NIVissimConnectionCluster::getPositionForEdge(), GUISUMOAbstractView::getPositionInformation(), GUINet::initGUIStructures(), main(), GUISUMOAbstractView::makeSnapshot(), NIVissimConnectionCluster::NIVissimConnectionCluster(), NIVissimConnectionCluster::overlapsWith(), NIVissimConnectionCluster::NodeSubCluster::overlapsWith(), GUISUMOAbstractView::paintGLGrid(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_GUI::processGet(), NIVissimConnectionCluster::recheckEdges(), NIVissimConnectionCluster::recomputeBoundary(), removeAdditionalGLObject(), Boundary::set(), GUIVehicle::setFunctionalColor(), BinaryFormatter::writeAttr(), and GUIDanielPerspectiveChanger::zoom().
|
inherited |
Returns maximum y-coordinate.
Definition at line 130 of file Boundary.cpp.
References Boundary::myYmax.
Referenced by Boundary::add(), addAdditionalGLObject(), GUIDanielPerspectiveChanger::changeCanvassLeft(), GeomHelper::crossPoint(), GUIViewTraffic::doPaintGL(), GUINet::initGUIStructures(), main(), GUISUMOAbstractView::makeSnapshot(), GUISUMOAbstractView::paintGLGrid(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_GUI::processGet(), removeAdditionalGLObject(), Boundary::set(), GUIVehicle::setFunctionalColor(), BinaryFormatter::writeAttr(), and GUIDanielPerspectiveChanger::zoom().
|
inherited |
Returns minimum y-coordinate.
Definition at line 124 of file Boundary.cpp.
References Boundary::myYmin.
Referenced by Boundary::add(), addAdditionalGLObject(), GUISUMOAbstractView::applyGLTransform(), GUIDanielPerspectiveChanger::changeCanvassLeft(), NBNetBuilder::compute(), GeomHelper::crossPoint(), GUIViewTraffic::doPaintGL(), GUISUMOAbstractView::getPositionInformation(), GUINet::initGUIStructures(), main(), GUISUMOAbstractView::makeSnapshot(), GUISUMOAbstractView::paintGLGrid(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_GUI::processGet(), removeAdditionalGLObject(), Boundary::set(), GUIVehicle::setFunctionalColor(), BinaryFormatter::writeAttr(), and GUIDanielPerspectiveChanger::zoom().
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |