 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
52 FXIMPLEMENT(
GNELane, FXDelegator, 0, 0)
62 mySpecialColor(
nullptr) {
67 myParentEdge(
GNEEdge::getDummyEdge()),
69 mySpecialColor(nullptr) {
122 for (
auto i : incomingConnections) {
127 for (
auto i : outGoingConnections) {
155 int noLinks = (int)cons.size();
165 for (
int i = noLinks; --i >= 0;) {
166 double x2 = x1 - (double)(w / 2.);
168 cons[lefthand ? noLinks - 1 - i : i]);
179 int noLinks = (int)cons.size();
189 for (
int i = noLinks; --i >= 0;) {
190 double x2 = x1 - (double)(w / 2.);
191 int linkNo = cons[lefthand ? noLinks - 1 - i : i].tlLinkIndex;
208 double rot = (double) atan2((end.
x() - f.
x()), (f.
y() - end.
y())) * (double) 180.0 / (
double)
M_PI;
213 glTranslated(end.
x(), end.
y(), 0);
214 glRotated(rot, 0, 0, 1);
218 for (
auto i : edgeCons) {
261 glTranslated(0, 5, 0);
263 glTranslated(0, -5, 0);
281 for (
auto it : connections) {
294 glColor3d(.4, .4, .4);
297 glColor3d(.7, .4, .4);
300 glColor3d(.7, .7, .7);
303 glColor3d(.7, .7, 1);
306 glColor3d(.75, .5, 0.25);
311 const Position& endPos = it.toEdge->getLaneShape(it.toLane)[0];
313 glVertex2d(startPos.
x(), startPos.
y());
314 glVertex2d(endPos.
x(), endPos.
y());
343 }
else if (s.
scale * exaggeration < 1.) {
370 if (spreadSuperposed) {
375 const double halfInnerFeetWidth = halfGauge - 0.039 * exaggeration;
376 const double halfRailWidth = halfInnerFeetWidth + 0.15 * exaggeration;
377 const double halfCrossTieWidth = halfGauge * 1.81;
387 glColor3d(0.8, 0.8, 0.8);
388 glTranslated(0, 0, .1);
401 if (halfWidth != halfWidth2 && !spreadSuperposed) {
404 glTranslated(0, 0, -.1);
429 glColor3d(0.3, 0.3, 0.3);
443 double iconWidth = 1;
458 glRotated(90, 0, 0, 1);
491 if (!i->getTagProperty().isPlacedInRTree()) {
497 if (!i->getTagProperty().isPlacedInRTree()) {
519 for (
int i = 0; i < e; ++i) {
527 glVertex2d(-mw, -t - length);
528 glVertex2d(-mw2, -t - length);
529 glVertex2d(-mw2, -t);
555 new FXMenuCommand(ret,
"Copy edge parent name to clipboard",
nullptr, ret,
MID_COPY_EDGE_NAME);
579 bool edgeHasSidewalk =
false;
580 bool edgeHasBikelane =
false;
581 bool edgeHasBuslane =
false;
582 bool edgeHasGreenVerge =
false;
583 bool differentLaneShapes =
false;
586 for (
auto i : selectedLanes) {
588 edgeHasSidewalk =
true;
590 if (i->getParentEdge().hasRestrictedLane(
SVC_BICYCLE)) {
591 edgeHasBikelane =
true;
593 if (i->getParentEdge().hasRestrictedLane(
SVC_BUS)) {
594 edgeHasBuslane =
true;
596 if (i->getParentEdge().hasRestrictedLane(
SVC_IGNORING)) {
597 edgeHasGreenVerge =
true;
599 if (i->getParentEdge().getNBEdge()->getLaneStruct(i->getIndex()).customShape.size() != 0) {
600 differentLaneShapes =
true;
611 FXMenuPane* edgeOperations =
new FXMenuPane(ret);
613 new FXMenuCascade(ret,
"edge operations",
nullptr, edgeOperations);
615 new FXMenuCommand(edgeOperations,
"Split edge here",
nullptr, &parent,
MID_GNE_EDGE_SPLIT);
616 new FXMenuCommand(edgeOperations,
"Split edge in both directions here",
nullptr, &parent,
MID_GNE_EDGE_SPLIT_BIDI);
619 new FXMenuCommand(edgeOperations, (
"Reverse " + edgeDescPossibleMulti).c_str(),
nullptr, &parent,
MID_GNE_EDGE_REVERSE);
620 new FXMenuCommand(edgeOperations, (
"Add reverse direction for " + edgeDescPossibleMulti).c_str(),
nullptr, &parent,
MID_GNE_EDGE_ADD_REVERSE);
621 new FXMenuCommand(edgeOperations, (
"Straighten " + edgeDescPossibleMulti).c_str(),
nullptr, &parent,
MID_GNE_EDGE_STRAIGHTEN);
622 new FXMenuCommand(edgeOperations, (
"Smooth " + edgeDescPossibleMulti).c_str(),
nullptr, &parent,
MID_GNE_EDGE_SMOOTH);
624 new FXMenuCommand(edgeOperations, (
"Smooth elevation of " + edgeDescPossibleMulti).c_str(),
nullptr, &parent,
MID_GNE_EDGE_SMOOTH_ELEVATION);
626 FXMenuPane* laneOperations =
new FXMenuPane(ret);
628 new FXMenuCascade(ret,
"lane operations",
nullptr, laneOperations);
630 if (differentLaneShapes) {
634 FXMenuPane* addSpecialLanes =
new FXMenuPane(laneOperations);
636 FXMenuPane* removeSpecialLanes =
new FXMenuPane(laneOperations);
638 FXMenuPane* transformSlanes =
new FXMenuPane(laneOperations);
641 FXMenuCommand* addSidewalk =
new FXMenuCommand(addSpecialLanes,
"Sidewalk", pedestrianIcon, &parent,
MID_GNE_LANE_ADD_SIDEWALK);
642 FXMenuCommand* addBikelane =
new FXMenuCommand(addSpecialLanes,
"Bikelane", bikeIcon, &parent,
MID_GNE_LANE_ADD_BIKE);
643 FXMenuCommand* addBuslane =
new FXMenuCommand(addSpecialLanes,
"Buslane", busIcon, &parent,
MID_GNE_LANE_ADD_BUS);
644 FXMenuCommand* addGreenVerge =
new FXMenuCommand(addSpecialLanes,
"Greenverge", greenVergeIcon, &parent,
MID_GNE_LANE_ADD_GREENVERGE);
646 FXMenuCommand* removeSidewalk =
new FXMenuCommand(removeSpecialLanes,
"Sidewalk", pedestrianIcon, &parent,
MID_GNE_LANE_REMOVE_SIDEWALK);
647 removeSidewalk->disable();
648 FXMenuCommand* removeBikelane =
new FXMenuCommand(removeSpecialLanes,
"Bikelane", bikeIcon, &parent,
MID_GNE_LANE_REMOVE_BIKE);
649 removeBikelane->disable();
650 FXMenuCommand* removeBuslane =
new FXMenuCommand(removeSpecialLanes,
"Buslane", busIcon, &parent,
MID_GNE_LANE_REMOVE_BUS);
651 removeBuslane->disable();
653 removeGreenVerge->disable();
656 FXMenuCommand* transformLaneToBikelane =
new FXMenuCommand(transformSlanes,
"Bikelane", bikeIcon, &parent,
MID_GNE_LANE_TRANSFORM_BIKE);
657 FXMenuCommand* transformLaneToBuslane =
new FXMenuCommand(transformSlanes,
"Buslane", busIcon, &parent,
MID_GNE_LANE_TRANSFORM_BUS);
660 FXMenuCascade* cascadeAddSpecialLane =
new FXMenuCascade(laneOperations, (
"add restricted " +
toString(
SUMO_TAG_LANE)).c_str(),
nullptr, addSpecialLanes);
661 FXMenuCascade* cascadeRemoveSpecialLane =
new FXMenuCascade(laneOperations, (
"remove restricted " +
toString(
SUMO_TAG_LANE)).c_str(),
nullptr, removeSpecialLanes);
662 new FXMenuCascade(laneOperations, (
"transform to restricted " +
toString(
SUMO_TAG_LANE)).c_str(),
nullptr, transformSlanes);
664 if (edgeHasSidewalk) {
665 transformLaneToSidewalk->disable();
666 addSidewalk->disable();
667 removeSidewalk->enable();
669 if (edgeHasBikelane) {
670 transformLaneToBikelane->disable();
671 addBikelane->disable();
672 removeBikelane->enable();
674 if (edgeHasBuslane) {
675 transformLaneToBuslane->disable();
676 addBuslane->disable();
677 removeBuslane->enable();
679 if (edgeHasGreenVerge) {
680 transformLaneToGreenVerge->disable();
681 addGreenVerge->disable();
682 removeGreenVerge->enable();
685 if (edgeHasSidewalk && edgeHasBikelane && edgeHasBuslane && edgeHasGreenVerge) {
686 cascadeAddSpecialLane->disable();
688 if (!edgeHasSidewalk && !edgeHasBikelane && !edgeHasBuslane && !edgeHasGreenVerge) {
689 cascadeRemoveSpecialLane->disable();
693 new FXMenuCommand(ret,
"Select state for all links from this edge:",
nullptr,
nullptr, 0);
695 for (
auto it : names) {
697 FXMenuRadio* mc =
new FXMenuRadio(ret, it.c_str(),
this, FXDataTarget::ID_OPTION + state);
703 FXMenuCommand* mc =
new FXMenuCommand(ret,
"Additional options available in 'Inspect Mode'",
nullptr,
nullptr, 0);
704 mc->handle(&parent, FXSEL(SEL_COMMAND, FXWindow::ID_DISABLE),
nullptr);
709 new FXMenuSeparator(ret);
712 new FXMenuCommand(ret, (
"Shape pos: " +
toString(pos)).c_str(),
nullptr,
nullptr, 0);
714 new FXMenuCommand(ret, (
"Height: " +
toString(height)).c_str(),
nullptr,
nullptr, 0);
753 if (laneParametricLenght > 0) {
754 return laneParametricLenght;
756 throw ProcessError(
"Lane Parametric Lenght cannot be never 0");
844 return canParse<double>(value);
851 return canParse<double>(value) && (parse<double>(value) >= 0);
853 return canParse<bool>(value);
858 }
else if (canParse<PositionVector>(value)) {
859 return parse<PositionVector>(value).size() > 1;
864 return canParse<int>(value) && (parse<int>(value) ==
myIndex);
866 return canParse<bool>(value);
880 result += i.first +
"=" + i.second +
"|";
883 if (!result.empty()) {
890 std::vector<std::pair<std::string, std::string> >
892 std::vector<std::pair<std::string, std::string> > result;
895 result.push_back(std::make_pair(i.first, i.second));
906 std::vector<std::string> parsedValues;
909 parsedValues.push_back(stValues.
next());
912 for (
auto i : parsedValues) {
913 std::vector<std::string> parsedParameters;
916 parsedParameters.push_back(stParam.
next());
970 if (parse<bool>(value)) {
994 for (
const auto& i : viaEdges) {
1028 switch (activeScheme) {
1044 switch (activeScheme) {
1070 switch (activeScheme) {
1072 switch (myPermissions) {
1094 return (
double)myPermissions;
1161 * (spreadSuperposed ? 0.4 : 1)));
1162 const double sideOffset = spreadSuperposed ? width * -0.5 : 0;
1166 for (
int i = 0; i < e; ++i) {
1172 glBegin(GL_TRIANGLES);
1173 glVertex2d(sideOffset, -t - length);
1174 glVertex2d(sideOffset - width * 0.25, -t);
1175 glVertex2d(sideOffset + width * 0.25, -t);
1194 glScaled(exaggeration, exaggeration, 1);
1195 glTranslated(lanePos.
x(), lanePos.
y(), vss->
getType());
1196 glRotated(-1 * laneRot, 0, 0, 1);
1197 glTranslated(0, -1.5, 0);
1201 noPoints = (int)(9.0 + s.
scale / 10.0);
1202 if (noPoints > 36) {
1209 glTranslated(0, 0, .1);
1214 glTranslated(0, 0, .1);
1215 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
1248 glTranslated(customShape.front().x(), customShape.front().y(),
GLO_JUNCTION + 0.01);
1250 glTranslated(0, 0, 0.01);
1263 glTranslated(customShape.back().x(), customShape.back().y(),
GLO_JUNCTION + 0.01);
1265 glTranslated(0, 0, 0.01);
1303 std::vector<GNEConnection*>
1306 std::vector<GNEConnection*> incomingConnections;
1309 if (junctionSource) {
1313 for (
auto j : i->getGNEConnections()) {
1314 if (j->getNBEdgeConnection().fromLane ==
getIndex()) {
1315 incomingConnections.push_back(j);
1320 return incomingConnections;
1324 std::vector<GNEConnection*>
1328 std::vector<GNEConnection*> outcomingConnections;
1330 for (
auto i : edgeConnections) {
1331 if (i->getNBEdgeConnection().fromLane ==
getIndex()) {
1332 outcomingConnections.push_back(i);
1335 return outcomingConnections;
1343 for (
auto i : incomingConnections) {
1348 for (
auto i : outcomingConnections) {
1370 i->startGeometryMoving();
1374 i->startGeometryMoving();
1378 i->startGeometryMoving();
1382 i->startGeometryMoving();
1386 i->startGeometryMoving();
1390 i->startGeometryMoving();
1400 i->endGeometryMoving();
1404 i->endGeometryMoving();
1408 i->endGeometryMoving();
1412 i->endGeometryMoving();
1416 i->endGeometryMoving();
1420 i->endGeometryMoving();
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
change default geometry endpoints
std::string getParentName() const
Returns the name of the parent object (if any)
reset default geometry endpoints
Position getPositionInView() const
Returns position of hierarchical element in view.
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.
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
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
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
#define WRITE_WARNING(msg)
double laneMinSize
The minimum visual lane width for drawing.
RGBColor setLaneColor(const GUIVisualizationSettings &s) const
set color according to edit mode and visualisation settings
const RGBColor * mySpecialColor
optional special color
The link is controlled by a tls which is off and blinks, has to brake.
transform lane to bikelane
transform lane to busLane
bool isRestricted(SUMOVehicleClass vclass) const
check if this lane is restricted
static const double SNAP_RADIUS
The link is controlled by a tls which is off, not blinking, may pass.
double z() const
Returns the z-position.
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 removeGLObjectFromGrid(GUIGlObject *o)
add GL Object into net
bool hasNext()
returns the information whether further substrings exist
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
The link is a partial right direction.
std::string getAttributeForSelection(SumoXMLAttr key) const
method for getting the attribute in the context of object selection
whether a given shape is user-defined
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
begin/end of the description of a single lane
static bool isGenericParametersValid(const std::string &value)
check if given string can be parsed to a map/list of generic parameters
static double naviDegree(const double angle)
const std::vector< GNEShape * > & getShapeParents() const
get shapes of VSS
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
The link is a 180 degree turn (left-hand network)
std::vector< RGBColor > myShapeColors
The color of the shape parts (cached)
static OptionsCont & getOptions()
Retrieves the options.
int getPriority() const
Returns the priority of the edge.
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
const double SUMO_const_laneWidth
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
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)....
int myIndex
The index of this lane.
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
This is an uncontrolled, major link, may pass.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
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
PositionVector shape
The shape of the netElement element.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
double getSpeed() const
@nrief 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.
GUIColorer junctionColorer
The junction colorer.
int getIndex() const
returns the index of the lane
The link is a (hard) right direction.
A road/street connecting two junctions (netedit-version)
friend class GNEChange_Attribute
declare friend class
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
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)
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
std::vector< double > shapeRotations
The rotations of the single shape parts.
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.
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
NetElementGeometry myGeometry
netElement geometry
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.
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
double mySpecialColorValue
optional value that corresponds to which the special color corresponds
double getLaneWidth() const
Returns the default width of lanes of this edge.
bool controlsEdge(GNEEdge &edge) const
whether the given edge is controlled by the currently edited tlDef
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
Copy edge name (for lanes only)
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.
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.
void calculateShapeRotationsAndLengths()
calculate shape rotations and lengths
std::string getLaneID(int lane) const
get lane ID
T get(const std::string &str) const
int getConnectionIndex(const NBEdge *from, const NBEdge::Connection &con) const
return the index of the given connection
std::vector< std::pair< std::string, std::string > > getGenericParameters() const
return generic parameters as vector of pairs format
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.
void drawChildConnections(const GUIVisualizationSettings &s, const GUIGlObjectType GLTypeParent) const
vehicle is a passenger car (a "normal" car)
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.
GNEEdge & getParentEdge()
Returns underlying parent edge.
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
begin/end of the description of an edge
static GUIGlID getTexture(GUITexture which)
returns a texture previously defined in the enum GUITexture
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
double getChildRotation(const GNELane *lane)
get child rotation calculated in ChildConnections
double scale
information about a lane's width (temporary, used for a single view)
const std::string & getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a ' '.
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
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.
mode for connecting lanes
double x() const
Returns the x-position.
static bool isValidGenericParameterKey(const std::string &value)
whether the given string is a valid key for a generic parameter
double selectionScale
the current selection scaling in NETEDIT (temporary)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
std::string getGenericParametersStr() const
return generic parameters in string format
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.
The link is a (hard) left direction.
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
const std::vector< GNEShape * > & getShapeChildren() const
get shapes of VSS
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.
void drawArrows() const
draw arrows
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
void clearGeometry()
reset geometry
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
NetworkEditMode
@brie enum for network edit modes
void setSpecialColor(const RGBColor *Color2, double colorValue=std::numeric_limits< double >::max())
static bool isValidGenericParameterValue(const std::string &value)
whether the given string is a valid value for a generic parameter
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.
GUIVisualizationColorSettings colorSettings
color settings
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
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
transform lane to greenVerge
double getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn't set.
const std::vector< GNEEdge * > & getGNEIncomingEdges() const
Returns incoming GNEEdges.
std::vector< GNEConnection * > getGNEOutcomingConnections()
returns a vector with the outgoing GNEConnections of this lane
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.
const std::vector< GNEDemandElement * > & getDemandElementParents() const
return vector of demand elements that have as Parent this edge (For example, Calibrators)
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.
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)
const std::vector< GNEAdditional * > & getAdditionalParents() const
return vector of additionals that have as Parent this edge (For example, Calibrators)
std::vector< Position > myLaneRestrictedTexturePositions
Position of textures of restricted lanes.
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 std::vector< GNEAdditional * > & getAdditionalChildren() const
return vector of additionals that have as Parent this edge (For example, Calibrators)
const SVCPermissions SVCAll
all VClasses are allowed
void drawLinkRules() const
draw link rules
virtual std::string getAttribute(SumoXMLAttr key) const =0
GNEEdge & myParentEdge
The Edge that to which this lane belongs.
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
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
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 setParameter(const std::string &key, const std::string &value)
Sets a parameter.
void drawDirectionIndicators(double exaggeration, bool spreadSuperposed) const
direction indicators for lanes
const Position & getChildPosition(const GNELane *lane)
get child position calculated in ChildConnections
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
void clearParameter()
Clears the parameter map.
bool accelRamp
Whether this lane is an acceleration lane.
This is an uncontrolled, all-way stop link.
smooth elevation with regard to adjoining edges
GUIVisualizationSizeSettings addSize
static const StringBijection< FXuint > LinkStateNames
long names for link states
GUIColorer laneColorer
The lane colorer.
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
bool spreadSuperposed
Whether to improve visualisation of superposed (rail) edges.
const double SUMO_const_laneMarkWidth
static const RGBColor GREEN
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 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.
const std::vector< GNEDemandElement * > & getDemandElementChildren() const
return vector of demand elements that have as Parent this edge (For example, Calibrators)
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.
vehicles ignoring classes
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.
bool isValid(SumoXMLAttr key, const std::string &value)
const std::vector< T > & getSchemes() const
mode for moving network elements
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
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
std::vector< double > shapeLengths
The lengths of the single shape parts.
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
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.