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