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-2022 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 
100  GUISUMOAbstractView& parent);
101 
103  double getExaggeration(const GUIVisualizationSettings& s) const;
104 
111 
116  void drawGL(const GUIVisualizationSettings& s) const;
118 
120  GUISUMOAbstractView& parent);
121 
123  void shiftProbs();
124 
125 public:
126 
131  };
132 
134 
135  public:
136  GUITriggeredRerouterEdge(GUIEdge* edge, GUITriggeredRerouter* parent, RerouterEdgeType edgeType, int distIndex = -1);
137 
138  virtual ~GUITriggeredRerouterEdge();
139 
141 
142 
151  GUISUMOAbstractView& parent);
152 
161  GUISUMOAbstractView& parent);
162 
164  double getExaggeration(const GUIVisualizationSettings& s) const;
165 
172 
177  void drawGL(const GUIVisualizationSettings& s) const;
178 
179  void onLeftBtnPress(void* data);
180 
182  return myEdgeType;
183  }
184 
185  const MSEdge* getEdge() const {
186  return myEdge;
187  }
189 
190  private:
192  typedef std::vector<Position> PosCont;
193 
195  typedef std::vector<double> RotCont;
196 
197  private:
200 
203 
206 
209 
212 
215 
217  std::vector<double> myHalfWidths;
218 
221  };
222 
223 public:
226  public:
227 
229  GUISUMOAbstractView& parent, GUIGlObject& o);
230 
232 
234  long onCmdOpenManip(FXObject*, FXSelector, void*);
235 
236  protected:
238 
239  };
240 
241 
243  FXDECLARE(GUIManip_TriggeredRerouter)
244  public:
245  enum {
246  MID_USER_DEF = FXDialogBox::ID_LAST,
251  ID_LAST
252  };
255  const std::string& name, GUITriggeredRerouter& o,
256  int xpos, int ypos);
257 
259  virtual ~GUIManip_TriggeredRerouter();
260 
261  long onCmdOverride(FXObject*, FXSelector, void*);
262  long onCmdClose(FXObject*, FXSelector, void*);
263  long onCmdUserDef(FXObject*, FXSelector, void*);
264  long onUpdUserDef(FXObject*, FXSelector, void*);
265  long onCmdChangeOption(FXObject*, FXSelector, void*);
266  long onCmdShiftProbs(FXObject*, FXSelector, void*);
267 
268  private:
270 
272 
273  FXDataTarget myChosenTarget;
274 
276 
277  FXRealSpinner* myUsageProbabilityDial;
278 
280 
282 
283  protected:
285 
286  };
287 
288 
289 private:
292 
293  std::vector<GUITriggeredRerouterEdge*> myEdgeVisualizations;
294 
296 };
std::vector< MSEdge * > MSEdgeVector
Definition: MSEdge.h:73
long long int SUMOTime
Definition: SUMOTime.h:32
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.
std::vector< double > myHalfWidths
The sign half-widths.
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.
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration asociated with this GLObject
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.
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration asociated with this GLObject
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