70 GNENetElement(from->getNet(),
"from" + from->getMicrosimID() +
"to" + to->getMicrosimID(),
106 if (nbCon.
shape.size() != 0) {
115 (
double) 5. * (
double)
getEdgeFrom()->getNBEdge()->getNumLanes(),
125 const double orthoLength = 0.5;
133 int segments = (int)
myShape.size() - 1;
137 for (
int i = 0; i < segments; ++i) {
254 mcCustomShape->disable();
293 glTranslated(0, 0, 0.1);
364 undoList->
p_begin(
"change tls linkIndex for connection");
372 std::vector<NBNode*> nodes = tlDef->getNodes();
373 for (
NBNode* node : nodes) {
375 undoList->add(
new GNEChange_TLS(junction, tlDef,
false),
true);
376 undoList->add(
new GNEChange_TLS(junction, newDef,
true),
true);
398 return canParse<bool>(value);
400 return canParse<bool>(value);
402 return canParse<double>(value);
404 return canParse<bool>(value);
406 return canParse<double>(value) && isPositive<double>(value);
409 &&
getEdgeFrom()->getNBEdge()->getToNode()->getControllingTLS().size() > 0) {
413 return logic != 0 && logic->
getNumLinks() > parse<int>(value);
418 return canParse<double>(value) && isPositive<double>(value);
444 nbCon.
contPos = parse<double>(value);
450 nbCon.
speed = parse<double>(value);
int tlLinkNo
The index of this connection within the controlling traffic light.
void updateGeometry()
update pre-computed geometry information
PositionVector getShape() const
get Position vector calculated in updateGeometry()
virtual void setParticipantsInformation()
Builds the list of participating nodes/edges/links.
std::vector< double > myShapeLengths
The lengths of the shape parts.
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
get link state
int toLane
The lane the connections yields in.
double scale
information about a lane's width (temporary, used for a single view)
bool isValid(SumoXMLAttr key, const std::string &value)
Whether vehicles must keep the junction clear.
whether a given shape is user-defined
GNENet * myNet
the net to inform about updates
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
void append(const PositionVector &v, double sameThreshold=2.0)
PositionVector getOrthogonal(const Position &p, double extend, bool before, double length=1.0) const
return orthogonal through p (extending this vector if necessary)
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.
GNENet * getNet() const
get Net in which this element is placed
int getNumLinks()
Returns the number of participating links.
A loaded (complete) traffic light logic.
LinkState getLinkState() const
get LinkState
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
A SUMO-compliant built logic for a traffic light.
Stores the information about how to visualize structures.
connectio between two lanes
double y() const
Returns the y-position.
foe visibility distance of a link
static RGBColor colorForLinksState(FXuint state)
return the color for each linkstate
double x() const
Returns the x-position.
NBTrafficLightLogic * compute(OptionsCont &oc)
Computes the traffic light logic.
The base class for traffic light logic definitions.
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.
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
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.
double visibility
custom foe visiblity for connection
const std::string & getID() const
Returns the id.
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
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.
A class that stores a 2D geometrical boundary.
PositionVector customShape
custom shape for connection
GNEEdge * getEdgeTo() const
get the name of the edge the vehicles may reach when leaving "from"
static OptionsCont & getOptions()
Retrieves the options.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
GNELane * getLaneFrom() const
get lane of the incoming lane
double area() const
Returns the area (0 for non-closed)
PositionVector shape
shape of Connection
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
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
double speed
custom speed for connection
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
void updateID()
update internal ID of Connection
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
GNEEdge & getParentEdge()
Returns underlying parent edge.
std::vector< double > myShapeRotations
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)
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
A point in 2D or 3D with translation and scaling methods.
GNEJunction * retrieveJunction(const std::string &id, bool failHard=true)
get junction by id
GNELane * getLaneTo() const
get lane of the outgoing lane
GNEEdge * getEdgeFrom() const
get the name of the edge the vehicles leave
void addConnection(NBEdge *from, NBEdge *to, int fromLane, int toLane, int linkIndex, bool reconstruct=true)
Adds a connection and immediately informs the edges.
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.
Boundary getBoundary() const
Returns the street's geometry.
GNELane * myToLane
outgoing lane of this connection
~GNEConnection()
Destructor.
Boundary & grow(double by)
extends the boundary by the given amount
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
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
PositionVector computeSmoothShape(const PositionVector &begShape, const PositionVector &endShape, int numPoints, bool isTurnaround, double extrapolateBeg, double extrapolateEnd, NBNode *recordError=0) const
Compute a smooth curve between the given geometries.
EditMode getCurrentEditMode() const
get the current edit mode
const PositionVector & getShape() const
retrieve the junction shape
A road/street connecting two junctions (netedit-version)
void extrapolate(const double val, const bool onlyFirst=false, const bool onlyLast=false)
extrapolate position vector
double length() const
Returns the length.
PositionVector viaShape
shape of via
NBConnection getNBConnection() const
get NBConnection
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
const std::set< NBTrafficLightDefinition * > & getControllingTLS() const
Returns the traffic lights that were assigned to this node (The set of tls that control this node) ...
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
bool showConnections()
show connections over junctions
static const RGBColor selectedConnectionColor
color of selected connection
PositionVector myInternalJunctionMarker
waiting position for internal junction
double contPos
custom position for internal junction on this connection
bool uncontrolled
check if Connection is uncontrolled
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in all GNEAttributeCarriers.
Represents a single node (junction) during network building.
GUIGlID getGlID() const
Returns the numerical id of the object.
void updateLinkState()
recompute cached myLinkState
link: the index of the link within the traffic light
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.
mode for connecting lanes
mode for creating new edges
NBEdge * getNBEdge()
returns the internal NBEdge
bool haveVia
check if Connection have a Via
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
GUISelectedStorage gSelected
A global holder of selected objects.
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.
static PositionVector parseShapeReporting(const std::string &shpdef, const std::string &objecttype, const char *objectid, bool &ok, bool allowEmpty, bool report=true)
Builds a PositionVector from a string representation, reporting occured errors.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
GNEViewNet * getViewNet() const
get view net
static RGBColor getColor()
gets the gl-color
SumoXMLTag getTag() const
get XML Tag assigned to this object