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-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 add Crossing elements
18 /****************************************************************************/
19 #ifndef GNECrossingFrame_h
20 #define GNECrossingFrame_h
21 
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 GNENetElement;
38 class GNECrossing;
39 class GNEJunction;
40 class GNEEdge;
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
49 class GNECrossingFrame : public GNEFrame {
51  FXDECLARE(GNECrossingFrame)
52 
53 public:
54 
55  // ===========================================================================
56  // class edgesSelector
57  // ===========================================================================
58 
59  class edgesSelector : public FXGroupBox {
62 
63  public:
65  edgesSelector(FXComposite* parent, GNECrossingFrame* crossingFrameParent);
66 
69 
72 
74  void enableEdgeSelector(GNEJunction* currentJunction);
75 
77  void disableEdgeSelector();
78 
80  void restoreEdgeColors();
81 
83  const RGBColor& getCandidateColor() const;
84 
86  const RGBColor& getSelectedColor() const;
87 
91  long onCmdUseSelectedEdges(FXObject*, FXSelector, void*);
92 
94  long onCmdClearSelection(FXObject*, FXSelector, void*);
95 
97  long onCmdInvertSelection(FXObject*, FXSelector, void*);
98 
100  long onCmdHelp(FXObject*, FXSelector, void*);
102 
103  protected:
106 
107  private:
110 
113 
115  FXButton* helpEdges;
116 
119 
122 
125  };
126 
127  // ===========================================================================
128  // class crossingParameters
129  // ===========================================================================
130 
131  class crossingParameters : public FXGroupBox {
134 
135  public:
138 
141 
143  void enableCrossingParameters();
144 
146  void disableCrossingParameters();
147 
149  bool isCrossingParametersEnabled() const;
150 
152  void markEdge(GNEEdge* edge);
153 
155  void clearEdges();
156 
158  void invertEdges(GNEJunction* parentJunction);
159 
161  void useSelectedEdges(GNEJunction* parentJunction);
162 
164  std::vector<NBEdge*> getCrossingEdges() const;
165 
167  bool getCrossingPriority() const;
168 
170  double getCrossingWidth() const;
171 
173  const RGBColor& getCandidateColor() const;
174 
176  const RGBColor& getSelectedColor() const;
177 
179  bool isCurrentParametersValid() const;
180 
184  long onCmdSetAttribute(FXObject*, FXSelector, void*);
185 
187  long onCmdHelp(FXObject*, FXSelector, void*);
189 
190  protected:
193 
194  private:
197 
200 
202  std::vector<GNEEdge*> myCurrentSelectedEdges;
203 
206 
208  FXTextField* myCrossingEdges;
209 
212 
215 
218 
220  FXTextField* myCrossingWidth;
221 
224 
227 
230 
233  };
234 
235 
240  GNECrossingFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
241 
244 
246  void hide();
247 
252  bool addCrossing(GNENetElement* netElement);
253 
257  void removeCrossing(GNECrossing* Crossing);
258 
260  void setCreateCrossingButton(bool value);
261 
265  long onCmdCreateCrossing(FXObject*, FXSelector, void*);
267 
269  static std::string getIdsSelected(const FXList* list);
270 
273 
276 
277 protected:
280 
281 private:
284 
287 
289  FXGroupBox* myGroupBoxLabel;
290 
293 
295  FXGroupBox* myGroupBoxButtons;
296 
299 
301  FXGroupBox* myGroupBoxLegend;
302 
305 
308 };
309 
310 
311 #endif
312 
313 /****************************************************************************/
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
long onCmdHelp(FXObject *, FXSelector, void *)
called when help button is pressed
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:51
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.
GNECrossingFrame::edgesSelector * myEdgeSelector
pointer to edge selector
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:56
FXButton * helpEdges
button for help
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 *)