SUMO - Simulation of Urban MObility
GNECrossingFrame.h
Go to the documentation of this file.
1 /****************************************************************************/
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
10 // Copyright (C) 2001-2013 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 GNECrossingFrame_h
21 #define GNECrossingFrame_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include "GNEFrame.h"
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
38 class GNENetElement;
39 class GNECrossing;
40 class GNEJunction;
41 class GNEEdge;
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
50 class GNECrossingFrame : public GNEFrame {
52  FXDECLARE(GNECrossingFrame)
53 
54 public:
55 
56  // ===========================================================================
57  // class edgesSelector
58  // ===========================================================================
59 
60  class edgesSelector : public FXGroupBox {
63 
64  public:
66  edgesSelector(FXComposite* parent, GNECrossingFrame* crossingFrameParent);
67 
70 
73 
75  void enableEdgeSelector(GNEJunction* currentJunction);
76 
78  void disableEdgeSelector();
79 
81  void restoreEdgeColors();
82 
84  const RGBColor& getCandidateColor() const;
85 
87  const RGBColor& getSelectedColor() const;
88 
92  long onCmdUseSelectedEdges(FXObject*, FXSelector, void*);
93 
95  long onCmdClearSelection(FXObject*, FXSelector, void*);
96 
98  long onCmdInvertSelection(FXObject*, FXSelector, void*);
99 
101  long onCmdHelp(FXObject*, FXSelector, void*);
103 
104  protected:
107 
108  private:
111 
114 
116  FXButton* helpEdges;
117 
120 
123 
126  };
127 
128  // ===========================================================================
129  // class crossingParameters
130  // ===========================================================================
131 
132  class crossingParameters : public FXGroupBox {
135 
136  public:
139 
142 
144  void enableCrossingParameters();
145 
147  void disableCrossingParameters();
148 
150  bool isCrossingParametersEnabled() const;
151 
153  void markEdge(GNEEdge* edge);
154 
156  void clearEdges();
157 
159  void invertEdges(GNEJunction* parentJunction);
160 
162  void useSelectedEdges(GNEJunction* parentJunction);
163 
165  std::vector<NBEdge*> getCrossingEdges() const;
166 
168  bool getCrossingPriority() const;
169 
171  double getCrossingWidth() const;
172 
174  const RGBColor& getCandidateColor() const;
175 
177  const RGBColor& getSelectedColor() const;
178 
180  bool isCurrentParametersValid() const;
181 
185  long onCmdSetAttribute(FXObject*, FXSelector, void*);
186 
188  long onCmdHelp(FXObject*, FXSelector, void*);
190 
191  protected:
194 
195  private:
198 
201 
203  std::vector<GNEEdge*> myCurrentSelectedEdges;
204 
207 
209  FXTextField* myCrossingEdges;
210 
213 
216 
219 
221  FXTextField* myCrossingWidth;
222 
225 
228 
231 
234  };
235 
236 
241  GNECrossingFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
242 
245 
247  void hide();
248 
253  bool addCrossing(GNENetElement* netElement);
254 
258  void removeCrossing(GNECrossing* Crossing);
259 
261  void setCreateCrossingButton(bool value);
262 
266  long onCmdCreateCrossing(FXObject*, FXSelector, void*);
268 
270  static std::string getIdsSelected(const FXList* list);
271 
274 
277 
278 protected:
281 
282 private:
285 
288 
290  FXGroupBox* myGroupBoxLabel;
291 
294 
296  FXGroupBox* myGroupBoxButtons;
297 
300 
302  FXGroupBox* myGroupBoxLegend;
303 
306 
309 };
310 
311 
312 #endif
313 
314 /****************************************************************************/
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:57
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 *)