 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
71 myVehiclesAdditionalVisualizations(additionalVisualizations) {
81 if (!static_cast<GUIPerson*>(myObject)->hasActiveAddVisualisation(myParent,
VO_SHOW_ROUTE)) {
82 static_cast<GUIPerson*>(myObject)->addActiveAddVisualisation(myParent,
VO_SHOW_ROUTE);
91 static_cast<GUIPerson*>(myObject)->removeActiveAddVisualisation(myParent,
VO_SHOW_ROUTE);
116 GUIPerson* p = dynamic_cast<GUIPerson*>(myObject);
122 for (
int stage = 1; stage < p->
getNumStages(); stage++) {
135 if (myParent->getTrackedID() != static_cast<GUIPerson*>(myObject)->getGlID()) {
136 myParent->startTrack(static_cast<GUIPerson*>(myObject)->
getGlID());
145 myParent->stopTrack();
152 GUIPerson* person = static_cast<GUIPerson*>(myObject);
154 stage->
abort(person);
169 MSPerson(pars, vtype, plan, speedFactor),
178 if (i->first->getTrackedID() ==
getGlID()) {
179 i->first->stopTrack();
181 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);
211 new FXMenuSeparator(ret);
216 new FXMenuSeparator(ret);
253 ret->
mkItem(
"Type Information:",
false,
"");
282 glRotated(90, 0, 0, 1);
287 glScaled(exaggeration, exaggeration, 1);
305 #ifdef GUIPerson_DEBUG_DRAW_WALKINGAREA_PATHS
321 if (stage !=
nullptr) {
324 if (stripingState !=
nullptr) {
326 if (waPath !=
nullptr) {
341 glTranslated(0, 0,
getType() - .1);
355 for (ConstMSEdgeVector::const_iterator it = edges.begin(); it != edges.end(); ++it) {
356 GUILane* lane = static_cast<GUILane*>((*it)->getLanes()[0]);
383 switch (activeScheme) {
415 const double hue = (long)
this % 360;
416 const double sat = (((long)
this / 360) % 67) / 100.0 + 0.33;
428 switch (activeScheme) {
448 FXMutexLock locker(
myLock);
455 FXMutexLock locker(
myLock);
462 FXMutexLock locker(
myLock);
473 FXMutexLock locker(
myLock);
480 FXMutexLock locker(
myLock);
487 FXMutexLock locker(
myLock);
494 FXMutexLock locker(
myLock);
501 FXMutexLock locker(
myLock);
508 FXMutexLock locker(
myLock);
515 FXMutexLock locker(
myLock);
522 FXMutexLock locker(
myLock);
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Container for pedestrian state and individual position update function.
The car-following model and parameter.
bool addAdditionalGLVisualisation(const GUIGlObject *const which)
Adds an object to call its additional visualisation method.
std::string getStageIndexDescription() const
get stage index description
Position getGUIPosition() const
return the Network coordinate of the person (only for drawing centering and tracking)
double getSpeed() const
the current speed of the person
const std::string & getID() const
Returns the name of the vehicle type.
static void drawTextSettings(const GUIVisualizationTextSettings &settings, const std::string &text, const Position &pos, const double scale, const double angle=0, const double layer=2048)
static RGBColor getColor()
gets the gl-color
A window containing a gl-object's parameter.
void setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
const MSEdge * getDestination() const
Returns the current destination.
An upper class for objects with additional parameters.
std::string getStageSummary(int stageIndex) const
return textual summary for the given stage
WalkingAreaPath * myWalkingAreaPath
the current walkingAreaPath or 0
void drawAction_drawWalkingareaPath(const GUIVisualizationSettings &s) const
draw walking area path
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
double angle
The current view rotation angle.
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
static const Position INVALID
used to indicate that a position is valid
Show vehicle's current route.
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.
std::string getEdgeID() const
get edge ID
virtual void erase(MSTransportable *transportable)
removes a single transportable
Start to track a vehicle.
void setPositionInVehicle(const Position &pos)
static double naviDegree(const double angle)
Show persons's path on walkingarea.
std::vector< const MSEdge * > ConstMSEdgeVector
GUIColorer personColorer
The person colorer.
FXDEFMAP(GUIPerson::GUIPersonPopupMenu) GUIPersonPopupMenuMap[]
void removeTransportable(MSTransportable *p)
Removes a transportable from this stop.
bool isSelected() const
whether this person is selected in the GUI
Structure representing possible vehicle parameter.
FXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
std::string getDestinationEdgeID() const
get destination edge ID
Hide persons's path on walkingarea.
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
StageType getCurrentStageType() const
the current stage type of the transportable
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
double scaledSize(double scale, double constFactor=0.1) const
get scale size
virtual const MSEdge * getEdge() const
Returns the current edge.
double getHeight() const
Get the height which vehicles of this class shall have when being drawn.
GUIPerson(const SUMOVehicleParameter *pars, MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan, const double speedFactor)
Constructor.
virtual void abort(MSTransportable *)
abort this stage (TraCI)
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
gets the color value according to the current scheme index
const MSEdge * getEdge() const
Returns the current edge.
static void drawAction_drawAsPoly(const double angle, const double lenght, const double width)
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
MSTransportable::Stage * getCurrentStage() const
Return the current stage.
const PositionVector & getShape() const
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
int getNumStages() const
Return the total number stages in this persons plan.
virtual double getWaitingSeconds() const
the time this transportable spent waiting in seconds
const int VEHPARS_COLOR_SET
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
const std::vector< double > & getShapeRotations() const
GUIGlID getGlID() const
Returns the numerical id of the object.
bool hasActiveAddVisualisation(GUISUMOAbstractView *const parent, int which) const
Returns whether the named feature is enabled in the given view.
A class that stores a 2D geometrical boundary.
const std::vector< double > & getShapeLengths() const
double scale
information about a lane's width (temporary, used for a single view)
std::string getFromEdgeID() const
ger from edge ID
void addActiveAddVisualisation(GUISUMOAbstractView *const parent, int which)
Adds the named visualisation feature to the given view.
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
std::string time2string(SUMOTime t)
bool isWaiting4Vehicle() const
Whether the transportable waits for a vehicle.
double getMinGap() const
Get the free space in front of vehicles of this class.
GUIVisualizationSizeSettings personSize
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb, inspired by http://alvyray.com/Papers/CG/hsv2rgb....
double getWaitingSeconds() const
the time this person spent waiting in seconds
double getArrivalPos() const
virtual double getEdgePos() const
Return the position on the edge.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
virtual void removePerson(MSTransportable *p) const
Position getPosition() const
return the Network coordinate of the person
double getSpeedFactor() const
the current speed factor of the transportable (where applicable)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Representation of a lane in the micro simulation (gui-version)
std::vector< MSTransportable::Stage * > MSTransportablePlan
the structure holding the plan of a transportable
show the current walkingarea path
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
double y() const
Returns the y-position.
int getNumRemainingStages() const
Return the number of remaining stages (including the current)
virtual MSTransportableControl & getPersonControl()
Returns the person control.
void removeActiveAddVisualisation(GUISUMOAbstractView *const parent, int which)
Adds the named visualisation feature to the given view.
bool removeAdditionalGLVisualisation(const GUIGlObject *const which)
Removes an object from the list of objects that show additional things.
virtual double getSpeed() const
the current speed of the transportable
const ConstMSEdgeVector & getRoute() const
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type.
double getLength() const
Get vehicle's length [m].
void buildShowTypeParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the type parameter window.
bool setFunctionalColor(int activeScheme) const
sets the color according to the current scheme index and some vehicle function
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
const SUMOVTypeParameter & getParameter() const
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
GUISelectedStorage gSelected
A global holder of selected objects.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used,...
virtual Position getPosition() const
Return the Network coordinate of the transportable.
show persons's current route
double getMaxSpeed() const
Get vehicle's maximum speed [m/s].
int personQuality
The quality of person drawing.
GUIParameterTableWindow * getTypeParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own type parameter window.
GUIVisualizationTextSettings personValue
GUIVisualizationTextSettings personName
Hide vehicle's current route.
MSStoppingPlace * getDestinationStop() const
returns the destination stop (if any)
static void drawAction_drawAsCircle(const double lenght, const double width)
Boundary & grow(double by)
extends the boundary by the given amount
virtual void drawGLAdditional(GUISUMOAbstractView *const parent, const GUIVisualizationSettings &s) const
Draws additionally triggered visualisations.
const MSEdge * getFromEdge() const
Returns the departure edge.
Position myPositionInVehicle
The position of a person while riding a vehicle.
Stores the information about how to visualize structures.
static void drawAction_drawAsImage(const double angle, const double lenght, const double width, const std::string &file, const SUMOVehicleShape guiShape, const double exaggeration)
const int VTYPEPARS_COLOR_SET
static void drawAction_drawAsTriangle(const double angle, const double lenght, const double width)
MSVehicleType * myVType
This transportable's type. (mainly used for drawing related information Note sure if it is really nec...
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
double getNaviDegree() const
return the current angle of the person
const SUMOVehicleParameter & getParameter() const
const std::string & getID() const
Returns the id.
virtual double getAngle() const
return the current angle of the transportable
const T getColor(const double value) const
virtual GUIGlID getTrackedID() const
get tracked id
std::map< GUISUMOAbstractView *, int > myAdditionalVisualizations
Enabled visualisations, per view.
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
double getEdgePos() const
Return the position on the edge.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
remove a vehice or person
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
double getStageArrivalPos() const
get stage arrival position
std::string getCurrentStageDescription() const
Returns the current stage description as a string.
PedestrianState * getPedestrianState() const