Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/elements/moving/GNEMoveElementVehicle.h
185836 views
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
/****************************************************************************/
14
/// @file GNEMoveElementVehicle.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Oct 2025
17
///
18
// Class used for elements that can be moved over a edge with two positions
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include <utils/iodevices/OutputDevice.h>
24
25
#include "GNEMoveElement.h"
26
27
// ===========================================================================
28
// class declaration
29
// ===========================================================================
30
31
class GNEEdge;
32
class GNEVehicle;
33
34
// ===========================================================================
35
// class definitions
36
// ===========================================================================
37
38
class GNEMoveElementVehicle : public GNEMoveElement {
39
40
public:
41
/**@brief Constructor
42
* @param[in] vehicle moved vehicle
43
* @param[in] fromEdge Edge of this element belongs
44
* @param[in] toEdge Edge of this element belongs
45
*/
46
GNEMoveElementVehicle(GNEVehicle* vehicle, GNEEdge* fromEdge, GNEEdge* toEdge);
47
48
/// @brief Destructor
49
~GNEMoveElementVehicle();
50
51
/**@brief get edge movable move operation for elements with
52
* @note returned GNEMoveOperation can be nullptr
53
*/
54
GNEMoveOperation* getMoveOperation() override;
55
56
/// @name functions related with moving attributes
57
/// @{
58
59
/// @brief get moving attribute
60
std::string getMovingAttribute(SumoXMLAttr key) const override;
61
62
/// @brief get moving attribute double
63
double getMovingAttributeDouble(SumoXMLAttr key) const override;
64
65
/// @brief get moving attribute position
66
Position getMovingAttributePosition(SumoXMLAttr key) const override;
67
68
/// @brief get moving attribute positionVector
69
PositionVector getMovingAttributePositionVector(SumoXMLAttr key) const override;
70
71
/// @brief set moving attribute (using undo-list)
72
void setMovingAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
73
74
/// @brief check if the given moving attribute is valid
75
bool isMovingAttributeValid(SumoXMLAttr key, const std::string& value) const override;
76
77
/// @brief set moving attribute
78
void setMovingAttribute(SumoXMLAttr key, const std::string& value) override;
79
80
/// @}
81
82
/// @brief remove geometry point in the clicked position
83
void removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList) override;
84
85
/// @brief vehicle arrival position radius
86
static const double arrivalPositionDiameter;
87
88
private:
89
/// @brief vehicle
90
GNEVehicle* myVehicle = nullptr;
91
92
/// @brief set move shape
93
void setMoveShape(const GNEMoveResult& moveResult) override;
94
95
/// @brief commit move shape
96
void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList) override;
97
98
/// @brief Invalidated copy constructor.
99
GNEMoveElementVehicle(const GNEMoveElementVehicle&) = delete;
100
101
/// @brief Invalidated assignment operator
102
GNEMoveElementVehicle& operator=(const GNEMoveElementVehicle& src) = delete;
103
};
104
105