Eclipse SUMO - Simulation of Urban MObility
GUILaneSpeedTrigger.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 // Changes the speed allowed on a set of lanes (gui version)
21 /****************************************************************************/
22 #pragma once
23 #include <config.h>
24 
25 #include <vector>
26 #include <string>
30 #include <gui/GUIManipulator.h>
31 
32 
33 // ===========================================================================
34 // class definitions
35 // ===========================================================================
43  : public MSLaneSpeedTrigger,
45 public:
52  GUILaneSpeedTrigger(const std::string& id,
53  const std::vector<MSLane*>& destLanes,
54  const std::string& file);
55 
56 
59 
60 
61 
63 
64 
73  GUISUMOAbstractView& parent);
74 
75 
84  GUISUMOAbstractView& parent);
85 
86 
93 
94 
99  void drawGL(const GUIVisualizationSettings& s) const;
101 
102 
103 
105  GUISUMOAbstractView& parent);
106 
107 public:
110  public:
111 
113  GUISUMOAbstractView& parent, GUIGlObject& o);
114 
116 
118  long onCmdOpenManip(FXObject*, FXSelector, void*);
119 
120  protected:
122 
123  };
124 
126  FXDECLARE(GUIManip_LaneSpeedTrigger)
127  public:
128  enum {
129  MID_USER_DEF = FXDialogBox::ID_LAST,
133  ID_LAST
134  };
137  const std::string& name, GUILaneSpeedTrigger& o,
138  int xpos, int ypos);
139 
141  virtual ~GUIManip_LaneSpeedTrigger();
142 
143  long onCmdOverride(FXObject*, FXSelector, void*);
144  long onCmdClose(FXObject*, FXSelector, void*);
145  long onCmdUserDef(FXObject*, FXSelector, void*);
146  long onUpdUserDef(FXObject*, FXSelector, void*);
147  long onCmdPreDef(FXObject*, FXSelector, void*);
148  long onUpdPreDef(FXObject*, FXSelector, void*);
149  long onCmdChangeOption(FXObject*, FXSelector, void*);
150 
151  private:
153 
155 
156  FXDataTarget myChosenTarget;
157 
158  double mySpeed;
159 
160  FXDataTarget mySpeedTarget;
161 
162  FXRealSpinner* myUserDefinedSpeed;
163 
164  FXComboBox* myPredefinedValues;
165 
167 
168  protected:
170 
171  };
172 
173 private:
175  typedef std::vector<Position> PosCont;
176 
178  typedef std::vector<double> RotCont;
179 
180 private:
183 
186 
189 
192 
194  mutable double myLastValue;
195 
197  mutable std::string myLastValueString;
198 
199 };
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:39
The popup menu of a globject.
long onCmdOpenManip(FXObject *, FXSelector, void *)
Called if the object's manipulator shall be shown.
long onCmdClose(FXObject *, FXSelector, void *)
long onCmdChangeOption(FXObject *, FXSelector, void *)
long onUpdPreDef(FXObject *, FXSelector, void *)
long onCmdUserDef(FXObject *, FXSelector, void *)
long onCmdPreDef(FXObject *, FXSelector, void *)
long onCmdOverride(FXObject *, FXSelector, void *)
long onUpdUserDef(FXObject *, FXSelector, void *)
Changes the speed allowed on a set of lanes (gui version)
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
std::vector< double > RotCont
Definition of a rotation container.
std::string myLastValueString
Storage for speed string to avoid recomputation.
GUIManipulator * openManipulator(GUIMainWindow &app, GUISUMOAbstractView &parent)
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
bool myShowAsKMH
The information whether the speed shall be shown in m/s or km/h.
PosCont myFGPositions
The positions in full-geometry mode.
RotCont myFGRotations
The rotations in full-geometry mode.
double myLastValue
Storage for last value to avoid string recomputation.
std::vector< Position > PosCont
Definition of a positions container.
Boundary myBoundary
The boundary of this rerouter.
GUILaneSpeedTrigger(const std::string &id, const std::vector< MSLane * > &destLanes, const std::string &file)
Constructor.
A window containing a gl-object's parameter.
Stores the information about how to visualize structures.
Changes the speed allowed on a set of lanes.