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-2024 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, const std::string& vTypes, const Position& pos,
60 SUMORTree& rtree);
61
62
65
66
73 void myEndElement(int element);
74
76
77
86 GUISUMOAbstractView& parent);
87
96 GUISUMOAbstractView& parent);
97
99 double getExaggeration(const GUIVisualizationSettings& s) const;
100
107
112 void drawGL(const GUIVisualizationSettings& s) const;
114
116 GUISUMOAbstractView& parent);
117
119 void shiftProbs();
120
121public:
122
128
130
131 public:
132 GUITriggeredRerouterEdge(GUIEdge* edge, GUITriggeredRerouter* parent, RerouterEdgeType edgeType, int distIndex = -1);
133
135
137
138
147 GUISUMOAbstractView& parent);
148
157 GUISUMOAbstractView& parent);
158
160 double getExaggeration(const GUIVisualizationSettings& s) const;
161
168
173 void drawGL(const GUIVisualizationSettings& s) const;
174
175 void onLeftBtnPress(void* data);
176
180
181 const MSEdge* getEdge() const {
182 return myEdge;
183 }
185
186 private:
188 typedef std::vector<Position> PosCont;
189
191 typedef std::vector<double> RotCont;
192
193 private:
196
199
202
205
208
211
213 std::vector<double> myHalfWidths;
214
217 };
218
219public:
222 public:
223
225 GUISUMOAbstractView& parent, GUIGlObject& o);
226
228
230 long onCmdOpenManip(FXObject*, FXSelector, void*);
231
232 protected:
234
235 };
236
237
240 public:
241 enum {
242 MID_USER_DEF = FXDialogBox::ID_LAST,
247 ID_LAST
248 };
250 GUIManip_TriggeredRerouter(GUIMainWindow& app, const std::string& name, GUITriggeredRerouter& o);
251
254
255 long onCmdClose(FXObject*, FXSelector, void*);
256 long onCmdUserDef(FXObject*, FXSelector, void*);
257 long onUpdUserDef(FXObject*, FXSelector, void*);
258 long onCmdChangeOption(FXObject*, FXSelector, void*);
259 long onCmdShiftProbs(FXObject*, FXSelector, void*);
260
261 private:
263
265
266 FXDataTarget myChosenTarget;
267
269
271
273
275
276 protected:
278
279 };
280
281
282private:
285
286 std::vector<GUITriggeredRerouterEdge*> myEdgeVisualizations;
287
289};
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
A RT-tree for efficient storing of SUMO's GL-objects.
Definition SUMORTree.h:66