SUMO - Simulation of Urban MObility
GUITriggeredRerouter.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 /****************************************************************************/
19 // Reroutes vehicles passing an edge (gui-version)
20 /****************************************************************************/
21 #ifndef GUITriggeredRerouter_h
22 #define GUITriggeredRerouter_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <vector>
35 #include <string>
41 #include <gui/GUIManipulator.h>
42 
43 // ===========================================================================
44 // class declarations
45 // ===========================================================================
46 class GUIEdge;
47 
48 // ===========================================================================
49 // class definitions
50 // ===========================================================================
59  : public MSTriggeredRerouter,
61 public:
69  GUITriggeredRerouter(const std::string& id,
70  const MSEdgeVector& edges, double prob,
71  const std::string& aXMLFilename, bool off,
72  SUMOTime timeThreshold,
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.
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:73
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:47
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:59
A road/street connecting two junctions.
Definition: MSEdge.h:80
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
GUITriggeredRerouter(const std::string &id, const MSEdgeVector &edges, double prob, const std::string &aXMLFilename, bool off, SUMOTime timeThreshold, SUMORTree &rtree)
Constructor.
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.
long long int SUMOTime
Definition: TraCIDefs.h:51
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.