Eclipse SUMO - Simulation of Urban MObility
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
GUITriggeredRerouter.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2025 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// ===========================================================================
36class GUIEdge;
37
38// ===========================================================================
39// class definitions
40// ===========================================================================
49 : public MSTriggeredRerouter,
51public:
58 GUITriggeredRerouter(const std::string& id, const MSEdgeVector& edges, double prob,
59 bool off, bool optional, SUMOTime timeThreshold,
60 const std::string& vTypes, const Position& pos, const double radius,
61 SUMORTree& rtree);
62
63
66
67
74 void myEndElement(int element);
75
77
78
87 GUISUMOAbstractView& parent);
88
97 GUISUMOAbstractView& parent);
98
100 double getExaggeration(const GUIVisualizationSettings& s) const;
101
108
113 void drawGL(const GUIVisualizationSettings& s) const;
115
117 GUISUMOAbstractView& parent);
118
120 void shiftProbs();
121
122public:
123
129
131
132 public:
133 GUITriggeredRerouterEdge(GUIEdge* edge, GUITriggeredRerouter* parent, RerouterEdgeType edgeType, int distIndex = -1,
134 const Position& pos = Position::INVALID, const double radius = std::numeric_limits<double>::max());
135
137
139
140
149 GUISUMOAbstractView& parent);
150
159 GUISUMOAbstractView& parent);
160
162 double getExaggeration(const GUIVisualizationSettings& s) const;
163
170
175 void drawGL(const GUIVisualizationSettings& s) const;
176
177 void onLeftBtnPress(void* data);
178
182
183 const MSEdge* getEdge() const {
184 return myEdge;
185 }
187
188 private:
190 typedef std::vector<Position> PosCont;
191
193 typedef std::vector<double> RotCont;
194
195 private:
198
201
204
207
210
213
215 std::vector<double> myHalfWidths;
216
219 };
220
221public:
224 public:
225
227
229
231 long onCmdOpenManip(FXObject*, FXSelector, void*);
232
233 protected:
235
236 };
237
238
241 public:
242 enum {
243 MID_USER_DEF = FXDialogBox::ID_LAST,
248 ID_LAST
249 };
251 GUIManip_TriggeredRerouter(GUIMainWindow& app, const std::string& name, GUITriggeredRerouter& o);
252
255
256 long onCmdClose(FXObject*, FXSelector, void*);
257 long onCmdUserDef(FXObject*, FXSelector, void*);
258 long onUpdUserDef(FXObject*, FXSelector, void*);
259 long onCmdChangeOption(FXObject*, FXSelector, void*);
260 long onCmdShiftProbs(FXObject*, FXSelector, void*);
261
262 private:
264
266
267 FXDataTarget myChosenTarget;
268
270
272
274
276
277 protected:
279
280 };
281
282
283private:
286
287 std::vector<GUITriggeredRerouterEdge*> myEdgeVisualizations;
288
290};
long long int SUMOTime
Definition GUI.h:36
std::vector< MSEdge * > MSEdgeVector
Definition MSEdge.h:73
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
A road/street connecting two junctions (gui-version)
Definition GUIEdge.h:51
The popup menu of a globject.
A window containing a gl-object's parameter.
long onUpdUserDef(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
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 associated 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()
shift route probabilities
GUIManipulator * openManipulator(GUIMainWindow &app, GUISUMOAbstractView &parent)
void myEndElement(int element)
Called when a closing tag occurs.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated 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 traffic objects passing an edge.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
static const Position INVALID
used to indicate that a position is valid
Definition Position.h:319
A RT-tree for efficient storing of SUMO's GL-objects.
Definition SUMORTree.h:66