 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
51 FXIMPLEMENT(
GNELane, FXDelegator, 0, 0)
61 mySpecialColor(
nullptr),
62 mySpecialColorValue(-1),
63 myLane2laneConnections(this) {
68 myParentEdge(nullptr),
70 mySpecialColor(nullptr),
71 mySpecialColorValue(-1),
72 myLane2laneConnections(this) {
91 const std::vector<double>&
97 const std::vector<double>&
142 for (
auto i : incomingConnections) {
147 for (
auto i : outGoingConnections) {
175 int noLinks = (int)cons.size();
184 for (
int i = noLinks; --i >= 0;) {
185 double x2 = x1 - (double)(w / 2.);
187 cons[s.
lefthand ? noLinks - 1 - i : i]);
198 int noLinks = (int)cons.size();
207 for (
int i = noLinks; --i >= 0;) {
208 double x2 = x1 - (double)(w / 2.);
209 int linkNo = cons[s.
lefthand ? noLinks - 1 - i : i].tlLinkIndex;
232 glTranslated(end.
x(), end.
y(), 0);
233 glRotated(rot, 0, 0, 1);
237 for (
auto i : edgeCons) {
280 glTranslated(0, 5, 0);
282 glTranslated(0, -5, 0);
300 for (
auto it : connections) {
313 glColor3d(.4, .4, .4);
316 glColor3d(.7, .4, .4);
319 glColor3d(.7, .7, .7);
322 glColor3d(.7, .7, 1);
325 glColor3d(.75, .5, 0.25);
330 const Position& endPos = it.toEdge->getLaneShape(it.toLane)[0];
332 glVertex2d(startPos.
x(), startPos.
y());
333 glVertex2d(endPos.
x(), endPos.
y());
362 }
else if ((s.
scale * exaggeration) < 1.) {
389 }
else if (!additional->getTagProperty().isPlacedInRTree()) {
391 additional->drawGL(s);
396 if (!i->getTagProperty().isPlacedInRTree()) {
416 if (spreadSuperposed) {
421 const double halfInnerFeetWidth = halfGauge - 0.039 * exaggeration;
422 const double halfRailWidth = halfInnerFeetWidth + 0.15 * exaggeration;
423 const double halfCrossTieWidth = halfGauge * 1.81;
429 glColor3d(0.8, 0.8, 0.8);
430 glTranslated(0, 0, .1);
439 if (halfWidth != halfWidth2 && !spreadSuperposed) {
442 glTranslated(0, 0, -.1);
467 glColor3d(0.3, 0.3, 0.3);
481 double iconWidth = 1;
496 glRotated(90, 0, 0, 1);
531 }
else if (!additional->getTagProperty().isPlacedInRTree()) {
533 additional->drawGL(s);
538 if (!i->getTagProperty().isPlacedInRTree()) {
560 for (
int i = 0; i < e; ++i) {
568 glVertex2d(-mw, -t - length);
569 glVertex2d(-mw2, -t - length);
570 glVertex2d(-mw2, -t);
592 new FXMenuCommand(ret,
"Copy parent edge name to clipboard",
nullptr, ret,
MID_COPY_EDGE_NAME);
618 bool edgeHasSidewalk =
false;
619 bool edgeHasBikelane =
false;
620 bool edgeHasBuslane =
false;
621 bool edgeHasGreenVerge =
false;
622 bool differentLaneShapes =
false;
625 for (
auto i : selectedLanes) {
627 edgeHasSidewalk =
true;
629 if (i->getParentEdge()->hasRestrictedLane(
SVC_BICYCLE)) {
630 edgeHasBikelane =
true;
632 if (i->getParentEdge()->hasRestrictedLane(
SVC_BUS)) {
633 edgeHasBuslane =
true;
635 if (i->getParentEdge()->hasRestrictedLane(
SVC_IGNORING)) {
636 edgeHasGreenVerge =
true;
638 if (i->getParentEdge()->getNBEdge()->getLaneStruct(i->getIndex()).customShape.size() != 0) {
639 differentLaneShapes =
true;
650 FXMenuPane* edgeOperations =
new FXMenuPane(ret);
652 new FXMenuCascade(ret,
"edge operations",
nullptr, edgeOperations);
654 new FXMenuCommand(edgeOperations,
"Split edge here",
nullptr, &parent,
MID_GNE_EDGE_SPLIT);
655 new FXMenuCommand(edgeOperations,
"Split edge in both directions here",
nullptr, &parent,
MID_GNE_EDGE_SPLIT_BIDI);
658 new FXMenuCommand(edgeOperations, (
"Reverse " + edgeDescPossibleMulti).c_str(),
nullptr, &parent,
MID_GNE_EDGE_REVERSE);
659 new FXMenuCommand(edgeOperations, (
"Add reverse direction for " + edgeDescPossibleMulti).c_str(),
nullptr, &parent,
MID_GNE_EDGE_ADD_REVERSE);
660 new FXMenuCommand(edgeOperations, (
"Reset lengths for " + edgeDescPossibleMulti).c_str(),
nullptr, &parent,
MID_GNE_EDGE_RESET_LENGTH);
661 new FXMenuCommand(edgeOperations, (
"Straighten " + edgeDescPossibleMulti).c_str(),
nullptr, &parent,
MID_GNE_EDGE_STRAIGHTEN);
662 new FXMenuCommand(edgeOperations, (
"Smooth " + edgeDescPossibleMulti).c_str(),
nullptr, &parent,
MID_GNE_EDGE_SMOOTH);
664 new FXMenuCommand(edgeOperations, (
"Smooth elevation of " + edgeDescPossibleMulti).c_str(),
nullptr, &parent,
MID_GNE_EDGE_SMOOTH_ELEVATION);
666 FXMenuPane* laneOperations =
new FXMenuPane(ret);
668 new FXMenuCascade(ret,
"lane operations",
nullptr, laneOperations);
670 if (differentLaneShapes) {
674 FXMenuPane* addSpecialLanes =
new FXMenuPane(laneOperations);
676 FXMenuPane* removeSpecialLanes =
new FXMenuPane(laneOperations);
678 FXMenuPane* transformSlanes =
new FXMenuPane(laneOperations);
681 FXMenuCommand* addSidewalk =
new FXMenuCommand(addSpecialLanes,
"Sidewalk", pedestrianIcon, &parent,
MID_GNE_LANE_ADD_SIDEWALK);
682 FXMenuCommand* addBikelane =
new FXMenuCommand(addSpecialLanes,
"Bikelane", bikeIcon, &parent,
MID_GNE_LANE_ADD_BIKE);
683 FXMenuCommand* addBuslane =
new FXMenuCommand(addSpecialLanes,
"Buslane", busIcon, &parent,
MID_GNE_LANE_ADD_BUS);
684 FXMenuCommand* addGreenVerge =
new FXMenuCommand(addSpecialLanes,
"Greenverge", greenVergeIcon, &parent,
MID_GNE_LANE_ADD_GREENVERGE);
686 FXMenuCommand* removeSidewalk =
new FXMenuCommand(removeSpecialLanes,
"Sidewalk", pedestrianIcon, &parent,
MID_GNE_LANE_REMOVE_SIDEWALK);
687 removeSidewalk->disable();
688 FXMenuCommand* removeBikelane =
new FXMenuCommand(removeSpecialLanes,
"Bikelane", bikeIcon, &parent,
MID_GNE_LANE_REMOVE_BIKE);
689 removeBikelane->disable();
690 FXMenuCommand* removeBuslane =
new FXMenuCommand(removeSpecialLanes,
"Buslane", busIcon, &parent,
MID_GNE_LANE_REMOVE_BUS);
691 removeBuslane->disable();
693 removeGreenVerge->disable();
696 FXMenuCommand* transformLaneToBikelane =
new FXMenuCommand(transformSlanes,
"Bikelane", bikeIcon, &parent,
MID_GNE_LANE_TRANSFORM_BIKE);
697 FXMenuCommand* transformLaneToBuslane =
new FXMenuCommand(transformSlanes,
"Buslane", busIcon, &parent,
MID_GNE_LANE_TRANSFORM_BUS);
700 FXMenuCascade* cascadeAddSpecialLane =
new FXMenuCascade(laneOperations, (
"add restricted " +
toString(
SUMO_TAG_LANE)).c_str(),
nullptr, addSpecialLanes);
701 FXMenuCascade* cascadeRemoveSpecialLane =
new FXMenuCascade(laneOperations, (
"remove restricted " +
toString(
SUMO_TAG_LANE)).c_str(),
nullptr, removeSpecialLanes);
702 new FXMenuCascade(laneOperations, (
"transform to restricted " +
toString(
SUMO_TAG_LANE)).c_str(),
nullptr, transformSlanes);
704 if (edgeHasSidewalk) {
705 transformLaneToSidewalk->disable();
706 addSidewalk->disable();
707 removeSidewalk->enable();
709 if (edgeHasBikelane) {
710 transformLaneToBikelane->disable();
711 addBikelane->disable();
712 removeBikelane->enable();
714 if (edgeHasBuslane) {
715 transformLaneToBuslane->disable();
716 addBuslane->disable();
717 removeBuslane->enable();
719 if (edgeHasGreenVerge) {
720 transformLaneToGreenVerge->disable();
721 addGreenVerge->disable();
722 removeGreenVerge->enable();
725 if (edgeHasSidewalk && edgeHasBikelane && edgeHasBuslane && edgeHasGreenVerge) {
726 cascadeAddSpecialLane->disable();
728 if (!edgeHasSidewalk && !edgeHasBikelane && !edgeHasBuslane && !edgeHasGreenVerge) {
729 cascadeRemoveSpecialLane->disable();
733 new FXMenuCommand(ret,
"Select state for all links from this edge:",
nullptr,
nullptr, 0);
735 for (
auto it : names) {
737 FXMenuRadio* mc =
new FXMenuRadio(ret, it.c_str(),
this, FXDataTarget::ID_OPTION + state);
743 FXMenuCommand* mc =
new FXMenuCommand(ret,
"Additional options available in 'Inspect Mode'",
nullptr,
nullptr, 0);
744 mc->handle(&parent, FXSEL(SEL_COMMAND, FXWindow::ID_DISABLE),
nullptr);
749 new FXMenuSeparator(ret);
752 new FXMenuCommand(ret, (
"Shape pos: " +
toString(pos)).c_str(),
nullptr,
nullptr, 0);
754 new FXMenuCommand(ret, (
"Height: " +
toString(height)).c_str(),
nullptr,
nullptr, 0);
794 if (laneParametricLength > 0) {
795 return laneParametricLength;
797 throw ProcessError(
"Lane Parametric Length cannot be never 0");
892 return canParse<double>(value);
899 return canParse<double>(value) && (parse<double>(value) >= 0);
901 return canParse<bool>(value);
906 }
else if (canParse<PositionVector>(value)) {
907 return parse<PositionVector>(value).size() > 1;
912 return canParse<bool>(value);
953 glPushName(E2Detector->
getGlID());
957 glTranslated(0, 0, E2Detector->
getType());
963 if ((segment.junction == junction) && (segment.AC == E2Detector)) {
978 if ((segment.lane ==
this) && (segment.AC == E2Detector)) {
1039 if (parse<bool>(value)) {
1063 for (
const auto& i : viaEdges) {
1097 switch (activeScheme) {
1113 switch (activeScheme) {
1139 switch (activeScheme) {
1141 switch (myPermissions) {
1163 return (
double)myPermissions;
1236 * (spreadSuperposed ? 0.4 : 1)));
1237 const double sideOffset = spreadSuperposed ? width * -0.5 : 0;
1241 for (
int i = 0; i < e; ++i) {
1247 glBegin(GL_TRIANGLES);
1248 glVertex2d(sideOffset, -t - length);
1249 glVertex2d(sideOffset - width * 0.25, -t);
1250 glVertex2d(sideOffset + width * 0.25, -t);
1272 glTranslated(lanePos.
x(), lanePos.
y(), vss->
getType());
1273 glRotated(-1 * laneRot, 0, 0, 1);
1274 glTranslated(0, -1.5, 0);
1275 glScaled(exaggeration, exaggeration, 1);
1279 noPoints = (int)(9.0 + s.
scale / 10.0);
1280 if (noPoints > 36) {
1287 glTranslated(0, 0, .1);
1292 glTranslated(0, 0, .1);
1293 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
1327 glTranslated(customShape.front().x(), customShape.front().y(),
GLO_JUNCTION + 0.01);
1329 glTranslated(0, 0, 0.01);
1342 glTranslated(customShape.back().x(), customShape.back().y(),
GLO_JUNCTION + 0.01);
1344 glTranslated(0, 0, 0.01);
1376 std::vector<GNEConnection*>
1379 std::vector<GNEConnection*> incomingConnections;
1382 if (junctionSource) {
1386 for (
auto j : i->getGNEConnections()) {
1387 if (j->getNBEdgeConnection().fromLane ==
getIndex()) {
1388 incomingConnections.push_back(j);
1393 return incomingConnections;
1397 std::vector<GNEConnection*>
1401 std::vector<GNEConnection*> outcomingConnections;
1403 for (
auto i : edgeConnections) {
1404 if (i->getNBEdgeConnection().fromLane ==
getIndex()) {
1405 outcomingConnections.push_back(i);
1408 return outcomingConnections;
1416 for (
auto i : incomingConnections) {
1421 for (
auto i : outcomingConnections) {
1443 i->startGeometryMoving();
1447 i->startGeometryMoving();
1451 i->startGeometryMoving();
1455 i->startGeometryMoving();
1459 i->startGeometryMoving();
1463 i->startGeometryMoving();
1473 i->endGeometryMoving();
1477 i->endGeometryMoving();
1481 i->endGeometryMoving();
1485 i->endGeometryMoving();
1489 i->endGeometryMoving();
1493 i->endGeometryMoving();
unsigned char alpha() const
Returns the alpha-amount of the color.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
bool setFunctionalColor(int activeScheme, RGBColor &col) const
sets the color according to the current scheme index and some lane function
void drawVSSSymbol(const GUIVisualizationSettings &s, GNEAdditional *vss) const
draw VSS symbol
@ MID_GNE_LANE_DUPLICATE
duplicate a lane
@ MID_GNE_EDGE_EDIT_ENDPOINT
change default geometry endpoints
@ MID_GNE_LANE_RESET_CUSTOMSHAPE
remove greenVerge
std::string getParentName() const
Returns the name of the parent object (if any)
@ MID_GNE_EDGE_RESET_ENDPOINT
reset default geometry endpoints
Position getPositionInView() const
Returns position of hierarchical element in view.
@ MID_GNE_LANE_REMOVE_GREENVERGE
remove greenVerge
double beginEndAngle() const
returns the angle in radians of the line connecting the first and the last position
Position getPositionInView() const
Returns position of hierarchical element in view.
@ SVC_PEDESTRIAN
pedestrian
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
RGBColor selectedEdgeColor
edge selection color
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
@ LINKSTATE_EQUAL
This is an uncontrolled, right-before-left link.
static RGBColor getColor()
gets the gl-color
bool isLogicValid()
whether this junction has a valid logic
An Element which don't belongs to GNENet but has influency in the simulation.
double getLaneSpeed(int lane) const
get lane speed
std::string getParametersStr() const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
bool laneShowBorders
Information whether lane borders shall be drawn.
std::string edgeParam
key for coloring by edge parameter
LinkState getLinkState(const NBEdge *incoming, NBEdge *outgoing, int fromLane, int toLane, bool mayDefinitelyPass, const std::string &tlID) const
get link state
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
const std::string getID() const
function to support debugging
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter
double laneMinSize
The minimum visual lane width for drawing.
RGBColor setLaneColor(const GUIVisualizationSettings &s) const
set color according to edit mode and visualisation settings
void updateGeometryShape(const PositionVector &shape, double startPos=-1, double endPos=-1, const Position &extraFirstPosition=Position::INVALID, const Position &extraLastPosition=Position::INVALID)
update geometry shape
const RGBColor * mySpecialColor
optional special color
@ LINKSTATE_TL_OFF_BLINKING
The link is controlled by a tls which is off and blinks, has to brake.
@ MID_GNE_LANE_TRANSFORM_BIKE
transform lane to bikelane
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
@ MID_GNE_EDGE_REVERSE
reverse an edge
@ MID_GNE_LANE_TRANSFORM_BUS
transform lane to busLane
static void drawSegmentGeometry(const GNEViewNet *viewNet, const SegmentGeometry::Segment &segment, const double width)
draw geometry segment
bool isAttributeEnabled(SumoXMLAttr key) const
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
bool isRestricted(SUMOVehicleClass vclass) const
check if this lane is restricted
static const double SNAP_RADIUS
GNEGeometry::Lane2laneConnection myLane2laneConnections
lane2lane connections
void drawPartialE2DetectorPlan(const GUIVisualizationSettings &s, const GNEAdditional *E2Detector, const GNEJunction *junction) const
draw partial E2 detector plan
@ LINKSTATE_TL_OFF_NOSIGNAL
The link is controlled by a tls which is off, not blinking, may pass.
double z() const
Returns the z-position.
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
GNEEdge * getParentEdge() const
Returns underlying parent edge.
void removeGLObjectFromGrid(GUIGlObject *o)
add GL Object into net
const std::vector< double > & getShapeLengths() const
The lengths of the single shape parts.
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
static const RGBColor E2
color for E2 detectors
void drawChildConnections(const GUIVisualizationSettings &s, const GUIGlObjectType GLTypeParent) const
static void drawCrossTies(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double length, double spacing, double halfWidth, bool drawForRectangleSelection)
draw crossties for railroads or pedestrian crossings
@ MID_GNE_EDGE_RESET_LENGTH
reset custom lengths
@ LINKDIR_PARTRIGHT
The link is a partial right direction.
std::string getAttributeForSelection(SumoXMLAttr key) const
method for getting the attribute in the context of object selection
@ SUMO_ATTR_CUSTOMSHAPE
whether a given shape is user-defined
static void drawLaneGeometry(const GNEViewNet *viewNet, const PositionVector &shape, const std::vector< double > &rotations, const std::vector< double > &lengths, const std::vector< RGBColor > &colors, double width)
draw lane geometry (use their own function due colors)
std::vector< std::string > getStrings() const
std::vector< Connection > getConnectionsFromLane(int lane, NBEdge *to=nullptr, int toLane=-1) const
Returns connections from a given lane.
bool isBidiRail(bool ignoreSpread=false) const
whether this edge is part of a bidirectional railway
@ SUMO_TAG_LANE
begin/end of the description of a single lane
static double naviDegree(const double angle)
@ MID_GNE_LANE_ADD_BUS
add busLane
void drawArrows(const GUIVisualizationSettings &s) const
draw arrows
@ LINKDIR_TURN_LEFTHAND
The link is a 180 degree turn (left-hand network)
@ SVC_BICYCLE
vehicle is a bicycle
std::vector< RGBColor > myShapeColors
The color of the shape parts (cached)
int getPriority() const
Returns the priority of the edge.
const std::vector< double > & getShapeRotations() const
get rotations of the single shape parts
const double SUMO_const_laneWidth
RGBColor selectedRouteColor
route selection color (used for routes and vehicle stops)
@ MID_GNE_EDGE_SMOOTH
smooth geometry
const std::vector< GNEConnection * > & getGNEConnections() const
returns a reference to the GNEConnection vector
double length() const
Returns the length.
bool hasRestrictedLane(SUMOVehicleClass vclass) const
check if edge has a restricted lane
GUIVisualizationTextSettings drawLinkJunctionIndex
bool showRails
Information whether rails shall be drawn.
void setPermissions(SVCPermissions permissions, int lane=-1)
set allowed/disallowed classes for the given lane or for all lanes if -1 is given
@ GNE_NMODE_CREATE_EDGE
mode for creating new edges
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)....
@ GNE_NMODE_TLS
mode for editing tls
int myIndex
The index of this lane.
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
@ LINKSTATE_MAJOR
This is an uncontrolled, major link, may pass.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
@ LINKDIR_NODIR
The link has no direction (is a dead end link)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
SumoXMLTag
Numbers representing SUMO-XML - element names.
bool drawAsRailway(const GUIVisualizationSettings &s) const
whether to draw this lane as a railway
static void drawTexturedBox(int which, double size)
Draws a named texture as a box with the given size.
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
double getSpeed() const
returns the current speed of lane
static const double geometryPointsText
details for Geometry Points Texts
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
The representation of a single edge during network building.
@ MID_GNE_EDGE_SPLIT_BIDI
split an edge
@ MID_GNE_LANE_REMOVE_SIDEWALK
remove sidewalk
const GNEGeometry::SegmentGeometry & getAdditionalSegmentGeometry() const
obtain additional segment geometry
GUIColorer junctionColorer
The junction colorer.
bool lefthand
whether drawing is performed in left-hand networks
int getIndex() const
returns the index of the lane
@ LINKDIR_RIGHT
The link is a (hard) right direction.
A road/street connecting two junctions (netedit-version)
friend class GNEChange_Attribute
declare friend class
@ MID_GNE_EDGE_STRAIGHTEN
remove inner geometry
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
GNEGeometry::Geometry myLaneGeometry
lane geometry
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
double getChildRotation(const GNELane *lane)
get child rotation calculated in ChildConnections
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
void setLaneShape(int lane, const PositionVector &shape)
sets a custom lane shape
void setEndOffset(int lane, double offset)
set lane specific end-offset (negative lane implies set for all lanes)
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
@ LINKDIR_TURN
The link is a 180 degree turn.
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, int align=0, double width=-1)
double getLaneParametricLength() const
returns the parameteric length of the lane
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic,...
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
GUIVisualizationTextSettings addName
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
@ LINKDIR_STRAIGHT
The link is a straight direction.
NBNode * getToNode() const
Returns the destination node of the edge.
bool canParseVehicleClasses(const std::string &classes)
Checks whether the given string contains only known vehicle classes.
@ SUMO_TAG_FLOW
a flow definitio nusing a from-to edges instead of a route (used by router)
static void drawOutlineCircle(double width, double iwidth, int steps=8)
Draws an unfilled circle around (0,0)
GUIVisualizationDetailSettings detailSettings
detail settings
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
double mySpecialColorValue
optional value that corresponds to which the special color corresponds
double getLaneWidth() const
Returns the default width of lanes of this edge.
std::vector< double > myLaneRestrictedTextureRotations
Rotations of textures of restricted lanes.
void endGeometryMoving()
begin movement (used when user click over edge to start a movement, to avoid problems with problems w...
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
const PositionVector & getShape() const
The shape of the additional element.
@ MID_COPY_EDGE_NAME
Copy edge name (for lanes only)
const PositionVector & getLaneShape() const
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.
@ SUMO_TAG_VSS
A variable speed sign.
bool drawAsWaterway(const GUIVisualizationSettings &s) const
whether to draw this lane as a waterways
NBEdge * getNBEdge() const
returns the internal NBEdge
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
std::string getLaneID(int lane) const
get lane ID
T get(const std::string &str) const
const std::vector< GNEShape * > & getChildShapes() const
get child shapes
int getConnectionIndex(const NBEdge *from, const NBEdge::Connection &con) const
return the index of the given connection
bool isWaterway(SVCPermissions permissions)
Returns whether an edge with the given permission is a waterway edge.
LinkDirection getDirection(const NBEdge *const incoming, const NBEdge *const outgoing, bool leftHand=false) const
Returns the representation of the described stream's direction.
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
const GNEGeometry::Lane2laneConnection & getLane2laneConnections() const
get Lane2laneConnection struct
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
double getLengthGeometryFactor() const
get length geometry factor
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
GUIGlID getGlID() const
Returns the numerical id of the object.
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
A class that stores a 2D geometrical boundary.
@ MID_GNE_LANE_REMOVE_BIKE
remove bikelane
@ LINKSTATE_ZIPPER
This is an uncontrolled, zipper-merge link.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
int getNumLanes() const
Returns the number of lanes.
static RGBColor colorForLinksState(FXuint state)
return the color for each linkstate
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
static GUIGlID getTexture(GUITexture which)
returns a texture previously defined in the enum GUITexture
void updateLane2laneConnection()
update
static void drawShapeDottedContourRectangle(const GUIVisualizationSettings &s, const int type, const Position ¢er, const double width, const double height, const double rotation=0, const double offsetX=0, const double offsetY=0)
draw a dotted contour around the given Position with certain width and height
static void drawGeometry(const GNEViewNet *viewNet, const Geometry &geometry, const double width)
draw geometry
double scale
information about a lane's width (temporary, used for a single view)
@ GNE_SUPERMODE_NETWORK
Network mode (Edges, junctions, etc..)
Supermode currentSupermode
the current supermode
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.
void setSpeed(int lane, double speed)
set lane specific speed (negative lane implies set for all lanes)
bool setMultiColor(const GUIVisualizationSettings &s, const GUIColorer &c, RGBColor &col) const
sets multiple colors according to the current scheme index and some lane function
A point in 2D or 3D with translation and scaling methods.
@ GNE_NMODE_CONNECT
mode for connecting lanes
double x() const
Returns the x-position.
double selectionScale
the current selection scaling in NETEDIT (temporary)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
GUIVisualizationTextSettings drawLinkTLIndex
Lane & getLaneStruct(int lane)
double width
This lane's width.
@ LINKDIR_LEFT
The link is a (hard) left direction.
@ MID_GNE_LANE_TRANSFORM_SIDEWALK
transform lane to sidewalk
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb, inspired by http://alvyray.com/Papers/CG/hsv2rgb....
double getLaneShapeLength() const
returns the length of the lane's shape
@ LINKSTATE_MINOR
This is an uncontrolled, minor link, has to brake.
std::vector< GNEConnection * > getGNEIncomingConnections()
returns a vector with the incoming GNEConnections of this lane
GNEJunction * getGNEJunctionDestiny() const
returns the destination-junction
static const double laneTextures
details for lane textures
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
static void drawShapeDottedContourAroundShape(const GUIVisualizationSettings &s, const int type, const PositionVector &shape, const double width)
draw a dotted contour around the given Non closed shape with certain width
@ SVC_SHIP
is an arbitrary ship
@ MID_GNE_LANE_ADD_SIDEWALK
add sidewalk
NetworkEditMode
@brie enum for network edit modes
void setSpecialColor(const RGBColor *Color2, double colorValue=std::numeric_limits< double >::max())
std::string getAttribute(SumoXMLAttr key) const
std::vector< Connection > myConnections
List of connections to following edges.
GNEViewNet * getViewNet() const
get view net
void drawMarkings(const GUIVisualizationSettings &s, double scale) const
draw lane markings
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
@ SUMO_TAG_E2DETECTOR_MULTILANE
an e2 detector over multiple lanes (used by Netedit)
GUIVisualizationColorSettings colorSettings
color settings
virtual bool isAttributeCarrierSelected() const =0
check if attribute carrier is selected
int getCircleResolution() const
function to calculate circle resolution for all circles drawn in drawGL(...) functions
@ MID_GNE_LANE_TRANSFORM_GREENVERGE
transform lane to greenVerge
double getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn't set.
const Position & getChildPosition(const GNELane *lane)
get child position calculated in ChildConnections
const std::vector< GNEEdge * > & getGNEIncomingEdges() const
Returns incoming GNEEdges.
std::vector< GNEConnection * > getGNEOutcomingConnections()
returns a vector with the outgoing GNEConnections of this lane
void setParametersStr(const std::string ¶msString)
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
double getLength() const
Returns the computed length of the edge.
GNEJunction * getGNEJunctionSource() const
returns the source-junction
const PositionVector & getLaneShape(int i) const
Returns the shape of the nth lane.
void startGeometryMoving()
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void updateGeometry()
update pre-computed geometry information
void addGLObjectIntoGrid(GUIGlObject *o)
add GL Object into net
PositionVector customShape
A custom shape for this lane set by the user.
long onDefault(FXObject *, FXSelector, void *)
multiplexes message to two targets
double y() const
Returns the y-position.
bool showLaneDirection
Whether to show direction indicators for lanes.
@ MID_GNE_EDGE_SPLIT
split an edge
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
void setAcceleration(int lane, bool accelRamp)
marks one lane as acceleration lane
void setLaneWidth(int lane, double width)
set lane specific width (negative lane implies set for all lanes)
static bool areParametersValid(const std::string &value, bool report=false)
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
std::vector< Position > myLaneRestrictedTexturePositions
Position of textures of restricted lanes.
@ MID_GNE_EDGE_STRAIGHTEN_ELEVATION
interpolate z values linear between junctions
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
const SVCPermissions SVCAll
all VClasses are allowed
virtual std::string getAttribute(SumoXMLAttr key) const =0
@ MID_GNE_EDGE_ADD_REVERSE
add reverse edge
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
bool drawAdditionals(const double exaggeration) const
check if additionals must be drawn
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
void handleMultiChange(GNELane *lane, FXObject *obj, FXSelector sel, void *data)
update phase definition for the current traffic light and phase
void updateConnectionIDs()
update IDs of incoming connections of this lane
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
const std::vector< GNEShape * > & getParentShapes() const
get parent shapes
GNETLSEditorFrame * getTLSEditorFrame() const
get frame for GNE_NMODE_TLS
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
static const double UNSPECIFIED_WIDTH
unspecified lane width
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used,...
void drawDirectionIndicators(double exaggeration, bool spreadSuperposed) const
direction indicators for lanes
bool controlsEdge(GNEEdge *edge) const
whether the given edge is controlled by the currently edited tlDef
double getFinalLength() const
get length that will be assigned to the lanes in the final network
GNENet * myNet
the net to inform about updates
void drawStartEndShapePoints(const GUIVisualizationSettings &s) const
draw start and end shape points
void drawTLSLinkNo(const GUIVisualizationSettings &s) const
draw TLS Link Number
bool accelRamp
Whether this lane is an acceleration lane.
@ LINKSTATE_ALLWAY_STOP
This is an uncontrolled, all-way stop link.
@ MID_GNE_LANE_ADD_GREENVERGE
add greenVerge
@ MID_GNE_EDGE_SMOOTH_ELEVATION
smooth elevation with regard to adjoining edges
GUIVisualizationSizeSettings addSize
static const StringBijection< FXuint > LinkStateNames
long names for link states
GUIColorer laneColorer
The lane colorer.
@ SVC_BUS
vehicle is a bus
const std::vector< double > & getShapeRotations() const
The rotations of the single shape parts.
@ GNE_ATTR_SELECTED
element is selected
@ MID_GNE_LANE_REMOVE_BUS
remove busLane
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
bool spreadSuperposed
Whether to improve visualisation of superposed (rail) edges.
const std::vector< double > & getShapeLengths() const
get lengths of the single shape parts
const double SUMO_const_laneMarkWidth
static const RGBColor GREEN
static double calculateRotation(const Position &first, const Position &second)
return angle between two points (used in geometric calculations)
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
return value for lane coloring according to the given scheme
bool drawDetail(const double detail, const double exaggeration) const
check if details can be drawn for the given GUIVisualizationDetailSettings and current scale and exxa...
double endOffset
This lane's offset to the intersection begin.
void selectAttributeCarrier(bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
void drawLinkRules(const GUIVisualizationSettings &s) const
draw link rules
void drawLinkNo(const GUIVisualizationSettings &s) const
draw link Number
PositionVector shape
The lane's shape.
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
const std::string & getTagStr() const
get tag assigned to this object in string format
Represents a single node (junction) during network building.
Stores the information about how to visualize structures.
SVCPermissions invertPermissions(SVCPermissions permissions)
negate the given permissions and ensure that only relevant bits are set
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
@ SVC_IGNORING
vehicles ignoring classes
@ GNETEXTURE_LANEPEDESTRIAN
@ LINKDIR_PARTLEFT
The link is a partial left direction.
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
NetworkEditMode networkEditMode
the current Network edit mode
RGBColor selectedLaneColor
lane selection color
const T getColor(const double value) const
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
@ MID_GNE_LANE_ADD_BIKE
add bikelane
bool isValid(SumoXMLAttr key, const std::string &value)
const std::vector< T > & getSchemes() const
@ GNE_NMODE_MOVE
mode for moving network elements
bool disableLaneIcons
whether drawing is performed in left-hand networks
const std::vector< GNEAdditional * > & getChildAdditionals() const
return child additionals
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
@ SUMO_TAG_TRIP
a single trip definition (used by router)
GNEViewParent * getViewParent() const
get the net object
double getDistance() const
static const RGBColor WHITE
void drawLane2LaneConnections() const
draw lane to lane connections
static void drawTextAtEnd(const std::string &text, const PositionVector &shape, double x, double size, RGBColor color)
draw text and the end of shape
GNEEdge * myParentEdge
The Edge that to which this lane belongs.
@ LINKSTATE_STOP
This is an uncontrolled, minor link, has to stop.
static void drawTriangleAtEnd(const Position &p1, const Position &p2, double tLength, double tWidth)
Draws a triangle at the end of the given line.