SUMO - Simulation of Urban MObility
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-2017 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 // class declarations
46 // ===========================================================================
47 class GUIEdge;
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
60  : public MSTriggeredRerouter,
62 public:
70  GUITriggeredRerouter(const std::string& id,
71  const MSEdgeVector& edges, double prob,
72  const std::string& aXMLFilename, bool off,
73  SUMORTree& rtree);
74 
75 
78 
79 
86  void myEndElement(int element);
87 
89 
90 
99  GUISUMOAbstractView& parent);
100 
101 
110  GUISUMOAbstractView& parent);
111 
112 
119 
120 
125  void drawGL(const GUIVisualizationSettings& s) const;
127 
128 
129 
131  GUISUMOAbstractView& parent);
132 
133 public:
135 
136  public:
137  GUITriggeredRerouterEdge(GUIEdge* edge, GUITriggeredRerouter* parent, bool closed);
138 
139  virtual ~GUITriggeredRerouterEdge();
140 
142 
143 
152  GUISUMOAbstractView& parent);
153 
154 
163  GUISUMOAbstractView& parent);
164 
165 
172 
173 
178  void drawGL(const GUIVisualizationSettings& s) const;
180 
181  private:
183  typedef std::vector<Position> PosCont;
184 
186  typedef std::vector<double> RotCont;
187 
188  private:
191 
194 
196  const bool myAmClosedEdge;
197 
199  PosCont myFGPositions;
200 
202  RotCont myFGRotations;
203 
206  };
207 
208 public:
211  public:
212 
214  GUISUMOAbstractView& parent, GUIGlObject& o);
215 
217 
219  long onCmdOpenManip(FXObject*, FXSelector, void*);
220 
221  protected:
223 
224  };
225 
226 
228  FXDECLARE(GUIManip_TriggeredRerouter)
229  public:
230  enum {
231  MID_USER_DEF = FXDialogBox::ID_LAST,
235  ID_LAST
236  };
239  const std::string& name, GUITriggeredRerouter& o,
240  int xpos, int ypos);
241 
243  virtual ~GUIManip_TriggeredRerouter();
244 
245  long onCmdOverride(FXObject*, FXSelector, void*);
246  long onCmdClose(FXObject*, FXSelector, void*);
247  long onCmdUserDef(FXObject*, FXSelector, void*);
248  long onUpdUserDef(FXObject*, FXSelector, void*);
249  long onCmdChangeOption(FXObject*, FXSelector, void*);
250 
251  private:
253 
255 
256  FXDataTarget myChosenTarget;
257 
259 
260  FXRealSpinDial* myUsageProbabilityDial;
261 
263 
265 
266  protected:
268 
269  };
270 
271 
272 private:
275 
276  std::vector<GUITriggeredRerouterEdge*> myEdgeVisualizations;
277 
278 };
279 
280 
281 #endif
282 
283 /****************************************************************************/
284 
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
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.
GUITriggeredRerouter(const std::string &id, const MSEdgeVector &edges, double prob, const std::string &aXMLFilename, bool off, SUMORTree &rtree)
Constructor.
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&#39;s GL-objects.
Definition: SUMORTree.h:74
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:48
std::vector< double > RotCont
Definition of a rotation container.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
A road/street connecting two junctions (gui-version)
Definition: GUIEdge.h:60
A road/street connecting two junctions.
Definition: MSEdge.h:80
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
const bool myAmClosedEdge
whether this edge instance visualizes a closed edge
Boundary myBoundary
The boundary of this rerouter.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
RotCont myFGRotations
The rotations in full-geometry mode.
Reroutes vehicles passing an edge.
The popup menu of a globject.
std::vector< MSEdge * > MSEdgeVector
Definition: MSEdge.h:77
void myEndElement(int element)
Called when a closing tag occurs.
Boundary myBoundary
The boundary of this rerouter.
A window containing a gl-object&#39;s parameter.
PosCont myFGPositions
The positions in full-geometry mode.