91 myChosenValue(0), myChosenTarget(myChosenValue,
nullptr, MID_OPTION),
92 myUsageProbability(o.getProbability()), myUsageProbabilityTarget(myUsageProbability),
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 Trigger Probability",
99 GROUPBOX_TITLE_LEFT | FRAME_SUNKEN | 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* gf12 =
112 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
113 new FXRadioButton(gf12,
"User Given: ", &myChosenTarget, FXDataTarget::ID_OPTION + 1,
114 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP | LAYOUT_CENTER_Y,
115 0, 0, 0, 0, 2, 2, 0, 0);
116 myUsageProbabilityDial =
117 new FXRealSpinner(gf12, 10,
this, MID_USER_DEF,
118 LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
121 myUsageProbabilityDial->setIncrement(.1);
122 myUsageProbabilityDial->setRange(0, 1);
123 myUsageProbabilityDial->setValue(myObject->getUserProbability());
127 FXHorizontalFrame* gf13 =
128 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
129 new FXRadioButton(gf13,
"Off", &myChosenTarget, FXDataTarget::ID_OPTION + 2,
130 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP,
131 0, 0, 0, 0, 2, 2, 0, 0);
133 myChosenValue = myObject->inUserMode()
134 ? myObject->getUserProbability() > 0
138 FXGroupBox* gp2 =
new FXGroupBox(f1,
"Change Route Probability",
139 GROUPBOX_TITLE_LEFT | FRAME_SUNKEN | FRAME_RIDGE,
140 0, 0, 0, 0, 4, 4, 1, 1, 2, 0);
141 new FXButton(gp2,
"Shift",
nullptr,
this, MID_SHIFT_PROBS,
142 BUTTON_INITIAL | BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 30, 30, 4, 4);
144 new FXButton(f1,
"Close",
nullptr,
this, MID_CLOSE,
145 BUTTON_INITIAL | BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 30, 30, 4, 4);
162 myUsageProbability = (double)(myUsageProbabilityDial->getValue());
165 myParent->updateChildren();
173 myChosenValue != 1 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
175 myParent->updateChildren();
183 switch (myChosenValue) {
197 myParent->updateChildren();
204 myParent->updateChildren();
227 *myApplication, *myParent);
236 const std::string& aXMLFilename,
bool off,
SUMOTime timeThreshold,
const std::string& vTypes,
SUMORTree& rtree) :
241 for (MSEdgeVector::const_iterator it = edges.begin(); it != edges.end(); ++it) {
263 for (MSEdgeVector::const_iterator it = ri.
closed.begin(); it != ri.
closed.end(); ++it) {
272 const MSEdge* lastEdge =
nullptr;
274 for (
int i = 0; i < (int)route0->
getEdges().size(); i++) {
277 const MSEdge* nextEdge = i < (int)route->getEdges().size() ? route->getEdges()[i] :
nullptr;
278 if (nextEdge != cand) {
282 if (cand !=
nullptr) {
289 if (lastEdge !=
nullptr) {
292 if (nextIndex < (
int)edges.size()) {
367 for (
const MSVehicle* veh : lane->getVehiclesSecure()) {
368 const_cast<MSVehicle*
>(veh)->addReminder(
this);
370 lane->releaseVehicles();
386 myEdgeType(edgeType),
387 myDistIndex(distIndex) {
388 const std::vector<MSLane*>& lanes = edge->
getLanes();
391 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
394 myFGPositions.push_back((*i)->geometryPositionAtOffset(pos));
407 return myParent->getPopUpMenu(app, parent);
421 if (s.
scale * exaggeration >= 3) {
423 const double prob = myParent->getProbability();
428 if (ri !=
nullptr && prob > 0) {
431 const int noLanes = (int)myFGPositions.size();
432 for (
int j = 0; j < noLanes; ++j) {
434 double rot = myFGRotations[j];
436 glTranslated(pos.
x(), pos.
y(), 0);
437 glRotated(rot, 0, 0, 1);
438 glTranslated(0, -1.5, 0);
441 noPoints = (int)(9.0 + s.
scale / 10.0);
448 glColor3d(0.7, 0, 0);
450 glTranslated(0, 0, .1);
453 glTranslated(0, 0, .1);
455 glRotated(-90, 0, 0, 1);
456 glBegin(GL_TRIANGLES);
457 glVertex2d(0 - .3, -1.);
458 glVertex2d(0 - .3, 1.);
459 glVertex2d(0 + .3, 1.);
460 glVertex2d(0 + .3, -1.);
461 glVertex2d(0 - .3, -1.);
462 glVertex2d(0 + .3, 1.);
471 for (
int i = 0; i < (int)myFGPositions.size(); ++i) {
472 const Position& pos = myFGPositions[i];
473 double rot = myFGRotations[i];
475 glTranslated(pos.
x(), pos.
y(), 0);
476 glRotated(rot, 0, 0, 1);
478 glScaled(exaggeration, exaggeration, 1);
479 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
481 glBegin(GL_TRIANGLES);
482 glColor3d(1, .8f, 0);
484 glVertex2d(0 - 1.4, 0);
485 glVertex2d(0 - 1.4, 6);
486 glVertex2d(0 + 1.4, 6);
487 glVertex2d(0 + 1.4, 0);
488 glVertex2d(0 - 1.4, 0);
489 glVertex2d(0 + 1.4, 6);
505 for (
int i = 0; i < (int)myFGPositions.size(); ++i) {
506 const Position& pos = myFGPositions[i];
507 double rot = myFGRotations[i];
509 glTranslated(pos.
x(), pos.
y(), 0);
510 glRotated(rot, 0, 0, 1);
512 glScaled(exaggeration, exaggeration, 1);
513 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
515 glBegin(GL_TRIANGLES);
518 glVertex2d(0 - 0.0, 0);
519 glVertex2d(0 - 1.4, 6);
520 glVertex2d(0 + 1.4, 6);
521 glVertex2d(0 + 0.0, 0);
522 glVertex2d(0 + 1.4, 6);
550 myParent->shiftProbs();