Eclipse 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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // Reroutes vehicles passing an edge (gui-version)
18 /****************************************************************************/
19 #ifndef GUITriggeredRerouter_h
20 #define GUITriggeredRerouter_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include <vector>
29 #include <string>
34 #include <gui/GUIManipulator.h>
35 
36 // ===========================================================================
37 // class declarations
38 // ===========================================================================
39 class GUIEdge;
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
52  : public MSTriggeredRerouter,
54 public:
62  GUITriggeredRerouter(const std::string& id,
63  const MSEdgeVector& edges, double prob,
64  const std::string& aXMLFilename, bool off,
65  SUMOTime timeThreshold,
66  const std::string& vTypes,
67  SUMORTree& rtree);
68 
69 
72 
73 
80  void myEndElement(int element);
81 
83 
84 
93  GUISUMOAbstractView& parent);
94 
95 
104  GUISUMOAbstractView& parent);
105 
106 
113 
114 
119  void drawGL(const GUIVisualizationSettings& s) const;
121 
122 
123 
125  GUISUMOAbstractView& parent);
126 
127 public:
129 
130  public:
131  GUITriggeredRerouterEdge(GUIEdge* edge, GUITriggeredRerouter* parent, bool closed);
132 
133  virtual ~GUITriggeredRerouterEdge();
134 
136 
137 
146  GUISUMOAbstractView& parent);
147 
148 
157  GUISUMOAbstractView& parent);
158 
159 
166 
167 
172  void drawGL(const GUIVisualizationSettings& s) const;
174 
175  private:
177  typedef std::vector<Position> PosCont;
178 
180  typedef std::vector<double> RotCont;
181 
182  private:
185 
188 
190  const bool myAmClosedEdge;
191 
193  PosCont myFGPositions;
194 
196  RotCont myFGRotations;
197 
200  };
201 
202 public:
205  public:
206 
208  GUISUMOAbstractView& parent, GUIGlObject& o);
209 
211 
213  long onCmdOpenManip(FXObject*, FXSelector, void*);
214 
215  protected:
217 
218  };
219 
220 
222  FXDECLARE(GUIManip_TriggeredRerouter)
223  public:
224  enum {
225  MID_USER_DEF = FXDialogBox::ID_LAST,
229  ID_LAST
230  };
233  const std::string& name, GUITriggeredRerouter& o,
234  int xpos, int ypos);
235 
237  virtual ~GUIManip_TriggeredRerouter();
238 
239  long onCmdOverride(FXObject*, FXSelector, void*);
240  long onCmdClose(FXObject*, FXSelector, void*);
241  long onCmdUserDef(FXObject*, FXSelector, void*);
242  long onUpdUserDef(FXObject*, FXSelector, void*);
243  long onCmdChangeOption(FXObject*, FXSelector, void*);
244 
245  private:
247 
249 
250  FXDataTarget myChosenTarget;
251 
253 
254  FXRealSpinner* myUsageProbabilityDial;
255 
257 
259 
260  protected:
262 
263  };
264 
265 
266 private:
269 
270  std::vector<GUITriggeredRerouterEdge*> myEdgeVisualizations;
271 
272 };
273 
274 
275 #endif
276 
277 /****************************************************************************/
278 
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
GUITriggeredRerouterEdge(GUIEdge *edge, GUITriggeredRerouter *parent, bool closed)
long long int SUMOTime
Definition: SUMOTime.h:35
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
GUITriggeredRerouter(const std::string &id, const MSEdgeVector &edges, double prob, const std::string &aXMLFilename, bool off, SUMOTime timeThreshold, const std::string &vTypes, SUMORTree &rtree)
Constructor.
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:69
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
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:53
A road/street connecting two junctions.
Definition: MSEdge.h:76
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:72
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.