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;
536 if (!isInternal || hasRailSignal) {
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);
635 if ((!isInternal || isCrossing)) {
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) {
713 int e = (int)
getShape().size() - 1;
714 for (
int i = 0; i < e; ++i) {
719 const double length =
MIN2((
double)3, myShapeLengths[i] - t);
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) {
782 const double length =
MIN2(w2, myShapeLengths[i] - t) * exaggeration;
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>&
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) {
std::vector< int > myShapeSegments
the meso segment index for each geometry segment
GUIVisualizationSizeSettings junctionSize
void drawDirectionIndicators(double exaggeration, bool spreadSuperposed) const
direction indicators for lanes
The link is a partial left direction.
double getBruttoOccupancy() const
Returns the brutto (including minGaps) occupancy of this lane during the last step.
The link has green light, may pass.
static double gLateralResolution
void debugDrawFoeIntersections() const
draw intersection positions of foe internal lanes with this one
SVCPermissions myPermissions
The vClass permissions for this lane.
MSLane * getLogicalPredecessorLane() const
get the most likely precedecessor lane (sorted using by_connections_to_sorter). The result is cached ...
double getLoadedEdgeWeight() const
Returns the loaded weight (effort) for the edge of this lane.
std::vector< RGBColor > myShapeColors
The color of the shape parts (cached)
VehCont myVehicles
The lane's vehicles. This container holds all vehicles that have their front (longitudinally) and the...
static RGBColor parseColor(std::string coldef)
Parses a color information.
double getNOxEmissions() const
Returns the sum of last step NOx emissions.
MSEdge & getEdge() const
Returns the lane's edge.
Representation of a vehicle in the micro simulation.
double scale
information about a lane's width (temporary, used for a single view)
double laneWidthExaggeration
The lane exaggeration (upscale thickness)
bool setFunctionalColor(const GUIColorer &c, RGBColor &col, int activeScheme=-1) const
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
int getPriority() const
Returns the priority of the edge.
const std::string myLaneType
the type of this lane
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.
void resetPartialOccupation(MSVehicle *v)
Removes the information about a vehicle lapping into this lane.
PositionVector getOrthogonal(const Position &p, double extend, bool before, double length=1.0) const
return orthogonal through p (extending this vector if necessary)
double z() const
Returns the z-position.
void drawLinkRules(const GUIVisualizationSettings &s, const GUINet &net) const
virtual void removeParking(MSVehicle *veh)
remove parking vehicle. This must be syncrhonized when running with GUI
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
static const long CHANGE_PERMISSIONS_GUI
double getScaleValue(int activeScheme) const
gets the scaling value according to the current scheme index
bool isLaneOrEdgeSelected() const
whether this lane or its parent edge is selected in the GUI
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.
double getScaleValue(int activeScheme) const
gets the scaling value according to the current scheme index
int getLinkTLID(MSLink *link) const
int indexOfClosest(const Position &p) const
index of the closest position to p
double getFuelConsumption() const
Returns the sum of last step fuel consumption.
bool knowsEffort(const MSEdge *const e) const
Returns the information whether any effort is known for the given edge.
static void drawTextAtEnd(const std::string &text, const PositionVector &shape, double x, double size, RGBColor color)
draw text and the end of shape
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb, inspired by http://alvyray.com/Papers/CG/hsv2rgb.htm.
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
void closeTraffic(bool rebuildAllowed=true)
close this lane for traffic
static const RGBColor MESO_USE_LANE_COLOR
special color to signify alternative coloring scheme
double exaggeration
The size exaggeration (upscale)
unsigned char alpha() const
Returns the alpha-amount of the color.
virtual void executeMovements(const SUMOTime t)
Executes planned vehicle movements with regards to right-of-way.
GUIColorer laneColorer
The lane colorer.
The link has green light, has to brake.
Stores the information about how to visualize structures.
const MSEdgeVector & getPredecessors() const
static void debugVertices(const PositionVector &shape, double size, double layer=256)
draw vertex numbers for the given shape (in a random color)
const double SUMO_const_laneWidth
double y() const
Returns the y-position.
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
PositionVector splitAtSegments(const PositionVector &shape)
add intermediate points at segment borders
int myIndex
The lane index.
static double rand(std::mt19937 *rng=0)
Returns a random real number in [0, 1)
bool showRails
Information whether rails shall be drawn.
void drawTLSLinkNo(const GUIVisualizationSettings &s, const GUINet &net) const
void executeMovements(const SUMOTime t)
The link is a 180 degree turn.
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
Notification
Definition of a vehicle state.
bool setMultiColor(const GUIVisualizationSettings &s, const GUIColorer &c, RGBColor &col) const
sets multiple colors according to the current scheme index and some lane function ...
virtual MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification, bool notify=true)
double x() const
Returns the x-position.
void integrateNewVehicles()
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
bool knowsTravelTime(const MSEdge *const e) const
Returns the information whether any travel time is known for the given edge.
std::map< long long, SVCPermissions > myPermissionChanges
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Position getCentroid() const
Returns the centroid (closes the polygon if unclosed)
bool retrieveExistingEffort(const MSEdge *const e, const double t, double &value) const
Returns an effort for an edge and time if stored.
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
double getPMxEmissions() const
Returns the sum of last step PMx emissions.
static void drawFilledPoly(const PositionVector &v, bool close)
Draws a filled polygon described by the list of points.
double getLength() const
Returns the lane's length.
const PositionVector & getShape() const
Returns this lane's shape.
bool showLaneDirection
Whether to show direction indicators for lanes.
PositionVector reverse() const
reverse position vector
unsigned char blue() const
Returns the blue-amount of the color.
bool laneShowBorders
Information whether lane borders shall be drawn.
This is an uncontrolled, right-before-left link.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
const std::string & getID() const
Returns the id.
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
bool showLinkRules
Information whether link rules (colored bars) shall be drawn.
A storage for edge travel times and efforts.
The link is controlled by a tls which is off, not blinking, may pass.
virtual double setPartialOccupation(MSVehicle *v)
Sets the information about a vehicle lapping into this lane.
const MSJunction * getToJunction() const
const std::vector< double > & getShapeRotations() const
int getNumericalID() const
Returns the numerical id of the edge.
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used, also builds an entry for copying the geo-position.
double getWidth() const
Returns the lane's width.
A class that stores a 2D geometrical boundary.
const MSEdge * getBidiEdge() const
return opposite superposable/congruent edge, if it exist and 0 else
std::vector< double > myShapeLengths
The lengths of the shape parts.
bool drawAsWaterway(const GUIVisualizationSettings &s) const
whether to draw this lane as a waterway
The link is a (hard) left direction.
PositionVector myShape
The shape of the lane.
#define WRITE_WARNING(msg)
std::set< const MSVehicle * > myParkingVehicles
static OptionsCont & getOptions()
Retrieves the options.
void setJunctionApproaches(const SUMOTime t) const
LinkState getState() const
Returns the current state of the link.
const std::string & getEdgeType() const
Returns the type 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 ...
double getStoredEdgeTravelTime() const
Returns the stored traveltime for the edge of this lane.
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)...
The link is a straight direction.
virtual void detectCollisions(SUMOTime timestep, const std::string &stage)
Check if vehicles are too close.
static void drawFilledPolyTesselated(const PositionVector &v, bool close)
Draws a filled polygon described by the list of points.
std::string edgeParam
key for coloring by edge parameter
A road/street connecting two junctions (gui-version)
double firstWaitingTime() const
A road/street connecting two junctions.
bool constantSize
whether the object shall be drawn with constant size regardless of zoom
static double naviDegree(const double angle)
void rebuildAllowedLanes()
double myLength
Lane length [m].
int getIndex() const
Returns the lane's index.
void removeParking(MSVehicle *veh)
remove parking vehicle
double getEdgeLaneNumber() const
void resetPermissions(long long transientID)
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
double getEdgeData(const MSEdge *edge, const std::string &attr)
retrieve loaded edged weight for the given attribute and the current simulation time ...
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.
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...
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
void drawLinkNo(const GUIVisualizationSettings &s) const
helper methods
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
double nearest_offset_to_point25D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D projected onto the 3D geometry
virtual void resetPartialOccupation(MSVehicle *v)
Removes the information about a vehicle lapping into this lane.
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
double getCO2Emissions() const
Returns the sum of last step CO2 emissions.
const double SUMO_const_halfLaneWidth
double minSize
The minimum size to draw this object.
static GUINet * getGUIInstance()
Returns the pointer to the unique instance of GUINet (singleton).
const MSTrafficLightLogic * getTLLogic() const
Returns the TLS index.
double interpolateGeometryPosToLanePos(double geometryPos) const
Copy edge name (for lanes only)
double beginEndAngle() const
returns the angle in radians of the line connecting the first and the last position ...
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter ...
This is an uncontrolled, minor link, has to brake.
A point in 2D or 3D with translation and scaling methods.
const std::vector< const MSLane * > & getFoeLanes() const
void planMovements(const SUMOTime t)
void drawBikeMarkings() const
bike lane markings on top of an intersection
bool isWaterway(SVCPermissions permissions)
Returns whether an edge with the given permission is a waterway edge.
double getPendingEmits() const
get number of vehicles waiting for departure on this lane
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
bool showSublanes
Whether to show sublane boundaries.
bool isSelected() const
whether this lane is selected in the GUI
const double SUMO_const_laneMarkWidth
double getSpeedLimit() const
Returns the lane's maximum allowed speed.
bool havePriority() const
Returns whether this link is a major link.
double getRoutingSpeed() const
Returns the averaged speed used by the routing device.
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
GUIVisualizationTextSettings drawLinkTLIndex
The link is a (hard) right direction.
RGBColor setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
const PositionVector & getShape() const
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
gets the color value according to the current scheme index
Boundary & grow(double by)
extends the boundary by the given amount
const VehCont & getVehiclesSecure() const
Returns the vehicles container; locks it for microsimulation.
MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification, bool notify)
int insertAtClosest(const Position &p)
inserts p between the two closest positions and returns the insertion index
const T getColor(const double value) const
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
bool drawAsRailway(const GUIVisualizationSettings &s) const
whether to draw this lane as a railway
bool isCrossing() const
return whether this edge is a pedestrian crossing
virtual void swapAfterLaneChange(SUMOTime t)
moves myTmpVehicles int myVehicles after a lane change procedure
bool isInternal() const
return whether this edge is an internal edge
double laneMinSize
The minimum visual lane width for drawing.
double getHCEmissions() const
Returns the sum of last step HC emissions.
GUIScaler edgeScaler
The mesoscopic edge scaler.
The link is a partial right direction.
bool lefthand() const
return whether the network was built for lefthand traffic
std::vector< MSVehicle * > VehCont
Container for vehicles.
vehicle is a passenger car (a "normal" car)
const std::string & getStreetName() const
Returns the street name of the edge.
std::map< SVCPermissions, double > myStopOffsets
void swapAfterLaneChange(SUMOTime t)
moves myTmpVehicles int myVehicles after a lane change procedure
const MSEdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges, restricted by vClass.
const std::vector< std::pair< double, double > > & getLengthsBehindCrossing() const
virtual void setJunctionApproaches(const SUMOTime t) const
Register junction approaches for all vehicles after velocities have been planned. ...
virtual void integrateNewVehicles()
Insert buffered vehicle into the real lane.
double getElectricityConsumption() const
Returns the sum of last step electricity consumption.
void drawMarkings(const GUIVisualizationSettings &s, double scale) const
draw lane borders and white markings
void extrapolate(const double val, const bool onlyFirst=false, const bool onlyLast=false)
extrapolate position vector
double getCOEmissions() const
Returns the sum of last step CO emissions.
void drawLinkRule(const GUIVisualizationSettings &s, const GUINet &net, MSLink *link, const PositionVector &shape, double x1, double x2) const
bool showLinkDecals
Information whether link textures (arrows) shall be drawn.
double length() const
Returns the length.
bool retrieveExistingTravelTime(const MSEdge *const e, const double t, double &value) const
Returns a travel time for an edge and time if stored.
bool isTazConnector() const
A MSNet extended by some values for usage within the gui.
The link has yellow light, may pass.
const std::string & getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a ' '.
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.
std::string edgeData
key for coloring by edgeData
unsigned char green() const
Returns the green-amount of the color.
The link is controlled by a tls which is off and blinks, has to brake.
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
MSEdge *const myEdge
The lane's edge, for routing only.
void drawLane2LaneConnections(double exaggeration) const
const std::vector< double > & getShapeLengths() const
void detectCollisions(SUMOTime timestep, const std::string &stage)
The link has red light (must brake)
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
This is an uncontrolled, major link, may pass.
double getHarmonoise_NoiseEmissions() const
Returns the sum of last step noise emissions.
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
int getIndex() const
Returns the respond index (for visualization)
std::vector< double > myShapeRotations
The rotations of the shape parts.
bool drawCrossingsAndWalkingareas
whether crosings and walkingareas shall be drawn
bool myAmClosed
state for dynamic lane closings
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
GUIGlID getGlID() const
Returns the numerical id of the object.
unsigned char red() const
Returns the red-amount of the color.
bool isWalkingArea() const
return whether this edge is walking area
The link is a 180 degree turn (left-hand network)
bool showLane2Lane
Information whether lane-to-lane arrows shall be drawn.
static void drawTriangleAtEnd(const Position &p1, const Position &p2, double tLength, double tWidth)
Draws a triangle at the end of the given line.
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
GUIVisualizationSizeSettings vehicleSize
bool drawJunctionShape
whether the shape of the junction should be drawn
double getMeanSpeed() const
Returns the mean speed on this lane.
double setPartialOccupation(MSVehicle *v)
Sets the information about a vehicle lapping into this lane.
const double myLengthGeometryFactor
precomputed myShape.length / myLength
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
SVCPermissions getPermissions() const
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
The link has yellow light, has to brake anyway.
const MSLinkCont & getLinkCont() const
returns the container with all links !!!
FXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
static int numSegmentsFor(const double length, const double slength)
Compute number of segments per edge (best value stay close to the configured segment length) ...
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
double getDistance() const
Returns the kilometrage/mileage at the start of the edge.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
double myHalfLaneWidth
Half of lane width, for speed-up.
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
static std::mt19937 * getColorRNG()
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
GUIScaler laneScaler
The lane scaler.
bool spreadSuperposed
Whether to improve visualisation of superposed (rail) edges.
double myQuarterLaneWidth
Quarter of lane width, for speed-up.
double myMaxSpeed
Lane-wide speedlimit [m/s].
double getNettoOccupancy() const
Returns the netto (excluding minGaps) occupancy of this lane during the last step (including minGaps)...
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
GUISelectedStorage gSelected
A global holder of selected objects.
Representation of a lane in the micro simulation.
void releaseVehicles() const
Allows to use the container for microsimulation again.
int getLinkTLIndex(MSLink *link) const
A window containing a gl-object's parameter.
static const RGBColor & getLinkColor(const LinkState &ls)
map from LinkState to color constants
The link has red light (must brake) but indicates upcoming green.
GUIVisualizationTextSettings drawLinkJunctionIndex
const PositionVector & getShape() const
Returns this junction's shape.
int getPendingEmits(const MSLane *lane)
return the number of pending emits for the given lane
const double myWidth
Lane width [m].
bool showBikeMarkings
Information whether bicycle lane marking shall be drawn.
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.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
virtual void planMovements(const SUMOTime t)
Compute safe velocities for all vehicles based on positions and speeds from the last time step...
SumoXMLNodeType getType() const
return the type of this Junction
The link has no direction (is a dead end link)
MSEdgeWeightsStorage & getWeightsStorage()
Returns the net's internal edge travel times/efforts container.
static RGBColor getColor()
gets the gl-color
A MSVehicle extended by some values for usage within the gui.