 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
43 myParentJunction(parentJunction),
44 myCrossingEdges(crossingEdges) {
62 return (crossing->customShape.size() > 0) ? crossing->
customShape : crossing->shape;
97 const std::vector<NBEdge*>&
127 }
else if (!crossing->valid) {
129 }
else if (crossing->priority) {
135 glTranslated(0, 0, .2);
138 double spacing = 1.0;
139 double halfWidth = crossing->width * 0.5;
143 glTranslated(0, 0, 0.1);
154 glVertex2d(-halfWidth, -t);
155 glVertex2d(-halfWidth, -t - length);
156 glVertex2d(halfWidth, -t - length);
157 glVertex2d(halfWidth, -t);
163 glVertex2d(-halfWidth, 0);
166 glVertex2d(halfWidth, 0);
175 glTranslated(0, 0, -.2);
200 int linkNo = crossing->tlLinkIndex;
201 int linkNo2 = crossing->tlLinkIndex2 > 0 ? crossing->tlLinkIndex2 : linkNo;
226 mcCustomShape->disable();
238 if (crossing->customShape.size() > 0) {
239 b = crossing->customShape.getBoxBoundary();
240 }
else if (crossing->shape.size() > 0) {
241 b = crossing->shape.getBoxBoundary();
262 return "Temporal Unreferenced";
265 return toString(crossing->customWidth);
267 return crossing->priority ?
"true" :
"false";
271 return toString(crossing->customTLIndex);
273 return toString(crossing->customTLIndex2);
275 return toString(crossing->customShape);
279 return crossing->getParametersStr();
334 std::vector<GNEEdge*> parsedEdges = parse<std::vector<GNEEdge*> >(
myNet, value);
336 for (
auto i : parsedEdges) {
337 nbEdges.push_back(i->getNBEdge());
339 std::sort(nbEdges.begin(), nbEdges.end());
342 std::sort(originalEdges.begin(), originalEdges.end());
353 return canParse<double>(value) && ((parse<double>(value) > 0) || (parse<double>(value) == -1));
355 return canParse<bool>(value);
366 return canParse<PositionVector>(value);
369 return canParse<bool>(value);
381 if (std::find(crossing->edges.begin(), crossing->edges.end(), edge->
getNBEdge()) != crossing->edges.end()) {
391 for (
auto i : edges) {
411 std::vector<GNEEdge*> edges = parse<std::vector<GNEEdge*> >(
myNet, value);
413 crossing->edges.clear();
415 for (
auto i : edges) {
416 crossing->edges.push_back(i->getNBEdge());
419 std::sort(crossing->edges.begin(), crossing->edges.end());
428 crossing->customWidth = parse<double>(value);
431 crossing->priority = parse<bool>(value);
434 crossing->customTLIndex = parse<int>(value);
436 crossing->tlLinkIndex = crossing->customTLIndex;
439 crossing->customTLIndex2 = parse<int>(value);
441 crossing->tlLinkIndex2 = crossing->customTLIndex2;
445 crossing->customShape = parse<PositionVector>(value);
449 if (parse<bool>(value)) {
456 crossing->setParametersStr(value);
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
GNEJunction * myParentJunction
the parent junction of this crossing
~GNECrossing()
Destructor.
void updateGeometryShape(const PositionVector &shape, double startPos=-1, double endPos=-1, const Position &extraFirstPosition=Position::INVALID, const Position &extraLastPosition=Position::INVALID)
update geometry shape
bool isAttributeEnabled(SumoXMLAttr key) const
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
const std::vector< double > & getShapeLengths() const
The lengths of the single shape parts.
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
@ SUMO_ATTR_CUSTOMSHAPE
whether a given shape is user-defined
const PositionVector & getCrossingShape() const
static const RGBColor crossing
color for crossings
void extrapolate(const double val, const bool onlyFirst=false, const bool onlyLast=false)
extrapolate position vector
@ GNE_NMODE_CREATE_EDGE
mode for creating new edges
@ GNE_NMODE_TLS
mode for editing tls
std::string getAttribute(SumoXMLAttr key) const
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
void drawTLSLinkNo(const GUIVisualizationSettings &s) const
draw TLS Link Number
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
SumoXMLTag
Numbers representing SUMO-XML - element names.
static const RGBColor crossingPriority
color for priority crossing
void updateGeometry()
update pre-computed geometry information (including crossings)
A road/street connecting two junctions (netedit-version)
NBNode::Crossing * getNBCrossing() const
get referente to NBode::Crossing
friend class GNEChange_Attribute
declare friend class
Position getPositionInView() const
Returns position of hierarchical element in view.
@ MID_GNE_CROSSING_EDIT_SHAPE
edit junction shape
NBNode * getNBNode() const
Return net build node.
bool drawCrossingsAndWalkingareas
whether crosings and walkingareas shall be drawn
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
const PositionVector & getShape() const
The shape of the additional element.
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
NBEdge * getNBEdge() const
returns the internal NBEdge
GNEGeometry::Geometry myCrossingGeometry
crossing geometry
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
@ SUMO_ATTR_TLLINKINDEX2
link: the index of the opposite direction link of a pedestrian crossing
GUIGlID getGlID() const
Returns the numerical id of the object.
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
@ SUMO_ATTR_EDGES
the edges of a route
A class that stores a 2D geometrical boundary.
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
double scale
information about a lane's width (temporary, used for a single view)
@ GNE_SUPERMODE_NETWORK
Network mode (Edges, junctions, etc..)
Supermode currentSupermode
the current supermode
A point in 2D or 3D with translation and scaling methods.
@ GNE_NMODE_CONNECT
mode for connecting lanes
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
GUIVisualizationTextSettings drawLinkTLIndex
bool checkEdgeBelong(GNEEdge *edges) const
return true if a edge belongs to crossing's edges
std::vector< NBEdge * > myCrossingEdges
Crossing Edges (It works as ID because a junction can only ONE Crossing with the same edges)
static void drawShapeDottedContourAroundShape(const GUIVisualizationSettings &s, const int type, const PositionVector &shape, const double width)
draw a dotted contour around the given Non closed shape with certain width
NetworkEditMode
@brie enum for network edit modes
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
static const RGBColor crossingInvalid
color for invalid crossing
GNEViewNet * getViewNet() const
get view net
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
GUIVisualizationColorSettings colorSettings
color settings
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
GNEJunction * getParentJunction() const
get parent Junction
@ SUMO_TAG_CROSSING
crossing between edges for pedestrians
PositionVector customShape
optional customShape for this crossing
@ SUMO_ATTR_TLLINKINDEX
link: the index of the link within the traffic light
static bool areParametersValid(const std::string &value, bool report=false)
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
PositionVector reverse() const
reverse position vector
const std::set< NBTrafficLightDefinition * > & getControllingTLS() const
Returns the traffic lights that were assigned to this node (The set of tls that control this node)
bool isValid(SumoXMLAttr key, const std::string &value)
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
GNECrossing(GNEJunction *parentJunction, std::vector< NBEdge * > edges)
Constructor.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used,...
Crossing * getCrossing(const std::string &id) const
return the crossing with the given id
GNENet * myNet
the net to inform about updates
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
void updateGeometry()
update pre-computed geometry information
const std::vector< double > & getShapeRotations() const
The rotations of the single shape parts.
@ GNE_ATTR_SELECTED
element is selected
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
RGBColor selectedCrossingColor
crossings selection color
Boundary & grow(double by)
extends the boundary by the given amount
void selectAttributeCarrier(bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
const std::string & getTagStr() const
get tag assigned to this object in string format
Stores the information about how to visualize structures.
A definition of a pedestrian crossing.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
NetworkEditMode networkEditMode
the current Network edit mode
std::string tlID
The id of the traffic light that controls this connection.
const std::vector< NBEdge * > & getCrossingEdges() const
get crossingEdges
bool checkCrossingDuplicated(EdgeVector edges)
return true if there already exist a crossing with the same edges as the input
static void drawTextAtEnd(const std::string &text, const PositionVector &shape, double x, double size, RGBColor color)
draw text and the end of shape