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