44 myParentJunction(parentJunction),
45 myCrossingEdges(crossingEdges) {
66 myGeometry.
shape = crossing->customShape.size() > 0 ? crossing->customShape : crossing->shape;
87 const std::vector<NBEdge*>&
117 }
else if (!crossing->valid) {
119 }
else if (crossing->priority) {
125 glTranslated(0, 0, .2);
128 double spacing = 1.0;
129 double halfWidth = crossing->width * 0.5;
133 glTranslated(0, 0, 0.1);
144 glVertex2d(-halfWidth, -t);
145 glVertex2d(-halfWidth, -t - length);
146 glVertex2d(halfWidth, -t - length);
147 glVertex2d(halfWidth, -t);
153 glVertex2d(-halfWidth, 0);
156 glVertex2d(halfWidth, 0);
165 glTranslated(0, 0, -.2);
190 int linkNo = crossing->tlLinkIndex;
191 int linkNo2 = crossing->tlLinkIndex2 > 0 ? crossing->tlLinkIndex2 : linkNo;
215 mcCustomShape->disable();
223 throw ProcessError(
"Crossings doesn't have a boundary");
236 return "Temporal Unreferenced";
239 return toString(crossing->customWidth);
241 return crossing->priority ?
"true" :
"false";
245 return toString(crossing->customTLIndex);
247 return toString(crossing->customTLIndex2);
249 return toString(crossing->customShape);
293 std::vector<GNEEdge*> parsedEdges = parse<std::vector<GNEEdge*> >(
myNet, value);
295 for (
auto i : parsedEdges) {
296 nbEdges.push_back(i->getNBEdge());
298 std::sort(nbEdges.begin(), nbEdges.end());
301 std::sort(originalEdges.begin(), originalEdges.end());
312 return canParse<double>(value) && ((parse<double>(value) > 0) || (parse<double>(value) == -1));
314 return canParse<bool>(value);
317 return (crossing->tlID !=
"" && canParse<int>(value)
324 return canParse<PositionVector>(value);
327 return canParse<bool>(value);
341 for (
auto i : crossing->getParametersMap()) {
342 result += i.first +
"=" + i.second +
"|";
345 if (!result.empty()) {
352 std::vector<std::pair<std::string, std::string> >
355 std::vector<std::pair<std::string, std::string> > result;
357 for (
auto i : crossing->getParametersMap()) {
358 result.push_back(std::make_pair(i.first, i.second));
370 std::vector<std::string> parsedValues;
373 parsedValues.push_back(stValues.
next());
376 for (
auto i : parsedValues) {
377 std::vector<std::string> parsedParameters;
380 parsedParameters.push_back(stParam.
next());
384 crossing->setParameter(parsedParameters.front(), parsedParameters.back());
393 if (std::find(crossing->edges.begin(), crossing->edges.end(), edge->
getNBEdge()) != crossing->edges.end()) {
403 for (
auto i : edges) {
423 std::vector<GNEEdge*> edges = parse<std::vector<GNEEdge*> >(
myNet, value);
425 crossing->edges.clear();
427 for (
auto i : edges) {
428 crossing->edges.push_back(i->getNBEdge());
431 std::sort(crossing->edges.begin(), crossing->edges.end());
440 crossing->customWidth = parse<double>(value);
443 crossing->priority = parse<bool>(value);
446 crossing->customTLIndex = parse<int>(value);
448 crossing->tlLinkIndex = crossing->customTLIndex;
451 crossing->customTLIndex2 = parse<int>(value);
453 crossing->tlLinkIndex2 = crossing->customTLIndex2;
457 crossing->customShape = parse<PositionVector>(value);
461 if (parse<bool>(value)) {
GNECrossing(GNEJunction *parentJunction, std::vector< NBEdge *> edges)
Constructor.
static const RGBColor crossing
color for crossings
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
SumoXMLTag
Numbers representing SUMO-XML - element names.
bool checkEdgeBelong(GNEEdge *edges) const
return true if a edge belongs to crossing's edges
double scale
information about a lane's width (temporary, used for a single view)
const std::vector< NBEdge * > & getCrossingEdges() const
get crossingEdges
PositionVector shape
The shape of the netElement element.
whether a given shape is user-defined
GNENet * myNet
the net to inform about updates
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
Position getPositionInView() const
Returns position of hierarchical element in view.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
static void drawTextAtEnd(const std::string &text, const PositionVector &shape, double x, double size, RGBColor color)
draw text and the end of shape
NetworkEditMode
enum for network edit modes
Stores the information about how to visualize structures.
NetElementGeometry myGeometry
netElement geometry
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
Crossing * getCrossing(const std::string &id) const
return the crossing with the given id
PositionVector reverse() const
reverse position vector
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
bool hasNext()
returns the information whether further substrings exist
std::string getGenericParametersStr() const
return generic parameters in string format
static bool isValidGenericParameterKey(const std::string &value)
whether the given string is a valid key for a generic parameter
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.
link: the index of the opposite direction link of a pedestrian crossing
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
void updateGeometry()
update pre-computed geometry information
NBEdge * getNBEdge() const
returns the internal NBEdge
std::vector< double > shapeRotations
The rotations of the single shape parts.
static bool isValidGenericParameterValue(const std::string &value)
whether the given string is a valid value for a generic parameter
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static const RGBColor crossingPriority
color for priority crossing
std::vector< NBEdge * > myCrossingEdges
Crossing Edges (It works as ID because a junction can only ONE Crossing with the same edges) ...
A point in 2D or 3D with translation and scaling methods.
static bool isGenericParametersValid(const std::string &value)
check if given string can be parsed to a map/list of generic parameters
friend class GNEChange_Attribute
declare friend class
mode for creating new edges
GUIVisualizationTextSettings drawLinkTLIndex
GNEJunction * myParentJunction
the parent junction of this crossing
void drawTLSLinkNo(const GUIVisualizationSettings &s) const
draw TLS Link Number
void selectAttributeCarrier(bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
std::vector< double > shapeLengths
The lengths of the single shape parts.
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
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
const PositionVector & getShape() const
retrieve the junction shape
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
A road/street connecting two junctions (netedit-version)
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
RGBColor selectedCrossingColor
crossings selection color
void extrapolate(const double val, const bool onlyFirst=false, const bool onlyLast=false)
extrapolate position vector
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
bool checkCrossingDuplicated(EdgeVector edges)
return true if there already exist a crossing with the same edges as the input
void updateGeometry()
update pre-computed geometry information
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
const std::set< NBTrafficLightDefinition * > & getControllingTLS() const
Returns the traffic lights that were assigned to this node (The set of tls that control this node) ...
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
const std::string & getTagStr() const
get tag assigned to this object in string format
static const RGBColor crossingInvalid
color for invalid crossing
std::vector< std::pair< std::string, std::string > > getGenericParameters() const
return generic parameters as vector of pairs format
crossing between edges for pedestrians
~GNECrossing()
Destructor.
bool drawCrossingsAndWalkingareas
whether crosings and walkingareas shall be drawn
mode for connecting lanes
GUIGlID getGlID() const
Returns the numerical id of the object.
A definition of a pedestrian crossing.
void calculateShapeRotationsAndLengths()
calculate shape rotations and lengths
NetworkEditMode networkEditMode
the current Network edit mode
link: the index of the link within the traffic light
GUIVisualizationColorSettings colorSettings
color settings
bool isValid(SumoXMLAttr key, const std::string &value)
NBNode::Crossing * getNBCrossing() const
get referente to NBode::Crossing
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
NBNode * getNBNode() const
Return net build node.
void clearGeometry()
reset geometry
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
std::string getAttribute(SumoXMLAttr key) const
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
GNEViewNet * getViewNet() const
get view net
void clearParameter()
Clears the parameter map.
GNEJunction * getParentJunction() const
get parent Junction