95 myChosenValue(0), myChosenTarget(myChosenValue, NULL, MID_OPTION),
96 myUsageProbability(o.getProbability()), myUsageProbabilityTarget(myUsageProbability),
98 myChosenTarget.setTarget(
this);
100 new FXVerticalFrame(
this, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0);
102 FXGroupBox* gp =
new FXGroupBox(f1,
"Change Probability",
103 GROUPBOX_TITLE_LEFT | FRAME_SUNKEN | FRAME_RIDGE,
104 0, 0, 0, 0, 4, 4, 1, 1, 2, 0);
107 FXHorizontalFrame* gf1 =
108 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
109 new FXRadioButton(gf1,
"Default", &myChosenTarget, FXDataTarget::ID_OPTION + 0,
110 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP,
111 0, 0, 0, 0, 2, 2, 0, 0);
115 FXHorizontalFrame* gf12 =
116 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
117 new FXRadioButton(gf12,
"User Given: ", &myChosenTarget, FXDataTarget::ID_OPTION + 1,
118 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP | LAYOUT_CENTER_Y,
119 0, 0, 0, 0, 2, 2, 0, 0);
120 myUsageProbabilityDial =
122 LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
123 myUsageProbabilityDial->setFormatString(
"%.2f");
124 myUsageProbabilityDial->setIncrements(.1, .1, .1);
125 myUsageProbabilityDial->setRange(0, 1);
126 myUsageProbabilityDial->setValue(myObject->getUserProbability());
130 FXHorizontalFrame* gf13 =
131 new FXHorizontalFrame(gp, LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 5, 5);
132 new FXRadioButton(gf13,
"Off", &myChosenTarget, FXDataTarget::ID_OPTION + 2,
133 ICON_BEFORE_TEXT | LAYOUT_SIDE_TOP,
134 0, 0, 0, 0, 2, 2, 0, 0);
136 myChosenValue = myObject->inUserMode()
137 ? myObject->getUserProbability() > 0
140 new FXButton(f1,
"Close", NULL,
this,
MID_CLOSE,
141 BUTTON_INITIAL | BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 30, 30, 4, 4);
168 myChosenValue != 1 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
223 const std::string&
id,
225 double prob,
const std::string& aXMLFilename,
bool off,
231 for (MSEdgeVector::const_iterator it = edges.begin(); it != edges.end(); ++it) {
253 for (MSEdgeVector::const_iterator it = ri.
closed.begin(); it != ri.
closed.end(); ++it) {
316 myAmClosedEdge(closed) {
317 const std::vector<MSLane*>& lanes = edge->
getLanes();
320 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
322 const double pos = closed ? 3 : v.
length() - (double) 6.;
323 myFGPositions.push_back((*i)->geometryPositionAtOffset(pos));
350 if (s.
scale * exaggeration >= 3) {
357 if (ri != 0 && prob > 0) {
361 for (
int j = 0; j < noLanes; ++j) {
365 glTranslated(pos.
x(), pos.
y(), 0);
366 glRotated(rot, 0, 0, 1);
367 glTranslated(0, -1.5, 0);
370 noPoints = (int)(9.0 + s.
scale / 10.0);
377 glColor3d(0.7, 0, 0);
379 glTranslated(0, 0, .1);
382 glTranslated(0, 0, .1);
384 glRotated(-90, 0, 0, 1);
385 glBegin(GL_TRIANGLES);
386 glVertex2d(0 - .3, -1.);
387 glVertex2d(0 - .3, 1.);
388 glVertex2d(0 + .3, 1.);
389 glVertex2d(0 + .3, -1.);
390 glVertex2d(0 - .3, -1.);
391 glVertex2d(0 + .3, 1.);
404 glTranslated(pos.
x(), pos.
y(), 0);
405 glRotated(rot, 0, 0, 1);
407 glScaled(exaggeration, exaggeration, 1);
408 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
410 glBegin(GL_TRIANGLES);
411 glColor3d(1, .8f, 0);
413 glVertex2d(0 - 1.4, 0);
414 glVertex2d(0 - 1.4, 6);
415 glVertex2d(0 + 1.4, 6);
416 glVertex2d(0 + 1.4, 0);
417 glVertex2d(0 - 1.4, 0);
418 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...
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
std::vector< GUITriggeredRerouterEdge * > myEdgeVisualizations
FXDEFMAP(GUITriggeredRerouter::GUIManip_TriggeredRerouter) GUIManip_TriggeredRerouterMap[]
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)
GUITriggeredRerouter(const std::string &id, const MSEdgeVector &edges, double prob, const std::string &aXMLFilename, bool off, SUMOTime timeThreshold, SUMORTree &rtree)
Constructor.
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.
FXRealSpinDial * myUsageProbabilityDial
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.
Open the object's manipulator.
void addAdditionalGLObject(GUIGlObject *o)
Adds an additional object (detector/shape/trigger) for visualisation.
std::vector< RerouteInterval > myIntervals
List of rerouting definition intervals.
FXdouble getValue() const
Return current value.
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.
double getExaggeration(const GUIVisualizationSettings &s, double factor=20) const
return the drawing size including exaggeration and constantSize values
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.
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.