97 myParent(&app), myChosenValue(0), myChosenTarget(myChosenValue, NULL, MID_OPTION),
98 mySpeed(o.getDefaultSpeed()), mySpeedTarget(mySpeed),
100 myChosenTarget.setTarget(
this);
101 FXVerticalFrame* f1 =
102 new FXVerticalFrame(
this, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0);
104 FXGroupBox* gp =
new FXGroupBox(f1,
"Change Speed",
105 GROUPBOX_TITLE_LEFT | FRAME_RIDGE,
106 0, 0, 0, 0, 4, 4, 1, 1, 2, 0);
109 FXHorizontalFrame* gf1 =
110 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
111 new FXRadioButton(gf1,
"Default", &myChosenTarget, FXDataTarget::ID_OPTION + 0,
112 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP,
113 0, 0, 0, 0, 2, 2, 0, 0);
117 FXHorizontalFrame* gf0 =
118 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
119 new FXRadioButton(gf0,
"Loaded", &myChosenTarget, FXDataTarget::ID_OPTION + 1,
120 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP,
121 0, 0, 0, 0, 2, 2, 0, 0);
125 FXHorizontalFrame* gf2 =
126 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
127 new FXRadioButton(gf2,
"Predefined: ", &myChosenTarget, FXDataTarget::ID_OPTION + 2,
128 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP | LAYOUT_CENTER_Y,
129 0, 0, 0, 0, 2, 2, 0, 0);
131 new FXComboBox(gf2, 10,
this, MID_PRE_DEF,
132 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP | LAYOUT_CENTER_Y | COMBOBOX_STATIC);
133 myPredefinedValues->appendItem(
"20 km/h");
134 myPredefinedValues->appendItem(
"40 km/h");
135 myPredefinedValues->appendItem(
"60 km/h");
136 myPredefinedValues->appendItem(
"80 km/h");
137 myPredefinedValues->appendItem(
"100 km/h");
138 myPredefinedValues->appendItem(
"120 km/h");
139 myPredefinedValues->appendItem(
"140 km/h");
140 myPredefinedValues->appendItem(
"160 km/h");
141 myPredefinedValues->appendItem(
"180 km/h");
142 myPredefinedValues->appendItem(
"200 km/h");
143 myPredefinedValues->setNumVisible(5);
147 FXHorizontalFrame* gf12 =
148 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
149 new FXRadioButton(gf12,
"Free Entry: ", &myChosenTarget, FXDataTarget::ID_OPTION + 3,
150 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP | LAYOUT_CENTER_Y,
151 0, 0, 0, 0, 2, 2, 0, 0);
154 LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
155 myUserDefinedSpeed->setFormatString(
"%.0f km/h");
156 myUserDefinedSpeed->setIncrements(1, 10, 10);
157 myUserDefinedSpeed->setRange(0, 300);
158 myUserDefinedSpeed->setValue(
159 static_cast<GUILaneSpeedTrigger*>(myObject)->getDefaultSpeed() * 3.6);
161 new FXButton(f1,
"Close", NULL,
this,
MID_CLOSE,
162 BUTTON_INITIAL | BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 30, 30, 4, 4);
189 myChosenValue != 3 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
208 myChosenValue != 2 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
220 mySpeed = (double) static_cast<GUILaneSpeedTrigger*>(
myObject)->getDefaultSpeed();
223 mySpeed = (double) static_cast<GUILaneSpeedTrigger*>(
myObject)->getLoadedSpeed();
272 const std::string&
id,
const std::vector<MSLane*>& destLanes,
273 const std::string& aXMLFilename) :
279 std::vector<MSLane*>::const_iterator i;
280 for (i = destLanes.begin(); i != destLanes.end(); ++i) {
313 ret->
mkItem(
"speed [m/s]",
true,
331 glScaled(exaggeration, exaggeration, 1);
332 glTranslated(pos.
x(), pos.
y(), 0);
333 glRotated(rot, 0, 0, 1);
334 glTranslated(0, -1.5, 0);
338 noPoints = (int)(9.0 + s.
scale / 10.0);
346 glTranslated(0, 0, .1);
355 if (((
int) value + 1) % 10 == 0) {
356 value = (double)(((
int) value + 1) / 10 * 10);
363 if (idx != std::string::npos) {
372 glTranslated(0, 0, .1);
373 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
long onCmdClose(FXObject *, FXSelector, void *)
double scale
information about a lane's width (temporary, used for a single view)
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
long onCmdUserDef(FXObject *, FXSelector, void *)
GUIVisualizationTextSettings addName
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
PosCont myFGPositions
The positions in full-geometry mode.
double getCurrentSpeed() const
Returns the current speed.
Stores the information about how to visualize structures.
long onCmdChangeOption(FXObject *, FXSelector, void *)
double y() const
Returns the y-position.
double x() const
Returns the x-position.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
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, int align=0, double width=-1)
long onUpdPreDef(FXObject *, FXSelector, void *)
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
double myLastValue
Storage for last value to avoid string recomputation.
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used, also builds an entry for copying the geo-position.
A class that stores a 2D geometrical boundary.
Changes the speed allowed on a set of lanes.
long onUpdUserDef(FXObject *, FXSelector, void *)
GUILaneSpeedTrigger(const std::string &id, const std::vector< MSLane *> &destLanes, const std::string &file)
Constructor.
Boundary myBoundary
The boundary of this rerouter.
GUIVisualizationSizeSettings addSize
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
FXComboBox * myPredefinedValues
A point in 2D or 3D with translation and scaling methods.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
GUILaneSpeedTriggerPopupMenuMap[]
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Boundary & grow(double by)
extends the boundary by the given amount
FXRealSpinDial * myUserDefinedSpeed
void setOverriding(bool val)
long onCmdPreDef(FXObject *, FXSelector, void *)
std::string myLastValueString
Storage for speed string to avoid recomputation.
void buildShowManipulatorPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the manipulator window.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Open the object's manipulator.
RotCont myFGRotations
The rotations in full-geometry mode.
bool myShowAsKMH
The information whether the speed shall be shown in m/s or km/h.
FXdouble getValue() const
Return current value.
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
GUIManipulator * openManipulator(GUIMainWindow &app, GUISUMOAbstractView &parent)
FXDEFMAP(GUILaneSpeedTrigger::GUIManip_LaneSpeedTrigger) GUIManip_LaneSpeedTriggerMap[]
GUIGlID getGlID() const
Returns the numerical id of the object.
double getExaggeration(const GUIVisualizationSettings &s, double factor=20) const
return the drawing size including exaggeration and constantSize values
const std::string & getFullName() const
Changes the speed allowed on a set of lanes (gui version)
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
virtual ~GUIManip_LaneSpeedTrigger()
Destructor.
GUILaneSpeedTrigger * myObject
void mkItem(const char *name, bool dynamic, ValueSource< unsigned > *src)
Adds a row which obtains its value from an unsigned-ValueSource.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
A window containing a gl-object's parameter.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
void setOverridingValue(double val)