35 myJunction(junction) {
104 if (shape.size() > 2) {
110 if ((index != -1) && shape[index].distanceSquaredTo2D(clickedPosition) < (snap_radius * snap_radius)) {
112 shape.erase(shape.begin() + index);
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
double getCommonAttributeDouble(SumoXMLAttr key) const
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
Position getCommonAttributePosition(SumoXMLAttr key) const
GNENet * getNet() const
get pointer to net
bool isCommonAttributeValid(SumoXMLAttr key, const std::string &value) const
std::string getCommonAttribute(SumoXMLAttr key) const
static void changeAttribute(GNEAttributeCarrier *AC, SumoXMLAttr key, const std::string &value, GNEUndoList *undoList, const bool force=false)
change attribute
void clearContour() const
void clear contour
void moveJunctionGeometry(const Position &pos, const bool updateEdgeBoundaries)
reposition the node at pos without updating GRID and informs the edges
void updateGeometry() override
update pre-computed geometry information (including crossings)
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
NBNode * getNBNode() const
Return net build node.
GNEAttributeCarrier * myMovedElement
pointer to element
GNEMoveOperation * getEditShapeOperation(const GUIGlObject *obj, const PositionVector originalShape, const bool maintainShapeClosed)
calculate move shape operation
~GNEMoveElementJunction()
GNEJunction * myJunction
pointer to junction
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList) override
commit move shape
GNEMoveElementJunction()=delete
invalidate default constructor
std::string getMovingAttribute(SumoXMLAttr key) const override
get moving attribute
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList) override
remove geometry point in the clicked position
PositionVector getMovingAttributePositionVector(SumoXMLAttr key) const override
get moving attribute positionVector
void setMoveShape(const GNEMoveResult &moveResult) override
set move shape
GNEMoveOperation * getMoveOperation()
get move operation
double getMovingAttributeDouble(SumoXMLAttr key) const override
get moving attribute double
bool isMovingAttributeValid(SumoXMLAttr key, const std::string &value) const override
check if the given moving attribute is valid
void setMovingAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
set moving attribute (using undo-list)
Position getMovingAttributePosition(SumoXMLAttr key) const override
get moving attribute position
bool getMoveOnlyJunctionCenter() const
check if option "move only junction center" is enabled
NetworkMoveOptions * getNetworkMoveOptions() const
get network mode options
PositionVector shapeToUpdate
shape to update (edited in moveElement)
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
GNEViewNet * getViewNet() const
get view net
GNEContour myNetworkElementContour
network element contour
bool isShapeEdited() const
check if shape is being edited
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
GNEViewParent * getViewParent() const
get the net object
GNEMoveFrame * getMoveFrame() const
get frame for move elements
const GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings (read only)
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
The representation of a single edge during network building.
const std::string & getID() const
Position getCenter() const
Returns a position that is guaranteed to lie within the node shape.
void setCustomShape(const PositionVector &shape)
set the junction shape
bool hasCustomShape() const
return whether the shape was set by the user
const Position & getPosition() const
const EdgeVector & getEdges() const
Returns all edges which participate in this node (Edges that start or end at this node)
const PositionVector & getShape() const
retrieve the junction shape
A point in 2D or 3D with translation and scaling methods.
PositionVector added(const Position &offset) const
int indexOfClosest(const Position &p, bool twoD=false) const
static const double junctionGeometryPointRadius
moving junction geometry point radius