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);
163 myChosenValue != 1 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
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));
341 if (s.
scale * exaggeration >= 3) {
348 if (ri !=
nullptr && prob > 0) {
352 for (
int j = 0; j < noLanes; ++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.);
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);
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
double getProbability() const
Returns the rerouting probability.
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
long onCmdClose(FXObject *, FXSelector, void *)
MSEdgeVector closed
The list of closed edges.
const RerouteInterval * getCurrentReroute(SUMOTime time, SUMOVehicle &veh) const
Returns the rerouting definition valid for the given time and vehicle, 0 if none. ...
GUITriggeredRerouterEdge(GUIEdge *edge, GUITriggeredRerouter *parent, bool closed)
double scale
information about a lane's width (temporary, used for a single view)
Reroutes vehicles passing an edge One rerouter can be active on multiple edges. To reduce drawing loa...
FXRealSpinner * myUsageProbabilityDial
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
Open the object's manipulator.
std::vector< GUITriggeredRerouterEdge * > myEdgeVisualizations
FXDEFMAP(GUITriggeredRerouter::GUIManip_TriggeredRerouter) GUIManip_TriggeredRerouterMap[]
GUITriggeredRerouter(const std::string &id, const MSEdgeVector &edges, double prob, const std::string &aXMLFilename, bool off, SUMOTime timeThreshold, const std::string &vTypes, SUMORTree &rtree)
Constructor.
GUIManipulator * openManipulator(GUIMainWindow &app, GUISUMOAbstractView &parent)
Stores the information about how to visualize structures.
double y() const
Returns the y-position.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
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)
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
GUITriggeredRerouter * myParent
The parent rerouter to which this edge instance belongs.
void setUserUsageProbability(double prob)
Sets the probability with which a vehicle is rerouted given by the user.
static const RGBColor BLACK
const std::string & getID() const
Returns the id.
void setUserMode(bool val)
Sets whether the process is currently steered by the user.
GUITriggeredRerouterPopupMenuMap[]
MSEdge * myEdge
The edge for which this visualization applies.
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
A RT-tree for efficient storing of SUMO's GL-objects.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
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.
#define UNUSED_PARAMETER(x)
A class that stores a 2D geometrical boundary.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
A road/street connecting two junctions (gui-version)
virtual void myEndElement(int element)
Called when a closing tag occurs.
GUIVisualizationSizeSettings addSize
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A point in 2D or 3D with translation and scaling methods.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
virtual ~GUIManip_TriggeredRerouter()
Destructor.
const bool myAmClosedEdge
whether this edge instance visualizes a closed edge
virtual ~GUITriggeredRerouterEdge()
Boundary & grow(double by)
extends the boundary by the given amount
GUITriggeredRerouter * myObject
long onCmdUserDef(FXObject *, FXSelector, void *)
Boundary myBoundary
The boundary of this rerouter.
long onUpdUserDef(FXObject *, FXSelector, void *)
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
long onCmdChangeOption(FXObject *, FXSelector, void *)
RotCont myFGRotations
The rotations in full-geometry mode.
void buildShowManipulatorPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the manipulator window.
Reroutes vehicles passing an edge.
double length() const
Returns the length.
A MSNet extended by some values for usage within the gui.
void addAdditionalGLObject(GUIGlObject *o)
Adds an additional object (detector/shape/trigger) for visualisation.
std::vector< RerouteInterval > myIntervals
List of rerouting definition intervals.
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.
an aggreagated-output interval
double myUsageProbability
std::vector< MSEdge * > MSEdgeVector
~GUITriggeredRerouter()
Destructor.
const std::string & getFullName() const
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
void myEndElement(int element)
Called when a closing tag occurs.
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
Boundary myBoundary
The boundary of this rerouter.
A window containing a gl-object's parameter.
PosCont myFGPositions
The positions in full-geometry mode.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.