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-2020 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
20 // Reroutes vehicles passing an edge (gui-version)
21 /****************************************************************************/
22 #pragma once
23 #include <config.h>
24 
25 #include <vector>
26 #include <string>
31 #include <gui/GUIManipulator.h>
32 
33 // ===========================================================================
34 // class declarations
35 // ===========================================================================
36 class GUIEdge;
37 
38 // ===========================================================================
39 // class definitions
40 // ===========================================================================
49  : public MSTriggeredRerouter,
51 public:
59  GUITriggeredRerouter(const std::string& id,
60  const MSEdgeVector& edges, double prob,
61  const std::string& aXMLFilename, bool off,
62  SUMOTime timeThreshold,
63  const std::string& vTypes,
64  SUMORTree& rtree);
65 
66 
69 
70 
77  void myEndElement(int element);
78 
80 
81 
90  GUISUMOAbstractView& parent);
91 
92 
101  GUISUMOAbstractView& parent);
102 
103 
110 
111 
116  void drawGL(const GUIVisualizationSettings& s) const;
118 
119 
120 
122  GUISUMOAbstractView& parent);
123 
125  void shiftProbs();
126 
127 public:
128 
133  };
134 
136 
137  public:
138  GUITriggeredRerouterEdge(GUIEdge* edge, GUITriggeredRerouter* parent, RerouterEdgeType edgeType, int distIndex = -1);
139 
140  virtual ~GUITriggeredRerouterEdge();
141 
143 
144 
153  GUISUMOAbstractView& parent);
154 
155 
164  GUISUMOAbstractView& parent);
165 
166 
173 
174 
179  void drawGL(const GUIVisualizationSettings& s) const;
180 
181  void onLeftBtnPress(void* data);
182 
184  return myEdgeType;
185  }
186 
187  const MSEdge* getEdge() const {
188  return myEdge;
189  }
191 
192  private:
194  typedef std::vector<Position> PosCont;
195 
197  typedef std::vector<double> RotCont;
198 
199  private:
202 
205 
208 
211 
214 
217 
220  };
221 
222 public:
225  public:
226 
228  GUISUMOAbstractView& parent, GUIGlObject& o);
229 
231 
233  long onCmdOpenManip(FXObject*, FXSelector, void*);
234 
235  protected:
237 
238  };
239 
240 
242  FXDECLARE(GUIManip_TriggeredRerouter)
243  public:
244  enum {
245  MID_USER_DEF = FXDialogBox::ID_LAST,
250  ID_LAST
251  };
254  const std::string& name, GUITriggeredRerouter& o,
255  int xpos, int ypos);
256 
258  virtual ~GUIManip_TriggeredRerouter();
259 
260  long onCmdOverride(FXObject*, FXSelector, void*);
261  long onCmdClose(FXObject*, FXSelector, void*);
262  long onCmdUserDef(FXObject*, FXSelector, void*);
263  long onUpdUserDef(FXObject*, FXSelector, void*);
264  long onCmdChangeOption(FXObject*, FXSelector, void*);
265  long onCmdShiftProbs(FXObject*, FXSelector, void*);
266 
267  private:
269 
271 
272  FXDataTarget myChosenTarget;
273 
275 
276  FXRealSpinner* myUsageProbabilityDial;
277 
279 
281 
282  protected:
284 
285  };
286 
287 
288 private:
291 
292  std::vector<GUITriggeredRerouterEdge*> myEdgeVisualizations;
293 
295 };
std::vector< MSEdge * > MSEdgeVector
Definition: MSEdge.h:73
long long int SUMOTime
Definition: SUMOTime.h:31
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:39
A road/street connecting two junctions (gui-version)
Definition: GUIEdge.h:50
The popup menu of a globject.
A window containing a gl-object's parameter.
long onUpdUserDef(FXObject *, FXSelector, void *)
long onCmdClose(FXObject *, FXSelector, void *)
long onCmdOverride(FXObject *, FXSelector, void *)
long onCmdChangeOption(FXObject *, FXSelector, void *)
long onCmdShiftProbs(FXObject *, FXSelector, void *)
long onCmdUserDef(FXObject *, FXSelector, void *)
std::vector< Position > PosCont
Definition of a positions container.
void onLeftBtnPress(void *data)
notify object about left click
Boundary myBoundary
The boundary of this rerouter.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
MSEdge * myEdge
The edge for which this visualization applies.
const RerouterEdgeType myEdgeType
whether this edge instance visualizes a closed edge
GUITriggeredRerouterEdge(GUIEdge *edge, GUITriggeredRerouter *parent, RerouterEdgeType edgeType, int distIndex=-1)
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
int myDistIndex
the index for this in edge in routeProbs
std::vector< double > RotCont
Definition of a rotation container.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
PosCont myFGPositions
The positions in full-geometry mode.
GUITriggeredRerouter * myParent
The parent rerouter to which this edge instance belongs.
RotCont myFGRotations
The rotations in full-geometry mode.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
long onCmdOpenManip(FXObject *, FXSelector, void *)
Called if the object's manipulator shall be shown.
Reroutes vehicles passing an edge One rerouter can be active on multiple edges. To reduce drawing loa...
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
std::vector< GUITriggeredRerouterEdge * > myEdgeVisualizations
void shiftProbs()
shit route probabilities
GUIManipulator * openManipulator(GUIMainWindow &app, GUISUMOAbstractView &parent)
void myEndElement(int element)
Called when a closing tag occurs.
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.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Boundary myBoundary
The boundary of this rerouter.
Stores the information about how to visualize structures.
A road/street connecting two junctions.
Definition: MSEdge.h:77
Reroutes vehicles passing an edge.
A RT-tree for efficient storing of SUMO's GL-objects.
Definition: SUMORTree.h:66