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 <config.h>
25 
26 #include "GNEFrame.h"
27 
28 // ===========================================================================
29 // class declarations
30 // ===========================================================================
31 class GNENetElement;
32 class GNECrossing;
33 class GNEJunction;
34 class GNEEdge;
35 
36 // ===========================================================================
37 // class definitions
38 // ===========================================================================
43 class GNECrossingFrame : public GNEFrame {
45  FXDECLARE(GNECrossingFrame)
46 
47 public:
48 
49  // ===========================================================================
50  // class edgesSelector
51  // ===========================================================================
52 
53  class edgesSelector : public FXGroupBox {
56 
57  public:
59  edgesSelector(GNECrossingFrame* crossingFrameParent);
60 
63 
66 
68  void enableEdgeSelector(GNEJunction* currentJunction);
69 
71  void disableEdgeSelector();
72 
74  void restoreEdgeColors();
75 
77  const RGBColor& getCandidateColor() const;
78 
80  const RGBColor& getSelectedColor() const;
81 
85  long onCmdUseSelectedEdges(FXObject*, FXSelector, void*);
86 
88  long onCmdClearSelection(FXObject*, FXSelector, void*);
89 
91  long onCmdInvertSelection(FXObject*, FXSelector, void*);
93 
94  protected:
97 
98  private:
101 
104 
107 
110 
113  };
114 
115  // ===========================================================================
116  // class crossingParameters
117  // ===========================================================================
118 
119  class crossingParameters : public FXGroupBox {
122 
123  public:
125  crossingParameters(GNECrossingFrame* crossingFrameParent);
126 
129 
131  void enableCrossingParameters(bool hasTLS);
132 
134  void disableCrossingParameters();
135 
137  bool isCrossingParametersEnabled() const;
138 
140  void markEdge(GNEEdge* edge);
141 
143  void clearEdges();
144 
146  void invertEdges(GNEJunction* parentJunction);
147 
149  void useSelectedEdges(GNEJunction* parentJunction);
150 
152  std::vector<NBEdge*> getCrossingEdges() const;
153 
155  bool getCrossingPriority() const;
156 
158  double getCrossingWidth() const;
159 
161  const RGBColor& getCandidateColor() const;
162 
164  const RGBColor& getSelectedColor() const;
165 
167  bool isCurrentParametersValid() const;
168 
172  long onCmdSetAttribute(FXObject*, FXSelector, void*);
173 
175  long onCmdHelp(FXObject*, FXSelector, void*);
177 
178  protected:
181 
182  private:
185 
187  std::vector<GNEEdge*> myCurrentSelectedEdges;
188 
191 
193  FXTextField* myCrossingEdges;
194 
197 
200 
203 
205  FXTextField* myCrossingWidth;
206 
209 
212 
215 
218  };
219 
220 
225  GNECrossingFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
226 
229 
231  void hide();
232 
237  bool addCrossing(GNENetElement* netElement);
238 
242  void removeCrossing(GNECrossing* Crossing);
243 
245  void setCreateCrossingButton(bool value);
246 
250  long onCmdCreateCrossing(FXObject*, FXSelector, void*);
252 
254  static std::string getIdsSelected(const FXList* list);
255 
258 
261 
262 protected:
265 
266 private:
269 
272 
274  FXGroupBox* myGroupBoxLabel;
275 
278 
280  FXGroupBox* myGroupBoxButtons;
281 
284 
286  FXGroupBox* myGroupBoxLegend;
287 
290 
293 };
294 
295 
296 #endif
297 
298 /****************************************************************************/
void setCreateCrossingButton(bool value)
enable or disable button create edges
long onCmdClearSelection(FXObject *, FXSelector, void *)
called when clear selection button is pressed
FXGroupBox * myGroupBoxLegend
groupbox for Legend
FXGroupBox * myGroupBoxButtons
groupbox for buttons
FXLabel * myCurrentJunctionLabel
Label for current Junction.
FXLabel * myColorCandidateLabel
Label for color candidate.
FXLabel * myCrossingWidthLabel
Label for width.
void disableEdgeSelector()
disable edgeSelector
bool myCurrentParametersValid
flag to check if current parameters are valid
long onCmdInvertSelection(FXObject *, FXSelector, void *)
called when invert selection button is pressed
GNECrossingFrame::crossingParameters * myCrossingParameters
crossing parameters
GNECrossingFrame * myCrossingFrameParent
pointer to GNECrossingFrame parent
void removeCrossing(GNECrossing *Crossing)
remove an Crossing element previously added
void restoreEdgeColors()
restore colors of all edges
GNEJunction * getCurrentJunction() const
get current junction
const RGBColor & getSelectedColor() const
return selected color
FXButton * myInvertEdgesSelection
button for invert selection
GNECrossingFrame::crossingParameters * getCrossingParameters() const
get Crossing parameters
FXGroupBox * myGroupBoxLabel
groupbox for the junction label
void hide()
hide crossing frame
void enableEdgeSelector(GNEJunction *currentJunction)
enable edgeSelector
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition: GNECrossing.h:45
FXLabel * myCrossingPriorityLabel
Label for Priority.
FXCheckButton * myCrossingPriorityCheckButton
CheckBox for Priority.
GNEJunction * myCurrentJunction
current Junction
static RGBColor myCandidateColor
color for candidate edges
bool addCrossing(GNENetElement *netElement)
add Crossing element
static RGBColor mySelectedColor
color for selected edges
GNECrossingFrame::edgesSelector * myEdgeSelector
edge selector
~GNECrossingFrame()
Destructor.
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:50
GNECrossingFrame::edgesSelector * getEdgeSelector() const
get edge selector
FXTextField * myCrossingEdges
TextField for edges.
long onCmdCreateCrossing(FXObject *, FXSelector, void *)
FXLabel * myCrossingEdgesLabel
Label for edges.
GNECrossingFrame * myCrossingFrameParent
pointer to GNECrossingFrame parent
FXTextField * myCrossingWidth
TextField for width.
GNECrossingFrame()
FOX needs this.
FXButton * myUseSelectedEdges
CheckBox for selected edges.
static std::string getIdsSelected(const FXList *list)
get list of selecte id&#39;s in string format
FXLabel * myColorSelectedLabel
Label for color selected.
std::vector< GNEEdge * > myCurrentSelectedEdges
current selected edges
FXButton * myHelpCrossingAttribute
button for help
const RGBColor & getCandidateColor() const
return candidate color
FXButton * myCreateCrossingButton
FXButton for create Crossing
FXButton * myClearEdgesSelection
button for clear selection
long onCmdUseSelectedEdges(FXObject *, FXSelector, void *)