34 myConnection(connection) {
104 PositionVector shape = connection.customShape.size() > 0 ? connection.customShape : connection.shape;
106 if (shape.size() > 2) {
112 if ((index != -1) && shape[index].distanceSquaredTo2D(clickedPosition) < (snap_radius * snap_radius)) {
114 shape.erase(shape.begin() + index);
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_CUSTOMSHAPE
whether a given shape is user-defined
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
GUIGeometry myConnectionGeometry
connection geometry
void updateGeometry() override
update pre-computed geometry information
NBEdge::Connection & getNBEdgeConnection() const
get Edge::Connection
bool myShapeDeprecated
flag to indicate that connection's shape has to be updated
std::string getMovingAttribute(SumoXMLAttr key) const override
get moving attribute
~GNEMoveElementConnection()
PositionVector getMovingAttributePositionVector(SumoXMLAttr key) const override
get moving attribute positionVector
void setMoveShape(const GNEMoveResult &moveResult) override
set move shape
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList) override
commit move shape
bool isMovingAttributeValid(SumoXMLAttr key, const std::string &value) const override
check if the given moving attribute is valid
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList) override
remove geometry point in the clicked position
GNEMoveOperation * getMoveOperation()
get move operation
Position getMovingAttributePosition(SumoXMLAttr key) const override
get moving attribute position
double getMovingAttributeDouble(SumoXMLAttr key) const override
get moving attribute double
GNEConnection * myConnection
pointer to connection
void setMovingAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
set moving attribute (using undo-list)
GNEMoveElementConnection()=delete
invalidate default constructor
GNEAttributeCarrier * myMovedElement
pointer to element
GNEMoveOperation * getEditShapeOperation(const GUIGlObject *obj, const PositionVector originalShape, const bool maintainShapeClosed)
calculate move shape operation
PositionVector shapeToUpdate
shape to update (edited in moveElement)
GNEViewNet * getViewNet() const
get view net
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...
const PositionVector & getShape() const
The shape of the additional element.
const GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings (read only)
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
A point in 2D or 3D with translation and scaling methods.
int indexOfClosest(const Position &p, bool twoD=false) const
static const double connectionGeometryPointRadius
moving connection geometry point radius
PositionVector customShape
custom shape for connection