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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // The Widget for modifying lane-to-lane connections
18 /****************************************************************************/
19 #ifndef GNEConnectorFrame_h
20 #define GNEConnectorFrame_h
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #ifdef _MSC_VER
26 #include <windows_config.h>
27 #else
28 #include <config.h>
29 #endif
30 
31 #include "GNEFrame.h"
32 
33 // ===========================================================================
34 // class declarations
35 // ===========================================================================
36 class GNELane;
37 class GNEInternalLane;
38 
39 // ===========================================================================
40 // class definitions
41 // ===========================================================================
46 class GNEConnectorFrame : public GNEFrame {
48  FXDECLARE(GNEConnectorFrame)
49 
50 public:
55  GNEConnectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
56 
59 
66  void handleLaneClick(GNELane* lane, bool mayDefinitelyPass, bool allowConflict, bool toggle);
67 
71  long onCmdOK(FXObject*, FXSelector, void*);
72 
74  long onCmdCancel(FXObject*, FXSelector, void*);
75 
77  long onCmdSelectDeadEnds(FXObject*, FXSelector, void*);
78  long onCmdSelectDeadStarts(FXObject*, FXSelector, void*);
79  long onCmdSelectConflicts(FXObject*, FXSelector, void*);
80  long onCmdSelectPass(FXObject*, FXSelector, void*);
81  long onCmdClearSelectedConnections(FXObject*, FXSelector, void*);
82  long onCmdResetSelectedConnections(FXObject*, FXSelector, void*);
84 
85 protected:
88 
89 private:
90 
92  enum LaneStatus {
97  };
98 
101 
104 
107 
109  FXButton* myCancelButton;
110 
112  FXButton* mySaveButton;
113 
115  FXGroupBox* myGroupBoxOperations;
116 
119 
122 
125 
128 
131 
134 
136  FXGroupBox* myGroupBoxSelection;
137 
140 
143 
145  FXGroupBox* myGroupBoxLegend;
146 
148  FXLabel* mySourceLabel;
149 
151  FXLabel* myTargetLabel;
152 
155 
158 
160  FXLabel* myConflictLabel;
161 
164 
166  std::set<GNELane*> myPotentialTargets;
167 
170 
172  std::map<int, GNEInternalLane*> myInternalLanes;
173 
176 
179 
182 
185 
188 
189 private:
191  void updateDescription() const;
192 
194  void initTargets();
195 
197  void cleanup();
198 
200  void removeConnections(GNELane* lane);
201 
203  LaneStatus getLaneStatus(const std::vector<NBEdge::Connection>& connections, GNELane* targetLane);
204 
205 };
206 
207 
208 #endif
209 
210 /****************************************************************************/
211 
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:53
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
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 *)