86 return TL(
"Crossing's edges don't support pedestrians");
93 return (crossing->customShape.size() > 0) ? crossing->customShape : crossing->shape;
101 myCrossingGeometry.updateGeometry(crossing->customShape.size() > 0 ? crossing->customShape : crossing->shape);
127 if (
myNet->getViewNet()->getPopup()) {
128 return myNet->getViewNet()->getPopup()->getGLObject() ==
this;
143 const auto& editModes =
myNet->getViewNet()->getEditModes();
162 const auto& editModes =
myNet->getViewNet()->getEditModes();
175 const auto& editModes =
myNet->getViewNet()->getEditModes();
177 if (!
myNet->getViewNet()->isCurrentlyMovingElements() && editModes.isCurrentSupermodeNetwork() &&
180 const GNENetworkElement* editedNetworkElement =
myNet->getViewNet()->getEditNetworkElementShapes().getEditedNetworkElement();
181 if (editedNetworkElement) {
182 return editedNetworkElement ==
this;
185 return myNet->getViewNet()->getViewObjectsSelector().getGUIGlObjectFront() ==
this;
193const std::vector<NBEdge*>&
218 const double crossingWidth = NBCrossing->width * 0.5 * crossingExaggeration;
224 drawCrossing(s, d, NBCrossing, crossingWidth, crossingExaggeration);
234 const GNENetworkElement* editedNetworkElement =
myNet->getViewNet()->getEditNetworkElementShapes().getEditedNetworkElement();
235 if (editedNetworkElement && (editedNetworkElement ==
this)) {
251 myNet->deleteNetworkElement(
this,
myNet->getViewNet()->getUndoList());
294 if (
myNet->getViewNet()->getEditModes().isCurrentSupermodeNetwork()) {
300 mcCustomShape->disable();
329 return "Temporal Unreferenced";
332 return toString(crossing->customWidth);
334 return crossing->priority ?
"true" :
"false";
338 return toString(crossing->customTLIndex < 0 ? crossing->tlLinkIndex : crossing->customTLIndex);
340 return toString(crossing->customTLIndex2 < 0 ? crossing->tlLinkIndex2 : crossing->customTLIndex2);
343 return toString(crossing->customShape);
424 for (
const auto& edge : parsedEdges) {
425 nbEdges.push_back(edge->getNBEdge());
427 std::sort(nbEdges.begin(), nbEdges.end());
430 std::sort(originalEdges.begin(), originalEdges.end());
465 if (std::find(crossing->edges.begin(), crossing->edges.end(), edge->
getNBEdge()) != crossing->edges.end()) {
475 for (
auto i : edges) {
490 if (
myNet->getViewNet()->getEditModes().isCurrentSupermodeData()) {
507 const NBNode::Crossing* crossing,
const double width,
const double exaggeration)
const {
525 if (
myShapeEdited &&
myNet->getViewNet()->getEditModes().isCurrentSupermodeNetwork() &&
530 glTranslated(0, 0, 0.2);
538 myNet->getViewNet()->getNetworkViewOptions().editingElevation());
552 }
else if (!crossing->
valid) {
556 }
else if (
myNet->getViewNet()->getEditModes().isCurrentSupermodeData()) {
567 const double length = 0.5 * exaggeration;
568 const double spacing = 1.0 * exaggeration;
572 glTranslated(0, 0, 0.1);
582 glVertex2d(-width, -t);
583 glVertex2d(-width, -t - length);
584 glVertex2d(width, -t - length);
585 glVertex2d(width, -t);
598 const double width,
const double exaggeration)
const {
607 const auto& editModes =
myNet->getViewNet()->getEditModes();
609 (
myNet->getViewNet()->getEditNetworkElementShapes().getEditedNetworkElement() ==
this) :
true;
612 width, exaggeration,
true,
true, 0,
nullptr,
getParentJunctions().front(), addToSelectedObjects);
628 crossing->edges.clear();
630 for (
auto i : edges) {
631 crossing->edges.push_back(i->getNBEdge());
634 std::sort(crossing->edges.begin(), crossing->edges.end());
651 crossing->tlLinkIndex = crossing->customTLIndex;
656 crossing->tlLinkIndex2 = crossing->customTLIndex2;
672 myNet->getDemandPathManager()->getPathCalculator()->invalidatePathCalculator();
NetworkEditMode
@brie enum for network edit modes
@ NETWORK_DELETE
mode for deleting network elements
@ NETWORK_MOVE
mode for moving network elements
@ NETWORK_CREATE_EDGE
mode for creating new edges
@ NETWORK_TLS
mode for editing tls
@ NETWORK_SELECT
mode for selecting network elements
@ NETWORK_CONNECT
mode for connecting lanes
@ MID_GNE_CROSSING_EDIT_SHAPE
edit crossing shape
GUIViewObjectsHandler gViewObjectsHandler
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
const std::string invalid_return< std::string >::value
@ SUMO_TAG_CROSSING
crossing between edges for pedestrians
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_TLLINKINDEX2
link: the index of the opposite direction link of a pedestrian crossing
@ GNE_ATTR_SELECTED
element is selected
@ SUMO_ATTR_CUSTOMSHAPE
whether a given shape is user-defined
@ SUMO_ATTR_EDGES
the edges of a route
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
@ SUMO_ATTR_TLLINKINDEX
link: the index of the link within the traffic light
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static void drawTextAtEnd(const std::string &text, const PositionVector &shape, double x, const GUIVisualizationTextSettings &settings, const double scale)
draw text and the end of shape
static void popMatrix()
pop matrix
static void pushMatrix()
push matrix
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
double getCommonAttributeDouble(SumoXMLAttr key) const
bool mySelected
boolean to check if this AC is selected (more quickly as checking GUIGlObjectStorage)
static T parse(const std::string &string)
parses a value of type T from string (used for basic types: int, double, bool, etc....
PositionVector getCommonAttributePositionVector(SumoXMLAttr key) const
void setCommonAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
const std::string & getTagStr() const
get tag assigned to this object in string format
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
void drawInLayer(const double typeOrLayer, const double extraOffset=0) const
draw element in the given layer, or in front if corresponding flag is enabled
Position getCommonAttributePosition(SumoXMLAttr key) const
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
GNENet * myNet
pointer to net
GNENet * getNet() const
get pointer to net
std::string getCommonAttribute(SumoXMLAttr key) const
const GNETagProperties * myTagProperty
reference to tagProperty associated with this attribute carrier
static void changeAttribute(GNEAttributeCarrier *AC, SumoXMLAttr key, const std::string &value, GNEUndoList *undoList, const bool force=false)
change attribute
bool checkDrawCrossing(const GUIVisualizationSettings &s) const
check if draw crossing
std::vector< NBEdge * > myCrossingEdges
Crossing Edges (It works as ID because a junction can only ONE Crossing with the same edges).
std::string getAttribute(SumoXMLAttr key) const override
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
GNEMoveElementCrossing * myMoveElementCrossing
move element crossing
GNECrossing(GNENet *net)
default constructor
void drawCrossing(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const NBNode::Crossing *crossing, const double width, const double exaggeration) const
draw crossing
Position getPositionInView() const
Returns position of hierarchical element in view.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own popup-menu.
void drawTLSLinkNo(const GUIVisualizationSettings &s, const NBNode::Crossing *crossing) const
draw TLS Link Number
bool checkEdgeBelong(GNEEdge *edges) const
return true if a edge belongs to crossing's edges
Position getAttributePosition(SumoXMLAttr key) const override
bool checkDrawFromContour() const override
check if draw from contour (green)
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
bool isValid(SumoXMLAttr key, const std::string &value) override
Parameterised * getParameters() override
get parameters associated with this crossing
const std::vector< NBEdge * > & getCrossingEdges() const
get crossingEdges
bool isNetworkElementValid() const override
check if current network element is valid to be written into XML
GUIGeometry myCrossingGeometry
crossing geometry
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
void updateGLObject() override
update GLObject (geometry, ID, etc.)
bool checkDrawRelatedContour() const override
check if draw related contour (cyan)
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this crossing
NBNode::Crossing * getNBCrossing() const
get referente to NBode::Crossing
bool checkDrawDeleteContourSmall() const override
check if draw delete contour small (pink/white)
bool checkDrawSelectContour() const override
check if draw select contour (blue)
bool checkDrawMoveContour() const override
check if draw move contour (red)
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
const PositionVector & getCrossingShape() const
get Crossing shape
void updateGeometry() override
update pre-computed geometry information
~GNECrossing()
Destructor.
void calculateCrossingContour(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double width, const double exaggeration) const
calculate contour
bool isAttributeEnabled(SumoXMLAttr key) const override
Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
bool checkDrawOverContour() const override
check if draw over contour (orange)
NBNode::Crossing * myTemplateNBCrossing
template NBCrossing
std::string getNetworkElementProblem() const override
return a string with the current network element problem
RGBColor getCrossingColor(const GUIVisualizationSettings &s, const NBNode::Crossing *crossing) const
get crossing color
bool checkDrawToContour() const override
check if draw from contour (magenta)
void deleteGLObject() override
delete element
void drawCrossingDetailed(const double width, const double exaggeration) const
draw crossing with hight detail
bool checkDrawDeleteContour() const override
check if draw delete contour (pink/white)
double getAttributeDouble(SumoXMLAttr key) const override
NBEdge * getNBEdge() const
returns the internal NBEdge
void setParent(ParentType parent)
edit parent and childrens without maintain integrity (use carefully)
const GNEHierarchicalContainerParents< GNEJunction * > & getParentJunctions() const
get parent junctions
A NBNetBuilder extended by visualisation and editing capabilities.
GNEContour myNetworkElementContour
network element contour
bool myShapeEdited
flag to check if element shape is being edited
GNENetworkElement(GNENet *net, const std::string &id, SumoXMLTag tag)
Constructor.
GUIGLObjectPopupMenu * getShapeEditedPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent, const PositionVector &shape)
get shape edited popup menu
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel, const bool disable=false)
build menu command
static void drawGeometryPoints(const GUIVisualizationSettings::Detail d, const PositionVector &shape, const RGBColor &color, const double radius, const double exaggeration, const bool editingElevation)
draw geometry points
static void drawGeometry(const GUIVisualizationSettings::Detail d, const GUIGeometry &geometry, const double width, double offset=0)
draw geometry
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
void buildPopUpMenuCommonOptions(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, GUISUMOAbstractView *parent, const SumoXMLTag tag, const bool selected, bool addSeparator=true)
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0, bool forceShow=false) const
draw name of item
const std::vector< T > & getSchemes() const
Stores the information about how to visualize structures.
Detail getDetailLevel(const double exaggeration) const
return the detail level
GUIVisualizationTextSettings cwaEdgeName
bool drawMovingGeometryPoint(const double exaggeration, const double radius) const
check if moving geometry point can be draw
GUIVisualizationColorSettings colorSettings
color settings
GUIVisualizationDottedContourSettings dottedContourSettings
dotted contour settings
double scale
information about a lane's width (temporary, used for a single view)
bool drawForViewObjectsHandler
whether drawing is performed for the purpose of selecting objects in view using ViewObjectsHandler
GUIColorer laneColorer
The lane colorer.
GUIVisualizationTextSettings edgeName
Setting bundles for optional drawing names with size and color.
GUIVisualizationTextSettings drawLinkTLIndex
bool drawCrossingsAndWalkingareas
whether crossings and walkingareas shall be drawn
double selectorFrameScale
the current selection scaling in netedit (set in SelectorFrame)
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
A definition of a pedestrian crossing.
int tlLinkIndex
the traffic light index of this crossing (if controlled)
PositionVector customShape
optional customShape for this crossing
PositionVector shape
The crossing's shape.
bool priority
whether the pedestrians have priority
bool valid
whether this crossing is valid (and can be written to the net.xml). This is needed for netedit becaus...
Represents a single node (junction) during network building.
An upper class for objects with additional parameters.
A point in 2D or 3D with translation and scaling methods.
void extrapolate(const double val, const bool onlyFirst=false, const bool onlyLast=false)
extrapolate position vector
PositionVector reverse() const
reverse position vector
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
static void drawLockIcon(const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, GUIGlObjectType type, const Position position, const double exaggeration, const double size=0.5, const double offsetx=0, const double offsety=0)
draw lock icon
RGBColor selectedCrossingColor
crossings selection color
static const RGBColor crossingPriorityColor
color for priority crossing
static const RGBColor crossingInvalidColor
color for invalid crossing
static const RGBColor crossingColor
color for crossings
static const RGBColor editShapeColor
color for edited shapes (Junctions, crossings and connections)
static const double segmentWidthSmall
width of small dotted contour segments
static const double segmentWidth
width of dotted contour segments
static const double crossingGeometryPointRadius
moving crossing geometry point radius
bool show(const GUIGlObject *o) const
whether to show the text