Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEConnectorFrame.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-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/****************************************************************************/
18// The Widget for modifying lane-to-lane connections
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include <netbuild/NBEdge.h>
26
27// ===========================================================================
28// class definitions
29// ===========================================================================
30
32
33public:
34
35 // ===========================================================================
36 // class CurrentLane
37 // ===========================================================================
38
40
41 public:
43 CurrentLane(GNEConnectorFrame* connectorFrameParent);
44
47
49 void updateCurrentLaneLabel(const std::string& laneID);
50
51 private:
54 };
55
56 // ===========================================================================
57 // class ConnectionModifications
58 // ===========================================================================
59
63
64 public:
66 ConnectionModifications(GNEConnectorFrame* connectorFrameParent);
67
70
73
75 long onCmdSaveModifications(FXObject*, FXSelector, void*);
76
78 long onCmdCancelModifications(FXObject*, FXSelector, void*);
80
81 protected:
82 FOX_CONSTRUCTOR(ConnectionModifications)
83
84 private:
87
89 FXButton* myCancelButton;
90
92 FXButton* mySaveButton;
93
96 };
97
98 // ===========================================================================
99 // class ConnectionOperations
100 // ===========================================================================
101
105
106 public:
108 ConnectionOperations(GNEConnectorFrame* connectorFrameParent);
109
112
115
117 long onCmdSelectDeadEnds(FXObject*, FXSelector, void*);
118
120 long onCmdSelectDeadStarts(FXObject*, FXSelector, void*);
121
123 long onCmdSelectConflicts(FXObject*, FXSelector, void*);
124
126 long onCmdSelectPass(FXObject*, FXSelector, void*);
127
129 long onCmdClearSelectedConnections(FXObject*, FXSelector, void*);
130
132 long onCmdResetSelectedConnections(FXObject*, FXSelector, void*);
134
135 protected:
136 FOX_CONSTRUCTOR(ConnectionOperations)
137
138 private:
141
144
147
150
153
156
159 };
160
161 // ===========================================================================
162 // class ConnectionSelection
163 // ===========================================================================
164
166
167 public:
169 ConnectionSelection(GNEConnectorFrame* connectorFrameParent);
170
173 };
174
175 // ===========================================================================
176 // class Legend
177 // ===========================================================================
178
179 class Legend : public MFXGroupBoxModule {
180
181 public:
183 Legend(GNEConnectorFrame* connectorFrameParent);
184
186 ~Legend();
187
188 private:
189 };
190
195 GNEConnectorFrame(GNEViewParent* viewParent, GNEViewNet* viewNet);
196
199
204
207
208private:
210 enum class LaneStatus {
212 CONNECTED,
215 };
216
223 void buildConnection(GNELane* lane, const bool mayDefinitelyPass, const bool allowConflict, const bool toggle);
224
226 void initTargets();
227
229 void cleanup();
230
232 void removeConnections(GNELane* lane);
233
235 LaneStatus getLaneStatus(const std::vector<NBEdge::Connection>& connections, const GNELane* targetLane) const;
236
239
242
245
248
251
254
256 std::set<GNELane*> myPotentialTargets;
257
260
262 std::map<int, GNEInternalLane*> myInternalLanes;
263
265 std::vector<NBEdge::Connection> myDeletedConnections;
266};
long onCmdSaveModifications(FXObject *, FXSelector, void *)
Called when the user presses the OK-Button saves any connection modifications.
long onCmdCancelModifications(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any connection modifications.
FXCheckButton * myProtectRoutesCheckBox
protect routes checkbox
GNEConnectorFrame * myConnectorFrameParent
pointer to connectorFrame parent
FXButton * mySelectDeadStartsButton
"Select Dead Starts" button
GNEConnectorFrame * myConnectorFrameParent
pointer to connectorFrame parent
FXButton * mySelectConflictsButton
"Select Conflicts" button
long onCmdSelectDeadEnds(FXObject *, FXSelector, void *)
Called when the user presses the select dead ends button.
long onCmdResetSelectedConnections(FXObject *, FXSelector, void *)
Called when the user presses the reset selected connections button.
long onCmdSelectDeadStarts(FXObject *, FXSelector, void *)
Called when the user presses the select dead starts button.
long onCmdSelectPass(FXObject *, FXSelector, void *)
Called when the user presses the select pass button.
FXButton * mySelectDeadEndsButton
"Select Dead Ends" button
long onCmdClearSelectedConnections(FXObject *, FXSelector, void *)
Called when the user presses the clear selected connections button.
FXButton * myClearSelectedButton
"Clear Selected"
long onCmdSelectConflicts(FXObject *, FXSelector, void *)
Called when the user presses the select conflicts button.
FXButton * myResetSelectedButton
"Reset Selected"
FXButton * mySelectPassingButton
"Select Edges which may always pass"
FXLabel * myCurrentLaneLabel
Label for current Lane.
void updateCurrentLaneLabel(const std::string &laneID)
set current junction label
int myNumChanges
number of changes
std::vector< NBEdge::Connection > myDeletedConnections
vector of connections deleted in the current editing step
void cleanup()
clean up when deselecting current lane
void initTargets()
init targets
ConnectionModifications * getConnectionModifications() const
get pointer to ConnectionModifications module
GNEConnectorFrame::ConnectionOperations * myConnectionOperations
ConnectionOperations module.
GNEConnectorFrame::Legend * myLegend
Legend module.
void buildConnection(GNELane *lane, const bool mayDefinitelyPass, const bool allowConflict, const bool toggle)
either sets the current lane or toggles the connection of the current lane to this lane (if they shar...
~GNEConnectorFrame()
Destructor.
void removeConnections(GNELane *lane)
remove connections
std::map< int, GNEInternalLane * > myInternalLanes
the internal lanes belonging the current junction indexed by their tl-index
std::set< GNELane * > myPotentialTargets
the set of lanes to which the current lane may be connected
LaneStatus getLaneStatus(const std::vector< NBEdge::Connection > &connections, const GNELane *targetLane) const
return the status of toLane
GNEConnectorFrame::ConnectionModifications * myConnectionModifications
ConnectionModifications module.
void handleLaneClick(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
either sets the current lane or toggles the connection of the
GNELane * myCurrentEditedLane
the lane of which connections are to be modified
LaneStatus
the status of a target lane
GNEConnectorFrame::ConnectionSelection * myConnectionSelection
ConnectionSelection module.
CurrentLane * myCurrentLane
CurrentLane module.
class used to group all variables related with objects under cursor after a click over view
A single child window which contains a view of the simulation area.
MFXGroupBoxModule (based on FXGroupBox)