46 FXIMPLEMENT(
GNELane, FXDelegator, 0, 0)
57 selectionScale(lane->isAttributeCarrierSelected() || lane->myParentEdge->isAttributeCarrierSelected() ? s.selectorFrameScale : 1),
58 exaggeration(selectionScale * s.laneWidthExaggeration),
59 halfWidth2(exaggeration * (lane->myParentEdge->getNBEdge()->getLaneWidth(lane->getIndex()) / 2 -
SUMO_const_laneMarkWidth / 2)),
60 halfWidth(lane->drawUsingSelectColor() ? halfWidth2 - exaggeration * 0.3 : halfWidth2) {
85 {}, {}, {}, {}, {}, {}, {}, {}),
88 mySpecialColor(
nullptr),
89 mySpecialColorValue(-1),
90 myLane2laneConnections(
this) {
92 updateCenteringBoundary(
false);
98 {}, {}, {}, {}, {}, {}, {}, {}),
99 myParentEdge(
nullptr),
101 mySpecialColor(
nullptr),
102 mySpecialColorValue(-1),
103 myLane2laneConnections(
this) {
122 const std::vector<double>&
128 const std::vector<double>&
157 shape->updateGeometry();
161 shape->updateGeometry();
165 additional->updateGeometry();
166 additional->updatePartialGeometry(
this);
170 additional->updateGeometry();
171 additional->updatePartialGeometry(
this);
175 demandElement->updateGeometry();
176 demandElement->updatePartialGeometry(
this);
180 demandElement->updateGeometry();
181 demandElement->updatePartialGeometry(
this);
185 additionalParent->updateGeometry();
189 childAdditionals->updateGeometry();
195 for (
auto i : incomingConnections) {
200 for (
auto i : outGoingConnections) {
245 const int noLinks = (int)cons.size();
257 for (
int i = noLinks; --i >= 0;) {
259 const double x2 = x1 - (double)(width / 2.);
262 cons[s.
lefthand ? noLinks - 1 - i : i]);
282 const int noLinks = (int)cons.size();
294 for (
int i = noLinks; --i >= 0;) {
296 const double x2 = x1 - (double)(w / 2.);
298 const int linkNo = cons[s.
lefthand ? noLinks - 1 - i : i].tlLinkIndex;
327 glTranslated(0, 0, 0.1);
331 glTranslated(end.
x(), end.
y(), 0);
333 glRotated(rot, 0, 0, 1);
338 if (connection.fromLane ==
myIndex) {
382 glTranslated(0, 5, 0);
384 glTranslated(0, -5, 0);
398 glTranslated(0, 0, 0.1);
402 for (
auto it : connections) {
415 glColor3d(.4, .4, .4);
418 glColor3d(.7, .4, .4);
421 glColor3d(.7, .7, .7);
424 glColor3d(.7, .7, 1);
427 glColor3d(.75, .5, 0.25);
432 const Position& endPos = it.toEdge->getLaneShape(it.toLane)[0];
434 glVertex2d(startPos.
x(), startPos.
y());
435 glVertex2d(endPos.
x(), endPos.
y());
488 if (laneDrawingConstants.
halfWidth != laneDrawingConstants.
halfWidth2 && !spreadSuperposed) {
492 glTranslated(0, 0, -0.1);
560 if (!additional->getTagProperty().isPlacedInRTree()) {
562 additional->drawGL(s);
567 if (!demandElement->getTagProperty().isPlacedInRTree()) {
568 demandElement->drawGL(s);
612 const int lefthand = s.
lefthand ? -1 : 1;
616 glTranslated(0, 0, 0.1);
636 glVertex2d(-markinWidthA, -subLengths);
637 glVertex2d(-markinWidthA, -subLengths - length);
638 glVertex2d(-markinWidthB, -subLengths - length);
639 glVertex2d(-markinWidthB, -subLengths);
651 glTranslated(0, 0, -0.1);
690 new FXMenuSeparator(ret);
697 for (
auto it : names) {
699 FXMenuRadio* mc =
new FXMenuRadio(ret, it.c_str(),
this, FXDataTarget::ID_OPTION + state);
706 mc->handle(&parent, FXSEL(SEL_COMMAND, FXWindow::ID_DISABLE),
nullptr);
710 new FXMenuSeparator(ret);
753 if (laneParametricLength > 0) {
754 return laneParametricLength;
756 throw ProcessError(
"Lane Parametric Length cannot be never 0");
856 return canParse<double>(value);
863 return canParse<double>(value) && (parse<double>(value) >= 0);
865 return canParse<bool>(value);
870 }
else if (canParse<PositionVector>(value)) {
871 return parse<PositionVector>(value).size() > 1;
885 WRITE_WARNING(
"Opposite lane '" + value +
"' does not connect the same nodes as edge '" + edge->
getID() +
"'!");
892 return canParse<bool>(value);
913 const std::map<std::string, std::string>&
992 for (
const auto& tag : copyOfPathAdditionalElements) {
993 for (
const auto& additionalElement : tag.second) {
995 additionalElement->updateGeometry();
1000 for (
const auto& tag : copyOfPathDemandElements) {
1001 for (
const auto& demandElement : tag.second) {
1002 demandElement->invalidatePath();
1007 for (
const auto& tag : copyOfPathGenericDatas) {
1008 for (
const auto& genericData : tag.second) {
1010 genericData->updateGeometry();
1068 if (oppEdge !=
nullptr) {
1076 if (parse<bool>(value)) {
1110 const GNEAttributeCarrier* inspectedAC = inspectedACs.size() > 0 ? inspectedACs.front() :
nullptr;
1117 for (
const auto& edge : viaEdges) {
1198 switch (activeScheme) {
1214 switch (activeScheme) {
1240 switch (activeScheme) {
1242 switch (myPermissions) {
1273 return (
double)myPermissions;
1351 glColor3d(0.3, 0.3, 0.3);
1355 const double sideOffset = spreadSuperposed ? width * -0.5 : 0;
1359 glTranslated(0, 0, 0.1);
1373 glBegin(GL_TRIANGLES);
1374 glVertex2d(sideOffset, -subWidth - length);
1375 glVertex2d(sideOffset - width * 0.25, -subWidth);
1376 glVertex2d(sideOffset + width * 0.25, -subWidth);
1402 if (spreadSuperposed) {
1408 const double halfInnerFeetWidth = halfGauge - 0.039 * laneDrawingConstants.
exaggeration;
1409 const double halfRailWidth = halfInnerFeetWidth + 0.15 * laneDrawingConstants.
exaggeration;
1410 const double halfCrossTieWidth = halfGauge * 1.81;
1416 glColor3d(0.8, 0.8, 0.8);
1418 glTranslated(0, 0, 0.1);
1444 double iconWidth = 1;
1459 glRotated(90, 0, 0, 1);
1495 glTranslated(customShape.front().x(), customShape.front().y(), 0.1);
1501 glTranslated(0, 0, 0.1);
1511 glTranslated(0, 0, 0.1);
1523 glTranslated(customShape.back().x(), customShape.back().y(), 0.1);
1529 glTranslated(0, 0, 0.1);
1539 glTranslated(0, 0, 0.1);
1563 std::vector<GNEConnection*>
1566 std::vector<GNEConnection*> incomingConnections;
1569 if (junctionSource) {
1573 for (
auto j : i->getGNEConnections()) {
1574 if (j->getNBEdgeConnection().fromLane ==
getIndex()) {
1575 incomingConnections.push_back(j);
1580 return incomingConnections;
1584 std::vector<GNEConnection*>
1588 std::vector<GNEConnection*> outcomingConnections;
1590 for (
auto i : edgeConnections) {
1591 if (i->getNBEdgeConnection().fromLane ==
getIndex()) {
1592 outcomingConnections.push_back(i);
1595 return outcomingConnections;
1603 for (
auto i : incomingConnections) {
1608 for (
auto i : outcomingConnections) {
1620 return POSITION_EPS;
1634 FXMenuPane* edgeOperations =
new FXMenuPane(ret);
1636 new FXMenuCascade(ret,
"edge operations",
nullptr, edgeOperations);
1643 if (edgeSelSize == 1) {
1669 bool edgeHasSidewalk =
false;
1670 bool edgeHasBikelane =
false;
1671 bool edgeHasBuslane =
false;
1672 bool edgeHasGreenVerge =
false;
1673 bool differentLaneShapes =
false;
1676 for (
auto i : selectedLanes) {
1678 edgeHasSidewalk =
true;
1680 if (i->myParentEdge->hasRestrictedLane(
SVC_BICYCLE)) {
1681 edgeHasBikelane =
true;
1683 if (i->myParentEdge->hasRestrictedLane(
SVC_BUS)) {
1684 edgeHasBuslane =
true;
1686 if (i->myParentEdge->hasRestrictedLane(
SVC_IGNORING)) {
1687 edgeHasGreenVerge =
true;
1689 if (i->myParentEdge->getNBEdge()->getLaneStruct(i->getIndex()).customShape.size() != 0) {
1690 differentLaneShapes =
true;
1701 FXMenuPane* laneOperations =
new FXMenuPane(ret);
1703 new FXMenuCascade(ret,
"lane operations",
nullptr, laneOperations);
1705 if (differentLaneShapes) {
1709 FXMenuPane* addSpecialLanes =
new FXMenuPane(laneOperations);
1711 FXMenuPane* removeSpecialLanes =
new FXMenuPane(laneOperations);
1713 FXMenuPane* transformSlanes =
new FXMenuPane(laneOperations);
1722 removeSidewalk->disable();
1724 removeBikelane->disable();
1726 removeBuslane->disable();
1728 removeGreenVerge->disable();
1735 FXMenuCascade* cascadeAddSpecialLane =
new FXMenuCascade(laneOperations, (
"add restricted " +
toString(
SUMO_TAG_LANE)).c_str(),
nullptr, addSpecialLanes);
1736 FXMenuCascade* cascadeRemoveSpecialLane =
new FXMenuCascade(laneOperations, (
"remove restricted " +
toString(
SUMO_TAG_LANE)).c_str(),
nullptr, removeSpecialLanes);
1737 new FXMenuCascade(laneOperations, (
"transform to restricted " +
toString(
SUMO_TAG_LANE)).c_str(),
nullptr, transformSlanes);
1739 if (edgeHasSidewalk) {
1740 transformLaneToSidewalk->disable();
1741 addSidewalk->disable();
1742 removeSidewalk->enable();
1744 if (edgeHasBikelane) {
1745 transformLaneToBikelane->disable();
1746 addBikelane->disable();
1747 removeBikelane->enable();
1749 if (edgeHasBuslane) {
1750 transformLaneToBuslane->disable();
1751 addBuslane->disable();
1752 removeBuslane->enable();
1754 if (edgeHasGreenVerge) {
1755 transformLaneToGreenVerge->disable();
1756 addGreenVerge->disable();
1757 removeGreenVerge->enable();
1760 if (edgeHasSidewalk && edgeHasBikelane && edgeHasBuslane && edgeHasGreenVerge) {
1761 cascadeAddSpecialLane->disable();
1763 if (!edgeHasSidewalk && !edgeHasBikelane && !edgeHasBuslane && !edgeHasGreenVerge) {
1764 cascadeRemoveSpecialLane->disable();
1772 FXMenuPane* reachableByClass =
new FXMenuPane(ret);
1781 menuCommand->handle(&parent, FXSEL(SEL_COMMAND, FXWindow::ID_DISABLE),
nullptr);
void removeGeometryPoint(const Position, GNEUndoList *)
NetworkEditMode
@brie enum for network edit modes
@ NETWORK_MOVE
mode for moving network elements
@ NETWORK_CREATE_EDGE
mode for creating new edges
@ NETWORK_TLS
mode for editing tls
@ NETWORK_CONNECT
mode for connecting lanes
@ MID_GNE_LANE_TRANSFORM_BIKE
transform lane to bikelane
@ MID_GNE_EDGE_REVERSE
reverse an edge
@ MID_GNE_LANE_ADD_GREENVERGE
add greenVerge
@ MID_GNE_LANE_ADD_BUS
add busLane
@ MID_GNE_EDGE_STRAIGHTEN_ELEVATION
interpolate z values linear between junctions
@ MID_GNE_EDGE_SMOOTH
smooth geometry
@ MID_GNE_LANE_RESET_CUSTOMSHAPE
remove greenVerge
@ MID_GNE_EDGE_STRAIGHTEN
remove inner geometry
@ MID_GNE_LANE_TRANSFORM_BUS
transform lane to busLane
@ MID_COPY_EDGE_NAME
Copy edge name (for lanes only)
@ MID_GNE_LANE_DUPLICATE
duplicate a lane
@ MID_GNE_LANE_REMOVE_GREENVERGE
remove greenVerge
@ MID_GNE_EDGE_SPLIT_BIDI
split an edge
@ MID_GNE_LANE_REMOVE_BIKE
remove bikelane
@ MID_REACHABILITY
show reachability from a given lane
@ MID_GNE_EDGE_RESET_LENGTH
reset custom lengths
@ MID_GNE_LANE_REMOVE_BUS
remove busLane
@ MID_GNE_LANE_REMOVE_SIDEWALK
remove sidewalk
@ MID_GNE_EDGE_RESET_ENDPOINT
reset default geometry endpoints
@ MID_GNE_EDGE_SMOOTH_ELEVATION
smooth elevation with regard to adjoining edges
@ MID_GNE_EDGE_ADD_REVERSE
add reverse edge
@ MID_GNE_LANE_ADD_SIDEWALK
add sidewalk
@ MID_GNE_LANE_TRANSFORM_SIDEWALK
transform lane to sidewalk
@ MID_GNE_LANE_ADD_BIKE
add bikelane
@ MID_GNE_EDGE_SPLIT
split an edge
@ MID_GNE_LANE_TRANSFORM_GREENVERGE
transform lane to greenVerge
@ MID_GNE_EDGE_EDIT_ENDPOINT
change default geometry endpoints
@ GLO_DOTTEDCONTOUR_FRONT
dotted contour front element (used in NETEDIT)
@ GLO_TEXTNAME
text element (used in NETEDIT)
@ GNETEXTURE_LANEPEDESTRIAN
#define WRITE_WARNING(msg)
const SVCPermissions SVCAll
all VClasses are allowed
SVCPermissions invertPermissions(SVCPermissions permissions)
negate the given permissions and ensure that only relevant bits are set
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
bool isWaterway(SVCPermissions permissions)
Returns whether an edge with the given permission is a waterway edge.
const std::string & getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a ' '.
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
bool canParseVehicleClasses(const std::string &classes)
Checks whether the given string contains only known vehicle classes.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_SHIP
is an arbitrary ship
@ SVC_IGNORING
vehicles ignoring classes
@ SVC_RAIL_CLASSES
classes which drive on tracks
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
@ SVC_BICYCLE
vehicle is a bicycle
@ SVC_RAIL_FAST
vehicle that is allowed to drive on high-speed rail tracks
@ SVC_AUTHORITY
authorities vehicles
@ SVC_BUS
vehicle is a bus
@ SVC_PEDESTRIAN
pedestrian
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_FLOW
a flow definitio nusing a from-to edges instead of a route (used by router)
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_TAG_TRIP
a single trip definition (used by router)
@ SUMO_TAG_EDGE
begin/end of the description of an edge
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)....
@ PARTLEFT
The link is a partial left direction.
@ RIGHT
The link is a (hard) right direction.
@ TURN
The link is a 180 degree turn.
@ LEFT
The link is a (hard) left direction.
@ STRAIGHT
The link is a straight direction.
@ TURN_LEFTHAND
The link is a 180 degree turn (left-hand network)
@ PARTRIGHT
The link is a partial right direction.
@ NODIR
The link has no direction (is a dead end link)
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic,...
@ LINKSTATE_ALLWAY_STOP
This is an uncontrolled, all-way stop link.
@ LINKSTATE_MAJOR
This is an uncontrolled, major link, may pass.
@ LINKSTATE_STOP
This is an uncontrolled, minor link, has to stop.
@ LINKSTATE_EQUAL
This is an uncontrolled, right-before-left link.
@ LINKSTATE_ZIPPER
This is an uncontrolled, zipper-merge link.
@ LINKSTATE_TL_OFF_BLINKING
The link is controlled by a tls which is off and blinks, has to brake.
@ LINKSTATE_MINOR
This is an uncontrolled, minor link, has to brake.
@ LINKSTATE_TL_OFF_NOSIGNAL
The link is controlled by a tls which is off, not blinking, may pass.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ GNE_ATTR_OPPOSITE
neighboring lane, simplified lane attr instead of child element
@ GNE_ATTR_PARENT
parent of an additional element
@ GNE_ATTR_SELECTED
element is selected
@ SUMO_ATTR_CUSTOMSHAPE
whether a given shape is user-defined
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
const double SUMO_const_laneWidth
const double SUMO_const_laneMarkWidth
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
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
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
static void drawTextAtEnd(const std::string &text, const PositionVector &shape, double x, const GUIVisualizationTextSettings &settings, const double scale)
draw text and the end of shape
static void drawOutlineCircle(double width, double iwidth, int steps=8)
Draws an unfilled circle around (0,0)
static RGBColor getColor()
gets the gl-color
static void drawTriangleAtEnd(const Position &p1, const Position &p2, double tLength, double tWidth)
Draws a triangle at the end of the given line.
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
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, const int align=0, double width=-1)
An Element which don't belongs to GNENet but has influency in the simulation.
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
friend class GNEChange_Attribute
declare friend class
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties & getTagProperty() const
get Tag Property assigned to this object
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
GNENet * myNet
pointer to net
GNENet * getNet() const
get pointer to net
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
virtual std::string getAttribute(SumoXMLAttr key) const =0
bool myPossibleCandidate
flag to mark this element as possible candidate
bool mySpecialCandidate
flag to mark this element as special candidate
bool isSpecialCandidate() const
check if this element is a special candidate
bool isPossibleCandidate() const
check if this element is a possible candidate
bool isTargetCandidate() const
check if this element is a target candidate
bool isSourceCandidate() const
check if this element is a source candidate
bool isConflictedCandidate() const
check if this element is a conflicted candidate
bool myTargetCandidate
flag to mark this element as target candidate
bool myConflictedCandidate
flag to mark this element as conflicted candidate
bool mySourceCandidate
flag to mark this element as source candidate
An Element which don't belongs to GNENet but has influency in the simulation.
A road/street connecting two junctions (netedit-version)
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
NBEdge * getNBEdge() const
returns the internal NBEdge
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
static const double SNAP_RADIUS
bool hasRestrictedLane(SUMOVehicleClass vclass) const
check if edge has a restricted lane
const std::vector< GNEConnection * > & getGNEConnections() const
returns a reference to the GNEConnection vector
void drawEdgeGeometryPoints(const GUIVisualizationSettings &s, const GNELane *lane) const
draw edge geometry points (note: This function is called by GNELane::drawGL(...)
bool drawCandidateEdgesWithSpecialColor() const
draw candidate edges with special color (Only for candidates, special and conflicted)
An Element which don't belongs to GNENet but has influency in the simulation.
class for pack all variables related with DottedGeometry
void updateDottedGeometry(const GUIVisualizationSettings &s, const GNELane *lane)
update DottedGeometry (using lane shape)
const std::vector< double > & getShapeRotations() const
The rotations of the single shape parts.
const PositionVector & getShape() const
The shape of the additional element.
void updateGeometry(const PositionVector &shape, double startPos=-1, double endPos=-1, const Position &extraFirstPosition=Position::INVALID, const Position &extraLastPosition=Position::INVALID)
update geometry shape
const std::vector< double > & getShapeLengths() const
The lengths of the single shape parts.
class lane2lane connection geometry
void updateLane2laneConnection()
update
const std::vector< GNEJunction * > & getParentJunctions() const
get parent junctions
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
const std::vector< GNEGenericData * > & getParentGenericDatas() const
get parent demand elements
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
const std::vector< GNEShape * > & getParentShapes() const
get parent shapes
const std::vector< GNEShape * > & getChildShapes() const
get child shapes
const std::vector< GNEAdditional * > & getChildAdditionals() const
return child additionals
const std::vector< GNEGenericData * > & getChildGenericDatas() const
return child generic data elements
static RGBColor colorForLinksState(FXuint state)
return the color for each linkstate
static const StringBijection< FXuint > LinkStateNames
long names for link states
const std::vector< GNEEdge * > & getGNEIncomingEdges() const
Returns incoming GNEEdges.
const double exaggeration
exaggeration
LaneDrawingConstants()
default constructor
const double halfWidth
Draw as a normal lane, and reduce width to make sure that a selected edge can still be seen.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
const PositionVector & getLaneShape() const
long onDefault(FXObject *, FXSelector, void *)
multiplexes message to two targets
void drawPathAdditionalElements(const GUIVisualizationSettings &s) const
path additional elements
std::string getParentName() const
Returns the name of the parent object (if any)
std::string getAttribute(SumoXMLAttr key) const
const GNEGeometry::DottedGeometry & getDottedLaneGeometry() const
get dotted lane geometry
void removePathDemandElement(GNEDemandElement *demandElement)
remove path demand element (used by GNEPathElement)
void drawLinkRules(const GUIVisualizationSettings &s) const
draw link rules
std::vector< double > myLaneRestrictedTextureRotations
Rotations of textures of restricted lanes.
const RGBColor * mySpecialColor
optional special color
Position getPositionInView() const
Returns position of hierarchical element in view.
void addPathGenericData(GNEGenericData *genericData)
add path demand element (used by GNEPathElement)
bool drawAsWaterway(const GUIVisualizationSettings &s) const
whether to draw this lane as a waterways
GNEGeometry::DottedGeometry myDottedLaneGeometry
dotted lane geometry
double getLengthGeometryFactor() const
get length geometry factor
bool isAttributeEnabled(SumoXMLAttr key) const
std::map< SumoXMLTag, std::vector< GNEDemandElement * > > myPathDemandElements
map with references to path demand elements
void updateGeometry()
update pre-computed geometry information
void invalidatePathElements()
invalidate path element childs
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
GNEEdge * myParentEdge
parent edge (GNELanes cannot use hierarchical structures)
const GNEGeometry::Lane2laneConnection & getLane2laneConnections() const
get Lane2laneConnection struct
std::string getAttributeForSelection(SumoXMLAttr key) const
method for getting the attribute in the context of object selection
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
int getIndex() const
returns the index of the lane
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
GNEGeometry::Lane2laneConnection myLane2laneConnections
lane2lane connections
void drawStartEndShapePoints(const GUIVisualizationSettings &s) const
draw start and end shape points
void drawMarkings(const GUIVisualizationSettings &s, const double exaggeration, const bool drawRailway) const
draw lane markings
void buildLaneOperations(GUISUMOAbstractView &parent, GUIGLObjectPopupMenu *ret)
build lane operations contextual menu
std::vector< GNEConnection * > getGNEOutcomingConnections()
returns a vector with the outgoing GNEConnections of this lane
const std::vector< double > & getShapeRotations() const
get rotations of the single shape parts
void drawTextures(const GUIVisualizationSettings &s, const LaneDrawingConstants &laneDrawingConstants) const
draw lane textures
bool setMultiColor(const GUIVisualizationSettings &s, const GUIColorer &c, RGBColor &col) const
sets multiple colors according to the current scheme index and some lane function
void drawLaneAsRailway(const GUIVisualizationSettings &s, const LaneDrawingConstants &laneDrawingConstants) const
draw lane as railway
GNEMoveOperation * getMoveOperation(const double shapeOffset)
get move operation for the given shapeOffset
GNEGeometry::Geometry myLaneGeometry
lane geometry
void drawTLSLinkNo(const GUIVisualizationSettings &s) const
draw TLS Link Number
double getLaneParametricLength() const
returns the parameteric length of the lane
RGBColor setLaneColor(const GUIVisualizationSettings &s) const
set color according to edit mode and visualisation settings
bool isValid(SumoXMLAttr key, const std::string &value)
std::vector< GNEConnection * > getGNEIncomingConnections()
returns a vector with the incoming GNEConnections of this lane
bool drawAsRailway(const GUIVisualizationSettings &s) const
whether to draw this lane as a railway
void removePathAdditionalElement(GNEAdditional *additionalElement)
remove path additional element (used by GNEPathElement)
bool isRestricted(SUMOVehicleClass vclass) const
check if this lane is restricted
void addPathDemandElement(GNEDemandElement *demandElement)
add path demand element (used by GNEPathElement)
int myIndex
The index of this lane.
void drawDirectionIndicators(const GUIVisualizationSettings &s, double exaggeration, const bool drawAsRailway, const bool spreadSuperposed) const
direction indicators for lanes
void addPathAdditionalElement(GNEAdditional *additionalElement)
add path additional element (used by GNEPathElement)
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
const std::map< std::string, std::string > & getACParametersMap() const
get parameters map
void setSpecialColor(const RGBColor *Color2, double colorValue=std::numeric_limits< double >::max())
void drawPathDemandElements(const GUIVisualizationSettings &s) const
path demand elements
void drawArrows(const GUIVisualizationSettings &s) const
draw arrows
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
double mySpecialColorValue
optional value that corresponds to which the special color corresponds
void drawChildren(const GUIVisualizationSettings &s) const
draw children
std::vector< Position > myLaneRestrictedTexturePositions
Position of textures of restricted lanes.
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
double getLaneShapeLength() const
returns the length of the lane's shape
std::vector< RGBColor > myShapeColors
The color of the shape parts (cached)
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
return value for lane coloring according to the given scheme
bool setFunctionalColor(int activeScheme, RGBColor &col) const
sets the color according to the current scheme index and some lane function
std::map< SumoXMLTag, std::vector< GNEAdditional * > > myPathAdditionalElements
map with references to path additional elements
void updateConnectionIDs()
update IDs of incoming connections of this lane
void buildRechableOperations(GUISUMOAbstractView &parent, GUIGLObjectPopupMenu *ret)
build rechable operations contextual menu
void drawLane2LaneConnections() const
draw lane to lane connections
void removePathGenericData(GNEGenericData *genericData)
remove path demand element (used by GNEPathElement)
std::map< SumoXMLTag, std::vector< GNEGenericData * > > myPathGenericDatas
map with references to path generic data elements
void buildEdgeOperations(GUISUMOAbstractView &parent, GUIGLObjectPopupMenu *ret)
build edge operations contextual menu
const std::vector< double > & getShapeLengths() const
get lengths of the single shape parts
void drawLinkNo(const GUIVisualizationSettings &s) const
draw link Number
void drawPathGenericDataElements(const GUIVisualizationSettings &s) const
path generic data elements
double getSpeed() const
returns the current speed of lane
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
GNEEdge * getParentEdge() const
get arent edge
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
bool isNetRecomputed() const
check if net requiere recomputing
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
NBEdgeCont & getEdgeCont()
returns the NBEdgeCont of the underlying netbuilder
GNEViewNet * getViewNet() const
get view net
const std::string & getID() const
get ID
Boundary myBoundary
object boundary
void drawLanePathChildren(const GUIVisualizationSettings &s, const GNELane *lane, const double offset) const
draw lane path child
GNEFrameModuls::PathCreator * getPathCreator() const
get path creator modul
bool controlsEdge(GNEEdge *edge) const
whether the given edge is controlled by the currently edited tlDef
void handleMultiChange(GNELane *lane, FXObject *obj, FXSelector sel, void *data)
update phase definition for the current traffic light and phase
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
GNEViewParent * getViewParent() const
get the net object
const std::vector< GNEAttributeCarrier * > & getInspectedAttributeCarriers() const
get inspected attribute carriers
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
bool isAttributeCarrierInspected(const GNEAttributeCarrier *AC) const
check if attribute carrier is being inspected
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, GUIGlObjectType objectType, const double extraOffset=0)
draw front attributeCarrier
GNETLSEditorFrame * getTLSEditorFrame() const
get frame for NETWORK_TLS
GNERouteFrame * getRouteFrame() const
get frame for DEMAND_ROUTE
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used,...
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
GUIGlID getGlID() const
Returns the numerical id of the object.
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
const T getColor(const double value) const
const std::vector< T > & getSchemes() const
GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
static GUIGlID getTexture(GUITexture which)
returns a texture previously defined in the enum GUITexture
static void drawTexturedBox(int which, double size)
Draws a named texture as a box with the given size.
Stores the information about how to visualize structures.
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
GUIVisualizationDetailSettings detailSettings
detail settings
GUIVisualizationSizeSettings addSize
bool disableLaneIcons
whether drawing is performed in left-hand networks
GUIVisualizationTextSettings drawLinkJunctionIndex
bool drawForPositionSelection
whether drawing is performed for the purpose of selecting objects with a single click
bool showRails
Information whether rails shall be drawn.
GUIVisualizationCandidateColorSettings candidateColorSettings
candidate color settings
double laneWidthExaggeration
The lane exaggeration (upscale thickness)
bool lefthand
whether drawing is performed in left-hand networks
bool drawDottedContour() const
check if dotted contour can be drawn
GUIVisualizationColorSettings colorSettings
color settings
double scale
information about a lane's width (temporary, used for a single view)
bool showLaneDirection
Whether to show direction indicators for lanes.
bool drawDetail(const double detail, const double exaggeration) const
check if details can be drawn for the given GUIVisualizationDetailSettings and current scale and exxa...
bool showLinkDecals
Information whether link textures (arrows) shall be drawn.
GUIColorer laneColorer
The lane colorer.
bool laneShowBorders
Information whether lane borders shall be drawn.
double laneMinSize
The minimum visual lane width for drawing.
GUIVisualizationTextSettings drawLinkTLIndex
int getCircleResolution() const
function to calculate circle resolution for all circles drawn in drawGL(...) functions
bool spreadSuperposed
Whether to improve visualisation of superposed (rail) edges.
GUIColorer junctionColorer
The junction colorer.
std::string edgeParam
key for coloring by edge parameter
static double naviDegree(const double angle)
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
NBEdge * retrieve(const std::string &id, bool retrieveExtracted=false) const
Returns the edge that has the given id.
The representation of a single edge during network building.
double getLaneSpeed(int lane) const
get lane speed
double getLength() const
Returns the computed length of the edge.
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
void setPermissions(SVCPermissions permissions, int lane=-1)
set allowed/disallowed classes for the given lane or for all lanes if -1 is given
double getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn't set.
void setSpeed(int lane, double speed)
set lane specific speed (negative lane implies set for all lanes)
double getLaneWidth() const
Returns the default width of lanes of this edge.
std::vector< Connection > myConnections
List of connections to following edges.
bool isBidiRail(bool ignoreSpread=false) const
whether this edge is part of a bidirectional railway
const std::string & getID() const
NBNode * getToNode() const
Returns the destination node of the edge.
double getDistance() const
void setLaneWidth(int lane, double width)
set lane specific width (negative lane implies set for all lanes)
void setAcceleration(int lane, bool accelRamp)
marks one lane as acceleration lane
std::vector< Connection > getConnectionsFromLane(int lane, NBEdge *to=nullptr, int toLane=-1) const
Returns connections from a given lane.
int getNumLanes() const
Returns the number of lanes.
std::string getLaneID(int lane) const
get lane ID
void setLaneShape(int lane, const PositionVector &shape)
sets a custom lane shape
int getPriority() const
Returns the priority of the edge.
static const double UNSPECIFIED_WIDTH
unspecified lane width
void setEndOffset(int lane, double offset)
set lane specific end-offset (negative lane implies set for all lanes)
bool isMacroscopicConnector() const
Returns whether this edge was marked as a macroscopic connector.
const PositionVector & getLaneShape(int i) const
Returns the shape of the nth lane.
Lane & getLaneStruct(int lane)
double getFinalLength() const
get length that will be assigned to the lanes in the final network
NBNode * getFromNode() const
Returns the origin node of the edge.
Represents a single node (junction) during network building.
LinkState getLinkState(const NBEdge *incoming, NBEdge *outgoing, int fromLane, int toLane, bool mayDefinitelyPass, const std::string &tlID) const
get link state
LinkDirection getDirection(const NBEdge *const incoming, const NBEdge *const outgoing, bool leftHand=false) const
Returns the representation of the described stream's direction.
int getConnectionIndex(const NBEdge *from, const NBEdge::Connection &con) const
return the index of the given connection
static bool areParametersValid(const std::string &value, bool report=false, ParameterisedAttrType attrType=ParameterisedAttrType::STRING, const std::string kvsep="=", const std::string sep="|")
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
void setParametersStr(const std::string ¶msString, const std::string kvsep="=", const std::string sep="|")
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
std::string getParametersStr(const std::string kvsep="=", const std::string sep="|") const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
double z() const
Returns the z-position.
double y() const
Returns the y-position.
double beginEndAngle() const
returns the angle in radians of the line connecting the first and the last position
double length() const
Returns the length.
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
static const RGBColor WHITE
unsigned char alpha() const
Returns the alpha-amount of the color.
static const RGBColor GREEN
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb, inspired by http://alvyray.com/Papers/CG/hsv2rgb....
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
T get(const std::string &str) const
std::vector< std::string > getStrings() const
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter
static void drawDottedContourLane(const DottedContourType type, const GUIVisualizationSettings &s, const DottedGeometry &dottedGeometry, const double width, const bool drawFirstExtrem, const bool drawLastExtrem)
draw dotted contour for the given dottedGeometry (used by lanes, routes, etc.)
static double calculateRotation(const Position &first, const Position &second)
return angle between two points (used in geometric calculations)
static void drawDottedContourShape(const DottedContourType type, const GUIVisualizationSettings &s, const PositionVector &shape, const double width, const double exaggeration)
draw dotted contour for the given shape (used by additionals)
static void drawGeometry(const GNEViewNet *viewNet, const Geometry &geometry, const double width)
draw geometry
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)
NetworkEditMode networkEditMode
the current Network edit mode
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
static const RGBColor special
color for selected special candidate element (Usually selected using shift+click)
static const RGBColor conflict
color for selected conflict candidate element (Usually selected using ctrl+click)
static const RGBColor target
color for selected candidate target
static const RGBColor possible
color for possible candidate element
static const RGBColor source
color for selected candidate source
RGBColor selectedEdgeColor
edge selection color
RGBColor selectedLaneColor
lane selection color
static const double laneTextures
details for lane textures
static const double geometryPointsText
details for Geometry Points Texts
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
double width
This lane's width.
PositionVector customShape
A custom shape for this lane set by the user.
double endOffset
This lane's offset to the intersection begin.
std::string oppositeID
An opposite lane ID, if given.
bool accelRamp
Whether this lane is an acceleration lane.
PositionVector shape
The lane's shape.