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>
25
26// ===========================================================================
27// class definitions
28// ===========================================================================
34
35public:
36
37 // ===========================================================================
38 // class CurrentLane
39 // ===========================================================================
40
42
43 public:
45 CurrentLane(GNEConnectorFrame* connectorFrameParent);
46
49
51 void updateCurrentLaneLabel(const std::string& laneID);
52
53 private:
56 };
57
58 // ===========================================================================
59 // class ConnectionModifications
60 // ===========================================================================
61
65
66 public:
68 ConnectionModifications(GNEConnectorFrame* connectorFrameParent);
69
72
75
77 long onCmdSaveModifications(FXObject*, FXSelector, void*);
78
80 long onCmdCancelModifications(FXObject*, FXSelector, void*);
82
83 protected:
84 FOX_CONSTRUCTOR(ConnectionModifications)
85
86 private:
89
91 FXButton* myCancelButton;
92
94 FXButton* mySaveButton;
95
98 };
99
100 // ===========================================================================
101 // class ConnectionOperations
102 // ===========================================================================
103
107
108 public:
110 ConnectionOperations(GNEConnectorFrame* connectorFrameParent);
111
114
117
119 long onCmdSelectDeadEnds(FXObject*, FXSelector, void*);
120
122 long onCmdSelectDeadStarts(FXObject*, FXSelector, void*);
123
125 long onCmdSelectConflicts(FXObject*, FXSelector, void*);
126
128 long onCmdSelectPass(FXObject*, FXSelector, void*);
129
131 long onCmdClearSelectedConnections(FXObject*, FXSelector, void*);
132
134 long onCmdResetSelectedConnections(FXObject*, FXSelector, void*);
136
137 protected:
138 FOX_CONSTRUCTOR(ConnectionOperations)
139
140 private:
143
146
149
152
155
158
161 };
162
163 // ===========================================================================
164 // class ConnectionSelection
165 // ===========================================================================
166
168
169 public:
171 ConnectionSelection(GNEConnectorFrame* connectorFrameParent);
172
175 };
176
177 // ===========================================================================
178 // class Legend
179 // ===========================================================================
180
181 class Legend : public MFXGroupBoxModule {
182
183 public:
185 Legend(GNEConnectorFrame* connectorFrameParent);
186
188 ~Legend();
189
190 private:
191 };
192
197 GNEConnectorFrame(GNEViewParent* viewParent, GNEViewNet* viewNet);
198
201
206
209
210private:
212 enum class LaneStatus {
214 CONNECTED,
217 };
218
225 void buildConnection(GNELane* lane, const bool mayDefinitelyPass, const bool allowConflict, const bool toggle);
226
228 void initTargets();
229
231 void cleanup();
232
234 void removeConnections(GNELane* lane);
235
237 LaneStatus getLaneStatus(const std::vector<NBEdge::Connection>& connections, const GNELane* targetLane) const;
238
241
244
247
250
253
256
258 std::set<GNELane*> myPotentialTargets;
259
262
264 std::map<int, GNEInternalLane*> myInternalLanes;
265
267 std::vector<NBEdge::Connection> myDeletedConnections;
268};
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.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition GNELane.h:46
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)