SUMO - Simulation of Urban MObility
GUIEdgeControlBuilder Class Reference

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

#include <GUIEdgeControlBuilder.h>

Inheritance diagram for GUIEdgeControlBuilder:
NLEdgeControlBuilder

Public Member Functions

virtual MSLaneaddLane (const std::string &id, SUMOReal maxSpeed, SUMOReal length, const PositionVector &shape, SUMOReal width, SVCPermissions permissions)
 Builds and adds a lane. More...
 
void beginEdgeParsing (const std::string &id, const MSEdge::EdgeBasicFunction function, const std::string &streetName, const std::string &edgeType, int priority)
 Begins building of an MSEdge. More...
 
MSEdgeControlbuild ()
 builds the MSEdgeControl-class which holds all edges More...
 
MSEdgebuildEdge (const std::string &id, const MSEdge::EdgeBasicFunction function, const std::string &streetName, const std::string &edgeType, const int priority)
 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...
 
 GUIEdgeControlBuilder ()
 Constructor. More...
 
 ~GUIEdgeControlBuilder ()
 Destructor. More...
 

Protected Attributes

MSEdgemyActiveEdge
 pointer to the currently chosen edge More...
 
unsigned int myCurrentNumericalEdgeID
 A running number for edge numbering. More...
 
unsigned 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...
 

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 60 of file GUIEdgeControlBuilder.h.

Constructor & Destructor Documentation

GUIEdgeControlBuilder::GUIEdgeControlBuilder ( )

Constructor.

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

Definition at line 53 of file GUIEdgeControlBuilder.cpp.

GUIEdgeControlBuilder::~GUIEdgeControlBuilder ( )

Destructor.

Definition at line 57 of file GUIEdgeControlBuilder.cpp.

GUIEdgeControlBuilder::GUIEdgeControlBuilder ( const GUIEdgeControlBuilder s)
private

invalidated copy constructor

Member Function Documentation

MSLane * GUIEdgeControlBuilder::addLane ( const std::string &  id,
SUMOReal  maxSpeed,
SUMOReal  length,
const PositionVector shape,
SUMOReal  width,
SVCPermissions  permissions 
)
virtual

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
See also
SUMOVehicleClass
MSLane

Reimplemented from NLEdgeControlBuilder.

Definition at line 61 of file GUIEdgeControlBuilder.cpp.

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

void NLEdgeControlBuilder::beginEdgeParsing ( const std::string &  id,
const MSEdge::EdgeBasicFunction  function,
const std::string &  streetName,
const std::string &  edgeType,
int  priority 
)
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 74 of file NLEdgeControlBuilder.cpp.

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

Referenced by NLHandler::beginEdgeParsing().

MSEdge * GUIEdgeControlBuilder::buildEdge ( const std::string &  id,
const MSEdge::EdgeBasicFunction  function,
const std::string &  streetName,
const std::string &  edgeType,
const int  priority 
)
virtual

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 74 of file GUIEdgeControlBuilder.cpp.

References NLEdgeControlBuilder::myCurrentNumericalEdgeID.

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 99 of file NLEdgeControlBuilder.cpp.

References MSEdge::initialize(), NLEdgeControlBuilder::myActiveEdge, and NLEdgeControlBuilder::myLaneStorage.

Referenced by NLHandler::closeEdge().

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

invalidated assignment operator

Field Documentation

MSEdge* NLEdgeControlBuilder::myActiveEdge
protectedinherited
unsigned int NLEdgeControlBuilder::myCurrentNumericalEdgeID
protectedinherited

A running number for edge numbering.

Definition at line 137 of file NLEdgeControlBuilder.h.

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

unsigned int NLEdgeControlBuilder::myCurrentNumericalLaneID
protectedinherited

A running number for lane numbering.

Definition at line 134 of file NLEdgeControlBuilder.h.

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

MSEdgeVector NLEdgeControlBuilder::myEdges
protectedinherited

Temporary, internal storage for built edges.

Definition at line 140 of file NLEdgeControlBuilder.h.

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

std::vector<MSLane*>* NLEdgeControlBuilder::myLaneStorage
protectedinherited

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