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.
int getFromLaneIndex() const
get lane index of the incoming lane
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
int getToLaneIndex() const
get lane index of the outgoing lane
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.
Boundary getBoundary() const
Returns the street's geometry.
void setDrawConnection(bool drawConnection)
enable or disable draw connection
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
Stores the information about how to visualize structures.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
foe visibility distance of a link
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 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.
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
GNELane * myFromLane
incoming lane of this connection
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
GNEEdge * getEdgeFrom() const
get the name of the edge the vehicles leave
The link is controlled by a tls which is off, not blinking, may pass.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
SUMOReal x() const
Returns the x-position.
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
int getIndex() const
returns the index of the lane
GUIGlID getGlID() const
Returns the numerical id of the object.
#define UNUSED_PARAMETER(x)
A class that stores a 2D geometrical boundary.
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
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
bool keepClear
whether the junction must be kept clear when using this connection
NBConnection getNBConnection() const
get NBConnection
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
const std::string & getID() const
Returns the id.
std::vector< SUMOReal > myShapeLengths
The lengths of the shape parts.
PositionVector myShape
the shape of the connection
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
GNEEdge * getEdgeTo() const
get the name of the edge the vehicles may reach when leaving "from"
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 fromLane
The lane the connections starts at.
GNEConnection(GNELane *from, GNELane *to)
A point in 2D or 3D with translation and scaling methods.
friend class GNEChange_Attribute
declare friend class
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
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.
SUMOReal contPos
custom position for internal junction on this connection
Position positionAtOffset(SUMOReal pos, SUMOReal lateralOffset=0) const
Returns the position at the given length.
LinkState getLinkState() const
get LinkState
GNELane * myToLane
outgoing lane of this connection
LinkState getLinkState(const NBEdge *incoming, NBEdge *outgoing, int fromLane, int toLane, bool mayDefinitelyPass, const std::string &tlID) const
~GNEConnection()
Destructor.
GUIColorer junctionColorer
The junction colorer.
bool getDrawConnection() const
get Draw connection
const std::string getID() const
function to support debugging
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
NBEdge::Connection & getNBEdgeConnection() const
get Edge::Connection
A road/street connecting two junctions (netedit-version)
SUMOReal length() const
Returns the length.
NBNode * getToNode() const
Returns the destination node of the edge.
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.
bool showConnections()
show connections over junctions
static const RGBColor selectedConnectionColor
color of selected connection
SUMOReal y() const
Returns the y-position.
GNELane * getLaneTo() const
get lane of the outgoing lane
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
SUMOReal distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
static void drawLine(const Position &beg, SUMOReal rot, SUMOReal visLength)
Draws a thin line.
void updateLinkState()
recompute cached myLinkState
NBEdge * getNBEdge()
returns the internal NBEdge
std::string getAttribute(SumoXMLAttr key) const
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
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...
GNEViewNet * getViewNet() const
get view net
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
SUMOReal visibility
custom foe visiblity for connection