Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
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) override;
75
77
78
87
96
98 double getExaggeration(const GUIVisualizationSettings& s) const override;
99
105 Boundary getCenteringBoundary() const override;
106
111 void drawGL(const GUIVisualizationSettings& s) const override;
113
115 GUISUMOAbstractView& parent);
116
118 void shiftProbs();
119
120public:
121
127
129
130 public:
131 GUITriggeredRerouterEdge(GUIEdge* edge, GUITriggeredRerouter* parent, RerouterEdgeType edgeType, int distIndex = -1,
132 const Position& pos = Position::INVALID, const double radius = std::numeric_limits<double>::max());
133
135
137
138
147
156
158 double getExaggeration(const GUIVisualizationSettings& s) const override;
159
165 Boundary getCenteringBoundary() const override;
166
171 void drawGL(const GUIVisualizationSettings& s) const override;
172
173 void onLeftBtnPress(void* data) override;
174
178
179 const MSEdge* getEdge() const {
180 return myEdge;
181 }
183
184 private:
186 typedef std::vector<Position> PosCont;
187
189 typedef std::vector<double> RotCont;
190
191 private:
194
197
200
203
206
209
211 std::vector<double> myHalfWidths;
212
215 };
216
217public:
220 public:
221
223
225
227 long onCmdOpenManip(FXObject*, FXSelector, void*);
228
229 protected:
231
232 };
233
234
237 public:
238 enum {
239 MID_USER_DEF = FXDialogBox::ID_LAST,
244 ID_LAST
245 };
247 GUIManip_TriggeredRerouter(GUIMainWindow& app, const std::string& name, GUITriggeredRerouter& o);
248
251
252 long onCmdClose(FXObject*, FXSelector, void*);
253 long onCmdUserDef(FXObject*, FXSelector, void*);
254 long onUpdUserDef(FXObject*, FXSelector, void*);
255 long onCmdChangeOption(FXObject*, FXSelector, void*);
256 long onCmdShiftProbs(FXObject*, FXSelector, void*);
257
258 private:
260
262
263 FXDataTarget myChosenTarget;
264
266
268
270
272
273 protected:
275
276 };
277
278
279private:
282
283 std::vector<GUITriggeredRerouterEdge*> myEdgeVisualizations;
284
286};
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) override
notify object about left click
Boundary myBoundary
The boundary of this rerouter.
Boundary getCenteringBoundary() const override
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 override
Draws the object.
std::vector< double > myHalfWidths
The sign half-widths.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own parameter window.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own popup-menu.
double getExaggeration(const GUIVisualizationSettings &s) const override
return exaggeration associated with this GLObject
int myDistIndex
the index for this in edge in routeProbs
std::vector< double > RotCont
Definition of a rotation container.
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.
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...
double getExaggeration(const GUIVisualizationSettings &s) const override
return exaggeration associated with this GLObject
Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
std::vector< GUITriggeredRerouterEdge * > myEdgeVisualizations
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own popup-menu.
void shiftProbs()
shift route probabilities
void myEndElement(int element) override
Called when a closing tag occurs.
GUIManipulator * openManipulator(GUIMainWindow &app, GUISUMOAbstractView &parent)
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own parameter window.
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:323
A RT-tree for efficient storing of SUMO's GL-objects.
Definition SUMORTree.h:66