43 SumoXMLAttr posAttr,
double& position,
bool& friendlyPos,
const std::string& defaultBehavior) :
58 const bool allowChangeLane =
myMovedElement->getNet()->getViewNet()->getViewParent()->getMoveFrame()->getCommonMoveOptions()->getAllowChangeLane();
81 return myMovedElement->getHierarchicalElement()->getParentLanes().front()->getID();
142 if (
myMovedElement->getNet()->getAttributeCarriers()->retrieveLane(
value,
false) !=
nullptr) {
191 myMovedElement->getHierarchicalElement()->getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
197 }
else if (adjustedPosition < 0) {
199 }
else if (adjustedPosition > laneLenght) {
213 myMovedElement->getHierarchicalElement()->getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
219 }
else if (adjustedPosition < 0) {
221 }
else if (adjustedPosition > laneLenght) {
234 const double laneLenght =
myMovedElement->getHierarchicalElement()->getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
238 if (adjustedPosition < 0) {
240 }
else if (adjustedPosition > laneLenght) {
267 const double laneLength = lane->getParentEdge()->getNBEdge()->getFinalLength();
271 return adjustGeometryFactor ? (laneLength * lane->getLengthGeometryFactor()) : laneLength;
280 fixedPos += laneLength;
283 if (adjustGeometryFactor) {
285 fixedPos *= lane->getLengthGeometryFactor();
289 }
else if (fixedPos > lane->getLaneShapeLength()) {
290 return lane->getLaneShapeLength();
298 }
else if (fixedPos > laneLength) {
const std::string invalid_return< std::string >::value
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
const double INVALID_DOUBLE
invalid double
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
const std::string getID() const override
get ID (all Attribute Carriers have one)
static T parse(const std::string &string)
parses a value of type T from string (used for basic types: int, double, bool, etc....
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
static void changeAttribute(GNEAttributeCarrier *AC, SumoXMLAttr key, const std::string &value, GNEUndoList *undoList, const bool force=false)
change attribute
double myMovingLateralOffset
move element lateral offset
GNEAttributeCarrier * myMovedElement
pointer to element
GNEMoveElement(GNEAttributeCarrier *movedElement)
constructor
double & myPosOverLane
position over lane
GNEMoveElementLaneSingle(GNEAttributeCarrier *element, SumoXMLAttr posAttr, double &position, bool &friendlyPos, const std::string &defaultBehavior)
constructor
bool & myFriendlyPos
friendly position
bool isMoveElementValid() const
check if current moving element is valid to be written into XML
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList) override
remove geometry point in the clicked position
double getMovingAttributeDouble(SumoXMLAttr key) const override
get moving attribute double
std::string getMovingProblem() const
return a string with the current moving problem
SumoXMLAttr myPosAttr
pos attribute
const std::string myPositionType
default behavior
std::string getMovingAttribute(SumoXMLAttr key) const override
get moving attribute
GNEMoveOperation * getMoveOperation() override
get move operation
void setMovingAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
set moving attribute (using undo-list)
bool isMovingAttributeValid(SumoXMLAttr key, const std::string &value) const override
check if the given moving attribute is valid
void writeMoveAttributes(OutputDevice &device) const
write move attributes
~GNEMoveElementLaneSingle()
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList) override
commit move shape
void setMoveShape(const GNEMoveResult &moveResult) override
set move shape
double getFixedPositionOverLane(const bool adjustGeometryFactor) const
get fixed offset position over lane
Position getMovingAttributePosition(SumoXMLAttr key) const override
get moving attribute position
PositionVector getMovingAttributePositionVector(SumoXMLAttr key) const override
get moving attribute positionVector
void fixMovingProblem()
fix moving problem
const GNELane * newFirstLane
new first Lane
double newFirstPos
new first position
double lastLaneOffset
lane offset
const GNELane * newLastLane
new last Lane
double firstLaneOffset
lane offset
double newLastPos
new last position
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...
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
A point in 2D or 3D with translation and scaling methods.
static const std::string STARPOS
static const std::string ENDPOS
static const std::string SINGLE