124 for (
int stage = 1; stage < p->
getNumStages(); stage++) {
137 if (myParent->getTrackedID() !=
static_cast<GUIPerson*
>(myObject)->
getGlID()) {
147 myParent->stopTrack();
156 stage->
abort(person);
171 MSPerson(pars, vtype, plan, speedFactor),
180 if (i->first->getTrackedID() ==
getGlID()) {
181 i->first->stopTrack();
183 while (i->first->removeAdditionalGLVisualisation(
this));
206 new FXMenuSeparator(ret);
213 new FXMenuSeparator(ret);
218 new FXMenuSeparator(ret);
293 glScaled(exaggeration, exaggeration, 1);
311#ifdef GUIPerson_DEBUG_DRAW_WALKINGAREA_PATHS
327 if (stage !=
nullptr) {
330 if (stripingState !=
nullptr) {
332 if (waPath !=
nullptr) {
346 glTranslated(0, 0,
getType() - .1);
361 for (ConstMSEdgeVector::const_iterator it = edges.begin(); it != edges.end(); ++it) {
391 switch (activeScheme) {
423 const double hue = (double)((
long long int)person % 360);
424 const double sat = (double)(((
long long int)person / 360) % 67) / 100. + 0.33;
436 switch (activeScheme) {
465 FXMutexLock locker(
myLock);
474 FXMutexLock locker(
myLock);
484 FXMutexLock locker(
myLock);
494 FXMutexLock locker(
myLock);
505 if (veh ==
nullptr) {
534 FXMutexLock locker(
myLock);
548 FXMutexLock locker(
myLock);
558 FXMutexLock locker(
myLock);
568 FXMutexLock locker(
myLock);
578 FXMutexLock locker(
myLock);
589 FXMutexLock locker(
myLock);
599 FXMutexLock locker(
myLock);
609 FXMutexLock locker(
myLock);
619 FXMutexLock locker(
myLock);
624 if (destStop !=
nullptr) {
625 return destStop->
getID();
634 FXMutexLock locker(
myLock);
639 if (veh !=
nullptr) {
649 FXMutexLock locker(
myLock);
663 FXMutexLock locker(
myLock);
674 FXMutexLock locker(
myLock);
@ MID_HIDE_CURRENTROUTE
Hide vehicle's current route.
@ MID_SHOWPLAN
Show transportable plan.
@ MID_HIDE_WALKINGAREA_PATH
Hide persons's path on walkingarea.
@ MID_SHOW_WALKINGAREA_PATH
Show persons's path on walkingarea.
@ MID_START_TRACK
Start to track a vehicle.
@ MID_REMOVE_OBJECT
remove a vehicle or person
@ MID_SHOW_CURRENTROUTE
Show vehicle's current route.
@ MID_STOP_TRACK
Stop to track a vehicle.
GUISelectedStorage gSelected
A global holder of selected objects.
GUIIcon
An enumeration of icons used by the gui applications.
FXDEFMAP(GUIPerson::GUIPersonPopupMenu) GUIPersonPopupMenuMap[]
std::vector< const MSEdge * > ConstMSEdgeVector
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
const long long int VTYPEPARS_COLOR_SET
const long long int VEHPARS_COLOR_SET
const double INVALID_DOUBLE
invalid double
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Boundary & grow(double by)
extends the boundary by the given amount
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static void pushName(unsigned int name)
push Name
static void popMatrix()
pop matrix
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.
static RGBColor getColor()
gets the gl-color
static void popName()
pop Name
static void pushMatrix()
push matrix
static void drawTextSettings(const GUIVisualizationTextSettings &settings, const std::string &text, const Position &pos, const double scale, const double angle=0, const double layer=2048, const int align=0)
static void drawAction_drawAsPoly(const double angle, const double length, const double width)
static void drawAction_drawAsImage(const double angle, const double length, const double width, const std::string &file, const SUMOVehicleShape guiShape, const double exaggeration)
static void drawAction_drawAsCircle(const double angle, const double length, const double width, double detail)
static void drawAction_drawAsTriangle(const double angle, const double length, const double width)
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel, const bool disable=false)
build menu command
void buildShowTypeParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the type parameter window.
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, const GUIMainWindow &app) const
Builds an entry which allows to copy the cursor position if geo projection is used,...
GUIGlID getGlID() const
Returns the numerical id of the object.
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0, bool forceShow=false) const
draw name of item
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
Representation of a lane in the micro simulation (gui-version)
const std::vector< double > & getShapeRotations(bool secondary) const
const PositionVector & getShape(bool secondary) const override
const std::vector< double > & getShapeLengths(bool secondary) const
A window containing a gl-object's parameter.
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
void setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
void drawAction_drawWalkingareaPath(const GUIVisualizationSettings &s) const
draw walking area path
bool proceed(MSNet *net, SUMOTime time, const bool vehicleArrived=false) override
double getExaggeration(const GUIVisualizationSettings &s) const override
return exaggeration associated with this GLObject
std::string getDestinationStopID() const
get destination stop ID
std::string getDestinationEdgeID() const
get destination edge ID
std::string getStageIndexDescription() const
get stage index description
Position getPosition() const override
return the Network coordinate of the person
virtual void drawGLAdditional(GUISUMOAbstractView *const parent, const GUIVisualizationSettings &s) const override
Draws additionally triggered visualisations.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own popup-menu.
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const override
gets the color value according to the current scheme index
double getGUIAngle() const
return the angle of the person (only for drawing centering and tracking)
Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
bool isSelected() const override
whether this person is selected in the GUI
Position getGUIPosition(const GUIVisualizationSettings *s=nullptr) const
return the Network coordinate of the person (only for drawing centering and tracking)
double getStopDuration() const
get remaining duration of current stop or -1
GUIBaseVehicle::Seat myPositionInVehicle
The position of a person while riding a vehicle.
std::map< GUISUMOAbstractView *, int > myAdditionalVisualizations
Enabled visualisations, per view.
@ VO_SHOW_WALKINGAREA_PATH
show the current walkingarea path
@ VO_SHOW_ROUTE
show persons's current route
double getEdgePos() const override
Return the position on the edge.
double getSpeed() const override
the current speed of the person
double getNaviDegree() const
return the current angle of the person
std::string getVehicleID() const
get current vehicle id if applicable
GUIPerson(const SUMOVehicleParameter *pars, MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan, const double speedFactor)
Constructor.
std::string getEdgeID() const
get edge ID
bool hasActiveAddVisualisation(GUISUMOAbstractView *const parent, int which) const
Returns whether the named feature is enabled in the given view.
double getWaitingSeconds() const override
the time this person spent waiting in seconds
void setPositionInVehicle(const GUIBaseVehicle::Seat &pos)
void removeActiveAddVisualisation(GUISUMOAbstractView *const parent, int which) override
Adds the named visualisation feature to the given view.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own parameter window.
FXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
int getDirection() const override
Return the movement directon on the edge.
std::string getFromEdgeID() const
ger from edge ID
double getStageArrivalPos() const
get stage arrival position
static bool setFunctionalColor(int activeScheme, const MSPerson *person, RGBColor &col)
sets the color according to the current scheme index and some vehicle function
GUIParameterTableWindow * getTypeParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own type parameter window.
void addActiveAddVisualisation(GUISUMOAbstractView *const parent, int which)
Adds the named visualisation feature to the given view.
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
T getColor(const double value) const
bool removeAdditionalGLVisualisation(GUIGlObject *const which)
Removes an object from the list of objects that show additional things.
bool addAdditionalGLVisualisation(GUIGlObject *const which)
Adds an object to call its additional visualisation method.
virtual GUIGlID getTrackedID() const
get tracked id
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
Stores the information about how to visualize structures.
GUIVisualizationTextSettings personValue
GUIVisualizationSizeSettings addSize
int personQuality
The quality of person drawing.
bool gaming
whether the application is in gaming mode or not
GUIVisualizationSizeSettings personSize
GUIColorer personColorer
The person colorer.
double scale
information about a lane's width (temporary, used for a single view)
bool secondaryShape
whether secondary lane shape shall be drawn
GUIVisualizationTextSettings personName
double angle
The current view rotation angle.
static double naviDegree(const double angle)
virtual void removeTransportable(MSTransportable *t) const
The simulated network and simulation perfomer.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
virtual MSTransportableControl & getPersonControl()
Returns the person control.
Container for pedestrian state and individual position update function.
const WalkingAreaPath * myWalkingAreaPath
the current walkingAreaPath or 0
static const int UNDEFINED_DIRECTION
double getChosenSpeedFactor() const
the current speed factor of the transportable (where applicable)
bool isJammed() const
whether the person is jammed as defined by the current pedestrian model
virtual double getArrivalPos() const
virtual MSStoppingPlace * getOriginStop() const
returns the origin stop (if any). only needed for MSStageTrip
MSStoppingPlace * getDestinationStop() const
returns the destination stop (if any)
virtual SUMOVehicle * getVehicle() const
Current vehicle in which the transportable is driving (or nullptr)
virtual void abort(MSTransportable *)
abort this stage (TraCI)
virtual const MSEdge * getEdge() const
Returns the current edge.
const std::vector< const MSEdge * > & getRoute() const
MSTransportableStateAdapter * getPState() const
A lane area vehicles can halt at.
Position getCenterPos() const
the position in the middle of the stop shape
void removeTransportable(const MSTransportable *p)
Removes a transportable from this stop.
virtual void erase(MSTransportable *transportable)
removes a single transportable
const MSEdge * getFromEdge() const
Returns the departure edge.
virtual double getEdgePos() const
Return the position on the edge.
std::string getCurrentStageDescription() const
Returns the current stage description as a string.
const MSEdge * getDestination() const
Returns the current destination.
virtual double getAngle() const
return the current angle of the transportable
MSStageType getStageType(int next) const
the stage type for the nth next stage
bool isWaiting4Vehicle() const
Whether the transportable waits for a vehicle.
virtual double getSpeed() const
the current speed of the transportable
std::string getStageSummary(int stageIndex) const
return textual summary for the given stage
MSStage * getCurrentStage() const
Return the current stage.
virtual bool proceed(MSNet *net, SUMOTime time, const bool vehicleArrived=false)
MSVehicleType * myVType
This transportable's type. (mainly used for drawing related information Note sure if it is really nec...
virtual Position getPosition() const
Return the Network coordinate of the transportable.
const MSVehicleType & getVehicleType() const
Returns the object's "vehicle" type.
int getNumStages() const
Return the total number stages in this person's plan.
int getCurrentStageIndex() const
Return the index of the current stage.
MSStageType getCurrentStageType() const
the current stage type of the transportable
virtual double getWaitingSeconds() const
the time this transportable spent waiting in seconds
bool hasArrived() const
return whether the person has reached the end of its plan
const MSEdge * getEdge() const
Returns the current edge.
virtual int getDirection() const
Return the movement directon on the edge.
std::vector< MSStage * > MSTransportablePlan
the structure holding the plan of a transportable
const SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition)
The car-following model and parameter.
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
double getMaxSpeed() const
Get vehicle's (technical) maximum speed [m/s].
double getDesiredMaxSpeed() const
Returns the vehicles's desired maximum speed.
const std::string & getID() const
Returns the name of the vehicle type.
double getMinGap() const
Get the free space in front of vehicles of this class.
bool wasSet(long long int what) const
Returns whether the given parameter was set.
double getHeight() const
Get the height which vehicles of this class shall have when being drawn.
double getLength() const
Get vehicle's length [m].
double getMass() const
Get this vehicle type's mass.
const SUMOVTypeParameter & getParameter() const
const RGBColor & getColor() const
Returns this type's color.
const std::string & getID() const
Returns the id.
An upper class for objects with additional parameters.
A point in 2D or 3D with translation and scaling methods.
static const Position INVALID
used to indicate that a position is valid
double x() const
Returns the x-position.
double y() const
Returns the y-position.
Position getCentroid() const
Returns the centroid (closes the polygon if unclosed)
bool around(const Position &p, double offset=0) const
Returns the information whether the position vector describes a polygon lying around the given point.
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb, inspired by http://alvyray.com/Papers/CG/hsv2rgb....
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
Representation of a vehicle.
virtual PositionVector getBoundingBox(double offset=0) const =0
get bounding rectangle
Structure representing possible vehicle parameter.
bool wasSet(long long int what) const
Returns whether the given parameter was set.
RGBColor color
The vehicle's color, TraCI may change this.
A scoped lock which only triggers on condition.
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
bool show(const GUIGlObject *o) const
whether to show the text
double scaledSize(double scale, double constFactor=0.1) const
get scale size
const PositionVector shape