46 double& endPosValue,
bool& friendlyPosition) :
71 if (geometryPoints.empty()) {
74 if (geometryPoints.front() == 0) {
84 if (parentLanes.size() > 1) {
239 return GNEAttributeCarrier::canParse<std::vector<GNELane*> >(
myMovedElement->
getNet(), value,
true);
250 return GNEAttributeCarrier::canParse<double>(value) && GNEAttributeCarrier::parse<double>(value) >= POSITION_EPS;
253 return GNEAttributeCarrier::canParse<bool>(value);
325 return TL(
"Lanes aren't consecutives");
327 return TL(
"Lanes aren't connected");
334 return TL(
"starPos > (endPos - EPS)");
350 bool foundConnection =
false;
351 for (
const auto& connection : firstLane->getParentEdge()->getGNEConnections()) {
352 if ((connection->getLaneFrom() == firstLane) && (connection->getLaneTo() == secondLane)) {
353 foundConnection =
true;
358 if (!foundConnection) {
360 NBEdge::Connection newCon(firstLane->getIndex(), secondLane->getParentEdge()->getNBEdge(), secondLane->getIndex());
372 if (maxStartPos < POSITION_EPS) {
377 const double newStartPos = (std::trunc(maxStartPos * 1000) / 1000);
477 const double newSize = GNEAttributeCarrier::parse<double>(value);
483 double newStartPos = center - (newSize * 0.5);
484 double newEndPos = center + (newSize * 0.5);
486 if (newStartPos < 0) {
489 if (newEndPos > laneLength) {
490 newEndPos = laneLength;
498 double newStartPos = laneLength - newSize;
500 if (newStartPos < 0) {
507 double newEndPos = newSize;
509 if (newEndPos > laneLength) {
510 newEndPos = laneLength;
GUIViewObjectsHandler gViewObjectsHandler
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ GNE_ATTR_FORCESIZE
size (used in stopping places)
@ GNE_ATTR_SIZE
size (used in stopping places)
@ GNE_ATTR_REFERENCE
reference position (used creating stoppingPlaces)
@ GNE_ATTR_SHIFTLANEINDEX
shift lane index (only used by elements over lanes)
const double INVALID_DOUBLE
invalid double
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static bool areLaneConnected(const std::vector< GNELane * > &lanes)
check if the given lanes are connected
static bool areLaneConsecutives(const std::vector< GNELane * > &lanes)
check if the given lanes are consecutive
bool drawMovingGeometryPoints() const
check if draw moving geometry points
virtual GNEMoveElement * getMoveElement() const =0
get GNEMoveElement associated with this AttributeCarrier
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 isTemplate() const
check if this AC is template
Position getCommonAttributePosition(SumoXMLAttr key) const
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
virtual GNEHierarchicalElement * getHierarchicalElement()=0
methods to retrieve the elements linked to this AttributeCarrier
GNENet * getNet() const
get pointer to net
static std::string parseIDs(const std::vector< T > &ACs)
parses a list of specific Attribute Carriers into a string of IDs
bool isCommonAttributeValid(SumoXMLAttr key, const std::string &value) const
virtual void updateGeometry()=0
update pre-computed geometry information
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
virtual std::string getAttribute(SumoXMLAttr key) const =0
std::string getCommonAttribute(SumoXMLAttr key) const
virtual GUIGlObject * getGUIGlObject()=0
get GUIGlObject associated with this AttributeCarrier
static void changeAttribute(GNEAttributeCarrier *AC, SumoXMLAttr key, const std::string &value, GNEUndoList *undoList, const bool force=false)
change attribute
const GNEHierarchicalContainerParents< GNELane * > & getParentLanes() const
get parent lanes
double myMovingLateralOffset
move element lateral offset
GNEAttributeCarrier * myMovedElement
pointer to element
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
void fixMovingProblem()
fix moving problem
Position getMovingAttributePosition(SumoXMLAttr key) const override
get moving attribute position
double getEndFixedPositionOverLane(const bool adjustGeometryFactor) const
get end offset position over lane
void setSize(const std::string &value, GNEUndoList *undoList)
set size
void setMoveShape(const GNEMoveResult &moveResult) override
set move shape
double getMovingAttributeDouble(SumoXMLAttr key) const override
get moving attribute double
~GNEMoveElementLaneDouble()
Destructor.
GNEMoveOperation * getMoveOperation()
get lane movable move operation for elements with
GNEMoveElementLaneSingle * myEndPos
end position
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList) override
commit move shape
std::string getMovingProblem() const
return a string with the current moving problem
bool isMovingAttributeValid(SumoXMLAttr key, const std::string &value) const override
check if the given moving attribute is valid
PositionVector getMovingAttributePositionVector(SumoXMLAttr key) const override
get moving attribute positionVector
ReferencePosition myReferencePosition
reference position
bool isMoveElementValid() const
check if current moving element is valid to be written into XML
double getStartFixedPositionOverLane(const bool adjustGeometryFactor) const
get start offset position over lane
double myTemplateSize
size (only use in AttributeCarrier templates)
void writeMoveAttributes(OutputDevice &device, const bool writeLength) const
write move attributes
bool myTemplateForceSize
force size (only used in AttributeCarrier templates
static const double defaultSize
default element size
GNEMoveElementLaneDouble(GNEAttributeCarrier *element, SumoXMLAttr startPosAttr, double &startPosValue, SumoXMLAttr endPosAttr, double &endPosValue, bool &friendlyPosition)
Constructor.
GNEMoveElementLaneSingle * myStartPos
start position
void setMovingAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
set moving attribute (using undo-list)
double & myPosOverLane
position over lane
bool & myFriendlyPos
friendly position
bool isMoveElementValid() const
check if current moving element is valid to be written into XML
std::string getMovingProblem() const
return a string with the current moving problem
SumoXMLAttr myPosAttr
pos attribute
std::string getMovingAttribute(SumoXMLAttr key) const override
get moving attribute
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 commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList) override
commit move shape
void setMoveShape(const GNEMoveResult &moveResult) override
set move shape
GNEMoveOperation * getMoveOperation()
get move operation
double getFixedPositionOverLane(const bool adjustGeometryFactor) const
get fixed offset position over lane
void fixMovingProblem()
fix moving problem
bool getAllowChangeLane() const
allow change lane
CommonMoveOptions * getCommonMoveOptions() const
get common mode options
double newFirstPos
new first position
double firstLaneOffset
lane offset
double newLastPos
new last position
GNEViewNet * getViewNet() const
get view net
double getDefaultDoubleValue(SumoXMLAttr attr) const
get default double value
bool hasAttribute(SumoXMLAttr attr) const
check if current TagProperties owns the attribute "attr"
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
GNEUndoList * getUndoList() const
get the undoList object
GNEMoveFrame * getMoveFrame() const
get frame for move elements
bool isObjectSelected(const GUIGlObject *GLObject) const
check if element was already selected
const std::vector< int > & getSelectedGeometryPoints(const GUIGlObject *GLObject) const
get geometry points for the given glObject
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 StringBijection< ReferencePosition > ReferencePositions
reference positions (used creating certain elements in netedit)
const std::string & getString(const T key) const
get string
bool hasString(const std::string &str) const
check if the given string exist
T get(const std::string &str) const
get key
A structure which describes a connection between edges or lanes.