Eclipse SUMO - Simulation of Urban MObility
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-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 // The Widget for modifying lane-to-lane connections
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
22 
23 #include <config.h>
24 #include <netbuild/NBEdge.h>
26 
27 
28 // ===========================================================================
29 // class definitions
30 // ===========================================================================
35 class GNEConnectorFrame : public GNEFrame {
36 
37 public:
38 
39  // ===========================================================================
40  // class CurrentLane
41  // ===========================================================================
42 
43  class CurrentLane : public MFXGroupBoxModule {
44 
45  public:
47  CurrentLane(GNEConnectorFrame* connectorFrameParent);
48 
50  ~CurrentLane();
51 
53  void updateCurrentLaneLabel(const std::string& laneID);
54 
55  private:
58  };
59 
60  // ===========================================================================
61  // class ConnectionModifications
62  // ===========================================================================
63 
67 
68  public:
70  ConnectionModifications(GNEConnectorFrame* connectorFrameParent);
71 
74 
77 
79  long onCmdSaveModifications(FXObject*, FXSelector, void*);
80 
82  long onCmdCancelModifications(FXObject*, FXSelector, void*);
84 
85  protected:
86  FOX_CONSTRUCTOR(ConnectionModifications)
87 
88  private:
91 
93  FXButton* myCancelButton;
94 
96  FXButton* mySaveButton;
97 
99  FXCheckButton* myProtectRoutesCheckBox;
100  };
101 
102  // ===========================================================================
103  // class ConnectionOperations
104  // ===========================================================================
105 
109 
110  public:
112  ConnectionOperations(GNEConnectorFrame* connectorFrameParent);
113 
116 
119 
121  long onCmdSelectDeadEnds(FXObject*, FXSelector, void*);
122 
124  long onCmdSelectDeadStarts(FXObject*, FXSelector, void*);
125 
127  long onCmdSelectConflicts(FXObject*, FXSelector, void*);
128 
130  long onCmdSelectPass(FXObject*, FXSelector, void*);
131 
133  long onCmdClearSelectedConnections(FXObject*, FXSelector, void*);
134 
136  long onCmdResetSelectedConnections(FXObject*, FXSelector, void*);
138 
139  protected:
140  FOX_CONSTRUCTOR(ConnectionOperations)
141 
142  private:
145 
148 
151 
154 
157 
160 
163  };
164 
165  // ===========================================================================
166  // class ConnectionSelection
167  // ===========================================================================
168 
170 
171  public:
173  ConnectionSelection(GNEConnectorFrame* connectorFrameParent);
174 
177  };
178 
179  // ===========================================================================
180  // class Legend
181  // ===========================================================================
182 
183  class Legend : public MFXGroupBoxModule {
184 
185  public:
187  Legend(GNEConnectorFrame* connectorFrameParent);
188 
190  ~Legend();
191 
192  private:
193  };
194 
199  GNEConnectorFrame(GNEViewParent* viewParent, GNEViewNet* viewNet);
200 
203 
208 
211 
212 private:
214  enum class LaneStatus {
215  UNCONNECTED,
216  CONNECTED,
218  CONFLICTED
219  };
220 
227  void buildConnection(GNELane* lane, const bool mayDefinitelyPass, const bool allowConflict, const bool toggle);
228 
230  void initTargets();
231 
233  void cleanup();
234 
236  void removeConnections(GNELane* lane);
237 
239  LaneStatus getLaneStatus(const std::vector<NBEdge::Connection>& connections, const GNELane* targetLane) const;
240 
243 
246 
249 
252 
255 
258 
260  std::set<GNELane*> myPotentialTargets;
261 
264 
266  std::map<int, GNEInternalLane*> myInternalLanes;
267 
269  std::vector<NBEdge::Connection> myDeletedConnections;
270 };
long onCmdSaveModifications(FXObject *, FXSelector, void *)
Called when the user presses the OK-Button saves any connection modifications.
ConnectionModifications(GNEConnectorFrame *connectorFrameParent)
FOX-declaration.
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.
ConnectionOperations(GNEConnectorFrame *connectorFrameParent)
FOX-declaration.
FXButton * myResetSelectedButton
"Reset Selected"
FXButton * mySelectPassingButton
"Select Edges which may always pass"
ConnectionSelection(GNEConnectorFrame *connectorFrameParent)
constructor
FXLabel * myCurrentLaneLabel
Label for current Lane.
void updateCurrentLaneLabel(const std::string &laneID)
set current junction label
CurrentLane(GNEConnectorFrame *connectorFrameParent)
constructor
Legend(GNEConnectorFrame *connectorFrameParent)
constructor
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
GNEConnectorFrame(GNEViewParent *viewParent, GNEViewNet *viewNet)
Constructor.
ConnectionModifications * getConnectionModifications() const
get pointer to ConnectionModifications modul
GNEConnectorFrame::ConnectionOperations * myConnectionOperations
ConnectionOperations modul.
GNEConnectorFrame::Legend * myLegend
Legend modul.
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 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 modul.
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 modul.
CurrentLane * myCurrentLane
CurrentLane modul.
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.
Definition: GNEViewParent.h:88
MFXGroupBoxModule (based on FXGroupBox)