91 myParent(&app), myChosenValue(0), myChosenTarget(myChosenValue,
nullptr, MID_OPTION),
92 mySpeed(o.getDefaultSpeed()), mySpeedTarget(mySpeed),
94 myChosenTarget.setTarget(
this);
96 new FXVerticalFrame(
this, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0);
98 FXGroupBox* gp =
new FXGroupBox(f1,
"Change Speed",
99 GROUPBOX_TITLE_LEFT | FRAME_RIDGE,
100 0, 0, 0, 0, 4, 4, 1, 1, 2, 0);
103 FXHorizontalFrame* gf1 =
104 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
105 new FXRadioButton(gf1,
"Default", &myChosenTarget, FXDataTarget::ID_OPTION + 0,
106 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP,
107 0, 0, 0, 0, 2, 2, 0, 0);
111 FXHorizontalFrame* gf0 =
112 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
113 new FXRadioButton(gf0,
"Loaded", &myChosenTarget, FXDataTarget::ID_OPTION + 1,
114 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP,
115 0, 0, 0, 0, 2, 2, 0, 0);
119 FXHorizontalFrame* gf2 =
120 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
121 new FXRadioButton(gf2,
"Predefined: ", &myChosenTarget, FXDataTarget::ID_OPTION + 2,
122 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP | LAYOUT_CENTER_Y,
123 0, 0, 0, 0, 2, 2, 0, 0);
125 new FXComboBox(gf2, 10,
this, MID_PRE_DEF,
126 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP | LAYOUT_CENTER_Y | COMBOBOX_STATIC);
127 myPredefinedValues->appendItem(
"20 km/h");
128 myPredefinedValues->appendItem(
"40 km/h");
129 myPredefinedValues->appendItem(
"60 km/h");
130 myPredefinedValues->appendItem(
"80 km/h");
131 myPredefinedValues->appendItem(
"100 km/h");
132 myPredefinedValues->appendItem(
"120 km/h");
133 myPredefinedValues->appendItem(
"140 km/h");
134 myPredefinedValues->appendItem(
"160 km/h");
135 myPredefinedValues->appendItem(
"180 km/h");
136 myPredefinedValues->appendItem(
"200 km/h");
137 myPredefinedValues->setNumVisible(5);
141 FXHorizontalFrame* gf12 =
142 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
143 new FXRadioButton(gf12,
"Free Entry: ", &myChosenTarget, FXDataTarget::ID_OPTION + 3,
144 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP | LAYOUT_CENTER_Y,
145 0, 0, 0, 0, 2, 2, 0, 0);
147 new FXRealSpinner(gf12, 10,
this, MID_USER_DEF,
148 LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
151 myUserDefinedSpeed->setIncrement(10);
152 myUserDefinedSpeed->setRange(0, 300);
153 myUserDefinedSpeed->setValue(
156 new FXButton(f1,
"Close",
nullptr,
this, MID_CLOSE,
157 BUTTON_INITIAL | BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 30, 30, 4, 4);
174 mySpeed = (double)(myUserDefinedSpeed->getValue() / 3.6);
176 myParent->updateChildren();
184 myChosenValue != 3 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
186 myParent->updateChildren();
193 mySpeed = (double)(
double)((myPredefinedValues->getCurrentItem() * 20 + 20) / 3.6);
195 myParent->updateChildren();
203 myChosenValue != 2 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
205 myParent->updateChildren();
213 switch (myChosenValue) {
221 mySpeed = (double)((myPredefinedValues->getCurrentItem() * 20 + 20) / 3.6);
224 mySpeed = (double)(myUserDefinedSpeed->getValue() / 3.6);
231 myParent->updateChildren();
232 if (myChosenValue == 1) {
258 *myApplication, *myParent);
267 const std::string&
id,
const std::vector<MSLane*>& destLanes,
268 const std::string& aXMLFilename) :
274 std::vector<MSLane*>::const_iterator i;
275 for (i = destLanes.begin(); i != destLanes.end(); ++i) {
307 ret->
mkItem(
"speed [m/s]",
true,
325 glTranslated(pos.
x(), pos.
y(), 0);
326 glRotated(rot, 0, 0, 1);
327 glTranslated(0, -1.5, 0);
328 glScaled(exaggeration, exaggeration, 1);
331 noPoints = (int)(9.0 + s.
scale / 10.0);
339 glTranslated(0, 0, .1);
348 if (((
int) value + 1) % 10 == 0) {
349 value = (double)(((
int) value + 1) / 10 * 10);
356 if (idx != std::string::npos) {
365 glTranslated(0, 0, .1);
366 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
@ MID_MANIP
Open the object's manipulator.
@ GLO_VSS
a Variable Speed Sign
GUILaneSpeedTriggerPopupMenuMap[]
FXDEFMAP(GUILaneSpeedTrigger::GUIManip_LaneSpeedTrigger) GUIManip_LaneSpeedTriggerMap[]
A class that stores a 2D geometrical boundary.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Boundary & grow(double by)
extends the boundary by the given amount
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, const int align=0, double width=-1)
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used,...
void buildShowManipulatorPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the manipulator window.
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
const std::string & getFullName() const
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
GUIGlID getGlID() const
Returns the numerical id of the object.
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
long onCmdClose(FXObject *, FXSelector, void *)
long onCmdChangeOption(FXObject *, FXSelector, void *)
long onUpdPreDef(FXObject *, FXSelector, void *)
long onCmdUserDef(FXObject *, FXSelector, void *)
virtual ~GUIManip_LaneSpeedTrigger()
Destructor.
long onCmdPreDef(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::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.
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.
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
Stores the information about how to visualize structures.
GUIVisualizationTextSettings addName
GUIVisualizationSizeSettings addSize
double scale
information about a lane's width (temporary, used for a single view)
Changes the speed allowed on a set of lanes.
void setOverridingValue(double val)
void setOverriding(bool val)
double getCurrentSpeed() const
Returns the current speed.
double getDefaultSpeed() const
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
double y() const
Returns the y-position.
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values