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