Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/changes/GNEChange_Lane.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_Lane.h
15
/// @author Jakob Erdmann
16
/// @date April 2011
17
///
18
// A network change in which a single lane is created or deleted
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include "GNEChange.h"
24
25
// ===========================================================================
26
// class definitions
27
// ===========================================================================
28
/**
29
* @class GNEChange_Lane
30
* A network change in which a single lane is created or deleted
31
*/
32
class GNEChange_Lane : public GNEChange {
33
FXDECLARE_ABSTRACT(GNEChange_Lane)
34
35
public:
36
/**@brief Constructor for creating a lane
37
* @param[in] edge The edge on which to apply changes
38
* @param[in] laneAttrs The attributes of the lane to be created/
39
*/
40
GNEChange_Lane(GNEEdge* edge, const NBEdge::Lane& laneAttrs);
41
42
/**@brief Constructor for deleting a lane
43
* @param[in] edge The edge on which to apply changes
44
* @param[in] lane The lane to be deleted
45
* @param[in] laneAttrs The attributes of the lane to be deleted
46
* @param[in] forward Whether to delete (true/false)
47
* @param[in] recomputeConnections Whether to recompute all connections for the affected edge
48
*/
49
GNEChange_Lane(GNEEdge* edge, GNELane* lane, const NBEdge::Lane& laneAttrs, bool forward, bool recomputeConnections = true);
50
51
/// @brief Destructor
52
~GNEChange_Lane();
53
54
/// @name inherited from GNEChange
55
/// @{
56
/// @brief get undo Name
57
std::string undoName() const;
58
59
/// @brief get Redo name
60
std::string redoName() const;
61
62
/// @brief undo action
63
void undo();
64
65
/// @brief redo action
66
void redo();
67
/// @}
68
69
private:
70
/// @brief we need the edge because it is the target of our change commands
71
GNEEdge* myEdge;
72
73
/// @brief we need to preserve the lane because it maybe the target of GNEChange_Attribute commands
74
GNELane* myLane;
75
76
/// @brief we need to preserve the attributes explicitly because they are not contained withing GNELane itself
77
const NBEdge::Lane myLaneAttrs;
78
79
/// @brief whether to recompute connection when adding a new lane
80
bool myRecomputeConnections;
81
};
82
83