92 myParent(&app), myChosenValue(0), myChosenTarget(myChosenValue,
nullptr, MID_OPTION),
93 mySpeed(o.getDefaultSpeed()), mySpeedTarget(mySpeed),
95 myChosenTarget.setTarget(
this);
97 new FXVerticalFrame(
this, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0);
99 FXGroupBox* gp =
new FXGroupBox(f1,
"Change Speed",
100 GROUPBOX_TITLE_LEFT | FRAME_RIDGE,
101 0, 0, 0, 0, 4, 4, 1, 1, 2, 0);
104 FXHorizontalFrame* gf1 =
105 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
106 new FXRadioButton(gf1,
"Default", &myChosenTarget, FXDataTarget::ID_OPTION + 0,
107 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP,
108 0, 0, 0, 0, 2, 2, 0, 0);
112 FXHorizontalFrame* gf0 =
113 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
114 new FXRadioButton(gf0,
"Loaded", &myChosenTarget, FXDataTarget::ID_OPTION + 1,
115 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP,
116 0, 0, 0, 0, 2, 2, 0, 0);
120 FXHorizontalFrame* gf2 =
121 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
122 new FXRadioButton(gf2,
"Predefined: ", &myChosenTarget, FXDataTarget::ID_OPTION + 2,
123 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP | LAYOUT_CENTER_Y,
124 0, 0, 0, 0, 2, 2, 0, 0);
127 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP | LAYOUT_CENTER_Y | COMBOBOX_STATIC);
128 myPredefinedValues->appendIconItem(
"20 km/h");
129 myPredefinedValues->appendIconItem(
"40 km/h");
130 myPredefinedValues->appendIconItem(
"60 km/h");
131 myPredefinedValues->appendIconItem(
"80 km/h");
132 myPredefinedValues->appendIconItem(
"100 km/h");
133 myPredefinedValues->appendIconItem(
"120 km/h");
134 myPredefinedValues->appendIconItem(
"140 km/h");
135 myPredefinedValues->appendIconItem(
"160 km/h");
136 myPredefinedValues->appendIconItem(
"180 km/h");
137 myPredefinedValues->appendIconItem(
"200 km/h");
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(myObject->getDefaultSpeed() * 3.6);
156 BUTTON_INITIAL | BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 30, 30, 4, 4);
157 myObject->setOverriding(
true);
173 mySpeed = myUserDefinedSpeed->getValue() / 3.6;
174 myObject->setOverridingValue(mySpeed);
175 myParent->updateChildren();
183 myChosenValue != 3 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
185 myParent->updateChildren();
192 mySpeed = ((double)myPredefinedValues->getCurrentItem() * 20. + 20.) / 3.6;
193 myObject->setOverridingValue(mySpeed);
194 myParent->updateChildren();
202 myChosenValue != 2 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
204 myParent->updateChildren();
211 myObject->setOverriding(
true);
212 switch (myChosenValue) {
214 mySpeed = myObject->getDefaultSpeed();
217 mySpeed = myObject->getLoadedSpeed();
220 mySpeed = ((double)myPredefinedValues->getCurrentItem() * 20. + 20.) / 3.6;
223 mySpeed = myUserDefinedSpeed->getValue() / 3.6;
229 myObject->setOverridingValue(mySpeed);
230 myParent->updateChildren();
231 if (myChosenValue == 1) {
233 myObject->setOverriding(
false);
257 *myApplication, *myParent);
266 const std::string&
id,
const std::vector<MSLane*>& destLanes,
267 const std::string& aXMLFilename) :
273 std::vector<MSLane*>::const_iterator i;
274 for (i = destLanes.begin(); i != destLanes.end(); ++i) {
306 ret->
mkItem(
TL(
"speed [m/s]"),
true,
324 glTranslated(pos.
x(), pos.
y(), 0);
325 glRotated(rot, 0, 0, 1);
326 glTranslated(0, -1.5, 0);
327 glScaled(exaggeration, exaggeration, 1);
330 noPoints = (int)(9.0 + s.
scale / 10.0);
338 glTranslated(0, 0, .1);
347 if (((
int) value + 1) % 10 == 0) {
348 value = (double)(((
int) value + 1) / 10 * 10);
355 if (idx != std::string::npos) {
364 glTranslated(0, 0, .1);
365 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
@ MID_MANIP
Open the object's manipulator.
#define GUIDesignComboBoxVisibleItems
@ GLO_VSS
a Variable Speed Sign
GUIIcon
An enumeration of icons used by the gui applications.
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 pushName(unsigned int name)
push Name
static void drawFilledCircle(const double widradiusth, const int steps=8)
Draws a filled circle around (0,0)
static void popMatrix()
pop matrix
static void popName()
pop Name
static void pushMatrix()
push matrix
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)
static FXButton * buildFXButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXIcon *ic, FXObject *tgt, FXSelector sel, FXuint opts=BUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
build button
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.
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, const GUIMainWindow &app) const
Builds an entry which allows to copy the cursor position if geo projection is used,...
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, bool forceShow=false) 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.
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.
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.
double getCurrentSpeed() const
Returns the current speed.
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