 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
58 #include <osg/Geometry>
75 MSEdge*
const edge,
int numericalID,
78 const std::string& type) :
79 MSLane(id, maxSpeed, length, edge, numericalID, shape, width, permissions, index, isRampAccel, type),
94 int e = (int)
myShape.size() - 1;
95 for (
int i = 0; i < e; ++i) {
118 const MSLane::VehCont::iterator& at,
120 FXMutexLock locker(
myLock);
141 FXMutexLock locker(
myLock);
147 FXMutexLock locker(
myLock);
154 FXMutexLock locker(
myLock);
161 FXMutexLock locker(
myLock);
168 FXMutexLock locker(
myLock);
175 FXMutexLock locker(
myLock);
182 FXMutexLock locker(
myLock);
189 FXMutexLock locker(
myLock);
196 FXMutexLock locker(
myLock);
203 FXMutexLock locker(
myLock);
211 int noLinks = (int)
myLinks.size();
226 double w =
myWidth / (double) noLinks;
229 for (
int i = noLinks; --i >= 0;) {
230 double x2 = x1 - (double)(w / 2.);
239 int noLinks = (int)
myLinks.size();
262 double w =
myWidth / (double) noLinks;
265 for (
int i = noLinks; --i >= 0;) {
266 double x2 = x1 - (double)(w / 2.);
279 int noLinks = (int)
myLinks.size();
298 const double w =
myWidth / (double) noLinks;
301 for (
int i = 0; i < noLinks; ++i) {
308 const double stopOffsetPassenger =
myStopOffsets.begin()->second;
311 const double rot =
RAD2DEG(atan2((end.
x() - f.
x()), (f.
y() - end.
y())));
314 glTranslated(end.
x(), end.
y(), 0);
315 glRotated(rot, 0, 0, 1);
316 glTranslated(0, stopOffsetPassenger, 0);
332 const double rot =
RAD2DEG(atan2((end.
x() - f.
x()), (f.
y() - end.
y())));
333 if (link ==
nullptr) {
336 glTranslated(end.
x(), end.
y(), 0);
337 glRotated(rot, 0, 0, 1);
347 glTranslated(end.
x(), end.
y(), 0);
348 glRotated(rot, 0, 0, 1);
376 glScaled(scale, scale, 1);
397 const double rot =
RAD2DEG(atan2((end.
x() - f.
x()), (f.
y() - end.
y())));
400 glTranslated(end.
x(), end.
y(), 0);
401 glRotated(rot, 0, 0, 1);
405 for (std::vector<MSLink*>::const_iterator i =
myLinks.begin(); i !=
myLinks.end(); ++i) {
459 if (exaggeration > 1) {
462 for (std::vector<MSLink*>::const_iterator i =
myLinks.begin(); i !=
myLinks.end(); ++i) {
463 const MSLane* connected = (*i)->getLane();
464 if (connected ==
nullptr) {
471 if (exaggeration > 1) {
472 p1 = centroid + ((p1 - centroid) * exaggeration);
473 p2 = centroid + ((p2 - centroid) * exaggeration);
475 glVertex2d(p1.
x(), p1.
y());
476 glVertex2d(p2.
x(), p2.
y());
490 bool mustDrawMarkings =
false;
499 const bool detailZoom = s.
scale * exaggeration > 5;
501 if (isCrossing || isWalkingArea) {
506 glTranslated(0, 0,
getType() - 0.2);
514 const std::vector<RGBColor>& segmentColors = static_cast<const GUIEdge*>(
myEdge)->getSegmentColors();
515 if (segmentColors.size() > 0) {
518 for (
int ii = 0; ii < (int)
myShape.size() - 1; ++ii) {
527 double junctionExaggeration = 1;
547 if (hiddenBidi && !spreadSuperposed) {
556 if (spreadSuperposed) {
560 const double halfInnerFeetWidth = halfGauge - 0.039 * exaggeration;
562 const double halfCrossTieWidth = halfGauge * 1.81;
571 glTranslated(0, 0, .1);
576 }
else if (isCrossing) {
578 glTranslated(0, 0, .2);
580 glTranslated(0, 0, -.2);
582 }
else if (isWalkingArea) {
584 glTranslated(0, 0, .2);
585 if (s.
scale * exaggeration < 20.) {
590 glTranslated(0, 0, -.2);
591 #ifdef GUILane_DEBUG_DRAW_WALKING_AREA_VERTICES
601 const int cornerDetail = drawDetails && !
isInternal ? (int)(s.
scale * exaggeration) : 0;
602 const double offset = halfWidth *
MAX2(0., (exaggeration - 1));
609 #ifdef GUILane_DEBUG_DRAW_VERTICES
612 #ifdef GUILane_DEBUG_DRAW_FOE_INTERSECTIONS
622 glTranslated(0, 0, .5);
629 glColor3d(0.3, 0.3, 0.3);
647 glTranslated(0, 0, 1000);
654 glTranslated(0, 0, -1000);
656 glTranslated(0, 0, .1);
664 if ((drawDetails || junctionExaggeration > 1) && s.
showLane2Lane) {
671 if (mustDrawMarkings && drawDetails && s.
laneShowBorders && !hiddenBidi) {
684 for (MSLane::VehCont::const_iterator v = vehicles.begin(); v != vehicles.end(); ++v) {
685 if ((*v)->getLane() ==
this) {
686 static_cast<const GUIVehicle* const>(*v)->drawGL(s);
691 static_cast<const GUIVehicle* const>(*v)->drawGL(s);
713 int e = (int)
getShape().size() - 1;
714 for (
int i = 0; i < e; ++i) {
722 glVertex2d(-mw, -t - length);
723 glVertex2d(-mw2, -t - length);
724 glVertex2d(-mw2, -t);
745 const int e = (int)
getShape().size() - 1;
746 const double markWidth = 0.1;
748 for (
int i = 0; i < e; ++i) {
754 for (
int side = -1; side <= 1; side += 2) {
756 glVertex2d(side * mw, -t);
757 glVertex2d(side * mw, -t - 0.35);
758 glVertex2d(side * (mw + markWidth), -t - 0.35);
759 glVertex2d(side * (mw + markWidth), -t);
771 int e = (int)
getShape().size() - 1;
772 const double widthFactor = spreadSuperposed ? 0.4 : 1;
776 const double sideOffset = spreadSuperposed ? w * -0.5 : 0;
777 for (
int i = 0; i < e; ++i) {
783 glBegin(GL_TRIANGLES);
784 glVertex2d(sideOffset, -t - length);
785 glVertex2d(sideOffset - w4 * exaggeration, -t);
786 glVertex2d(sideOffset + w4 * exaggeration, -t);
798 glColor3d(1.0, 0.3, 0.3);
799 const double orthoLength = 0.5;
801 const std::vector<const MSLane*>& foeLanes = link->
getFoeLanes();
803 if (foeLanes.size() == lengthsBehind.size()) {
804 for (
int i = 0; i < (int)foeLanes.size(); ++i) {
805 const MSLane* l = foeLanes[i];
808 if (ortho.
length() < orthoLength) {
826 new FXMenuCommand(ret,
"Copy edge name to clipboard",
nullptr, ret,
MID_COPY_EDGE_NAME);
833 new FXMenuCommand(ret, (
"pos: " +
toString(pos) +
" height: " +
toString(height)).c_str(),
nullptr,
nullptr, 0);
834 new FXMenuSeparator(ret);
836 new FXMenuSeparator(ret);
839 new FXMenuCommand(ret,
"Reopen lane",
nullptr, &parent,
MID_CLOSE_LANE);
840 new FXMenuCommand(ret,
"Reopen edge",
nullptr, &parent,
MID_CLOSE_EDGE);
842 new FXMenuCommand(ret,
"Reopen lane (override rerouter)",
nullptr, &parent,
MID_CLOSE_LANE);
843 new FXMenuCommand(ret,
"Reopen edge (override rerouter)",
nullptr, &parent,
MID_CLOSE_EDGE);
846 new FXMenuCommand(ret,
"Close lane",
nullptr, &parent,
MID_CLOSE_LANE);
847 new FXMenuCommand(ret,
"Close edge",
nullptr, &parent,
MID_CLOSE_EDGE);
879 ret->
mkItem((
"edgeParam:" + kv.first).c_str(),
false, kv.second);
904 const std::vector<double>&
910 const std::vector<double>&
959 col = static_cast<const GUIEdge*>(
myEdge)->getMesoColor();
973 if (activeScheme < 0) {
976 switch (activeScheme) {
999 std::vector<RGBColor> tazColors;
1001 if (e->isTazConnector() && e->knowsParameter(
"tazColor")) {
1006 if (e->isTazConnector() && e->knowsParameter(
"tazColor")) {
1010 if (tazColors.size() > 0) {
1012 col = tazColors[randColor];
1027 switch (activeScheme) {
1029 for (PositionVector::const_iterator ii =
myShape.begin(); ii !=
myShape.end() - 1; ++ii) {
1036 for (
int ii = 1; ii < (int)
myShape.size(); ++ii) {
1050 switch (activeScheme) {
1194 switch (activeScheme) {
1282 osg::Vec4ubArray* colors = dynamic_cast<osg::Vec4ubArray*>(myGeom->getColorArray());
1284 myGeom->setColorArray(colors);
1299 if (rebuildAllowed) {
1302 pred->rebuildAllowedTargets();
1312 const double slength =
myLength / no;
1315 for (
int i = 0; i < no; ++i) {
unsigned char alpha() const
Returns the alpha-amount of the color.
double nearest_offset_to_point25D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D projected onto the 3D geometry
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
bool knowsEffort(const MSEdge *const e) const
Returns the information whether any effort is known for the given edge.
const std::string & getEdgeType() const
Returns the type of the edge.
static void debugVertices(const PositionVector &shape, double size, double layer=256)
draw vertex numbers for the given shape (in a random color)
void detectCollisions(SUMOTime timestep, const std::string &stage)
double beginEndAngle() const
returns the angle in radians of the line connecting the first and the last position
PositionVector splitAtSegments(const PositionVector &shape)
add intermediate points at segment borders
bool havePriority() const
Returns whether this link is a major link.
void drawTLSLinkNo(const GUIVisualizationSettings &s, const GUINet &net) const
This is an uncontrolled, right-before-left link.
double getCOEmissions() const
Returns the sum of last step CO emissions.
const MSEdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges, restricted by vClass.
static RGBColor getColor()
gets the gl-color
A window containing a gl-object's parameter.
bool laneShowBorders
Information whether lane borders shall be drawn.
LinkState getState() const
Returns the current state of the link.
bool setMultiColor(const GUIVisualizationSettings &s, const GUIColorer &c, RGBColor &col) const
sets multiple colors according to the current scheme index and some lane function
std::string edgeParam
key for coloring by edge parameter
int getNumericalID() const
Returns the numerical id of the edge.
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter
#define WRITE_WARNING(msg)
double myQuarterLaneWidth
Quarter of lane width, for speed-up.
double laneMinSize
The minimum visual lane width for drawing.
const std::string & getStreetName() const
Returns the street name of the edge.
Representation of a lane in the micro simulation.
GUIVisualizationSizeSettings junctionSize
The link is controlled by a tls which is off and blinks, has to brake.
int getLinkTLID(MSLink *link) const
virtual void resetPartialOccupation(MSVehicle *v)
Removes the information about a vehicle lapping into this lane.
virtual void setJunctionApproaches(const SUMOTime t) const
Register junction approaches for all vehicles after velocities have been planned.
static GUINet * getGUIInstance()
Returns the pointer to the unique instance of GUINet (singleton).
The link is controlled by a tls which is off, not blinking, may pass.
double z() const
Returns the z-position.
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
int insertAtClosest(const Position &p)
inserts p between the two closest positions and returns the insertion index
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
const std::string myLaneType
the type of this lane
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
std::vector< int > myShapeSegments
the meso segment index for each geometry segment
The link is a partial right direction.
double getEdgeLaneNumber() const
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
void debugDrawFoeIntersections() const
draw intersection positions of foe internal lanes with this one
double getLoadedEdgeWeight() const
Returns the loaded weight (effort) for the edge of this lane.
static MSLink * getConnectingLink(const MSLane &from, const MSLane &to)
Returns the link connecting both lanes Both lanes have to be non-internal; 0 may be returned if no co...
MSInsertionControl & getInsertionControl()
Returns the insertion control.
void drawLinkNo(const GUIVisualizationSettings &s) const
helper methods
std::vector< MSVehicle * > VehCont
Container for vehicles.
static double naviDegree(const double angle)
bool setFunctionalColor(const GUIColorer &c, RGBColor &col, int activeScheme=-1) const
The link is a 180 degree turn (left-hand network)
static OptionsCont & getOptions()
Retrieves the options.
double getHarmonoise_NoiseEmissions() const
Returns the sum of last step noise emissions.
The link has green light, has to brake.
const double SUMO_const_laneWidth
int getPriority() const
Returns the priority of the edge.
void extrapolate(const double val, const bool onlyFirst=false, const bool onlyLast=false)
extrapolate position vector
double length() const
Returns the length.
double getHCEmissions() const
Returns the sum of last step HC emissions.
unsigned char red() const
Returns the red-amount of the color.
bool isLaneOrEdgeSelected() const
whether this lane or its parent edge is selected in the GUI
virtual void planMovements(const SUMOTime t)
Compute safe velocities for all vehicles based on positions and speeds from the last time step....
GUIVisualizationTextSettings drawLinkJunctionIndex
double getScaleValue(int activeScheme) const
gets the scaling value according to the current scheme index
GUIVisualizationSizeSettings vehicleSize
bool showRails
Information whether rails shall be drawn.
bool isSelected() const
whether this lane is selected in the GUI
PositionVector myShape
The shape of the lane.
void drawDirectionIndicators(double exaggeration, bool spreadSuperposed) const
direction indicators for lanes
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)....
The link has green light, may pass.
GUIScaler edgeScaler
The mesoscopic edge scaler.
This is an uncontrolled, major link, may pass.
virtual void incorporateVehicle(MSVehicle *veh, double pos, double speed, double posLat, const MSLane::VehCont::iterator &at, MSMoveReminder::Notification notification=MSMoveReminder::NOTIFICATION_DEPARTED)
Inserts the vehicle into this lane, and informs it about entering the network.
The link has no direction (is a dead end link)
static void drawFilledPoly(const PositionVector &v, bool close)
Draws a filled polygon described by the list of points.
void closeTraffic(bool rebuildAllowed=true)
close this lane for traffic
double getBruttoOccupancy() const
Returns the brutto (including minGaps) occupancy of this lane during the last step.
int getIndex() const
Returns the respond index (for visualization)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static const RGBColor MESO_USE_LANE_COLOR
special color to signify alternative coloring scheme
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
A storage for edge travel times and efforts.
const double myWidth
Lane width [m].
MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification, bool notify)
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
static double gLateralResolution
void drawBikeMarkings() const
bike lane markings on top of an intersection
void drawLinkRules(const GUIVisualizationSettings &s, const GUINet &net) const
void resetPartialOccupation(MSVehicle *v)
Removes the information about a vehicle lapping into this lane.
void executeMovements(const SUMOTime t)
The link is a (hard) right direction.
bool isInternal() const
return whether this edge is an internal edge
void integrateNewVehicles()
bool knowsTravelTime(const MSEdge *const e) const
Returns the information whether any travel time is known for the given edge.
The link is a 180 degree turn.
GUILane(const std::string &id, double maxSpeed, double length, MSEdge *const edge, int numericalID, const PositionVector &shape, double width, SVCPermissions permissions, int index, bool isRampAccel, const std::string &type)
Constructor.
bool drawCrossingsAndWalkingareas
whether crosings and walkingareas shall be drawn
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic,...
bool retrieveExistingTravelTime(const MSEdge *const e, const double t, double &value) const
Returns a travel time for an edge and time if stored.
double getCO2Emissions() const
Returns the sum of last step CO2 emissions.
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
static double rand(std::mt19937 *rng=0)
Returns a random real number in [0, 1)
bool isCrossing() const
return whether this edge is a pedestrian crossing
The link is a straight direction.
const double SUMO_const_halfLaneWidth
virtual void executeMovements(const SUMOTime t)
Executes planned vehicle movements with regards to right-of-way.
virtual void swapAfterLaneChange(SUMOTime t)
moves myTmpVehicles int myVehicles after a lane change procedure
double getElectricityConsumption() const
Returns the sum of last step electricity consumption.
bool showBikeMarkings
Information whether bicycle lane marking shall be drawn.
void setPermissions(SVCPermissions permissions, long long transientID)
Sets the permissions to the given value. If a transientID is given, the permissions are recored as te...
RGBColor setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
double interpolateGeometryPosToLanePos(double geometryPos) const
The link has yellow light, has to brake anyway.
const std::vector< const MSLane * > & getFoeLanes() const
const PositionVector & getShape() const
std::map< SVCPermissions, double > myStopOffsets
const double myLengthGeometryFactor
precomputed myShape.length / myLength
bool showLinkDecals
Information whether link textures (arrows) shall be drawn.
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
Copy edge name (for lanes only)
MSEdgeWeightsStorage & getWeightsStorage()
Returns the net's internal edge travel times/efforts container.
double laneWidthExaggeration
The lane exaggeration (upscale thickness)
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
The link has red light (must brake) but indicates upcoming green.
double getDistance() const
Returns the kilometrage/mileage at the start of the edge.
bool lefthand() const
return whether the network was built for lefthand traffic
bool drawAsRailway(const GUIVisualizationSettings &s) const
whether to draw this lane as a railway
GUIScaler laneScaler
The lane scaler.
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
bool constantSize
whether the object shall be drawn with constant size regardless of zoom
const std::vector< double > & getShapeRotations() const
bool isTazConnector() const
double getEdgeData(const MSEdge *edge, const std::string &attr)
retrieve loaded edged weight for the given attribute and the current simulation time
bool isWaterway(SVCPermissions permissions)
Returns whether an edge with the given permission is a waterway edge.
static RGBColor parseColor(std::string coldef)
Parses a color information.
static std::mt19937 * getColorRNG()
vehicle is a passenger car (a "normal" car)
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
GUIGlID getGlID() const
Returns the numerical id of the object.
bool showSublanes
Whether to show sublane boundaries.
A class that stores a 2D geometrical boundary.
double getNOxEmissions() const
Returns the sum of last step NOx emissions.
bool drawAsWaterway(const GUIVisualizationSettings &s) const
whether to draw this lane as a waterway
double getLength() const
Returns the lane's length.
int getPendingEmits(const MSLane *lane)
return the number of pending emits for the given lane
static const long CHANGE_PERMISSIONS_GUI
void setJunctionApproaches(const SUMOTime t) const
const std::vector< double > & getShapeLengths() const
double scale
information about a lane's width (temporary, used for a single view)
const std::string & getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a ' '.
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
double getMeanSpeed() const
Returns the mean speed on this lane.
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
static void drawFilledPolyTesselated(const PositionVector &v, bool close)
Draws a filled polygon described by the list of points.
void drawMarkings(const GUIVisualizationSettings &s, double scale) const
draw lane borders and white markings
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
const MSEdge * getBidiEdge() const
return opposite superposable/congruent edge, if it exist and 0 else
virtual MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification, bool notify=true)
GUIVisualizationTextSettings drawLinkTLIndex
A road/street connecting two junctions.
std::vector< double > myShapeRotations
The rotations of the shape parts.
double firstWaitingTime() const
The link is a (hard) left direction.
SumoXMLNodeType getType() const
return the type of this Junction
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb, inspired by http://alvyray.com/Papers/CG/hsv2rgb....
bool retrieveExistingEffort(const MSEdge *const e, const double t, double &value) const
Returns an effort for an edge and time if stored.
const MSJunction * getToJunction() const
This is an uncontrolled, minor link, has to brake.
int indexOfClosest(const Position &p) const
index of the closest position to p
double getNettoOccupancy() const
Returns the netto (excluding minGaps) occupancy of this lane during the last step (including minGaps)
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
const MSLinkCont & getLinkCont() const
returns the container with all links !!!
unsigned char green() const
Returns the green-amount of the color.
std::vector< double > myShapeLengths
The lengths of the shape parts.
double getRoutingSpeed() const
Returns the averaged speed used by the routing device.
static void drawCrossTies(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double length, double spacing, double halfWidth, bool drawForSelecting)
draw crossties for railroads or pedestrian crossings
virtual void detectCollisions(SUMOTime timestep, const std::string &stage)
Check if vehicles are too close.
double setPartialOccupation(MSVehicle *v)
Sets the information about a vehicle lapping into this lane.
double getPMxEmissions() const
Returns the sum of last step PMx emissions.
double minSize
The minimum size to draw this object.
double getStoredEdgeTravelTime() const
Returns the stored traveltime for the edge of this lane.
MSLane * getLogicalPredecessorLane() const
get the most likely precedecessor lane (sorted using by_connections_to_sorter). The result is cached ...
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
PositionVector getOrthogonal(const Position &p, double extend, bool before, double length=1.0) const
return orthogonal through p (extending this vector if necessary)
double myHalfLaneWidth
Half of lane width, for speed-up.
static const RGBColor & getLinkColor(const LinkState &ls)
map from LinkState to color constants
MSEdge & getEdge() const
Returns the lane's edge.
virtual void incorporateVehicle(MSVehicle *veh, double pos, double speed, double posLat, const MSLane::VehCont::iterator &at, MSMoveReminder::Notification notification=MSMoveReminder::NOTIFICATION_DEPARTED)
Inserts the vehicle into this lane, and informs it about entering the network.
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
bool isWalkingArea() const
return whether this edge is walking area
bool myAmClosed
state for dynamic lane closings
double getPendingEmits() const
get number of vehicles waiting for departure on this lane
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
MSEdge *const myEdge
The lane's edge, for routing only.
const PositionVector & getShape() const
Returns this lane's shape.
void releaseVehicles() const
Allows to use the container for microsimulation again.
void removeParking(MSVehicle *veh)
remove parking vehicle
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
double y() const
Returns the y-position.
int myIndex
The lane index.
A road/street connecting two junctions (gui-version)
bool showLaneDirection
Whether to show direction indicators for lanes.
unsigned char blue() const
Returns the blue-amount of the color.
bool showLane2Lane
Information whether lane-to-lane arrows shall be drawn.
The link has yellow light, may pass.
PositionVector reverse() const
reverse position vector
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
FXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
virtual void integrateNewVehicles()
Insert buffered vehicle into the real lane.
const VehCont & getVehiclesSecure() const
Returns the vehicles container; locks it for microsimulation.
SVCPermissions myPermissions
The vClass permissions for this lane.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
double myLength
Lane length [m].
void planMovements(const SUMOTime t)
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
std::vector< RGBColor > myShapeColors
The color of the shape parts (cached)
GUISelectedStorage gSelected
A global holder of selected objects.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used,...
Position getCentroid() const
Returns the centroid (closes the polygon if unclosed)
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
virtual void removeParking(MSVehicle *veh)
remove parking vehicle. This must be syncrhonized when running with GUI
double getWidth() const
Returns the lane's width.
int getLinkTLIndex(MSLink *link) const
const PositionVector & getShape() const
Returns this junction's shape.
std::set< const MSVehicle * > myParkingVehicles
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
gets the color value according to the current scheme index
GUIColorer laneColorer
The lane colorer.
bool showLinkRules
Information whether link rules (colored bars) shall be drawn.
bool spreadSuperposed
Whether to improve visualisation of superposed (rail) edges.
Boundary & grow(double by)
extends the boundary by the given amount
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
const double SUMO_const_laneMarkWidth
The link has red light (must brake)
double getScaleValue(int activeScheme) const
gets the scaling value according to the current scheme index
bool drawJunctionShape
whether the shape of the junction should be drawn
static int numSegmentsFor(const double length, const double slength)
Compute number of segments per edge (best value stay close to the configured segment length)
Stores the information about how to visualize structures.
std::map< long long, SVCPermissions > myPermissionChanges
double getSpeedLimit() const
Returns the lane's maximum allowed speed.
A MSNet extended by some values for usage within the gui.
SVCPermissions getPermissions() const
double getFuelConsumption() const
Returns the sum of last step fuel consumption.
virtual double setPartialOccupation(MSVehicle *v)
Sets the information about a vehicle lapping into this lane.
void drawLane2LaneConnections(double exaggeration) const
The link is a partial left direction.
void swapAfterLaneChange(SUMOTime t)
moves myTmpVehicles int myVehicles after a lane change procedure
const std::string & getID() const
Returns the id.
Notification
Definition of a vehicle state.
const T getColor(const double value) const
int getIndex() const
Returns the lane's index.
VehCont myVehicles
The lane's vehicles. This container holds all vehicles that have their front (longitudinally) and the...
double myMaxSpeed
Lane-wide speedlimit [m/s].
std::string edgeData
key for coloring by edgeData
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
void drawLinkRule(const GUIVisualizationSettings &s, const GUINet &net, MSLink *link, const PositionVector &shape, double x1, double x2) const
void resetPermissions(long long transientID)
void rebuildAllowedLanes()
const MSTrafficLightLogic * getTLLogic() const
Returns the TLS index.
static void drawTextAtEnd(const std::string &text, const PositionVector &shape, double x, double size, RGBColor color)
draw text and the end of shape
const std::vector< std::pair< double, double > > & getLengthsBehindCrossing() const
double exaggeration
The size exaggeration (upscale)
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
const MSEdgeVector & getPredecessors() const
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
Representation of a vehicle in the micro simulation.
static void drawTriangleAtEnd(const Position &p1, const Position &p2, double tLength, double tWidth)
Draws a triangle at the end of the given line.