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-2026 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 ConnectionVisualization
163 // ===========================================================================
164
168
169 public:
171 ConnectionVisualization(GNEConnectorFrame* connectorFrameParent);
172
175
178
180 bool showConnections() const;
181
183 bool showOnlyFromConnections() const;
184
186 bool inspectConnections() const;
187
190
192 long onCmdToggleVisibleInInspectMode(FXObject* obj, FXSelector sel, void* ptr);
193
195 long onCmdToggleHideOtherSources(FXObject*, FXSelector, void*);
196
198 long onCmdToggleInspectConnections(FXObject*, FXSelector, void*);
200
201 protected:
202 FOX_CONSTRUCTOR(ConnectionVisualization)
203
204 private:
207
210
213
216 };
217
218 // ===========================================================================
219 // class ConnectionSelection
220 // ===========================================================================
221
223
224 public:
226 ConnectionSelection(GNEConnectorFrame* connectorFrameParent);
227
230 };
231
232 // ===========================================================================
233 // class Legend
234 // ===========================================================================
235
236 class Legend : public GNEGroupBoxModule {
237
238 public:
240 Legend(GNEConnectorFrame* connectorFrameParent);
241
243 ~Legend();
244
245 private:
246 };
247
252 GNEConnectorFrame(GNEViewParent* viewParent, GNEViewNet* viewNet);
253
256
260 void show();
261
266
269
272
275
276private:
278 enum class LaneStatus {
280 CONNECTED,
283 };
284
291 void buildConnection(GNELane* lane, const bool mayDefinitelyPass, const bool allowConflict, const bool toggle);
292
294 void initTargets();
295
297 void cleanup();
298
300 void removeConnections(GNELane* lane);
301
303 LaneStatus getLaneStatus(const std::vector<NBEdge::Connection>& connections, const GNELane* targetLane) const;
304
307
310
313
316
319
322
325
327 std::set<GNELane*> myPotentialTargets;
328
331
333 std::map<int, GNEInternalLane*> myInternalLanes;
334
336 std::vector<NBEdge::Connection> myDeletedConnections;
337};
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"
void updateShowConnections()
update show connections
long onCmdToggleInspectConnections(FXObject *, FXSelector, void *)
Called when the user toggles the inspect connections checkbox.
bool inspectConnections() const
check if inspect connections
long onCmdToggleHideOtherSources(FXObject *, FXSelector, void *)
Called when the user toggles the show only from checkbox.
FXCheckButton * myToggleInspectConnectionsCheckbutton
"Inspect connections" check button
bool showConnections() const
check if show connections
FXCheckButton * myToggleVisibleInInspectMode
"Visible in inspet mode" check button
GNEConnectorFrame * myConnectorFrameParent
pointer to connectorFrame parent
FXCheckButton * myToggleHideOtherSources
"Hide other sources" check button
long onCmdToggleVisibleInInspectMode(FXObject *obj, FXSelector sel, void *ptr)
Called when the user toggles the show always connection checkbox.
bool showOnlyFromConnections() const
check if show only from connections
FXLabel * myCurrentLaneLabel
Label for current Lane.
void updateCurrentLaneLabel(const std::string &laneID)
set current junction label
int myNumChanges
number of changes
GNELane * getCurrentEditedLane() const
get the lane of which connections are to be modified
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
ConnectionVisualization * getConnectionVisualization()
get pointer to ConnectionVisualization module
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
GNEConnectorFrame::ConnectionVisualization * myConnectionVisualization
ConnectionVisualization module.
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
void show()
show Frame
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.
GNEGroupBoxModule (based on FXGroupBox)
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.