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  SUMOReal 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 
210 
212  FXTextField* myCrossingEdges;
213 
216 
218  FXMenuCheck* myCrossingPriority;
219 
222 
224  FXTextField* myCrossingWidth;
225 
228 
231 
234 
237  };
238 
239 
244  GNECrossingFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
245 
248 
250  void hide();
251 
256  bool addCrossing(GNENetElement* netElement);
257 
261  void removeCrossing(GNECrossing* Crossing);
262 
264  void setCreateCrossingButton(bool value);
265 
269  long onCmdCreateCrossing(FXObject*, FXSelector, void*);
271 
273  static std::string getIdsSelected(const FXList* list);
274 
277 
280 
281 protected:
284 
285 private:
288 
291 
293  FXGroupBox* myGroupBoxLabel;
294 
297 
299  FXGroupBox* myGroupBoxButtons;
300 
303 
305  FXGroupBox* myGroupBoxLegend;
306 
309 
312 };
313 
314 
315 #endif
316 
317 /****************************************************************************/
FXMatrix * myAttributesMatrix
FXMatrix for place attributes.
void setCreateCrossingButton(bool value)
enable or disable button create edges
const RGBColor & getCandidateColor() const
return candidate color
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
GNEJunction * getCurrentJunction() const
get current junction
long onCmdInvertSelection(FXObject *, FXSelector, void *)
called when invert selection button is pressed
GNECrossingFrame::edgesSelector * getEdgeSelector() const
get edge selector
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
FXButton * myInvertEdgesSelection
button for invert selection
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.
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.
FXMenuCheck * myCrossingPriority
CheckBox for Priority.
GNECrossingFrame::edgesSelector * myEdgeSelector
pointer to edge selector
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:54
FXButton * helpEdges
button for help
FXTextField * myCrossingEdges
TextField for edges.
long onCmdCreateCrossing(FXObject *, FXSelector, void *)
GNECrossingFrame::crossingParameters * getCrossingParameters() const
get Crossing parameters
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.
const RGBColor & getSelectedColor() const
return selected color
static std::string getIdsSelected(const FXList *list)
get list of selecte id&#39;s in string format
#define SUMOReal
Definition: config.h:208
FXLabel * myColorSelectedLabel
Label for color selected.
std::vector< GNEEdge * > myCurrentSelectedEdges
current selected edges
FXButton * myHelpCrossingAttribute
button for help
FXButton * myCreateCrossingButton
FXButton for create Crossing
FXButton * myClearEdgesSelection
button for clear selection
long onCmdUseSelectedEdges(FXObject *, FXSelector, void *)