Eclipse SUMO - Simulation of Urban MObility
GUIEdgeControlBuilder Class Reference

Derivation of NLEdgeControlBuilder which builds gui-edges. More...

#include <GUIEdgeControlBuilder.h>

Inheritance diagram for GUIEdgeControlBuilder:
[legend]
Collaboration diagram for GUIEdgeControlBuilder:
[legend]

Public Member Functions

virtual void addCrossingEdges (const std::vector< std::string > &)
 add the crossingEdges in a crossing edge if present More...
 
MSLaneaddLane (const std::string &id, double maxSpeed, double friction, double length, const PositionVector &shape, double width, SVCPermissions permissions, SVCPermissions changeLeft, SVCPermissions changeRight, int index, bool isRampAccel, const std::string &type, const PositionVector &outlineShape) override
 Builds and adds a lane. More...
 
virtual void addNeigh (const std::string id)
 Adds a neighbor to the current lane. More...
 
void addStopOffsets (const StopOffset &stopOffsets)
 process a stopOffset element (originates either from the active edge or lane). More...
 
void beginEdgeParsing (const std::string &id, const SumoXMLEdgeFunc function, const std::string &streetName, const std::string &edgeType, int priority, const std::string &bidi, double distance)
 Begins building of an MSEdge. More...
 
MSEdgeControlbuild (const MMVersion &networkVersion)
 builds the MSEdgeControl-class which holds all edges More...
 
MSEdgebuildEdge (const std::string &id, const SumoXMLEdgeFunc function, const std::string &streetName, const std::string &edgeType, const int priority, const double distance) override
 Builds an edge instance (GUIEdge in this case) More...
 
virtual MSEdgecloseEdge ()
 Closes the building of an edge; The edge is completely described by now and may not be opened again. More...
 
void closeLane ()
 Closes the building of a lane; The edge is completely described by now and may not be opened again. More...
 
 GUIEdgeControlBuilder ()
 Constructor. More...
 
std::string reportCurrentEdgeOrLane () const
 Return info about currently processed edge or lane. More...
 
 ~GUIEdgeControlBuilder ()
 Destructor. More...
 

Protected Member Functions

void applyDefaultStopOffsetsToLanes ()
 
void setDefaultStopOffset (const StopOffset &stopOffset)
 set the stopOffset for the last added lane. More...
 
void updateCurrentLaneStopOffset (const StopOffset &stopOffset)
 set the stopOffset for the last added lane. More...
 

Protected Attributes

MSEdgemyActiveEdge
 pointer to the currently chosen edge More...
 
std::map< MSEdge *, std::string, ComparatorNumericalIdLessmyBidiEdges
 temporary storage for bidi attributes (to be resolved after loading all edges) More...
 
StopOffset myCurrentDefaultStopOffset
 The default stop offset for all lanes belonging to the active edge (this is set if the edge was given a stopOffset child) More...
 
int myCurrentLaneIndex
 The index of the currently active lane (-1 if none is active) More...
 
int myCurrentNumericalEdgeID
 A running number for edge numbering. More...
 
int myCurrentNumericalLaneID
 A running number for lane numbering. More...
 
MSEdgeVector myEdges
 Temporary, internal storage for built edges. More...
 
std::vector< MSLane * > * myLaneStorage
 pointer to a temporary lane storage More...
 
std::vector< std::pair< MSLane *, std::string > > myOppositeLanes
 

Private Member Functions

 GUIEdgeControlBuilder (const GUIEdgeControlBuilder &s)
 invalidated copy constructor More...
 
GUIEdgeControlBuilderoperator= (const GUIEdgeControlBuilder &s)
 invalidated assignment operator More...
 

Detailed Description

Derivation of NLEdgeControlBuilder which builds gui-edges.

Instead of building pure microsim-objects (MSEdge and MSLane), this class builds GUIEdges and GUILanes.

See also
NLEdgeControlBuilder

Definition at line 50 of file GUIEdgeControlBuilder.h.

Constructor & Destructor Documentation

◆ GUIEdgeControlBuilder() [1/2]

GUIEdgeControlBuilder::GUIEdgeControlBuilder ( )

Constructor.

Parameters
[in]glObjectIDStorageStorage of gl-ids used to assign new ids to built edges

Definition at line 40 of file GUIEdgeControlBuilder.cpp.

◆ ~GUIEdgeControlBuilder()

GUIEdgeControlBuilder::~GUIEdgeControlBuilder ( )

Destructor.

Definition at line 44 of file GUIEdgeControlBuilder.cpp.

◆ GUIEdgeControlBuilder() [2/2]

GUIEdgeControlBuilder::GUIEdgeControlBuilder ( const GUIEdgeControlBuilder s)
private

invalidated copy constructor

Member Function Documentation

◆ addCrossingEdges()

void NLEdgeControlBuilder::addCrossingEdges ( const std::vector< std::string > &  crossingEdges)
virtualinherited

add the crossingEdges in a crossing edge if present

Parameters
[in]thevector of crossed edges id

Definition at line 256 of file NLEdgeControlBuilder.cpp.

References NLEdgeControlBuilder::myActiveEdge, and MSEdge::setCrossingEdges().

Referenced by NLHandler::beginEdgeParsing().

Here is the caller graph for this function:

◆ addLane()

MSLane * GUIEdgeControlBuilder::addLane ( const std::string &  id,
double  maxSpeed,
double  friction,
double  length,
const PositionVector shape,
double  width,
SVCPermissions  permissions,
SVCPermissions  changeLeft,
SVCPermissions  changeRight,
int  index,
bool  isRampAccel,
const std::string &  type,
const PositionVector outlineShape 
)
overridevirtual

Builds and adds a lane.

Parameters
[in]idThe lane's id
[in]maxSpeedThe speed allowed on this lane
[in]lengthThe lane's length
[in]shapeThe shape of the lane
[in]widthThe width of the lane
[in]permissionsEncoding of vehicle classes that may drive on this lane
[in]indexThe index of this lane within its parent edge
See also
SUMOVehicleClass
MSLane

Reimplemented from NLEdgeControlBuilder.

Definition at line 48 of file GUIEdgeControlBuilder.cpp.

References NLEdgeControlBuilder::myActiveEdge, NLEdgeControlBuilder::myCurrentLaneIndex, NLEdgeControlBuilder::myCurrentNumericalLaneID, and NLEdgeControlBuilder::myLaneStorage.

◆ addNeigh()

void NLEdgeControlBuilder::addNeigh ( const std::string  id)
virtualinherited

Adds a neighbor to the current lane.

Parameters
[in]idThe lane's id
See also
MSLane

Definition at line 158 of file NLEdgeControlBuilder.cpp.

References NLEdgeControlBuilder::myLaneStorage, and NLEdgeControlBuilder::myOppositeLanes.

Referenced by NLHandler::myStartElement().

Here is the caller graph for this function:

◆ addStopOffsets()

void NLEdgeControlBuilder::addStopOffsets ( const StopOffset stopOffsets)
inherited

process a stopOffset element (originates either from the active edge or lane).

Definition at line 96 of file NLEdgeControlBuilder.cpp.

References NLEdgeControlBuilder::myCurrentLaneIndex, NLEdgeControlBuilder::setDefaultStopOffset(), and NLEdgeControlBuilder::updateCurrentLaneStopOffset().

Referenced by NLHandler::myStartElement().

Here is the caller graph for this function:

◆ applyDefaultStopOffsetsToLanes()

void NLEdgeControlBuilder::applyDefaultStopOffsetsToLanes ( )
protectedinherited

Definition at line 143 of file NLEdgeControlBuilder.cpp.

References StopOffset::isDefined(), NLEdgeControlBuilder::myActiveEdge, NLEdgeControlBuilder::myCurrentDefaultStopOffset, and NLEdgeControlBuilder::myLaneStorage.

Referenced by NLEdgeControlBuilder::closeEdge().

Here is the caller graph for this function:

◆ beginEdgeParsing()

void NLEdgeControlBuilder::beginEdgeParsing ( const std::string &  id,
const SumoXMLEdgeFunc  function,
const std::string &  streetName,
const std::string &  edgeType,
int  priority,
const std::string &  bidi,
double  distance 
)
inherited

Begins building of an MSEdge.

Builds an instance of MSEdge using "buildEdge". Stores it as the current edge in "myActiveEdge" and appends it to the list of built edges ("myEdges").

The given information is used to build the edge.

Parameters
[in]idThe id of the edge
[in]functionThe function of the edge
[in]streetNameThe street name of the edge
Exceptions
InvalidArgumentIf an edge with the same name was already built

Definition at line 59 of file NLEdgeControlBuilder.cpp.

References NLEdgeControlBuilder::buildEdge(), MSEdge::dictionary(), NLEdgeControlBuilder::myActiveEdge, NLEdgeControlBuilder::myBidiEdges, NLEdgeControlBuilder::myEdges, and NLEdgeControlBuilder::myLaneStorage.

Referenced by NLHandler::beginEdgeParsing().

Here is the caller graph for this function:

◆ build()

MSEdgeControl * NLEdgeControlBuilder::build ( const MMVersion networkVersion)
inherited

builds the MSEdgeControl-class which holds all edges

Definition at line 183 of file NLEdgeControlBuilder.cpp.

References MELoop::buildSegmentsFor(), deprecatedVehicleClassesSeen, MSLane::dictionary(), OptionsCont::getOptions(), MSGlobals::gMesoNet, MSGlobals::gUseMesoSim, MSGlobals::gUsingInternalLanes, NLEdgeControlBuilder::myBidiEdges, NLEdgeControlBuilder::myEdges, NLEdgeControlBuilder::myOppositeLanes, parseVehicleClasses(), MSEdge::setMesoIgnoredVClasses(), TL, TLF, toString(), WRITE_ERRORF, and WRITE_WARNINGF.

Referenced by NLBuilder::buildNet().

Here is the caller graph for this function:

◆ buildEdge()

MSEdge * GUIEdgeControlBuilder::buildEdge ( const std::string &  id,
const SumoXMLEdgeFunc  function,
const std::string &  streetName,
const std::string &  edgeType,
const int  priority,
const double  distance 
)
overridevirtual

Builds an edge instance (GUIEdge in this case)

Builds an GUIEdge-instance using the given name and the current index "myCurrentNumericalEdgeID" Post-increments the index, returns the built edge.

Parameters
[in]idThe id of the edge to build

Reimplemented from NLEdgeControlBuilder.

Definition at line 66 of file GUIEdgeControlBuilder.cpp.

References NLEdgeControlBuilder::myCurrentNumericalEdgeID.

◆ closeEdge()

MSEdge * NLEdgeControlBuilder::closeEdge ( )
virtualinherited

Closes the building of an edge; The edge is completely described by now and may not be opened again.

Definition at line 164 of file NLEdgeControlBuilder.cpp.

References NLEdgeControlBuilder::applyDefaultStopOffsetsToLanes(), MSEdge::initialize(), NLEdgeControlBuilder::myActiveEdge, NLEdgeControlBuilder::myCurrentDefaultStopOffset, NLEdgeControlBuilder::myLaneStorage, and StopOffset::reset().

Referenced by NLHandler::closeEdge().

Here is the caller graph for this function:

◆ closeLane()

void NLEdgeControlBuilder::closeLane ( )
inherited

Closes the building of a lane; The edge is completely described by now and may not be opened again.

Definition at line 177 of file NLEdgeControlBuilder.cpp.

References NLEdgeControlBuilder::myCurrentLaneIndex.

Referenced by NLHandler::myEndElement().

Here is the caller graph for this function:

◆ operator=()

GUIEdgeControlBuilder& GUIEdgeControlBuilder::operator= ( const GUIEdgeControlBuilder s)
private

invalidated assignment operator

◆ reportCurrentEdgeOrLane()

std::string NLEdgeControlBuilder::reportCurrentEdgeOrLane ( ) const
inherited

Return info about currently processed edge or lane.

Definition at line 106 of file NLEdgeControlBuilder.cpp.

References Named::getID(), NLEdgeControlBuilder::myActiveEdge, and NLEdgeControlBuilder::myCurrentLaneIndex.

Referenced by NLHandler::myStartElement().

Here is the caller graph for this function:

◆ setDefaultStopOffset()

void NLEdgeControlBuilder::setDefaultStopOffset ( const StopOffset stopOffset)
protectedinherited

set the stopOffset for the last added lane.

Definition at line 133 of file NLEdgeControlBuilder.cpp.

References Named::getID(), StopOffset::isDefined(), NLEdgeControlBuilder::myActiveEdge, NLEdgeControlBuilder::myCurrentDefaultStopOffset, and WRITE_WARNING.

Referenced by NLEdgeControlBuilder::addStopOffsets().

Here is the caller graph for this function:

◆ updateCurrentLaneStopOffset()

void NLEdgeControlBuilder::updateCurrentLaneStopOffset ( const StopOffset stopOffset)
protectedinherited

set the stopOffset for the last added lane.

Definition at line 117 of file NLEdgeControlBuilder.cpp.

References Named::getID(), StopOffset::isDefined(), NLEdgeControlBuilder::myActiveEdge, NLEdgeControlBuilder::myLaneStorage, toString(), and WRITE_WARNING.

Referenced by NLEdgeControlBuilder::addStopOffsets().

Here is the caller graph for this function:

Field Documentation

◆ myActiveEdge

◆ myBidiEdges

std::map<MSEdge*, std::string, ComparatorNumericalIdLess> NLEdgeControlBuilder::myBidiEdges
protectedinherited

temporary storage for bidi attributes (to be resolved after loading all edges)

Definition at line 175 of file NLEdgeControlBuilder.h.

Referenced by NLEdgeControlBuilder::beginEdgeParsing(), and NLEdgeControlBuilder::build().

◆ myCurrentDefaultStopOffset

StopOffset NLEdgeControlBuilder::myCurrentDefaultStopOffset
protectedinherited

The default stop offset for all lanes belonging to the active edge (this is set if the edge was given a stopOffset child)

Definition at line 166 of file NLEdgeControlBuilder.h.

Referenced by NLEdgeControlBuilder::applyDefaultStopOffsetsToLanes(), NLEdgeControlBuilder::closeEdge(), and NLEdgeControlBuilder::setDefaultStopOffset().

◆ myCurrentLaneIndex

int NLEdgeControlBuilder::myCurrentLaneIndex
protectedinherited

◆ myCurrentNumericalEdgeID

int NLEdgeControlBuilder::myCurrentNumericalEdgeID
protectedinherited

A running number for edge numbering.

Definition at line 157 of file NLEdgeControlBuilder.h.

Referenced by NLEdgeControlBuilder::buildEdge(), and buildEdge().

◆ myCurrentNumericalLaneID

int NLEdgeControlBuilder::myCurrentNumericalLaneID
protectedinherited

A running number for lane numbering.

Definition at line 154 of file NLEdgeControlBuilder.h.

Referenced by NLEdgeControlBuilder::addLane(), and addLane().

◆ myEdges

MSEdgeVector NLEdgeControlBuilder::myEdges
protectedinherited

Temporary, internal storage for built edges.

Definition at line 160 of file NLEdgeControlBuilder.h.

Referenced by NLEdgeControlBuilder::beginEdgeParsing(), and NLEdgeControlBuilder::build().

◆ myLaneStorage

◆ myOppositeLanes

std::vector<std::pair<MSLane*, std::string> > NLEdgeControlBuilder::myOppositeLanes
protectedinherited

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