59 myParentJunction(parentJunction),
61 myForceDrawCustomShape(crossing->customShape.size() > 0) {
79 int segments = (int)shape.size() - 1;
83 for (
int i = 0; i < segments; ++i) {
120 glColor3d(0.118, 0.565, 1.000);
122 glColor3d(1.0, 0.1, 0.1);
124 glColor3d(0.9, 0.9, 0.9);
126 glColor3d(0.1, 0.1, 0.1);
129 glTranslated(0, 0, .2);
132 double spacing = 1.0;
137 glTranslated(0, 0, 0.1);
138 for (
int i = 0; i < (int)shape.size() - 1; ++i) {
142 glTranslated(shape[i].x(), shape[i].y(), 0.0);
147 glVertex2d(-halfWidth, -t);
148 glVertex2d(-halfWidth, -t - length);
149 glVertex2d(halfWidth, -t - length);
150 glVertex2d(halfWidth, -t);
160 glTranslated(0, 0, -.2);
186 mcCustomShape->disable();
250 return canParse<double>(value) && isPositive<double>(value);
252 return canParse<bool>(value);
254 return (
myCrossing->
tlID !=
"" && canParse<int>(value) && isPositive<int>(value)
280 for (std::vector<GNEEdge*>::const_iterator i = edges.begin(); i != edges.end(); i++) {
303 for (
auto i : edges) {
EditMode getCurrentEditMode() const
get the current edit mode
bool checkEdgeBelong(GNEEdge *edges) const
return true if a edge belongs to crossing's edges
bool myForceDrawCustomShape
flag used for force draw custom shape
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
whether a given shape is user-defined
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.
void refreshElement(GUIGlObject *o)
refreshes boundary information for o and update
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
double x() const
Returns the x-position.
Stores the information about how to visualize structures.
NBNode * getNBNode() const
Return net build node.
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.
PositionVector shape
The crossing's shape.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in all GNEAttributeCarriers.
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
GNECrossing(GNEJunction *parentJunction, NBNode::Crossing *crossing)
Constructor.
static std::vector< GNEEdge * > parseGNEEdges(GNENet *net, const std::string &value)
parse string into vector of GNEEdges
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.
GUIGlID getGlID() const
Returns the numerical id of the object.
A class that stores a 2D geometrical boundary.
static OptionsCont & getOptions()
Retrieves the options.
bool priority
whether the pedestrians have priority
void updateGeometry()
update pre-computed geometry information
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
NBNode::Crossing * myCrossing
the data for this crossing
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
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::string toString(const T &t, std::streamsize accuracy=gPrecision)
std::vector< double > myShapeRotations
A point in 2D or 3D with translation and scaling methods.
friend class GNEChange_Attribute
declare friend class
double y() const
Returns the y-position.
GNEJunction * getParentJunction() const
get parent Junction
GNEJunction * myParentJunction
the parent junction of this crossing
Boundary & grow(double by)
extends the boundary by the given amount
const PositionVector & getShape() const
retrieve the junction shape
NBNode::Crossing * getNBCrossing() const
get referente to NBode::Crossing
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
A road/street connecting two junctions (netedit-version)
double width
This crossing's width.
int customTLIndex
the custom traffic light index of this crossing (if controlled)
void updateGeometry()
Update the boundary of the junction.
PositionVector customShape
optional customShape for this crossing
double customWidth
This crossing's width.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
crossing between edges for pedestrians
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
virtual ~GNECrossing()
Destructor.
bool drawCrossingsAndWalkingareas
whether crosings and walkingareas shall be drawn
EdgeVector edges
The edges being crossed.
A definition of a pedestrian crossing.
SumoXMLTag getTag() const
get XML Tag assigned to this object
link: the index of the link within the traffic light
std::string tlID
The id of the traffic light that controls this connection.
bool isValid(SumoXMLAttr key, const std::string &value)
std::vector< double > myShapeLengths
The lengths of the shape parts.
mode for connecting lanes
mode for creating new edges
NBEdge * getNBEdge()
returns the internal NBEdge
static bool checkGNEEdgesValid(GNENet *net, const std::string &value, bool report)
check if a list of edge IDs is valid
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
GUISelectedStorage gSelected
A global holder of selected objects.
GNEViewNet * getViewNet() const
get view net
bool valid
whether this crossing is valid (and can be written to the net.xml). This is needed for netedit becaus...
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.