61 #ifdef CHECK_MEMORY_LEAKS 63 #endif // CHECK_MEMORY_LEAKS 69 FXIMPLEMENT(
GNELane, FXDelegator, 0, 0)
91 myParentEdge(*static_cast<
GNEEdge*>(0)),
124 glTranslated(end.
x(), end.
y(), 0);
125 glRotated(rot, 0, 0, 1);
130 for (std::vector<NBEdge::Connection>::const_iterator i = edgeCons.begin(); i != edgeCons.end(); ++i) {
131 if ((*i).fromLane == (
int)
myIndex) {
173 glTranslated(0, 5, 0);
175 glTranslated(0, -5, 0);
193 for (std::vector<NBEdge::Connection>::iterator it = connections.begin(); it != connections.end(); it++) {
207 glColor3d(.4, .4, .4);
210 glColor3d(.7, .4, .4);
213 glColor3d(.7, .7, .7);
216 glColor3d(.7, .7, 1);
218 glColor3d(.75, .5, 0.25);
223 const Position& endPos = it->toEdge->getLaneShape(it->toLane)[0];
225 glVertex2f(startPos.
x(), startPos.
y());
226 glVertex2f(endPos.
x(), endPos.
y());
244 }
else if (selected) {
246 }
else if (selectedEdge) {
259 if (s.
scale * exaggeration < 1.) {
269 const SUMOReal halfRailWidth = 0.725 * exaggeration;
277 glTranslated(0, 0, .1);
280 drawCrossties(0.3 * exaggeration, 1 * exaggeration, 1 * exaggeration);
292 if (exaggeration == 1) {
315 int e = (int)
getShape().size() - 1;
316 for (
int i = 0; i < e; ++i) {
324 glVertex2d(-mw, -t - length);
325 glVertex2d(halfWidth * 0.5 * scale, -t - length);
326 glVertex2d(halfWidth * 0.5 * scale, -t);
335 glTranslated(0, 0, 0.2);
382 FXMenuCommand* mc =
new FXMenuCommand(ret,
"Select state for all links from this edge:", 0, 0, 0);
384 for (std::vector<std::string>::const_iterator it = names.begin(); it != names.end(); it++) {
386 FXMenuRadio* mc =
new FXMenuRadio(ret, (*it).c_str(),
this, FXDataTarget::ID_OPTION + state);
392 FXMenuCommand* mc =
new FXMenuCommand(ret,
"Additional options available in 'Inspect Mode'", 0, 0, 0);
393 mc->handle(&parent, FXSEL(SEL_COMMAND, FXWindow::ID_DISABLE), 0);
398 new FXMenuCommand(ret, (
"pos: " +
toString(pos) +
" height: " +
toString(height)).c_str(), 0, 0, 0);
403 (
dynamic_cast<GNEViewNet&
>(parent)).markPopupPosition();
435 const std::vector<SUMOReal>&
441 const std::vector<SUMOReal>&
459 int segments = (int)
getShape().size() - 1;
463 for (
int i = 0; i < segments; ++i) {
531 return canParse<SUMOReal>(value);
538 return canParse<SUMOReal>(value);
580 switch (activeScheme) {
594 const size_t activeScheme = c.
getActive();
596 switch (activeScheme) {
598 for (PositionVector::const_iterator ii =
getShape().begin(); ii !=
getShape().end() - 1; ++ii) {
603 for (
int ii = 1; ii < (int)
getShape().size(); ++ii) {
617 switch (activeScheme) {
619 switch (myPermissions) {
682 glTranslated(0, 0, 0.1);
683 int e = (int)
getShape().size() - 1;
684 for (
int i = 0; i < e; ++i) {
690 glVertex2d(-halfWidth, -t);
691 glVertex2d(-halfWidth, -t - length);
692 glVertex2d(halfWidth, -t - length);
693 glVertex2d(halfWidth, -t);
bool drawAsWaterway(const GUIVisualizationSettings &s) const
whether to draw this lane as a waterways
The link is a partial left direction.
bool controlsEdge(GNEEdge &edge) const
whether the given edge is controlled by the currently edited tlDef
const PositionVector & getLaneShape(unsigned int i) const
Returns the shape of the nth lane.
SUMOReal endOffset
This lane's offset to the intersection begin.
const std::string & getParentName() const
Returns the name of the parent object (if any)
const std::vector< SUMOReal > & getShapeRotations() const
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
static RGBColor fromHSV(SUMOReal h, SUMOReal s, SUMOReal v)
Converts the given hsv-triplet to rgb.
GUIVisualizationSettings * getVisualisationSettings()
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
const RGBColor * mySpecialColor
optional special color
static const RGBColor selectedLaneColor
Copy edge name (for lanes only)
void setLaneWidth(int lane, SUMOReal width)
set lane specific width (negative lane implies set for all lanes)
void setSpeed(int lane, SUMOReal speed)
set lane specific speed (negative lane implies set for all lanes)
GUIColorer laneColorer
The lane colorer.
void handleMultiChange(GNELane *lane, FXObject *obj, FXSelector sel, void *data)
update phase definition for the current traffic light and phase
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)
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.
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
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 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
const SUMOReal SUMO_const_laneOffset
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
The link is controlled by a tls which is off, not blinking, may pass.
std::vector< Connection > getConnectionsFromLane(unsigned int lane) const
Returns connections from a given lane.
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.
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.
A class that stores a 2D geometrical boundary.
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.
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.
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
int getPriority() const
Returns the priority of the edge.
std::string getLaneID(unsigned int lane) const
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
This is an uncontrolled, minor link, has to brake.
A point in 2D or 3D with translation and scaling methods.
bool setFunctionalColor(size_t activeScheme) const
sets the color according to the current scheme index and some lane function
std::vector< SUMOReal > myShapeRotations
The rotations of the shape parts.
bool isWaterway(SVCPermissions permissions)
Returns whether an edge with the given permission is a waterway edge.
friend class GNEChange_Attribute
unsigned int getNumLanes() const
Returns the number of lanes.
SUMOReal z() const
Returns the z-position.
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
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
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
NBEdge * getNBEdge()
returns the internal NBEdge
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
GNEEdge & myParentEdge
The Edge that to which this lane belongs.
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
long onDefault(FXObject *, FXSelector, void *)
multiplexes message to two targets
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object (happens in NETEDIT)
The link is controlled by a tls which is off and blinks, has to brake.
std::vector< SUMOReal > myShapeLengths
The lengths of the shape parts.
SUMOReal y() const
Returns the y-position.
const std::vector< SUMOReal > & getShapeLengths() const
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
SUMOReal getLaneSpeed(unsigned int lane) const
static const StringBijection< FXuint > LinkStateNames
long names for link states
unsigned int myIndex
The index of this lane.
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
Lane & getLaneStruct(unsigned int lane)
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.
void setEndOffset(int lane, SUMOReal offset)
set lane specific end-offset (negative lane implies set for all lanes)
static const RGBColor selectionColor
void setIndex(unsigned int index)
bool isValid(SumoXMLAttr key, const std::string &value)
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
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.
GNETLSEditor * myTLSEditor
the tls-editor for setting multiple links in TLS-mode
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
virtual ~GNELane()
Destructor.
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.
SUMOReal getColorValue(size_t activeScheme) const
The link has no direction (is a dead end link)
static RGBColor getColor()
gets the gl-color