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