Eclipse SUMO - Simulation of Urban MObility
|
#include <GNEPathManager.h>
Data Structures | |
class | PathCalculator |
class used to calculate paths in nets More... | |
class | PathDraw |
class used to mark path draw More... | |
Public Member Functions | |
void | calculateConsecutivePathEdges (GNEPathElement *pathElement, SUMOVehicleClass vClass, const std::vector< GNEEdge * > &edges, const int firstLaneIndex=-1, const int lastLaneIndex=-1) |
calculate consecutive path edges | |
void | calculateConsecutivePathLanes (GNEPathElement *pathElement, const std::vector< GNELane * > &lanes) |
calculate consecutive path lanes | |
void | calculatePath (GNEPathElement *pathElement, SUMOVehicleClass vClass, const std::vector< GNEEdge * > &edges) |
calculate path lanes between list of edges (using dijkstra, require path calculator updated) | |
void | calculatePath (GNEPathElement *pathElement, SUMOVehicleClass vClass, GNEJunction *fromJunction, GNEJunction *toJunction) |
calculate path between from junction and to junction (using dijkstra, require path calculator updated) | |
void | calculatePath (GNEPathElement *pathElement, SUMOVehicleClass vClass, GNEJunction *fromJunction, GNELane *toLane) |
calculate path between from junction and to edge (using dijkstra, require path calculator updated) | |
void | calculatePath (GNEPathElement *pathElement, SUMOVehicleClass vClass, GNELane *fromLane, GNEJunction *toJunction) |
calculate path between from edge and to junction(using dijkstra, require path calculator updated) | |
void | calculatePath (GNEPathElement *pathElement, SUMOVehicleClass vClass, GNELane *fromLane, GNELane *toLane) |
calculate path between from-to edges (using dijkstra, require path calculator updated) | |
void | clearSegments () |
clear segments | |
void | drawJunctionPathElements (const GUIVisualizationSettings &s, const GNEJunction *junction) const |
draw junction path elements | |
void | drawLanePathElements (const GUIVisualizationSettings &s, const GNELane *lane) const |
draw lane path elements | |
const GNELane * | getFirstLane (const GNEPathElement *pathElement) const |
get first lane associated with path element | |
PathCalculator * | getPathCalculator () |
obtain instance of PathCalculator | |
PathDraw * | getPathDraw () |
obtain instance of PathDraw | |
const GNEPathElement * | getPathElement (const GUIGlObject *GLObject) const |
get path element | |
const std::vector< GNESegment * > & | getPathElementSegments (GNEPathElement *pathElement) const |
get path segments | |
GNEPathManager (const GNENet *net) | |
constructor | |
void | invalidateJunctionPath (const GNEJunction *junction) |
invalidate junction path | |
void | invalidateLanePath (const GNELane *lane) |
invalidate lane path | |
bool | isPathValid (const GNEPathElement *pathElement) const |
check if path element is valid | |
void | redrawPathElements (const GUIVisualizationSettings &s) const |
redraw path elements saved in gViewObjectsHandler buffer | |
void | removePath (GNEPathElement *pathElement) |
remove path | |
~GNEPathManager () | |
destructor | |
Protected Member Functions | |
void | addSegmentInJunctionSegments (GNESegment *segment, const GNEJunction *junction) |
add segments int junctionSegments (called by GNESegment constructor) | |
void | addSegmentInLaneSegments (GNESegment *segment, const GNELane *lane) |
add segments int laneSegments (called by GNESegment constructor) | |
void | buildPath (GNEPathElement *pathElement, SUMOVehicleClass vClass, const std::vector< GNEEdge * > path, GNELane *fromLane, GNEJunction *fromJunction, GNELane *toLane, GNEJunction *toJunction) |
build path | |
void | clearSegmentFromJunctionAndLaneSegments (GNESegment *segment) |
clear segments from junction and lane Segments (called by GNESegment destructor) | |
bool | connectedLanes (const GNELane *fromLane, const GNELane *toLane) const |
check if given lanes are connected | |
Protected Attributes | |
bool | myCleaningSegments = false |
flag for clear segments quickly | |
std::map< const GNEJunction *, std::set< GNESegment * > > | myJunctionSegments |
map with junction segments | |
std::map< const GNELane *, std::set< GNESegment * > > | myLaneSegments |
map with lane segments | |
PathCalculator * | myPathCalculator |
PathCalculator instance. | |
PathDraw * | myPathDraw |
PathDraw instance. | |
std::map< const GNEPathElement *, std::vector< GNESegment * > > | myPaths |
map with path element and their associated segments | |
Private Member Functions | |
GNEPathManager (const GNEPathManager &)=delete | |
Invalidated copy constructor. | |
void | markLabelSegment (const std::vector< GNESegment * > &segments) const |
mark label segment | |
GNEPathManager & | operator= (const GNEPathManager &)=delete |
Invalidated assignment operator. | |
Private Attributes | |
const std::vector< GNESegment * > | myEmptySegments |
empty segments (used in getPathElementSegments) | |
Friends | |
class | GNESegment |
friend class declaration | |
Definition at line 48 of file GNEPathManager.h.
GNEPathManager::GNEPathManager | ( | const GNENet * | net | ) |
constructor
Definition at line 428 of file GNEPathManager.cpp.
GNEPathManager::~GNEPathManager | ( | ) |
destructor
Definition at line 434 of file GNEPathManager.cpp.
References clearSegments(), myPathCalculator, and myPathDraw.
|
privatedelete |
Invalidated copy constructor.
|
protected |
add segments int junctionSegments (called by GNESegment constructor)
Definition at line 769 of file GNEPathManager.cpp.
References myJunctionSegments.
Referenced by GNESegment::GNESegment().
|
protected |
add segments int laneSegments (called by GNESegment constructor)
Definition at line 763 of file GNEPathManager.cpp.
References myLaneSegments.
Referenced by GNESegment::GNESegment().
|
protected |
build path
Definition at line 813 of file GNEPathManager.cpp.
References GNESegment, markLabelSegment(), GNESegment::markSegmentLabel(), myPaths, and removePath().
Referenced by calculatePath(), calculatePath(), calculatePath(), calculatePath(), and calculatePath().
void GNEPathManager::calculateConsecutivePathEdges | ( | GNEPathElement * | pathElement, |
SUMOVehicleClass | vClass, | ||
const std::vector< GNEEdge * > & | edges, | ||
const int | firstLaneIndex = -1 , |
||
const int | lastLaneIndex = -1 |
||
) |
calculate consecutive path edges
Definition at line 558 of file GNEPathManager.cpp.
References calculateConsecutivePathLanes().
Referenced by GNEEdgeRelData::computePathElement(), GNERoute::computePathElement(), GNEDemandElementPlan::computePlanPathElement(), and GNEEdgeData::updateGeometry().
void GNEPathManager::calculateConsecutivePathLanes | ( | GNEPathElement * | pathElement, |
const std::vector< GNELane * > & | lanes | ||
) |
calculate consecutive path lanes
Definition at line 590 of file GNEPathManager.cpp.
References GNESegment, markLabelSegment(), myPaths, and removePath().
Referenced by calculateConsecutivePathEdges(), GNELaneAreaDetector::computePathElement(), and GNEOverheadWire::computePathElement().
void GNEPathManager::calculatePath | ( | GNEPathElement * | pathElement, |
SUMOVehicleClass | vClass, | ||
const std::vector< GNEEdge * > & | edges | ||
) |
calculate path lanes between list of edges (using dijkstra, require path calculator updated)
Definition at line 546 of file GNEPathManager.cpp.
References buildPath(), GNEPathManager::PathCalculator::calculateDijkstraPath(), myPathCalculator, and removePath().
void GNEPathManager::calculatePath | ( | GNEPathElement * | pathElement, |
SUMOVehicleClass | vClass, | ||
GNEJunction * | fromJunction, | ||
GNEJunction * | toJunction | ||
) |
calculate path between from junction and to junction (using dijkstra, require path calculator updated)
Definition at line 539 of file GNEPathManager.cpp.
References buildPath(), GNEPathManager::PathCalculator::calculateDijkstraPath(), and myPathCalculator.
void GNEPathManager::calculatePath | ( | GNEPathElement * | pathElement, |
SUMOVehicleClass | vClass, | ||
GNEJunction * | fromJunction, | ||
GNELane * | toLane | ||
) |
calculate path between from junction and to edge (using dijkstra, require path calculator updated)
Definition at line 531 of file GNEPathManager.cpp.
References buildPath(), GNEPathManager::PathCalculator::calculateDijkstraPath(), GNELane::getParentEdge(), and myPathCalculator.
void GNEPathManager::calculatePath | ( | GNEPathElement * | pathElement, |
SUMOVehicleClass | vClass, | ||
GNELane * | fromLane, | ||
GNEJunction * | toJunction | ||
) |
calculate path between from edge and to junction(using dijkstra, require path calculator updated)
Definition at line 523 of file GNEPathManager.cpp.
References buildPath(), GNEPathManager::PathCalculator::calculateDijkstraPath(), GNELane::getParentEdge(), and myPathCalculator.
void GNEPathManager::calculatePath | ( | GNEPathElement * | pathElement, |
SUMOVehicleClass | vClass, | ||
GNELane * | fromLane, | ||
GNELane * | toLane | ||
) |
calculate path between from-to edges (using dijkstra, require path calculator updated)
Definition at line 515 of file GNEPathManager.cpp.
References buildPath(), GNEPathManager::PathCalculator::calculateDijkstraPath(), GNELane::getParentEdge(), and myPathCalculator.
Referenced by GNEVehicle::computePathElement().
|
protected |
clear segments from junction and lane Segments (called by GNESegment destructor)
Definition at line 775 of file GNEPathManager.cpp.
References GNESegment::getJunction(), GNESegment::getLane(), myJunctionSegments, and myLaneSegments.
Referenced by GNESegment::~GNESegment().
void GNEPathManager::clearSegments | ( | ) |
clear segments
Definition at line 743 of file GNEPathManager.cpp.
References myCleaningSegments, myJunctionSegments, myLaneSegments, and myPaths.
Referenced by GNENet::computeDemandElements(), and ~GNEPathManager().
|
protected |
check if given lanes are connected
Definition at line 797 of file GNEPathManager.cpp.
References NBEdge::getConnectionsFromLane(), GNELane::getIndex(), GNEEdge::getNBEdge(), and GNELane::getParentEdge().
void GNEPathManager::drawJunctionPathElements | ( | const GUIVisualizationSettings & | s, |
const GNEJunction * | junction | ||
) | const |
draw junction path elements
Definition at line 667 of file GNEPathManager.cpp.
References gViewObjectsHandler, GUIViewObjectsHandler::isPathElementMarkForRedraw(), and myJunctionSegments.
Referenced by GNEJunction::drawJunctionChildren().
void GNEPathManager::drawLanePathElements | ( | const GUIVisualizationSettings & | s, |
const GNELane * | lane | ||
) | const |
draw lane path elements
Definition at line 634 of file GNEPathManager.cpp.
References GNELane::drawOverlappedRoutes(), GNEViewNet::getDemandViewOptions(), GNEAttributeCarrier::getNet(), GNENet::getViewNet(), gViewObjectsHandler, GUIViewObjectsHandler::isPathElementMarkForRedraw(), myLaneSegments, and GNEViewNetHelper::DemandViewOptions::showOverlappedRoutes().
Referenced by GNELane::drawChildren().
const GNELane * GNEPathManager::getFirstLane | ( | const GNEPathElement * | pathElement | ) | const |
get first lane associated with path element
Definition at line 504 of file GNEPathManager.cpp.
References myPaths.
GNEPathManager::PathCalculator * GNEPathManager::getPathCalculator | ( | ) |
obtain instance of PathCalculator
Definition at line 445 of file GNEPathManager.cpp.
References myPathCalculator.
Referenced by GNEDemandElement::buildMenuCommandRouteLength(), GNERouteHandler::canReverse(), GNERouteHandler::canReverse(), GNENet::computeDemandElements(), GNEVehicle::computePathElement(), GNEVehicle::getDemandElementProblem(), GNEVehicle::isDemandElementValid(), GNEApplicationWindow::onCmdComputePathManager(), GNEViewNet::onCmdLaneReachability(), GNEApplicationWindow::onUpdComputePathManager(), GNEPathCreator::Path::Path(), GNEPathCreator::Path::Path(), GNEPlanCreator::PlanPath::PlanPath(), GNEPlanCreator::PlanPath::PlanPath(), GNEPlanCreator::PlanPath::PlanPath(), GNEConnection::setAttribute(), GNECrossing::setAttribute(), GNEEdge::setAttribute(), GNEJunction::setAttribute(), GNELane::setAttribute(), GNEPathCreator::setPossibleCandidates(), GNEPathCreator::setSpecialCandidates(), GNERouteHandler::transformToRouteFlow(), and GNERouteHandler::transformToVehicle().
GNEPathManager::PathDraw * GNEPathManager::getPathDraw | ( | ) |
obtain instance of PathDraw
Definition at line 479 of file GNEPathManager.cpp.
References myPathDraw.
Referenced by GNEViewNet::doPaintGL(), GNERoute::drawJunctionPartialGL(), GNEVehicle::drawJunctionPartialGL(), GNERoute::drawLanePartialGL(), GNEVehicle::drawLanePartialGL(), GNEDemandElementPlan::drawPlanJunctionPartial(), and GNEDemandElementPlan::drawPlanLanePartial().
const GNEPathElement * GNEPathManager::getPathElement | ( | const GUIGlObject * | GLObject | ) | const |
const std::vector< GNESegment * > & GNEPathManager::getPathElementSegments | ( | GNEPathElement * | pathElement | ) | const |
get path segments
Definition at line 469 of file GNEPathManager.cpp.
References myEmptySegments, and myPaths.
Referenced by GNEDemandElement::getEdgeStopIndex().
void GNEPathManager::invalidateJunctionPath | ( | const GNEJunction * | junction | ) |
invalidate junction path
Definition at line 725 of file GNEPathManager.cpp.
References myJunctionSegments.
Referenced by GNENet::deleteJunction().
void GNEPathManager::invalidateLanePath | ( | const GNELane * | lane | ) |
invalidate lane path
Definition at line 707 of file GNEPathManager.cpp.
References myLaneSegments.
Referenced by GNENet::deleteEdge(), and GNENet::deleteLane().
bool GNEPathManager::isPathValid | ( | const GNEPathElement * | pathElement | ) | const |
check if path element is valid
Definition at line 485 of file GNEPathManager.cpp.
References myPaths.
Referenced by GNERoute::computePathElement(), GNEContainer::drawGL(), GNEVehicle::drawGL(), and GNEVehicle::isDemandElementValid().
|
private |
mark label segment
Definition at line 892 of file GNEPathManager.cpp.
References GNESegment::markSegmentLabel().
Referenced by buildPath(), and calculateConsecutivePathLanes().
|
privatedelete |
Invalidated assignment operator.
void GNEPathManager::redrawPathElements | ( | const GUIVisualizationSettings & | s | ) | const |
redraw path elements saved in gViewObjectsHandler buffer
Definition at line 687 of file GNEPathManager.cpp.
References GUIViewObjectsHandler::getRedrawPathElements(), gViewObjectsHandler, and myPaths.
Referenced by GNEViewNet::redrawPathElementContours().
void GNEPathManager::removePath | ( | GNEPathElement * | pathElement | ) |
remove path
Definition at line 620 of file GNEPathManager.cpp.
References myPaths.
Referenced by buildPath(), calculateConsecutivePathLanes(), calculatePath(), and GNEDataInterval::removeGenericDataChild().
|
friend |
friend class declaration
Definition at line 51 of file GNEPathManager.h.
Referenced by buildPath(), and calculateConsecutivePathLanes().
|
protected |
flag for clear segments quickly
Definition at line 241 of file GNEPathManager.h.
Referenced by clearSegments(), and GNESegment::~GNESegment().
|
private |
empty segments (used in getPathElementSegments)
Definition at line 248 of file GNEPathManager.h.
Referenced by getPathElementSegments().
|
protected |
map with junction segments
Definition at line 238 of file GNEPathManager.h.
Referenced by addSegmentInJunctionSegments(), clearSegmentFromJunctionAndLaneSegments(), clearSegments(), drawJunctionPathElements(), and invalidateJunctionPath().
|
protected |
map with lane segments
Definition at line 235 of file GNEPathManager.h.
Referenced by addSegmentInLaneSegments(), clearSegmentFromJunctionAndLaneSegments(), clearSegments(), drawLanePathElements(), and invalidateLanePath().
|
protected |
PathCalculator instance.
Definition at line 226 of file GNEPathManager.h.
Referenced by calculatePath(), calculatePath(), calculatePath(), calculatePath(), calculatePath(), getPathCalculator(), and ~GNEPathManager().
|
protected |
PathDraw instance.
Definition at line 229 of file GNEPathManager.h.
Referenced by getPathDraw(), and ~GNEPathManager().
|
protected |
map with path element and their associated segments
Definition at line 232 of file GNEPathManager.h.
Referenced by buildPath(), calculateConsecutivePathLanes(), clearSegments(), getFirstLane(), getPathElement(), getPathElementSegments(), isPathValid(), redrawPathElements(), and removePath().