57 #include <osg/Geometry>
60 #ifdef CHECK_MEMORY_LEAKS
62 #endif // CHECK_MEMORY_LEAKS
69 MSEdge*
const edge,
unsigned int numericalID,
72 :
MSLane(id, maxSpeed, length, edge, numericalID, shape, width, permissions),
77 for (
int i = 0; i < e; ++i) {
101 const MSLane::VehCont::iterator& at,
167 unsigned int noLinks = (
unsigned int)
myLinks.size();
180 glTranslated(end.
x(), end.
y(), 0);
181 glRotated(rot, 0, 0, 1);
182 for (
int i = noLinks; --i >= 0;) {
194 unsigned int noLinks = (
unsigned int)
myLinks.size();
207 glTranslated(end.
x(), end.
y(), 0);
208 glRotated(rot, 0, 0, 1);
209 for (
int i = noLinks; --i >= 0;) {
225 unsigned int noLinks = (
unsigned int)
myLinks.size();
234 glColor3d(0.5, 0.5, 0.5);
236 glTranslated(end.
x(), end.
y(), 0);
237 glRotated(rot, 0, 0, 1);
253 glTranslated(end.
x(), end.
y(), 0);
254 glRotated(rot, 0, 0, 1);
255 for (
unsigned int i = 0; i < noLinks; ++i) {
290 glColor3d(.7, .7, 0);
299 glColor3d(.2, .2, .2);
302 glColor3d(.4, .2, .2);
305 glColor3d(.5, .5, .5);
308 glColor3d(.2, .2, .4);
344 glTranslated(end.
x(), end.
y(), 0);
345 glRotated(rot, 0, 0, 1);
346 for (std::vector<MSLink*>::const_iterator i =
myLinks.begin(); i !=
myLinks.end(); ++i) {
394 for (std::vector<MSLink*>::const_iterator i =
myLinks.begin(); i !=
myLinks.end(); ++i) {
396 const MSLane* connected = (*i)->getLane();
397 if (connected == 0) {
422 glColor3d(.2, .2, .2);
425 glColor3d(.4, .2, .2);
428 glColor3d(.5, .5, .5);
431 glColor3d(.2, .2, .4);
441 glVertex2f(p1.
x(), p1.
y());
442 glVertex2f(p2.
x(), p2.
y());
453 bool mustDrawMarkings =
false;
477 const SUMOReal halfRailWidth = 0.725;
480 glTranslated(0, 0, .1);
485 mustDrawMarkings = !isInternal;
493 if (!isInternal && drawDetails) {
497 glTranslated(0, 0, .2);
507 glTranslated(0, 0, .1);
517 if (mustDrawMarkings && drawDetails) {
524 for (MSLane::VehCont::const_iterator v = vehicles.begin(); v != vehicles.end(); ++v) {
525 if ((*v)->getLane() ==
this) {
531 for (std::set<const MSVehicle*>::const_iterator v = parking.begin(); v != parking.end(); ++v) {
553 for (
int i = 0; i < e; ++i) {
560 glVertex2d(-mw, -t - 3.);
588 glTranslated(0, 0, 0.1);
590 for (
int i = 0; i < e; ++i) {
597 glVertex2d(-1, -t - 0.3);
598 glVertex2d(1.0, -t - 0.3);
622 new FXMenuSeparator(ret);
667 const std::vector<SUMOReal>&
673 const std::vector<SUMOReal>&
748 switch (activeScheme) {
807 osg::Vec4ubArray* colors =
dynamic_cast<osg::Vec4ubArray*
>(myGeom->getColorArray());
809 myGeom->setColorArray(colors);
The link is a partial left direction.
The link has green light, may pass.
SVCPermissions myPermissions
The vClass permissions for this lane.
void drawLane2LaneConnections() const
VehCont myVehicles
The lane's vehicles. The entering vehicles are inserted at the front of this container and the leavin...
const std::vector< SUMOReal > & getShapeRotations() const
SUMOReal getNormedHBEFA_HCEmissions() const
Returns the sum of last step HC emissions normed by the lane's length.
SUMOReal getNormedHBEFA_NOxEmissions() const
Returns the sum of last step NOx emissions normed by the lane's length.
SUMOReal myWidth
Lane width [m].
Representation of a vehicle in the micro simulation.
float laneWidthExaggeration
The lane exaggeration (upscale thickness)
void setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
const RGBColor getColor(const SUMOReal value) const
SUMOReal nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
unsigned int myIndex
The lane index.
bool drawLinkTLIndex
Information whether a link's tls index shall be drawn.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
void detectCollisions(SUMOTime timestep, int stage)
bool retrieveExistingTravelTime(const MSEdge *const e, const SUMOVehicle *const v, SUMOReal t, SUMOReal &value) const
Returns a travel time for an edge and time if stored.
GUIColorer laneColorer
The lane colorer.
The link has green light, has to brake.
Stores the information about how to visualize structures.
This is an uncontrolled, minor link, has to stop.
SUMOReal getLength() const
Returns the lane's length.
virtual bool integrateNewVehicle(SUMOTime t)
Insert buffered vehicle into the real lane.
std::string getAllowedVehicleClassNames(SVCPermissions permissions)
Returns the ids of the given classes, divided using a ' '.
The link is a 180 degree turn.
std::vector< MSVehicle * > VehCont
Container for vehicles.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Notification
Definition of a vehicle state.
const std::string & getStreetName() const
Returns the street name of the edge.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
virtual void incorporateVehicle(MSVehicle *veh, SUMOReal pos, SUMOReal speed, const MSLane::VehCont::iterator &at, MSMoveReminder::Notification notification=MSMoveReminder::NOTIFICATION_DEPARTED)
Inserts the vehicle into this lane, and informs it about entering the network.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
SUMOReal getNettoOccupancy() const
Returns the netto (excluding minGaps) occupancy of this lane during the last step (including minGaps)...
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
This is an uncontrolled, right-before-left link.
const std::vector< SUMOReal > & getShapeLengths() const
static void drawText(const std::string &text, const Position &pos, const SUMOReal layer, const SUMOReal size, const RGBColor &col=RGBColor::BLACK, const SUMOReal angle=0)
draw Text with given parameters
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
const SUMOReal SUMO_const_laneOffset
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
A storage for edge travel times and efforts.
The link is controlled by a tls which is off, not blinking, may pass.
SUMOReal x() const
Returns the x-position.
This is an uncontrolled, all-way stop link.
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.
GUIGlID getGlID() const
Returns the numerical id of the object.
bool integrateNewVehicle(SUMOTime t)
A class that stores a 2D geometrical boundary.
const std::set< const MSVehicle * > & getParkingVehicles(const MSLane *lane) const
return parking vehicles on the given lane
The link is a (hard) left direction.
PositionVector myShape
The shape of the lane.
SUMOReal scale
information about a lane's width (temporary, used for a single view)
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)...
virtual bool executeMovements(SUMOTime t, std::vector< MSLane * > &into)
Executes planned vehicle movements with regards to right-of-way.
unsigned char blue() const
Returns the blue-amount of the color.
The link is a straight direction.
void drawLinkRules(const GUINet &net) const
std::vector< SUMOReal > myShapeRotations
The rotations of the shape parts.
A road/street connecting two junctions.
SUMOReal getHBEFA_HCEmissions() const
Returns the sum of last step HC emissions.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
bool allowsVehicleClass(SUMOVehicleClass vclass) const
virtual MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification)
remove the vehicle from this lane
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
bool executeMovements(SUMOTime t, std::vector< MSLane * > &into)
MFXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
SUMOReal getNormedHBEFA_CO2Emissions() const
Returns the sum of last step CO2 emissions normed by the lane's length.
This is an uncontrolled, minor link, has to brake.
A point in 2D or 3D with translation and scaling methods.
void set(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
assigns new values
void drawTLSLinkNo(const GUINet &net) const
SUMOReal getHBEFA_COEmissions() const
Returns the sum of last step CO emissions.
void planMovements(const SUMOTime t)
unsigned char alpha() const
Returns the alpha-amount of the color.
std::vector< SUMOReal > myShapeLengths
The lengths of the shape parts.
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
int getLinkTLIndex(MSLink *link) const
SUMOReal firstWaitingTime() const
void drawLinkNo() const
helper methods
The link is a (hard) right direction.
SUMOReal getSpeedLimit() const
Returns the lane's maximum allowed speed.
MSEdge * myEdge
The lane's edge, for routing only.
GUILane(const std::string &id, SUMOReal maxSpeed, SUMOReal length, MSEdge *const edge, unsigned int numericalID, const PositionVector &shape, SUMOReal width, SVCPermissions permissions, unsigned int index)
Constructor.
SUMOReal getHBEFA_PMxEmissions() const
Returns the sum of last step PMx emissions.
SUMOReal myLength
Lane length [m].
virtual void incorporateVehicle(MSVehicle *veh, SUMOReal pos, SUMOReal speed, const MSLane::VehCont::iterator &at, MSMoveReminder::Notification notification=MSMoveReminder::NOTIFICATION_DEPARTED)
Inserts the vehicle into this lane, and informs it about entering the network.
static void drawBoxLines(const PositionVector &geom, const std::vector< SUMOReal > &rots, const std::vector< SUMOReal > &lengths, SUMOReal width)
Draws thick lines.
virtual void swapAfterLaneChange(SUMOTime t)
moves myTmpVehicles int myVehicles after a lane change procedure
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
The link is a partial right direction.
vehicle is a passenger car (a "normal" car)
SUMOReal getEdgeLaneNumber() const
const SUMOReal myLengthGeometryFactor
static MSVehicleTransfer * getInstance()
Returns the instance of this object.
void unlock()
release mutex lock
void swapAfterLaneChange(SUMOTime t)
moves myTmpVehicles int myVehicles after a lane change procedure
SUMOReal getNormedHBEFA_COEmissions() const
Returns the sum of last step CO emissions normed by the lane's length.
static void drawBoxLine(const Position &beg, SUMOReal rot, SUMOReal visLength, SUMOReal width)
Draws a thick line.
void drawMarkings(const GUIVisualizationSettings &s) const
draw lane borders and white markings
void add(SUMOReal x, SUMOReal y)
Makes the boundary include the given coordinate.
Boundary & grow(SUMOReal by)
extends the boundary by the given amount
EdgeBasicFunction getPurpose() const
Returns the edge type (EdgeBasicFunction)
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
SUMOReal getColorValue(size_t activeScheme) const
gets the color value according to the current scheme index
bool showLinkDecals
Information whether link textures (arrows) shall be drawn.
A MSNet extended by some values for usage within the gui.
GUIColorScheme & getScheme()
The link has yellow light, may pass.
SUMOReal getNormedHBEFA_FuelConsumption() const
Returns the sum of last step fuel comsumption normed by the lane's length.
The link is controlled by a tls which is off and blinks, has to brake.
A mutex encapsulator which locks/unlocks the given mutex on construction/destruction, respectively.
SUMOReal getStoredEdgeTravelTime() const
Returns the stored traveltime for the edge of this lane.
static void drawTriangleAtEnd(const Line &l, SUMOReal tLength, SUMOReal tWidth)
Draws a triangle at the end of the given line.
MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification)
SUMOReal y() const
Returns the y-position.
The link has red light (must brake)
SUMOReal getHalfWidth() const
SUMOReal myHalfLaneWidth
Half of lane width, for speed-up.
bool drawLinkJunctionIndex
Information whether a link's junction index shall be drawn.
This is an uncontrolled, major link, may pass.
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
unsigned int getLinkTLID(MSLink *link) const
SUMOReal myQuarterLaneWidth
Quarter of lane width, for speed-up.
SUMOReal getHBEFA_FuelConsumption() const
Returns the sum of last step fuel consumption.
SUMOReal getHBEFA_NOxEmissions() const
Returns the sum of last step NOx emissions.
const PositionVector & getShape() const
Returns this lane's shape.
const VehCont & getVehiclesSecure() const
Returns the vehicles container; locks it for microsimulation.
SUMOReal distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
static void drawLine(const Position &beg, SUMOReal rot, SUMOReal visLength)
Draws a thin line.
float minVehicleSize
The minimum size of vehicles to let them be drawn.
bool showLane2Lane
Information whether lane-to-lane arrows shall be drawn.
SUMOReal getNormedHBEFA_PMxEmissions() const
Returns the sum of last step PMx emissions normed by the lane's length.
LinkState getState() const
Returns the current state of the link.
unsigned char green() const
Returns the green-amount of the color.
static const bool gUseMesoSim
SUMOReal getHBEFA_CO2Emissions() const
Returns the sum of last step CO2 emissions.
The link has yellow light, has to brake anyway.
bool knowsTravelTime(const MSEdge *const e) const
Returns the information whether any travel time is known for the given edge.
SUMOReal getHarmonoise_NoiseEmissions() const
Returns the sum of last step noise emissions.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
The edge is an internal edge.
SUMOReal interpolateGeometryPosToLanePos(SUMOReal geometryPos) const
SUMOReal getBruttoOccupancy() const
Returns the brutto (including minGaps) occupancy of this lane during the last step.
unsigned char red() const
Returns the red-amount of the color.
void mkItem(const char *name, bool dynamic, ValueSource< unsigned > *src)
Adds a row which obtains its value from an unsigned-ValueSource.
GUISelectedStorage gSelected
A global holder of selected objects.
void closeBuilding()
Closes the building of the table.
Representation of a lane in the micro simulation.
void drawCrossties(const GUIVisualizationSettings &s) const
draw crossties for railroads
A window containing a gl-object's parameter.
void releaseVehicles() const
Allows to use the container for microsimulation again.
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...
The link has no direction (is a dead end link)
const PositionVector & getShape() const
MSEdgeWeightsStorage & getWeightsStorage()
Returns the net's internal edge travel times/efforts container.
A MSVehicle extended by some values for usage within the gui.
virtual void detectCollisions(SUMOTime timestep, int stage)
Check if vehicles are too close.