Eclipse SUMO - Simulation of Urban MObility
GNEChange_Lane.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // A network change in which a single lane is created or deleted
16 /****************************************************************************/
17 #ifndef GNEChange_Lane_h
18 #define GNEChange_Lane_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <fx.h>
28 #include <netbuild/NBEdge.h>
29 
30 #include "GNEChange.h"
31 
32 // ===========================================================================
33 // class declarations
34 // ===========================================================================
35 class GNEEdge;
36 class GNELane;
37 class GNEAdditional;
38 class GNEShape;
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
47 class GNEChange_Lane : public GNEChange {
48  FXDECLARE_ABSTRACT(GNEChange_Lane)
49 
50 public:
58  GNEChange_Lane(GNEEdge* edge, GNELane* lane, const NBEdge::Lane& laneAttrs, bool forward, bool recomputeConnections = true);
59 
62 
66  FXString undoName() const;
67 
69  FXString redoName() const;
70 
72  void undo();
73 
75  void redo();
77 
78 
79 private:
82 
85 
88 
91 
93  std::vector<GNEShape*> myShapeParents;
94 
96  std::vector<GNEAdditional*> myAdditionalParents;
97 
99  std::vector<GNEDemandElement*> myDemandElementParents;
100 
102  std::vector<GNEShape*> myShapeChildren;
103 
105  std::vector<GNEAdditional*> myAdditionalChildren;
106 
108  std::vector<GNEDemandElement*> myDemandElementChildren;
109 };
110 
111 #endif
112 /****************************************************************************/
const NBEdge::Lane myLaneAttrs
we need to preserve the attributes explicitly because they are not contained withing GNELane itself ...
~GNEChange_Lane()
Destructor.
std::vector< GNEShape * > myShapeParents
vector of shape parents
the function-object for an editing operation (abstract base)
Definition: GNEChange.h:43
FXString redoName() const
get Redo name
FXString undoName() const
return undoName
void undo()
undo action
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
std::vector< GNEAdditional * > myAdditionalChildren
vector of additional children
std::vector< GNEAdditional * > myAdditionalParents
vector of additional parents
An (internal) definition of a single lane of an edge.
Definition: NBEdge.h:137
std::vector< GNEShape * > myShapeChildren
vector of shape children
void redo()
redo action
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:50
GNEEdge * myEdge
we need the edge because it is the target of our change commands
GNEChange_Lane(GNEEdge *edge, GNELane *lane, const NBEdge::Lane &laneAttrs, bool forward, bool recomputeConnections=true)
Constructor for creating/deleting an edge.
GNELane * myLane
we need to preserve the lane because it maybe the target of GNEChange_Attribute commands ...
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
bool myRecomputeConnections
whether to recompute connection when adding a new lane
std::vector< GNEDemandElement * > myDemandElementParents
vector of demand element parents
std::vector< GNEDemandElement * > myDemandElementChildren
vector of demand element children