Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEMoveElementLaneSingle.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// Class used for elements that can be moved over a lane with only one position
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
24
25#include "GNEMoveElement.h"
26
27// ===========================================================================
28// class definitions
29// ===========================================================================
30
32
33public:
36
37 // declare type of moving
38 struct PositionType {
39 static const std::string SINGLE; // Element has only one position
40 static const std::string STARPOS; // Element's start position
41 static const std::string ENDPOS; // Element's end position
42 };
43
46 double& position, bool& friendlyPos,
47 const std::string& defaultBehavior);
48
51
56
59
61 std::string getMovingAttribute(SumoXMLAttr key) const override;
62
64 double getMovingAttributeDouble(SumoXMLAttr key) const override;
65
68
71
73 void setMovingAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
74
76 bool isMovingAttributeValid(SumoXMLAttr key, const std::string& value) const override;
77
79 void setMovingAttribute(SumoXMLAttr key, const std::string& value) override;
80
82
84 void removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList) override;
85
87 bool isMoveElementValid() const;
88
90 std::string getMovingProblem() const;
91
93 void fixMovingProblem();
94
96 void writeMoveAttributes(OutputDevice& device) const;
97
99 double getFixedPositionOverLane(const bool adjustGeometryFactor) const;
100
101private:
104
107
110
112 const std::string myPositionType;
113
115 void setMoveShape(const GNEMoveResult& moveResult) override;
116
118 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList) override;
119
122
125};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
double & myPosOverLane
position over lane
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
void setMovingAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
set moving attribute (using undo-list)
GNEMoveElementLaneSingle(const GNEMoveElementLaneSingle &)=delete
Invalidated copy constructor.
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
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
GNEMoveElementLaneSingle & operator=(const GNEMoveElementLaneSingle &)=delete
Invalidated assignment operator.
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
Static storage of an output device and its base (abstract) implementation.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A list of positions.