Eclipse SUMO - Simulation of Urban MObility
GNEChange_Crossing.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 // Copyright (C) 2001-2024 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 /****************************************************************************/
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 // ===========================================================================
34 class GNEChange_Crossing : public GNEChange {
35  // @brief FOX Declaration
36  FXDECLARE_ABSTRACT(GNEChange_Crossing)
37 
38 public:
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 
52  GNEChange_Crossing(GNEJunction* junctionParent, const NBNode::Crossing& crossing, bool forward);
53 
56 
60  std::string undoName() const;
61 
63  std::string redoName() const;
64 
66  void undo();
67 
69  void redo();
71 
72 private:
75 
77  std::vector<NBEdge*> myEdges;
78 
80  double myWidth;
81 
83  bool myPriority;
84 
87 
90 
93 };
double myWidth
width of GNECrossing
int myCustomTLIndex
custom index of GNECrossing
bool myPriority
priority of GNECrossing
~GNEChange_Crossing()
Destructor.
void redo()
redo action
std::vector< NBEdge * > myEdges
vector to save all edges of GNECrossing
PositionVector myCustomShape
priority of GNECrossing
std::string undoName() const
return undoName
GNEChange_Crossing(GNEJunction *junctionParent, const std::vector< NBEdge * > &edges, double width, bool priority, int customTLIndex, int customTLIndex2, const PositionVector &customShape, bool selected, bool forward)
Constructor for creating/deleting an crossing.
void undo()
undo action
std::string redoName() const
get Redo name
GNEJunction * myJunctionParent
full information regarding the Junction in which GNECRossing is created
int myCustomTLIndex2
custom index of GNECrossing (reverse direction)
the function-object for an editing operation (abstract base)
Definition: GNEChange.h:56
A definition of a pedestrian crossing.
Definition: NBNode.h:135
A list of positions.