SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GUITriggeredRerouter.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // Reroutes vehicles passing an edge (gui-version)
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef GUITriggeredRerouter_h
23 #define GUITriggeredRerouter_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <vector>
36 #include <string>
42 #include <gui/GUIManipulator.h>
43 
44 
45 // ===========================================================================
46 // class definitions
47 // ===========================================================================
56  : public MSTriggeredRerouter,
58 public:
66  GUITriggeredRerouter(const std::string& id,
67  const MSEdgeVector& edges, SUMOReal prob,
68  const std::string& aXMLFilename, bool off,
69  SUMORTree& rtree);
70 
71 
74 
75 
82  void myEndElement(int element);
83 
85 
86 
95  GUISUMOAbstractView& parent);
96 
97 
106  GUISUMOAbstractView& parent);
107 
108 
115 
116 
121  void drawGL(const GUIVisualizationSettings& s) const;
123 
124 
125 
127  GUISUMOAbstractView& parent);
128 
129 public:
131 
132  public:
133  GUITriggeredRerouterEdge(GUIEdge* edge, GUITriggeredRerouter* parent, bool closed);
134 
135  virtual ~GUITriggeredRerouterEdge();
136 
138 
139 
148  GUISUMOAbstractView& parent);
149 
150 
159  GUISUMOAbstractView& parent);
160 
161 
168 
169 
174  void drawGL(const GUIVisualizationSettings& s) const;
176 
177  private:
179  typedef std::vector<Position> PosCont;
180 
182  typedef std::vector<SUMOReal> RotCont;
183 
184  private:
187 
190 
192  const bool myAmClosedEdge;
193 
195  PosCont myFGPositions;
196 
198  RotCont myFGRotations;
199 
202  };
203 
204 public:
207  public:
208 
210  GUISUMOAbstractView& parent, GUIGlObject& o);
211 
213 
215  long onCmdOpenManip(FXObject*, FXSelector, void*);
216 
217  protected:
219 
220  };
221 
222 
224  FXDECLARE(GUIManip_TriggeredRerouter)
225  public:
226  enum {
227  MID_USER_DEF = FXDialogBox::ID_LAST,
232  };
235  const std::string& name, GUITriggeredRerouter& o,
236  int xpos, int ypos);
237 
239  virtual ~GUIManip_TriggeredRerouter();
240 
241  long onCmdOverride(FXObject*, FXSelector, void*);
242  long onCmdClose(FXObject*, FXSelector, void*);
243  long onCmdUserDef(FXObject*, FXSelector, void*);
244  long onUpdUserDef(FXObject*, FXSelector, void*);
245  long onCmdChangeOption(FXObject*, FXSelector, void*);
246 
247  private:
249 
251 
252  FXDataTarget myChosenTarget;
253 
255 
256  FXRealSpinDial* myUsageProbabilityDial;
257 
259 
261 
262  protected:
264 
265  };
266 
267 
268 private:
271 
272  std::vector<GUITriggeredRerouterEdge*> myEdgeVisualizations;
273 
274 };
275 
276 
277 #endif
278 
279 /****************************************************************************/
280 
long onCmdClose(FXObject *, FXSelector, void *)
GUITriggeredRerouterEdge(GUIEdge *edge, GUITriggeredRerouter *parent, bool closed)
std::vector< Position > PosCont
Definition of a positions container.
Reroutes vehicles passing an edge One rerouter can be active on multiple edges. To reduce drawing loa...
std::vector< GUITriggeredRerouterEdge * > myEdgeVisualizations
GUIManipulator * openManipulator(GUIMainWindow &app, GUISUMOAbstractView &parent)
Stores the information about how to visualize structures.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
GUITriggeredRerouter * myParent
The parent rerouter to which this edge instance belongs.
MSEdge * myEdge
The edge for which this visualization applies.
A RT-tree for efficient storing of SUMO's GL-objects.
Definition: SUMORTree.h:74
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:48
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
A road/street connecting two junctions (gui-version)
Definition: GUIEdge.h:61
A road/street connecting two junctions.
Definition: MSEdge.h:81
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
std::vector< SUMOReal > RotCont
Definition of a rotation container.
long onCmdOverride(FXObject *, FXSelector, void *)
const bool myAmClosedEdge
whether this edge instance visualizes a closed edge
long onCmdUserDef(FXObject *, FXSelector, void *)
Boundary myBoundary
The boundary of this rerouter.
long onCmdOpenManip(FXObject *, FXSelector, void *)
Called if the object's manipulator shall be shown.
long onUpdUserDef(FXObject *, FXSelector, void *)
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
long onCmdChangeOption(FXObject *, FXSelector, void *)
RotCont myFGRotations
The rotations in full-geometry mode.
Reroutes vehicles passing an edge.
The popup menu of a globject.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
#define SUMOReal
Definition: config.h:218
std::vector< MSEdge * > MSEdgeVector
Definition: MSEdge.h:78
void myEndElement(int element)
Called when a closing tag occurs.
Boundary myBoundary
The boundary of this rerouter.
A window containing a gl-object's parameter.
GUITriggeredRerouter(const std::string &id, const MSEdgeVector &edges, SUMOReal prob, const std::string &aXMLFilename, bool off, SUMORTree &rtree)
Constructor.
PosCont myFGPositions
The positions in full-geometry mode.