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-2022 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 
58 
60 
61 
70  GUISUMOAbstractView& parent);
71 
80  GUISUMOAbstractView& parent);
81 
83  double getExaggeration(const GUIVisualizationSettings& s) const;
84 
91 
96  void drawGL(const GUIVisualizationSettings& s) const;
98 
100  GUISUMOAbstractView& parent);
101 
102 public:
105  public:
106 
108  GUISUMOAbstractView& parent, GUIGlObject& o);
109 
111 
113  long onCmdOpenManip(FXObject*, FXSelector, void*);
114 
115  protected:
117 
118  };
119 
121  FXDECLARE(GUIManip_LaneSpeedTrigger)
122  public:
123  enum {
124  MID_USER_DEF = FXDialogBox::ID_LAST,
128  ID_LAST
129  };
132  const std::string& name, GUILaneSpeedTrigger& o,
133  int xpos, int ypos);
134 
136  virtual ~GUIManip_LaneSpeedTrigger();
137 
138  long onCmdOverride(FXObject*, FXSelector, void*);
139  long onCmdClose(FXObject*, FXSelector, void*);
140  long onCmdUserDef(FXObject*, FXSelector, void*);
141  long onUpdUserDef(FXObject*, FXSelector, void*);
142  long onCmdPreDef(FXObject*, FXSelector, void*);
143  long onUpdPreDef(FXObject*, FXSelector, void*);
144  long onCmdChangeOption(FXObject*, FXSelector, void*);
145 
146  private:
148 
150 
151  FXDataTarget myChosenTarget;
152 
153  double mySpeed;
154 
155  FXDataTarget mySpeedTarget;
156 
157  FXRealSpinner* myUserDefinedSpeed;
158 
159  FXComboBox* myPredefinedValues;
160 
162 
163  protected:
165 
166  };
167 
168 private:
170  typedef std::vector<Position> PosCont;
171 
173  typedef std::vector<double> RotCont;
174 
175 private:
178 
181 
184 
187 
189  mutable double myLastValue;
190 
192  mutable std::string myLastValueString;
193 
194 };
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.
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration asociated with this GLObject
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.