89 myChosenValue(0), myChosenTarget(myChosenValue,
nullptr, MID_OPTION),
90 myUsageProbability(o.getProbability()), myUsageProbabilityTarget(myUsageProbability),
92 myChosenTarget.setTarget(
this);
94 new FXVerticalFrame(
this, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0);
96 FXGroupBox* gp =
new FXGroupBox(f1,
"Change Probability",
97 GROUPBOX_TITLE_LEFT | FRAME_SUNKEN | FRAME_RIDGE,
98 0, 0, 0, 0, 4, 4, 1, 1, 2, 0);
101 FXHorizontalFrame* gf1 =
102 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
103 new FXRadioButton(gf1,
"Default", &myChosenTarget, FXDataTarget::ID_OPTION + 0,
104 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP,
105 0, 0, 0, 0, 2, 2, 0, 0);
109 FXHorizontalFrame* gf12 =
110 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
111 new FXRadioButton(gf12,
"User Given: ", &myChosenTarget, FXDataTarget::ID_OPTION + 1,
112 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP | LAYOUT_CENTER_Y,
113 0, 0, 0, 0, 2, 2, 0, 0);
114 myUsageProbabilityDial =
115 new FXRealSpinner(gf12, 10,
this, MID_USER_DEF,
116 LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
119 myUsageProbabilityDial->setIncrement(.1);
120 myUsageProbabilityDial->setRange(0, 1);
121 myUsageProbabilityDial->setValue(myObject->getUserProbability());
125 FXHorizontalFrame* gf13 =
126 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
127 new FXRadioButton(gf13,
"Off", &myChosenTarget, FXDataTarget::ID_OPTION + 2,
128 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP,
129 0, 0, 0, 0, 2, 2, 0, 0);
131 myChosenValue = myObject->inUserMode()
132 ? myObject->getUserProbability() > 0
135 new FXButton(f1,
"Close",
nullptr,
this, MID_CLOSE,
136 BUTTON_INITIAL | BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 30, 30, 4, 4);
152 myUsageProbability = (double)(myUsageProbabilityDial->getValue());
153 static_cast<GUITriggeredRerouter*>(myObject)->setUserUsageProbability(myUsageProbability);
154 static_cast<GUITriggeredRerouter*>(myObject)->setUserMode(
true);
155 myParent->updateChildren();
163 myChosenValue != 1 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
165 myParent->updateChildren();
172 static_cast<GUITriggeredRerouter*>(myObject)->setUserUsageProbability(myUsageProbability);
173 switch (myChosenValue) {
175 static_cast<GUITriggeredRerouter*>(myObject)->setUserMode(
false);
178 static_cast<GUITriggeredRerouter*>(myObject)->setUserMode(
true);
181 static_cast<GUITriggeredRerouter*>(myObject)->setUserUsageProbability(0);
182 static_cast<GUITriggeredRerouter*>(myObject)->setUserMode(
true);
187 myParent->updateChildren();
208 static_cast<GUITriggeredRerouter*>(myObject)->openManipulator(
209 *myApplication, *myParent);
218 const std::string& aXMLFilename,
bool off,
SUMOTime timeThreshold,
const std::string& vTypes,
SUMORTree& rtree) :
222 for (MSEdgeVector::const_iterator it = edges.begin(); it != edges.end(); ++it) {
244 for (MSEdgeVector::const_iterator it = ri.
closed.begin(); it != ri.
closed.end(); ++it) {
307 myAmClosedEdge(closed) {
308 const std::vector<MSLane*>& lanes = edge->
getLanes();
311 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
313 const double pos = closed ? 3 : v.
length() - (double) 6.;
314 myFGPositions.push_back((*i)->geometryPositionAtOffset(pos));
327 return myParent->getPopUpMenu(app, parent);
341 if (s.
scale * exaggeration >= 3) {
343 const double prob = myParent->getProbability();
344 if (myAmClosedEdge) {
348 if (ri !=
nullptr && prob > 0) {
351 const int noLanes = (int)myFGPositions.size();
352 for (
int j = 0; j < noLanes; ++j) {
354 double rot = myFGRotations[j];
356 glTranslated(pos.
x(), pos.
y(), 0);
357 glRotated(rot, 0, 0, 1);
358 glTranslated(0, -1.5, 0);
361 noPoints = (int)(9.0 + s.
scale / 10.0);
368 glColor3d(0.7, 0, 0);
370 glTranslated(0, 0, .1);
373 glTranslated(0, 0, .1);
375 glRotated(-90, 0, 0, 1);
376 glBegin(GL_TRIANGLES);
377 glVertex2d(0 - .3, -1.);
378 glVertex2d(0 - .3, 1.);
379 glVertex2d(0 + .3, 1.);
380 glVertex2d(0 + .3, -1.);
381 glVertex2d(0 - .3, -1.);
382 glVertex2d(0 + .3, 1.);
391 for (
int i = 0; i < (int)myFGPositions.size(); ++i) {
392 const Position& pos = myFGPositions[i];
393 double rot = myFGRotations[i];
395 glTranslated(pos.
x(), pos.
y(), 0);
396 glRotated(rot, 0, 0, 1);
398 glScaled(exaggeration, exaggeration, 1);
399 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
401 glBegin(GL_TRIANGLES);
402 glColor3d(1, .8f, 0);
404 glVertex2d(0 - 1.4, 0);
405 glVertex2d(0 - 1.4, 6);
406 glVertex2d(0 + 1.4, 6);
407 glVertex2d(0 + 1.4, 0);
408 glVertex2d(0 - 1.4, 0);
409 glVertex2d(0 + 1.4, 6);