58 #ifdef CHECK_MEMORY_LEAKS 60 #endif // CHECK_MEMORY_LEAKS 75 std::string(
":") + from->getMicrosimID() +
"->" + to->getMicrosimID(),
80 myDrawConnection(true) {
108 if (
getEdgeFrom()->getNBEdge()->getToNode()->getShape().area() > 4) {
124 int segments = (int)
myShape.size() - 1;
128 for (
int i = 0; i < segments; ++i) {
233 (
dynamic_cast<GNEViewNet&
>(parent)).markPopupPosition();
351 return canParse<bool>(value);
353 return canParse<bool>(value);
355 return canParse<SUMOReal>(value);
360 return isPositive<SUMOReal>(value);
383 nbCon.
contPos = parse<SUMOReal>(value);
void updateGeometry()
update pre-computed geometry information
A structure which describes a connection between edges or lanes.
LinkState getLinkState(const NBEdge *incoming, NBEdge *outgoing, int fromLane, int toLane, bool mayDefinitelyPass, const std::string &tlID) const
int toLane
The lane the connections yields in.
bool isValid(SumoXMLAttr key, const std::string &value)
Whether vehicles must keep the junction clear.
GNENet * myNet
the net to inform about updates
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
NBEdge * toEdge
The edge the connections yields in.
bool myDrawConnection
Enable or disable draw connection.
LinkState getLinkState() const
get LinkState
SUMOReal length() const
Returns the length.
PositionVector computeSmoothShape(const PositionVector &begShape, const PositionVector &endShape, int numPoints, bool isTurnaround, SUMOReal extrapolateBeg, SUMOReal extrapolateEnd, NBNode *recordError=0) const
Compute a smooth curve between the given geometries.
void setDrawConnection(bool drawConnection)
enable or disable draw connection
Stores the information about how to visualize structures.
bool getDrawConnection() const
get Draw connection
foe visibility distance of a link
static RGBColor colorForLinksState(FXuint state)
return the color for each linkstate
Position positionAtOffset(SUMOReal pos, SUMOReal lateralOffset=0) const
Returns the position at the given length.
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 isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
GNELane * myFromLane
incoming lane of this connection
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
const std::string & getID() const
Returns the id.
The link is controlled by a tls which is off, not blinking, may pass.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
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.
std::vector< SUMOReal > myShapeRotations
#define UNUSED_PARAMETER(x)
A class that stores a 2D geometrical boundary.
GNEEdge * getEdgeTo() const
get the name of the edge the vehicles may reach when leaving "from"
SUMOReal scale
information about a lane's width (temporary, used for a single view)
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
GNELane * getLaneFrom() const
get lane of the incoming lane
SUMOReal distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
bool keepClear
whether the junction must be kept clear when using this connection
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
NBEdge::Connection & getNBEdgeConnection() const
get Edge::Connection
std::vector< SUMOReal > myShapeLengths
The lengths of the shape parts.
int getFromLaneIndex() const
get lane index of the incoming lane
int getToLaneIndex() const
get lane index of the outgoing lane
PositionVector myShape
the shape of the connection
int getIndex() const
returns the index of the lane
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
GNEEdge & getParentEdge()
Returns underlying parent edge.
LinkState myLinkState
Linkstate.
std::string tlID
The id of the traffic light that controls this connection.
int getNumLanes() const
Returns the number of lanes.
int fromLane
The lane the connections starts at.
GNEConnection(GNELane *from, GNELane *to)
A point in 2D or 3D with translation and scaling methods.
GNELane * getLaneTo() const
get lane of the outgoing lane
GNEEdge * getEdgeFrom() const
get the name of the edge the vehicles leave
friend class GNEChange_Attribute
declare friend class
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
SUMOReal contPos
custom position for internal junction on this connection
Boundary getBoundary() const
Returns the street's geometry.
SUMOReal x() const
Returns the x-position.
GNELane * myToLane
outgoing lane of this connection
~GNEConnection()
Destructor.
GUIColorer junctionColorer
The junction colorer.
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
const std::string getID() const
function to support debugging
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
A road/street connecting two junctions (netedit-version)
NBConnection getNBConnection() const
get NBConnection
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
bool showConnections()
show connections over junctions
static const RGBColor selectedConnectionColor
color of selected connection
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
std::string getAttribute(SumoXMLAttr key) const
GUIGlID getGlID() const
Returns the numerical id of the object.
static void drawLine(const Position &beg, SUMOReal rot, SUMOReal visLength)
Draws a thin line.
void updateLinkState()
recompute cached myLinkState
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
NBEdge * getNBEdge()
returns the internal NBEdge
SUMOReal y() const
Returns the y-position.
GUISelectedStorage gSelected
A global holder of selected objects.
A window containing a gl-object's parameter.
Connection & getConnectionRef(int fromLane, const NBEdge *to, int toLane)
Returns reference to the specified connection This method goes through "myConnections" and returns th...
NBNode * getToNode() const
Returns the destination node of the edge.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
GNEViewNet * getViewNet() const
get view net
SUMOReal visibility
custom foe visiblity for connection