SUMO - Simulation of Urban MObility
GNEConnectorFrame.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // The Widget for modifying lane-to-lane connections
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef GNEConnectorFrame_h
21 #define GNEConnectorFrame_h
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include "GNEFrame.h"
33 
34 // ===========================================================================
35 // class declarations
36 // ===========================================================================
37 class GNELane;
38 class GNEInternalLane;
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
47 class GNEConnectorFrame : public GNEFrame {
49  FXDECLARE(GNEConnectorFrame)
50 
51 public:
56  GNEConnectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
57 
60 
67  void handleLaneClick(GNELane* lane, bool mayDefinitelyPass, bool allowConflict, bool toggle);
68 
72  long onCmdOK(FXObject*, FXSelector, void*);
73 
75  long onCmdCancel(FXObject*, FXSelector, void*);
76 
78  long onCmdSelectDeadEnds(FXObject*, FXSelector, void*);
79  long onCmdSelectDeadStarts(FXObject*, FXSelector, void*);
80  long onCmdSelectConflicts(FXObject*, FXSelector, void*);
81  long onCmdSelectPass(FXObject*, FXSelector, void*);
82  long onCmdClearSelectedConnections(FXObject*, FXSelector, void*);
83  long onCmdResetSelectedConnections(FXObject*, FXSelector, void*);
85 
86 protected:
89 
90 private:
91 
93  enum LaneStatus {
98  };
99 
102 
105 
108 
110  FXButton* myCancelButton;
111 
113  FXButton* mySaveButton;
114 
116  FXGroupBox* myGroupBoxOperations;
117 
120 
123 
126 
129 
132 
135 
137  FXGroupBox* myGroupBoxSelection;
138 
141 
144 
146  FXGroupBox* myGroupBoxLegend;
147 
149  FXLabel* mySourceLabel;
150 
152  FXLabel* myTargetLabel;
153 
156 
159 
161  FXLabel* myConflictLabel;
162 
165 
167  std::set<GNELane*> myPotentialTargets;
168 
171 
173  std::map<int, GNEInternalLane*> myInternalLanes;
174 
177 
180 
183 
186 
189 
190 private:
192  void updateDescription() const;
193 
195  void initTargets();
196 
198  void cleanup();
199 
201  void removeConnections(GNELane* lane);
202 
204  LaneStatus getLaneStatus(const std::vector<NBEdge::Connection>& connections, GNELane* targetLane);
205 
206 };
207 
208 
209 #endif
210 
211 /****************************************************************************/
212 
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:54
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 *)