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

#include <NBAlgorithms.h>

Collaboration diagram for NBNodesEdgesSorter:
Collaboration graph

Data Structures

class  crossing_by_junction_angle_sorter
 Sorts crossings by minimum clockwise clockwise edge angle. Use the ordering found in myAllEdges of the given node. More...
 
class  edge_by_junction_angle_sorter
 Sorts incoming and outgoing edges clockwise around the given node. More...
 

Static Public Member Functions

static void sortNodesEdges (NBNodeCont &nc, bool useNodeShape=false)
 Sorts a node's edges clockwise regarding driving direction. More...
 

Static Private Member Functions

static void swapWhenReversed (const NBNode *const n, const std::vector< NBEdge * >::iterator &i1, const std::vector< NBEdge * >::iterator &i2)
 Assures correct order for same-angle opposite-direction edges. More...
 

Detailed Description

Definition at line 108 of file NBAlgorithms.h.

Member Function Documentation

void NBNodesEdgesSorter::sortNodesEdges ( NBNodeCont nc,
bool  useNodeShape = false 
)
static

Sorts a node's edges clockwise regarding driving direction.

Parameters
[in]ncThe container of nodes to loop along
[in]useNodeShapeWhether to sort based on the node shape (instead of only the edge angle)

Definition at line 134 of file NBAlgorithms.cpp.

References PositionVector::area(), NBNodeCont::begin(), NBNodeCont::end(), NBNode::getShape(), NBNode::myAllEdges, NBNode::myCrossings, NBNode::myIncomingEdges, NBNode::myOutgoingEdges, and swapWhenReversed().

Referenced by NBNetBuilder::compute(), and GNENet::GNENet().

void NBNodesEdgesSorter::swapWhenReversed ( const NBNode *const  n,
const std::vector< NBEdge * >::iterator &  i1,
const std::vector< NBEdge * >::iterator &  i2 
)
staticprivate

Assures correct order for same-angle opposite-direction edges.

Parameters
[in]nThe currently processed node
[in]i1Pointer to first edge
[in]i2Pointer to second edge

Definition at line 208 of file NBAlgorithms.cpp.

References NBEdge::getToNode(), and NBEdge::isTurningDirectionAt().

Referenced by sortNodesEdges().


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