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.org/sumo
3 // Copyright (C) 2001-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // The Widget for modifying lane-to-lane connections
16 /****************************************************************************/
17 #ifndef GNEConnectorFrame_h
18 #define GNEConnectorFrame_h
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include "GNEFrame.h"
26 
27 // ===========================================================================
28 // class declarations
29 // ===========================================================================
30 class GNELane;
31 class GNEInternalLane;
32 
33 // ===========================================================================
34 // class definitions
35 // ===========================================================================
40 class GNEConnectorFrame : public GNEFrame {
42  FXDECLARE(GNEConnectorFrame)
43 
44 public:
49  GNEConnectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
50 
53 
60  void handleLaneClick(GNELane* lane, bool mayDefinitelyPass, bool allowConflict, bool toggle);
61 
65  long onCmdOK(FXObject*, FXSelector, void*);
66 
68  long onCmdCancel(FXObject*, FXSelector, void*);
69 
71  long onCmdSelectDeadEnds(FXObject*, FXSelector, void*);
72  long onCmdSelectDeadStarts(FXObject*, FXSelector, void*);
73  long onCmdSelectConflicts(FXObject*, FXSelector, void*);
74  long onCmdSelectPass(FXObject*, FXSelector, void*);
75  long onCmdClearSelectedConnections(FXObject*, FXSelector, void*);
76  long onCmdResetSelectedConnections(FXObject*, FXSelector, void*);
78 
79 protected:
82 
83 private:
84 
86  enum LaneStatus {
91  };
92 
94  FXGroupBox* myGroupBoxDescription;
95 
98 
101 
103  FXButton* myCancelButton;
104 
106  FXButton* mySaveButton;
107 
109  FXGroupBox* myGroupBoxOperations;
110 
113 
116 
119 
122 
125 
128 
130  FXGroupBox* myGroupBoxSelection;
131 
134 
137 
139  FXGroupBox* myGroupBoxLegend;
140 
142  FXLabel* mySourceLabel;
143 
145  FXLabel* myTargetLabel;
146 
149 
152 
154  FXLabel* myConflictLabel;
155 
158 
160  std::set<GNELane*> myPotentialTargets;
161 
164 
166  std::map<int, GNEInternalLane*> myInternalLanes;
167 
169  std::vector<NBEdge::Connection> myDeletedConnections;
170 
173 
176 
179 
182 
185 
186 private:
188  void updateDescription() const;
189 
191  void initTargets();
192 
194  void cleanup();
195 
197  void removeConnections(GNELane* lane);
198 
200  LaneStatus getLaneStatus(const std::vector<NBEdge::Connection>& connections, GNELane* targetLane);
201 
202 };
203 
204 
205 #endif
206 
207 /****************************************************************************/
208 
static RGBColor targetColor
color for the to-lane of a connection
FXButton * mySelectPassingButton
"Select Edges which may always pass"
long onCmdSelectDeadStarts(FXObject *, FXSelector, void *)
FXLabel * myHoldShiftLabel
Selection Hint.
long onCmdSelectPass(FXObject *, FXSelector, void *)
FXLabel * myHoldControlLabel
hold control label
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
FXGroupBox * myGroupBoxSelection
groupbox for selection hints
FXGroupBox * myGroupBoxModifications
GroupBox for Buttons.
std::set< GNELane * > myPotentialTargets
the set of lanes to which the current lane may be connected
long onCmdClearSelectedConnections(FXObject *, FXSelector, void *)
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:47
FXGroupBox * myGroupBoxLegend
group box for legend
FXGroupBox * myGroupBoxDescription
Groupbox for description.
FXLabel * myConflictLabel
conflict label
LaneStatus getLaneStatus(const std::vector< NBEdge::Connection > &connections, GNELane *targetLane)
return the status of toLane
static RGBColor potentialTargetColor
color for potential to-lane targets (currently unconnected)
void handleLaneClick(GNELane *lane, bool mayDefinitelyPass, bool allowConflict, bool toggle)
either sets the current lane or toggles the connection of the current lane to this lane (if they shar...
long onCmdSelectConflicts(FXObject *, FXSelector, void *)
int myNumChanges
number of changes
FXGroupBox * myGroupBoxOperations
groupbox for operations
void initTargets()
init targets
GNEConnectorFrame()
FOX needs this.
void removeConnections(GNELane *lane)
remove connections
FXButton * myResetSelectedButton
"Reset Selected"
static RGBColor sourceColor
color for the from-lane of a connection
FXLabel * myTargetLabel
target label
FXButton * mySelectDeadStartsButton
"Select Dead Starts" button
static RGBColor targetPassColor
color for the to-lane of a connection with pass attribute
FXLabel * myPossibleTargetLabel
possible target label
FXButton * mySelectConflictsButton
"Select Conflicts" button
std::vector< NBEdge::Connection > myDeletedConnections
vector of connections deleted in the current editing step
long onCmdOK(FXObject *, FXSelector, void *)
static RGBColor conflictColor
color for a to-lane that cannot be used because another connection conflicts
FXButton * mySaveButton
"OK" button
FXButton * myCancelButton
"Cancel" button
std::map< int, GNEInternalLane * > myInternalLanes
the internal lanes belonging the the current junction indexed by their tl-index
FXLabel * mySourceLabel
source label
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any connection modifications.
FXLabel * myLaneDescriptionLabel
the label that shows the current editing state
LaneStatus
the status of a target lane
long onCmdSelectDeadEnds(FXObject *, FXSelector, void *)
Called when the user presses the Corresponding-button.
GNELane * myCurrentLane
the lane of which connections are to be modified
~GNEConnectorFrame()
Destructor.
FXLabel * myTargetPassLabel
target pass label
FXButton * myClearSelectedButton
"Clear Selected"
void cleanup()
clean up when deselecting current lane
FXButton * mySelectDeadEndsButton
"Select Dead Ends" button
void updateDescription() const
update description
long onCmdResetSelectedConnections(FXObject *, FXSelector, void *)