SUMO - Simulation of Urban MObility
GNECrossingFrame.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 add Crossing elements
16 /****************************************************************************/
17 #ifndef GNECrossingFrame_h
18 #define GNECrossingFrame_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include "GNEFrame.h"
25 
26 // ===========================================================================
27 // class definitions
28 // ===========================================================================
33 class GNECrossingFrame : public GNEFrame {
34 
35 public:
36 
37  // ===========================================================================
38  // class CurrentJunction
39  // ===========================================================================
40 
41  class CurrentJunction : protected FXGroupBox {
42 
43  public:
45  CurrentJunction(GNECrossingFrame* crossingFrameParent);
46 
49 
51  void updateCurrentJunctionLabel(const std::string &junctionID);
52 
53  private:
56 
57  };
58 
59  // ===========================================================================
60  // class EdgesSelector
61  // ===========================================================================
62 
63  class EdgesSelector : protected FXGroupBox {
66 
67  public:
69  EdgesSelector(GNECrossingFrame* crossingFrameParent);
70 
72  ~EdgesSelector();
73 
75  GNEJunction* getCurrentJunction() const;
76 
78  void enableEdgeSelector(GNEJunction* currentJunction);
79 
81  void disableEdgeSelector();
82 
84  void restoreEdgeColors();
85 
89  long onCmdUseSelectedEdges(FXObject*, FXSelector, void*);
90 
92  long onCmdClearSelection(FXObject*, FXSelector, void*);
93 
95  long onCmdInvertSelection(FXObject*, FXSelector, void*);
97 
98  protected:
101 
102  private:
105 
108 
111 
114 
117  };
118 
119  // ===========================================================================
120  // class CrossingParameters
121  // ===========================================================================
122 
123  class CrossingParameters : protected FXGroupBox {
126 
127  public:
129  CrossingParameters(GNECrossingFrame* crossingFrameParent);
130 
133 
135  void enableCrossingParameters(bool hasTLS);
136 
138  void disableCrossingParameters();
139 
141  bool isCrossingParametersEnabled() const;
142 
144  void markEdge(GNEEdge* edge);
145 
147  void clearEdges();
148 
150  void invertEdges(GNEJunction* parentJunction);
151 
153  void useSelectedEdges(GNEJunction* parentJunction);
154 
156  std::vector<NBEdge*> getCrossingEdges() const;
157 
159  bool getCrossingPriority() const;
160 
162  double getCrossingWidth() const;
163 
165  bool isCurrentParametersValid() const;
166 
170  long onCmdSetAttribute(FXObject*, FXSelector, void*);
171 
173  long onCmdHelp(FXObject*, FXSelector, void*);
175 
176  protected:
179 
180  private:
183 
185  std::vector<GNEEdge*> myCurrentSelectedEdges;
186 
189 
191  FXTextField* myCrossingEdges;
192 
195 
198 
201 
203  FXTextField* myCrossingWidth;
204 
207 
210  };
211 
212  // ===========================================================================
213  // class CreateCrossing
214  // ===========================================================================
215 
216  class CreateCrossing : protected FXGroupBox {
219 
220  public:
222  CreateCrossing(GNECrossingFrame* crossingFrameParent);
223 
225  ~CreateCrossing();
226 
228  void setCreateCrossingButton(bool value);
229 
233  long onCmdCreateCrossing(FXObject*, FXSelector, void*);
235 
236  protected:
239 
240  private:
243 
246  };
247 
252  GNECrossingFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
253 
256 
258  void hide();
259 
263  void addCrossing(const GNEViewNet::ObjectsUnderCursor &objectsUnderCursor);
264 
266  void createCrossingHotkey();
267 
268 protected:
271 
272 private:
275 
278 
281 
284 };
285 
286 
287 #endif
288 
289 /****************************************************************************/
FXLabel * myCrossingPriorityLabel
Label for Priority.
GNECrossingFrame * myCrossingFrameParent
pointer to GNECrossingFrame parent
GNECrossingFrame::CurrentJunction * myCurrentJunction
current junction modul
FXLabel * myCurrentJunctionLabel
Label for current Junction.
FXLabel * myCrossingWidthLabel
Label for width.
GNECrossingFrame * myCrossingFrameParent
pointer to GNECrossingFrame parent
FXButton * myCreateCrossingButton
FXButton for create Crossing
void updateCurrentJunctionLabel(const std::string &junctionID)
set current junction label
FXButton * myHelpCrossingAttribute
button for help
GNEJunction * myCurrentJunction
current Junction
void hide()
hide crossing frame
GNECrossingFrame::EdgesSelector * myEdgeSelector
edge selector modul
FXTextField * myCrossingEdges
TextField for edges.
FXButton * myInvertEdgesSelection
button for invert selection
FXButton * myClearEdgesSelection
button for clear selection
FXButton * myUseSelectedEdges
CheckBox for selected edges.
FXTextField * myCrossingWidth
TextField for width.
void createCrossingHotkey()
create crossing (used when user press ENTER key in Crossing mode)
FXLabel * myCrossingEdgesLabel
Label for edges.
~GNECrossingFrame()
Destructor.
GNECrossingFrame::CrossingParameters * myCrossingParameters
crossing parameters modul
GNECrossingFrame::CreateCrossing * myCreateCrossing
create crossing modul
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:50
FXCheckButton * myCrossingPriorityCheckButton
CheckBox for Priority.
CurrentJunction(GNECrossingFrame *crossingFrameParent)
constructor
GNECrossingFrame * myCrossingFrameParent
pointer to crossingFrame parent
GNECrossingFrame()
FOX needs this.
bool myCurrentParametersValid
flag to check if current parameters are valid
std::vector< GNEEdge * > myCurrentSelectedEdges
current selected edges
void addCrossing(const GNEViewNet::ObjectsUnderCursor &objectsUnderCursor)
add Crossing element