Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/elements/moving/GNEMoveElementPlan.h
185790 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 GNEMoveElementPlan.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
#include <utils/vehicle/SUMOVehicleParameter.h>
25
26
#include "GNEMoveElement.h"
27
28
// ===========================================================================
29
// class declaration
30
// ===========================================================================
31
32
class GNEDemandElement;
33
34
// ===========================================================================
35
// class definitions
36
// ===========================================================================
37
38
class GNEMoveElementPlan : public GNEMoveElement {
39
40
public:
41
/**@brief Constructor
42
* @param[in] planElement moved planElement
43
* @param[in] departPos Start position value
44
*/
45
GNEMoveElementPlan(GNEDemandElement* planElement, double& departPos);
46
47
/// @brief Destructor
48
~GNEMoveElementPlan();
49
50
/**@brief get edge movable move operation for elements with
51
* @note returned GNEMoveOperation can be nullptr
52
*/
53
GNEMoveOperation* getMoveOperation() override;
54
55
/// @name functions related with moving attributes
56
/// @{
57
58
/// @brief get moving attribute
59
std::string getMovingAttribute(SumoXMLAttr key) const override;
60
61
/// @brief get moving attribute double
62
double getMovingAttributeDouble(SumoXMLAttr key) const override;
63
64
/// @brief get moving attribute position
65
Position getMovingAttributePosition(SumoXMLAttr key) const override;
66
67
/// @brief get moving attribute positionVector
68
PositionVector getMovingAttributePositionVector(SumoXMLAttr key) const override;
69
70
/// @brief set moving attribute (using undo-list)
71
void setMovingAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
72
73
/// @brief check if the given moving attribute is valid
74
bool isMovingAttributeValid(SumoXMLAttr key, const std::string& value) const override;
75
76
/// @brief set moving attribute
77
void setMovingAttribute(SumoXMLAttr key, const std::string& value) override;
78
79
/// @}
80
81
/// @brief remove geometry point in the clicked position
82
void removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList) override;
83
84
private:
85
/// @brief planElement
86
GNEDemandElement* myPlanElement = nullptr;
87
88
/// @brief departPos
89
double& myArrivalPosition;
90
91
/// @brief set move shape
92
void setMoveShape(const GNEMoveResult& moveResult) override;
93
94
/// @brief commit move shape
95
void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList) override;
96
97
/// @brief Invalidated copy constructor.
98
GNEMoveElementPlan(const GNEMoveElementPlan&) = delete;
99
100
/// @brief Invalidated assignment operator
101
GNEMoveElementPlan& operator=(const GNEMoveElementPlan& src) = delete;
102
};
103
104