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.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 // 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>
31 #include <gui/GUIManipulator.h>
32 
33 
34 // ===========================================================================
35 // class definitions
36 // ===========================================================================
44  : public MSLaneSpeedTrigger,
46 public:
53  GUILaneSpeedTrigger(const std::string& id,
54  const std::vector<MSLane*>& destLanes,
55  const std::string& file);
56 
59 
61 
62 
71  GUISUMOAbstractView& parent);
72 
81  GUISUMOAbstractView& parent);
82 
84  double getExaggeration(const GUIVisualizationSettings& s) const;
85 
92 
97  void drawGL(const GUIVisualizationSettings& s) const;
99 
101  GUISUMOAbstractView& parent);
102 
103 public:
106  public:
107 
109  GUISUMOAbstractView& parent, GUIGlObject& o);
110 
112 
114  long onCmdOpenManip(FXObject*, FXSelector, void*);
115 
116  protected:
118 
119  };
120 
122  FXDECLARE(GUIManip_LaneSpeedTrigger)
123  public:
124  enum {
125  MID_USER_DEF = FXDialogBox::ID_LAST,
129  ID_LAST
130  };
133  const std::string& name, GUILaneSpeedTrigger& o,
134  int xpos, int ypos);
135 
137  virtual ~GUIManip_LaneSpeedTrigger();
138 
139  long onCmdOverride(FXObject*, FXSelector, void*);
140  long onCmdClose(FXObject*, FXSelector, void*);
141  long onCmdUserDef(FXObject*, FXSelector, void*);
142  long onUpdUserDef(FXObject*, FXSelector, void*);
143  long onCmdPreDef(FXObject*, FXSelector, void*);
144  long onUpdPreDef(FXObject*, FXSelector, void*);
145  long onCmdChangeOption(FXObject*, FXSelector, void*);
146 
147  private:
149 
151 
152  FXDataTarget myChosenTarget;
153 
154  double mySpeed;
155 
156  FXDataTarget mySpeedTarget;
157 
158  FXRealSpinner* myUserDefinedSpeed;
159 
161 
163 
164  protected:
166 
167  };
168 
169 private:
171  typedef std::vector<Position> PosCont;
172 
174  typedef std::vector<double> RotCont;
175 
176 private:
179 
182 
185 
188 
190  mutable double myLastValue;
191 
193  mutable std::string myLastValueString;
194 
195 };
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 associated 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.
ComboBox with icon.
Changes the speed allowed on a set of lanes.