86 myVehiclesAdditionalVisualizations(additionalVisualizations) {
135 for (
int stage = 1; stage < p->
getNumStages(); stage++) {
168 MSPerson(pars, vtype, plan, speedFactor),
177 if (i->first->getTrackedID() ==
getGlID()) {
178 i->first->stopTrack();
180 while (i->first->removeAdditionalGLVisualisation(
this));
204 new FXMenuSeparator(ret);
206 new FXMenuCommand(ret,
"Start Tracking",
nullptr, ret,
MID_START_TRACK);
208 new FXMenuCommand(ret,
"Stop Tracking",
nullptr, ret,
MID_STOP_TRACK);
210 new FXMenuSeparator(ret);
215 new FXMenuSeparator(ret);
252 ret->
mkItem(
"Type Information:",
false,
"");
281 glRotated(90, 0, 0, 1);
286 glScaled(upscale, upscale, 1);
301 #ifdef GUIPerson_DEBUG_DRAW_WALKINGAREA_PATHS 316 if (stage !=
nullptr) {
319 if (stripingState !=
nullptr) {
321 if (waPath !=
nullptr) {
335 glTranslated(0, 0,
getType() - .1);
349 for (ConstMSEdgeVector::const_iterator it = edges.begin(); it != edges.end(); ++it) {
373 switch (activeScheme) {
405 const double hue = (long)
this % 360;
406 const double sat = (((long)
this / 360) % 67) / 100.0 + 0.33;
418 switch (activeScheme) {
487 glBegin(GL_TRIANGLES);
494 glTranslated(0, 0, .045);
495 glBegin(GL_TRIANGLES);
497 glVertex2d(0.5, -0.25);
498 glVertex2d(0.5, 0.25);
500 glTranslated(0, 0, -.045);
510 glTranslated(0, 0, .045);
512 glScaled(1, 0.5, 1.);
515 glBegin(GL_TRIANGLES);
516 glVertex2d(0.0, -0.2);
517 glVertex2d(0.0, 0.2);
518 glVertex2d(-0.6, 0.0);
520 glTranslated(0, 0, -.045);
522 glScaled(0.9, 2.0, 1);
523 glTranslated(0, 0, .04);
526 glTranslated(0, 0, -.04);
static void drawTexturedBox(int which, double size)
Draws a named texture as a box with the given size.
bool isSelected() const
whether this person is selected in the GUI
virtual void drawGLAdditional(GUISUMOAbstractView *const parent, const GUIVisualizationSettings &s) const
Draws additionally triggered visualisations.
std::map< GUISUMOAbstractView *, int > myAdditionalVisualizations
Enabled visualisations, per view.
double scale
information about a lane's width (temporary, used for a single view)
bool hasActiveAddVisualisation(GUISUMOAbstractView *const parent, int which) const
Returns whether the named feature is enabled in the given view.
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
double getArrivalPos() const
returns the final arrival pos
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
show persons's current route
GUIVisualizationTextSettings personValue
const MSEdge * getEdge() const
Returns the current edge.
GUIVisualizationTextSettings personName
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb.
WalkingAreaPath * myWalkingAreaPath
the current walkingAreaPath or 0
virtual double getEdgePos() const
Return the position on the edge.
Position getPosition() const
return the Network coordinate of the person
Stores the information about how to visualize structures.
double y() const
Returns the y-position.
void drawAction_drawAsImage(const GUIVisualizationSettings &s) const
static void drawTextSettings(const GUIVisualizationTextSettings &settings, const std::string &text, const Position &pos, const double scale, const double angle=0, const double layer=2048)
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
std::string time2string(SUMOTime t)
double x() const
Returns the x-position.
std::string getImgFile() const
Get this vehicle type's raster model file name.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
bool addAdditionalGLVisualisation(const GUIGlObject *const which)
Adds an object to call its additional visualisation method.
std::vector< const MSEdge * > ConstMSEdgeVector
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
virtual double getSpeed() const
the current speed of the transportable
const SUMOVehicleParameter & getParameter() const
virtual void stopTrack()
stop track
const std::vector< double > & getShapeRotations() const
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.
void buildShowTypeParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the type parameter window.
GUIPerson(const SUMOVehicleParameter *pars, MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan, const double speedFactor)
Constructor.
int getNumRemainingStages() const
Return the number of remaining stages (including the current)
A class that stores a 2D geometrical boundary.
bool removeAdditionalGLVisualisation(const GUIGlObject *const which)
Removes an object from the list of objects that show additional things.
The car-following model and parameter.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Start to track a vehicle.
PedestrianState * getPedestrianState() const
Representation of a lane in the micro simulation (gui-version)
double getEdgePos() const
return the offset from the start of the current edge
MFXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
const MSEdge * getFromEdge() const
Returns the departure edge.
void drawAction_drawWalkingareaPath(const GUIVisualizationSettings &s) const
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
std::vector< MSTransportable::Stage * > MSTransportablePlan
the structure holding the plan of a transportable
static double naviDegree(const double angle)
MSTransportable::Stage * getCurrentStage() const
Return the current stage.
virtual GUIGlID getTrackedID() const
get tracked id
virtual void startTrack(int)
star track
MSVehicleType * myVType
This transportable's type. (mainly used for drawing related information Note sure if it is really nec...
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
void drawAction_drawAsPoly(const GUIVisualizationSettings &s) const
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
double getWaitingSeconds() const
the time this person spent waiting in seconds
A point in 2D or 3D with translation and scaling methods.
double scaledSize(double scale, double constFactor=0.1) const
double getNaviDegree() const
return the current angle of the person
virtual double getAngle() const
return the current angle of the transportable
bool setFunctionalColor(int activeScheme) const
sets the color according to the current scheme index and some vehicle function
GUIParameterTableWindow * getTypeParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own type parameter window.
static int getTextureID(const std::string &filename, const bool mirrorX=false)
return texture id for the given filename (initialize on first use)
bool isWaiting4Vehicle() const
Whether the transportable waits for a vehicle.
double getMaxSpeed() const
Get vehicle's maximum speed [m/s].
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
GUIColorer personColorer
The person colorer.
const std::string & getID() const
returns the id of the transportable
const PositionVector & getShape() const
double getSpeed() const
the current speed of the person
Boundary & grow(double by)
extends the boundary by the given amount
double getMinGap() const
Get the free space in front of vehicles of this class.
double angle
The current view rotation angle.
double getColorValue(int activeScheme) const
gets the color value according to the current scheme index
const T getColor(const double value) const
Show vehicle's current route.
std::string getStageSummary(int stageIndex) const
return textual summary for the given stage
An upper class for objects with additional parameters.
show the current walkingarea path
const int VEHPARS_COLOR_SET
const ConstMSEdgeVector & getRoute() const
FXDEFMAP(GUIPerson::GUIPersonPopupMenu) GUIPersonPopupMenuMap[]
const SUMOVTypeParameter & getParameter() const
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void removeActiveAddVisualisation(GUISUMOAbstractView *const parent, int which)
Adds the named visualisation feature to the given view.
void unlock()
release mutex lock
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
double getHeight() const
Get the height which vehicles of this class shall have when being drawn.
std::string getCurrentStageDescription() const
Returns the current stage description as a string.
double getSpeedFactor() const
the current speed factor of the transportable (where applicable)
Structure representing possible vehicle parameter.
virtual Position getPosition() const
Return the Network coordinate of the transportable.
A mutex encapsulator which locks/unlocks the given mutex on construction/destruction, respectively.
void setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
void addActiveAddVisualisation(GUISUMOAbstractView *const parent, int which)
Adds the named visualisation feature to the given view.
const std::vector< double > & getShapeLengths() const
const std::string & getID() const
Returns the name of the vehicle type.
Container for pedestrian state and individual position update function.
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
GUIVisualizationSizeSettings personSize
int personQuality
The quality of person drawing.
double getLength() const
Get vehicle's length [m].
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
GUIGlID getGlID() const
Returns the numerical id of the object.
const MSVehicleType & getVehicleType() const
virtual double getWaitingSeconds() const
the time this transportable spent waiting in seconds
const MSEdge * getDestination() const
Returns the current destination.
Show persons's path on walkingarea.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
Hide persons's path on walkingarea.
GUISelectedStorage gSelected
A global holder of selected objects.
Position myPositionInVehicle
The position of a person while riding a vehicle.
A window containing a gl-object's parameter.
const int VTYPEPARS_COLOR_SET
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
Hide vehicle's current route.
int getNumStages() const
Return the total number stages in this persons plan.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
static const Position INVALID
used to indicate that a position is valid
StageType getCurrentStageType() const
the current stage type of the transportable
void drawAction_drawAsTriangle(const GUIVisualizationSettings &s) const
static RGBColor getColor()
gets the gl-color
Position getGUIPosition() const
return the Network coordinate of the person (only for drawing centering and tracking) ...