62 #ifdef CHECK_MEMORY_LEAKS 64 #endif // CHECK_MEMORY_LEAKS 71 FXIMPLEMENT(
GNELane, FXDelegator, 0, 0)
88 myParentEdge(*static_cast<
GNEEdge*>(0)),
98 (*i)->removeLaneReference();
127 glTranslated(end.
x(), end.
y(), 0);
128 glRotated(rot, 0, 0, 1);
133 for (std::vector<NBEdge::Connection>::const_iterator i = edgeCons.begin(); i != edgeCons.end(); ++i) {
134 if ((*i).fromLane ==
myIndex) {
176 glTranslated(0, 5, 0);
178 glTranslated(0, -5, 0);
196 for (std::vector<NBEdge::Connection>::iterator it = connections.begin(); it != connections.end(); it++) {
210 glColor3d(.4, .4, .4);
213 glColor3d(.7, .4, .4);
216 glColor3d(.7, .7, .7);
219 glColor3d(.7, .7, 1);
221 glColor3d(.75, .5, 0.25);
226 const Position& endPos = it->toEdge->getLaneShape(it->toLane)[0];
228 glVertex2f(startPos.
x(), startPos.
y());
229 glVertex2f(endPos.
x(), endPos.
y());
271 glGetFloatv(GL_CURRENT_COLOR, color);
274 }
else if (s.
scale * exaggeration < 1.) {
285 const SUMOReal halfRailWidth = 0.725 * exaggeration;
293 glTranslated(0, 0, .1);
296 drawCrossties(0.3 * exaggeration, 1 * exaggeration, 1 * exaggeration);
308 if (exaggeration == 1) {
334 int e = (int)
getShape().size() - 1;
335 for (
int i = 0; i < e; ++i) {
343 glVertex2d(-mw, -t - length);
344 glVertex2d(halfWidth * 0.5 * scale, -t - length);
345 glVertex2d(halfWidth * 0.5 * scale, -t);
354 glTranslated(0, 0, 0.2);
401 new FXMenuCommand(ret,
"Select state for all links from this edge:", 0, 0, 0);
403 for (std::vector<std::string>::const_iterator it = names.begin(); it != names.end(); it++) {
405 FXMenuRadio* mc =
new FXMenuRadio(ret, (*it).c_str(),
this, FXDataTarget::ID_OPTION + state);
411 FXMenuCommand* mc =
new FXMenuCommand(ret,
"Additional options available in 'Inspect Mode'", 0, 0, 0);
412 mc->handle(&parent, FXSEL(SEL_COMMAND, FXWindow::ID_DISABLE), 0);
415 new FXMenuSeparator(ret);
418 new FXMenuCommand(ret, (
"Shape pos: " +
toString(pos)).c_str(), 0, 0, 0);
420 new FXMenuCommand(ret, (
"Height: " +
toString(height)).c_str(), 0, 0, 0);
425 (
dynamic_cast<GNEViewNet&
>(parent)).markPopupPosition();
461 const std::vector<SUMOReal>&
467 const std::vector<SUMOReal>&
478 int segments = (int)
getShape().size() - 1;
482 for (
int i = 0; i < segments; ++i) {
491 (*i)->updateGeometry();
495 (*i)->updateGeometry();
551 if (*i == additional) {
560 const std::vector<GNEAdditional*>&
570 if ((*i) == additionalSet) {
584 if ((*i) == additionalSet) {
594 const std::vector<GNEAdditionalSet*>&
652 return canParse<SUMOReal>(value);
657 return canParse<SUMOReal>(value) && (isPositive<SUMOReal>(value) || parse<SUMOReal>(value) ==
NBEdge::UNSPECIFIED_WIDTH);
659 return canParse<SUMOReal>(value);
706 switch (activeScheme) {
722 switch (activeScheme) {
724 for (PositionVector::const_iterator ii =
getShape().begin(); ii !=
getShape().end() - 1; ++ii) {
729 for (
int ii = 1; ii < (int)
getShape().size(); ++ii) {
743 switch (activeScheme) {
745 switch (myPermissions) {
808 glTranslated(0, 0, 0.1);
809 int e = (int)
getShape().size() - 1;
810 for (
int i = 0; i < e; ++i) {
816 glVertex2d(-halfWidth, -t);
817 glVertex2d(-halfWidth, -t - length);
818 glVertex2d(halfWidth, -t - length);
819 glVertex2d(halfWidth, -t);
831 glColor3d(0.3, 0.3, 0.3);
834 int e = (int)
getShape().size() - 1;
835 for (
int i = 0; i < e; ++i) {
841 glBegin(GL_TRIANGLES);
842 glVertex2d(0, -t - length);
843 glVertex2d(-width * 0.25, -t);
844 glVertex2d(+width * 0.25, -t);
bool drawAsWaterway(const GUIVisualizationSettings &s) const
whether to draw this lane as a waterways
The link is a partial left direction.
SUMOReal endOffset
This lane's offset to the intersection begin.
bool controlsEdge(GNEEdge &edge) const
whether the given edge is controlled by the currently edited tlDef
const std::string & getParentName() const
Returns the name of the parent object (if any)
const std::vector< SUMOReal > & getShapeRotations() const
returns the vector with the shape rotations
static const SUMOReal UNSPECIFIED_WIDTH
unspecified lane width
float laneWidthExaggeration
The lane exaggeration (upscale thickness)
PositionVector shape
The lane's shape.
SUMOReal nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
GNETLSEditorFrame * myTLSEditor
the tls-editor for setting multiple links in TLS-mode
static RGBColor fromHSV(SUMOReal h, SUMOReal s, SUMOReal v)
Converts the given hsv-triplet to rgb.
AdditionalVector myAdditionals
list with the additonals vinculated with this lane
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
void drawMarkings(const bool &selectedEdge, SUMOReal scale) const
draw lane markings
SUMOReal getSpeed() const
returns the current speed of lane
const RGBColor * mySpecialColor
optional special color
static const RGBColor selectedLaneColor
color of selected lane
std::vector< Connection > getConnectionsFromLane(int lane) const
Returns connections from a given lane.
Copy edge name (for lanes only)
void setLaneWidth(int lane, SUMOReal width)
set lane specific width (negative lane implies set for all lanes)
SUMOReal getPositionRelativeToShapeLenght(SUMOReal position) const
void setSpeed(int lane, SUMOReal speed)
set lane specific speed (negative lane implies set for all lanes)
GUIColorer laneColorer
The lane colorer.
Stores the information about how to visualize structures.
This is an uncontrolled, minor link, has to stop.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
The representation of a single edge during network building.
static void drawOutlineCircle(SUMOReal width, SUMOReal iwidth, int steps=8)
Draws an unfilled circle around (0,0)
bool showRails
Information whether rails shall be drawn.
The link is a 180 degree turn.
static RGBColor colorForLinksState(FXuint state)
return the color for each linkstate
static void drawBoxLines(const PositionVector &geom, const std::vector< SUMOReal > &rots, const std::vector< SUMOReal > &lengths, SUMOReal width, int cornerDetail=0, SUMOReal offset=0)
Draws thick lines.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
bool setFunctionalColor(int activeScheme) const
sets the color according to the current scheme index and some lane function
SUMOReal getColorValue(int activeScheme) const
return value for lane coloring according to the given scheme
SUMOReal getLaneWidth() const
Returns the default width of lanes of this edge.
static void drawBoxLine(const Position &beg, SUMOReal rot, SUMOReal visLength, SUMOReal width, SUMOReal offset=0)
Draws a thick line.
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
void setPermissions(SVCPermissions permissions, int lane=-1)
set allowed/disallowed classes for the given lane or for all lanes if -1 is given ...
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
int editMode
the current NETEDIT mode (temporary)
bool showLaneDirection
Whether to show direction indicators for lanes.
bool setMultiColor(const GUIColorer &c) const
sets multiple colors according to the current scheme index and some lane function ...
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
std::vector< RGBColor > myShapeColors
The color of the shape parts (cached)
This is an uncontrolled, right-before-left link.
void drawTLSLinkNo() const
draw TLS Link Number
void handleMultiChange(GNELane *lane, FXObject *obj, FXSelector sel, void *data)
update phase definition for the current traffic light and phase
const SUMOReal SUMO_const_laneOffset
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
Lane & getLaneStruct(int lane)
An Element wich group additionalSet elements.
The link is controlled by a tls which is off, not blinking, may pass.
SUMOReal x() const
Returns the x-position.
This is an uncontrolled, all-way stop link.
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used, also builds an entry for copying the geo-position.
Boundary getBoundary() const
returns the boundry (including lanes)
Position positionAtOffset2D(SUMOReal pos, SUMOReal lateralOffset=0) const
Returns the position at the given length.
int getIndex() const
returns the index of the lane
GUIGlID getGlID() const
Returns the numerical id of the object.
static void drawTriangleAtEnd(const Position &p1, const Position &p2, SUMOReal tLength, SUMOReal tWidth)
Draws a triangle at the end of the given line.
SUMOReal getLaneSpeed(int lane) const
A class that stores a 2D geometrical boundary.
int myIndex
The index of this lane.
This is an uncontrolled, zipper-merge link.
The link is a (hard) left direction.
static OptionsCont & getOptions()
Retrieves the options.
SUMOReal scale
information about a lane's width (temporary, used for a single view)
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)...
std::vector< std::string > getStrings() const
The link is a straight direction.
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
bool drawAsRailway(const GUIVisualizationSettings &s) const
whether to draw this lane as a railway
SUMOReal getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn't set.
void drawDirectionIndicators() const
direction indicators for lanes
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
SUMOReal selectionScale
the current selection scaling in NETEDIT (temporary)
void drawLane2LaneConnections() const
draw lane to lane connections
void drawArrows() const
draw arrows
int getPriority() const
Returns the priority of the edge.
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
GNEEdge & getParentEdge()
Returns underlying parent edge.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
float laneMinSize
The minimum visual lane width for drawing.
SUMOReal getLaneParametricLenght() const
returns the parameteric length of the lane
SUMOReal getPositionRelativeToParametricLenght(SUMOReal position) const
This is an uncontrolled, minor link, has to brake.
A point in 2D or 3D with translation and scaling methods.
bool isLogicValid()
whether this junction has a valid logic
std::vector< SUMOReal > myShapeRotations
bool isWaterway(SVCPermissions permissions)
Returns whether an edge with the given permission is a waterway edge.
friend class GNEChange_Attribute
declare friend class
AdditionalSetVector myAdditionalSets
list with the additonalSets vinculated with this lane
SUMOReal z() const
Returns the z-position.
int getNumLanes() const
Returns the number of lanes.
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
const T getColor(const SUMOReal value) const
The link is a (hard) right direction.
LinkState getLinkState(const NBEdge *incoming, NBEdge *outgoing, int fromLane, int toLane, bool mayDefinitelyPass, const std::string &tlID) const
bool removeAdditionalSet(GNEAdditionalSet *additionalSet)
remove GNEAdditionalSet from this lane
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
bool removeAdditional(GNEAdditional *additional)
LinkDirection getDirection(const NBEdge *const incoming, const NBEdge *const outgoing, bool leftHand=false) const
Returns the representation of the described stream's direction.
std::vector< Connection > myConnections
List of connections to following edges.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
The link is a partial right direction.
std::string getVehicleClassNames(SVCPermissions permissions)
Returns the ids of the given classes, divided using a ' '.
vehicle is a passenger car (a "normal" car)
void updateGeometry()
update pre-computed geometry information
static SUMOReal naviDegree(const SUMOReal angle)
void drawCrossties(SUMOReal length, SUMOReal spacing, SUMOReal halfWidth) const
draw crossties for railroads
bool addAdditionalSet(GNEAdditionalSet *additionalSet)
add GNEAdditionalSet to this lane
bool canParseVehicleClasses(const std::string &classes)
Checks whether the given string contains only known vehicle classes.
std::string getAttribute(SumoXMLAttr key) const
A road/street connecting two junctions (netedit-version)
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
void drawLinkRules() const
draw link rules
GNEEdge & myParentEdge
The Edge that to which this lane belongs.
SUMOReal length() const
Returns the length.
Boundary & grow(SUMOReal by)
extends the boundary by the given amount
NBNode * getToNode() const
Returns the destination node of the edge.
const PositionVector & getShape() const
returns the shape of the lane
SUMOReal getLaneShapeLenght() const
returns the length of the lane's shape
long onDefault(FXObject *, FXSelector, void *)
multiplexes message to two targets
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
An Element which don't belongs to GNENet but has influency in the simulation.
The link is controlled by a tls which is off and blinks, has to brake.
const std::vector< GNEAdditional * > & getAdditionals() const
method to obtain a list of additional elements associated to this lane
std::vector< SUMOReal > myShapeLengths
The lengths of the shape parts.
SUMOReal y() const
Returns the y-position.
void setSpecialColor(const RGBColor *Color2)
const std::vector< SUMOReal > & getShapeLengths() const
returns the vector with the shape lengths
This is an uncontrolled, major link, may pass.
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
GNEJunction * getDest() const
returns the destination-junction
static const StringBijection< FXuint > LinkStateNames
long names for link states
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Represents a single node (junction) during network building.
T get(const std::string &str) const
SUMOReal distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
The link is a 180 degree turn (left-hand network)
static void drawLine(const Position &beg, SUMOReal rot, SUMOReal visLength)
Draws a thin line.
GUIVisualizationSettings * getVisualisationSettings() const
get visualitation settings
void setEndOffset(int lane, SUMOReal offset)
set lane specific end-offset (negative lane implies set for all lanes)
std::string getLaneID(int lane) const
void addAdditional(GNEAdditional *additional)
static const RGBColor selectionColor
color of selection
mode for connecting lanes
const std::vector< GNEAdditionalSet * > & getAdditionalSets()
return list of additionalSets associated with this lane
mode for creating new edges
bool isValid(SumoXMLAttr key, const std::string &value)
NBEdge * getNBEdge()
returns the internal NBEdge
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
void drawLinkNo() const
draw link Number
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
void mkItem(const char *name, bool dynamic, ValueSource< unsigned > *src)
Adds a row which obtains its value from an unsigned-ValueSource.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
GUISelectedStorage gSelected
A global holder of selected objects.
void closeBuilding()
Closes the building of the table.
A window containing a gl-object's parameter.
const PositionVector & getLaneShape(int i) const
Returns the shape of the nth lane.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
SUMOReal width
This lane's width.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
SUMOReal getLength() const
Returns the computed length of the edge.
The link has no direction (is a dead end link)
static RGBColor getColor()
gets the gl-color