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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // Changes the speed allowed on a set of lanes (gui version)
18 /****************************************************************************/
19 #ifndef GUILaneSpeedTrigger_h
20 #define GUILaneSpeedTrigger_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include <vector>
29 #include <string>
33 #include <gui/GUIManipulator.h>
34 
35 
36 // ===========================================================================
37 // class definitions
38 // ===========================================================================
46  : public MSLaneSpeedTrigger,
48 public:
55  GUILaneSpeedTrigger(const std::string& id,
56  const std::vector<MSLane*>& destLanes,
57  const std::string& file);
58 
59 
62 
63 
64 
66 
67 
76  GUISUMOAbstractView& parent);
77 
78 
87  GUISUMOAbstractView& parent);
88 
89 
96 
97 
102  void drawGL(const GUIVisualizationSettings& s) const;
104 
105 
106 
108  GUISUMOAbstractView& parent);
109 
110 public:
113  public:
114 
116  GUISUMOAbstractView& parent, GUIGlObject& o);
117 
119 
121  long onCmdOpenManip(FXObject*, FXSelector, void*);
122 
123  protected:
125 
126  };
127 
129  FXDECLARE(GUIManip_LaneSpeedTrigger)
130  public:
131  enum {
132  MID_USER_DEF = FXDialogBox::ID_LAST,
136  ID_LAST
137  };
140  const std::string& name, GUILaneSpeedTrigger& o,
141  int xpos, int ypos);
142 
144  virtual ~GUIManip_LaneSpeedTrigger();
145 
146  long onCmdOverride(FXObject*, FXSelector, void*);
147  long onCmdClose(FXObject*, FXSelector, void*);
148  long onCmdUserDef(FXObject*, FXSelector, void*);
149  long onUpdUserDef(FXObject*, FXSelector, void*);
150  long onCmdPreDef(FXObject*, FXSelector, void*);
151  long onUpdPreDef(FXObject*, FXSelector, void*);
152  long onCmdChangeOption(FXObject*, FXSelector, void*);
153 
154  private:
156 
158 
159  FXDataTarget myChosenTarget;
160 
161  double mySpeed;
162 
163  FXDataTarget mySpeedTarget;
164 
165  FXRealSpinner* myUserDefinedSpeed;
166 
167  FXComboBox* myPredefinedValues;
168 
170 
171  protected:
173 
174  };
175 
176 private:
178  typedef std::vector<Position> PosCont;
179 
181  typedef std::vector<double> RotCont;
182 
183 private:
185  PosCont myFGPositions;
186 
188  RotCont myFGRotations;
189 
192 
195 
197  mutable double myLastValue;
198 
200  mutable std::string myLastValueString;
201 
202 };
203 
204 
205 #endif
206 
207 /****************************************************************************/
208 
PosCont myFGPositions
The positions in full-geometry mode.
long onCmdOpenManip(FXObject *, FXSelector, void *)
Called if the object&#39;s manipulator shall be shown.
Stores the information about how to visualize structures.
std::vector< Position > PosCont
Definition of a positions container.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
double myLastValue
Storage for last value to avoid string recomputation.
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
Changes the speed allowed on a set of lanes.
GUILaneSpeedTrigger(const std::string &id, const std::vector< MSLane *> &destLanes, const std::string &file)
Constructor.
Boundary myBoundary
The boundary of this rerouter.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
std::string myLastValueString
Storage for speed string to avoid recomputation.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
RotCont myFGRotations
The rotations in full-geometry mode.
bool myShowAsKMH
The information whether the speed shall be shown in m/s or km/h.
The popup menu of a globject.
GUIManipulator * openManipulator(GUIMainWindow &app, GUISUMOAbstractView &parent)
Changes the speed allowed on a set of lanes (gui version)
A window containing a gl-object&#39;s parameter.
std::vector< double > RotCont
Definition of a rotation container.