37 #include <osg/Geometry>
66 #include <utils/common/HelpersHarmonoise.h>
70 #ifdef CHECK_MEMORY_LEAKS
72 #endif // CHECK_MEMORY_LEAKS
90 for (
int i = 0; i < e; ++i) {
107 return (&
myLane) == (&lane);
127 glTranslated(end.
x(), end.
y(), 0);
128 glRotated(rot, 0, 0, 1);
129 for (
int i = noLinks; --i >= 0;) {
154 glTranslated(end.
x(), end.
y(), 0);
155 glRotated(rot, 0, 0, 1);
156 for (
int i = noLinks; --i >= 0;) {
181 glColor3d(0.5, 0.5, 0.5);
183 glTranslated(end.
x(), end.
y(), 0);
184 glRotated(rot, 0, 0, 1);
199 glTranslated(end.
x(), end.
y(), 0);
200 glRotated(rot, 0, 0, 1);
201 for (
unsigned int i = 0; i < noLinks; ++i) {
236 glColor3d(.7, .7, 0);
245 glColor3d(.2, .2, .2);
248 glColor3d(.5, .5, .5);
281 glTranslated(end.
x(), end.
y(), 0);
282 glRotated(rot, 0, 0, 1);
283 for (
unsigned int i = 0; i < noLinks; ++i) {
332 for (
unsigned int i = 0; i < noLinks; ++i) {
335 if (connected == 0) {
360 glColor3d(.2, .2, .2);
363 glColor3d(.5, .5, .5);
373 glVertex2f(p1.
x(), p1.
y());
374 glVertex2f(p2.
x(), p2.
y());
385 bool mustDrawMarkings =
false;
408 const SUMOReal halfRailWidth = 0.725;
411 glTranslated(0, 0, .1);
420 mustDrawMarkings = !isInternal;
427 if (!isInternal && drawDetails) {
431 glTranslated(0, 0, .2);
441 glTranslated(0, 0, .1);
451 if (mustDrawMarkings && drawDetails) {
458 for (MSLane::VehCont::const_iterator v = vehicles.begin(); v != vehicles.end(); ++v) {
459 if ((*v)->getLane() == &
myLane) {
465 for (std::set<const MSVehicle*>::const_iterator v = parking.begin(); v != parking.end(); ++v) {
487 for (
int i = 0; i < e; ++i) {
494 glVertex2d(-mw, -t - 3.);
522 glTranslated(0, 0, 0.1);
524 for (
int i = 0; i < e; ++i) {
531 glVertex2d(-1, -t - 0.3);
532 glVertex2d(1.0, -t - 0.3);
556 new FXMenuSeparator(ret);
603 const std::vector<SUMOReal>&
609 const std::vector<SUMOReal>&
724 switch (activeScheme) {
738 return getLane().getOccupancy();
791 osg::Vec4ubArray* colors =
dynamic_cast<osg::Vec4ubArray*
>(myGeom->getColorArray());
793 myGeom->setColorArray(colors);
The link is a partial left direction.
SUMOReal myHalfLaneWidth
Half of lane width, for speed-up.
The link has green light, may pass.
VehCont myVehicles
The lane's vehicles. The entering vehicles are inserted at the front of this container and the leavin...
MSEdge & getEdge() const
Returns the lane's edge.
float laneWidthExaggeration
The lane exaggeration (upscale thickness)
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.
SUMOReal getNormedHBEFA_CO2Emissions() const
Returns the sum of last step CO2 emissions normed by the lane's length.
virtual void releaseVehicles() const
Allows to use the container for microsimulation again.
void drawLinkRules(const GUINet &net) const
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
bool drawLinkTLIndex
Information whether a link's tls index shall be drawn.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
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.
SUMOReal getLength() const
Returns the lane's length.
MSLane & myLane
The assigned lane.
std::string getAllowedVehicleClassNames(SVCPermissions permissions)
Returns the ids of the given classes, divided using a ' '.
The link is a 180 degree turn.
GUILaneWrapper(MSLane &lane, const PositionVector &shape, unsigned int index)
Constructor.
std::vector< MSVehicle * > VehCont
Container for vehicles.
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.
unsigned int myIndex
The lane index.
SUMOReal getNormedHBEFA_HCEmissions() const
Returns the sum of last step HC emissions normed by the lane's length.
SUMOReal getWidth() const
Returns the lane's width.
SUMOReal getNormedPHEMlight_NOxEmissions() const
Returns the sum of last step NOx emissions normed by the lane's length.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
bool forLane(const MSLane &lane) const
Returns true if the given lane id the lane this wrapper wraps the geometry of.
SUMOReal getNormedPHEMlight_CO2Emissions() const
Returns the sum of last step CO2 emissions normed by the lane's length.
This is an uncontrolled, right-before-left link.
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
SUMOReal getNormedPHEMlight_PMxEmissions() const
Returns the sum of last step PMx emissions normed by the lane's length.
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
SUMOReal getEdgeLaneNumber() const
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
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.
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.
SUMOReal getNormedHBEFA_NOxEmissions() const
Returns the sum of last step NOx emissions normed by the lane's length.
const MSLane & getLane() const
Returns the represented lane.
GUIGlID getGlID() const
Returns the numerical id of the object.
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.
SUMOReal getNormedHBEFA_PMxEmissions() const
Returns the sum of last step PMx emissions normed by the lane's length.
SUMOReal scale
information about a lane's width (temporary, used for a single view)
virtual const VehCont & getVehiclesSecure() const
Returns the vehicles container; locks it for microsimulation.
const PositionVector & myShape
The shape of the lane.
virtual ~GUILaneWrapper()
Destructor.
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)...
unsigned char blue() const
Returns the blue-amount of the color.
The link is a straight direction.
A road/street connecting two junctions.
unsigned int getLinkNumber() const
Returns the number of links.
SUMOReal getNormedPHEMlight_FuelConsumption() const
Returns the sum of last step fuel comsumption normed by the lane's length.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
void drawCrossties(const GUIVisualizationSettings &s) const
draw crossties for railroads
bool allowsVehicleClass(SUMOVehicleClass vclass) const
SUMOReal getColorValue(size_t activeScheme) const
gets the color value according to the current scheme index
SUMOReal myQuarterLaneWidth
Quarter of lane width, for speed-up.
void drawLinkNo() const
helper methods
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
SUMOReal getNormedPHEMlight_HCEmissions() const
Returns the sum of last step HC 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
unsigned char alpha() const
Returns the alpha-amount of the color.
std::vector< SUMOReal > myShapeLengths
The lengths of the shape parts.
void drawLane2LaneConnections() const
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
The link is a (hard) right direction.
SUMOReal getSpeedLimit() const
Returns the lane's maximum allowed speed.
SUMOReal getNormedHBEFA_FuelConsumption() const
Returns the sum of last step fuel comsumption normed by the lane's length.
void drawTLSLinkNo(const GUINet &net) const
SVCPermissions getPermissions() const
Returns the vehicle class permissions for this lane.
static void drawBoxLines(const PositionVector &geom, const std::vector< SUMOReal > &rots, const std::vector< SUMOReal > &lengths, SUMOReal width)
Draws thick lines.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
SUMOReal firstWaitingTime() const
std::vector< SUMOReal > myShapeRotations
The rotations of the shape parts.
The link is a partial right direction.
vehicle is a passenger car (a "normal" car)
const std::vector< SUMOReal > & getShapeRotations() const
void drawMarkings(const GUIVisualizationSettings &s) const
draw lane borders and white markings
static MSVehicleTransfer * getInstance()
Returns the instance of this object.
static void drawBoxLine(const Position &beg, SUMOReal rot, SUMOReal visLength, SUMOReal width)
Draws a thick line.
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.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
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.
The link is controlled by a tls which is off and blinks, has to brake.
static void drawTriangleAtEnd(const Line &l, SUMOReal tLength, SUMOReal tWidth)
Draws a triangle at the end of the given line.
SUMOReal y() const
Returns the y-position.
The link has red light (must brake)
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.
const std::vector< SUMOReal > & getShapeLengths() const
unsigned int getLinkTLID(MSLink *link) const
const PositionVector & getShape() const
Returns this lane's shape.
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.
LinkState getState() const
Returns the current state of the link.
void setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
unsigned char green() const
Returns the green-amount of the color.
static const bool gUseMesoSim
const MSLinkCont & getLinkCont() const
returns the container with all links !!!
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.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
SUMOReal getNormedPHEMlight_COEmissions() const
Returns the sum of last step CO emissions normed by the lane's length.
SUMOReal getHarmonoise_NoiseEmissions() const
Returns the sum of last step noise emissions.
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
The edge is an internal edge.
SUMOReal interpolateGeometryPosToLanePos(SUMOReal geometryPos) const
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.
const PositionVector & getShape() const
A window containing a gl-object's parameter.
SUMOReal getHalfWidth() const
SUMOReal getNormedHBEFA_COEmissions() const
Returns the sum of last step CO emissions normed by the lane's length.
SUMOReal getStoredEdgeTravelTime() const
Returns the stored traveltime for the edge of this lane.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
The link has no direction (is a dead end link)
MSEdgeWeightsStorage & getWeightsStorage()
Returns the net's internal edge travel times/efforts container.
A MSVehicle extended by some values for usage within the gui.