Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/changes/GNEChange_Crossing.h
169678 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 GNEChange_Crossing.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Oct 2016
17
///
18
// A network change in which a single crossing is created or deleted
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include "GNEChange.h"
24
25
class GNEJunction;
26
27
// ===========================================================================
28
// class definitions
29
// ===========================================================================
30
/**
31
* @class GNEChange_Crossing
32
* A network change in which a single crossing is created or deleted
33
*/
34
class GNEChange_Crossing : public GNEChange {
35
// @brief FOX Declaration
36
FXDECLARE_ABSTRACT(GNEChange_Crossing)
37
38
public:
39
/**@brief Constructor for creating/deleting an crossing
40
* @param[in] JunctionParent GNEJunction in which the crossing will be created/deleted
41
* @param[in] edges vector of edges of crossing
42
* @param[in] width value with the width of crossing
43
* @param[in] priority boolean with the priority of crossing
44
* @param[in] check if in the moment of change connection was selected
45
* @param[in] forward Whether to create/delete (true/false)
46
*/
47
GNEChange_Crossing(GNEJunction* junctionParent, const std::vector<NBEdge*>& edges, double width,
48
bool priority, int customTLIndex, int customTLIndex2, const PositionVector& customShape, bool selected, bool forward);
49
50
/**@brief Constructor for creating/deleting an crossing based on an existing object
51
*/
52
GNEChange_Crossing(GNEJunction* junctionParent, const NBNode::Crossing& crossing, bool forward);
53
54
/// @brief Destructor
55
~GNEChange_Crossing();
56
57
/// @name inherited from GNEChange
58
/// @{
59
/// @brief get undo Name
60
std::string undoName() const;
61
62
/// @brief get Redo name
63
std::string redoName() const;
64
65
/// @brief undo action
66
void undo();
67
68
/// @brief redo action
69
void redo();
70
/// @}
71
72
private:
73
/// @brief full information regarding the Junction in which GNECRossing is created
74
GNEJunction* myJunctionParent;
75
76
/// @brief vector to save all edges of GNECrossing
77
std::vector<NBEdge*> myEdges;
78
79
/// @brief width of GNECrossing
80
double myWidth;
81
82
/// @brief priority of GNECrossing
83
bool myPriority;
84
85
/// @brief custom index of GNECrossing
86
int myCustomTLIndex;
87
88
/// @brief custom index of GNECrossing (reverse direction)
89
int myCustomTLIndex2;
90
91
/// @brief priority of GNECrossing
92
PositionVector myCustomShape;
93
};
94
95