209 myParent->stopTrack();
257 if (microVeh !=
nullptr) {
259 if (lane !=
nullptr) {
264 if (lane !=
nullptr) {
272 myParent->destroyPopup();
282 if (microVeh !=
nullptr) {
286 std::string errorOut;
289 if (stopPos.first !=
nullptr) {
291 stop.
lane = stopPos.first->getID();
293 stop.
endPos = stopPos.second + POSITION_EPS;
296 if (errorOut !=
"") {
328 if (i->first->getTrackedID() ==
getGlID()) {
329 i->first->stopTrack();
331 while (i->first->removeAdditionalGLVisualisation(
this));
367 showLoops->setCheck(
false);
370 showLoops->setCheck(
true);
382 new FXMenuSeparator(ret);
395 new FXMenuSeparator(ret);
438 const double degAngle =
RAD2DEG(angle +
M_PI / 2.);
441 glRotated(degAngle, 0, 0, 1);
454 glScaled(upscale, upscaleLength, 1);
466 bool drawCarriages =
false;
472 double scaledLength = length * geometryFactor;
473 if (col.
alpha() != 0) {
485 glTranslated(0, 0, .1);
494 const double w = 1.8 * sqrt(
getVType().getWidth() / 1.8);
505 glColor3d(0., 1., 0.);
508 glVertex2d(0., minGap);
509 glVertex2d(-.5, minGap);
510 glVertex2d(.5, minGap);
516 glColor3d(1., 0., 0.);
519 glVertex2d(0., brakeGap);
520 glVertex2d(-.5, brakeGap);
521 glVertex2d(.5, brakeGap);
526 if (dev !=
nullptr) {
527 glColor3d(1., 0., 0.);
533 glTranslated(0, 0, .1);
552 if (!drawCarriages) {
585 glTranslated(0,
MIN2(scaledLength / 2,
double(5)), -
getType());
586 glScaled(1 / upscale, 1 / upscaleLength, 1);
587 glRotated(-degAngle, 0, 0, 1);
590 glRotated(-s.
angle, 0, 0, 1);
592 glRotated(s.
angle, 0, 0, 1);
596 glRotated(-s.
angle, 0, 0, 1);
598 glRotated(s.
angle, 0, 0, 1);
603 glRotated(-s.
angle, 0, 0, 1);
605 glRotated(s.
angle, 0, 0, 1);
614 glRotated(-s.
angle, 0, 0, 1);
616 glRotated(s.
angle, 0, 0, 1);
617 for (std::string& line : lines) {
619 glRotated(-s.
angle, 0, 0, 1);
621 glRotated(s.
angle, 0, 0, 1);
627 glRotated(-s.
angle, 0, 0, 1);
629 glRotated(s.
angle, 0, 0, 1);
634 if (!drawCarriages) {
639 const Position back = (p1 +
Position(-scaledLength * upscaleLength, 0)).rotateAround2D(angle, p1);
640 double extraOffset = scaledLength * 0.15;
664 glTranslated(0, 0,
getType() - .1);
678 for (
int i = noReroutePlus1 - 1; i >= 0; i--) {
679 double darken = double(0.4) / double(noReroutePlus1) * double(i);
696 glTranslated(pos.
x(), pos.
y(), -.1);
700 glTranslated(-pos.
x(), -pos.
y(), .1);
718 switch (activeScheme) {
774 double hue = 180. + atan2(center.
x() - p.
x(), center.
y() - p.
y()) * 180. /
M_PI;
783 double hue = 180. + atan2(center.
x() - p.
x(), center.
y() - p.
y()) * 180. /
M_PI;
792 double hue = 180. + atan2(pb.
x() - pe.
x(), pb.
y() - pe.
y()) * 180. /
M_PI;
800 std::hash<const MSBaseVehicle*> ptr_hash;
801 const double hue = (double)(ptr_hash(veh) % 360);
802 const double sat = (double)((ptr_hash(veh) / 360) % 67) / 100.0 + 0.33;
818 switch (activeScheme) {
842 return (microVeh !=
nullptr
873 WRITE_WARNINGF(
TL(
"Vehicle parameter '%' key '%' is not a number for vehicle '%'."),
917 darker = vehColor.
multiply(1 - darken);
925 if (route !=
nullptr) {
934 std::map<const MSLane*, int> repeat;
938 if (stop.getSpeed() > 0) {
939 stopLanePos = stop.reached ? stop.pars.endPos : stop.pars.startPos;
943 if (stop.isOpposite && !stop.reached) {
944 stopLanePos = stop.lane->getLength() - stopLanePos;
946 Position pos = stop.lane->geometryPositionAtOffset(stopLanePos);
949 std::string label = (stop.getSpeed() > 0
950 ? (stop.reached ?
"passing waypoint" :
"waypoint ")
951 : (stop.reached ?
"stopped" :
"stop "));
956 if (stop.isOpposite) {
957 label +=
" (opposite)";
963 label +=
" triggered:";
964 if (stop.triggered) {
966 if (stop.numExpectedPerson > 0) {
967 label +=
"(" +
toString(stop.numExpectedPerson) +
")";
970 if (stop.containerTriggered) {
971 label +=
"container";
972 if (stop.numExpectedContainer > 0) {
973 label +=
"(" +
toString(stop.numExpectedContainer) +
")";
976 if (stop.joinTriggered) {
978 if (stop.pars.join !=
"") {
979 label +=
"(" + stop.pars.join +
")";
985 }
else if (stop.pars.until >= 0) {
988 if (stop.duration >= 0 || stop.pars.duration > 0) {
990 label +=
" duration:1day+";
992 label +=
" duration:" +
time2string(stop.duration);
995 if (stop.getSpeed() > 0) {
996 if (stop.skipOnDemand) {
997 label +=
" onDemand (skipped)";
999 label +=
" speed:" +
toString(stop.getSpeed());
1002 if (stop.pars.actType !=
"") {
1003 label +=
" actType:" + stop.pars.actType;
1007 if (noLoop && repeat[stop.lane] > 0) {
1011 repeat[stop.lane]++;
1033 if (pm !=
nullptr) {
1034 for (
auto item : *pm) {
1036 if (item.second.blockedAtTime >= 0) {
1043 if (item.second.score !=
"") {
1070 int personIndex = 0;
1071 for (std::vector<MSTransportable*>::const_iterator i = ps.begin(); i != ps.end(); ++i) {
1073 assert(person != 0);
1080 int containerIndex = 0;
1081 for (std::vector<MSTransportable*>::const_iterator i = cs.begin(); i != cs.end(); ++i) {
1083 assert(container != 0);
1088 #ifdef DRAW_BOUNDING_BOX
1093 glTranslated(0, 0,
getType());
1095 glColor3d(0.5, .8, 0);
1097 glTranslated(0, 0, 0.1);
1099 boundingBox.push_back(boundingBox.front());
1115 if (
getVType().getParameter().carriageLength > 0) {
1148 std::vector<std::string> devs;
1150 devs.push_back(d->deviceName());
1158 if (requiredSeats <= 0) {
1161 maxSeats =
MAX2(maxSeats, 1);
1162 seatOffset *= exaggeration;
1165 const int rowSize =
MAX2(1, (
int)floor(vehWidth / seatOffset));
1167 const double rowOffset =
MAX2(1.0, (length - frontSeatPos - 1)) / ceil((
double)maxSeats / rowSize);
1168 const double sideOffset = (rowSize - 1) / 2.0 * seatOffset;
1169 double rowPos = frontSeatPos - rowOffset;
1173 for (
int i = 0; requiredSeats > 0 && i < maxSeats; i++) {
1174 int seat = (i % rowSize);
1176 rowPos += rowOffset;
@ MID_HIDE_ALLROUTES
Hide all vehicle's routes.
@ MID_HIDE_BEST_LANES
Hide vehicle's best lanes.
@ MID_HIDE_CURRENTROUTE
Hide vehicle's current route.
@ MID_SHOW_FOES
select foes of a vehicle
@ MID_SHOW_BEST_LANES
Show vehicle's best lanes.
@ MID_START_TRACK
Start to track a vehicle.
@ MID_SHOW_ALLROUTES
Show all vehicle's routes.
@ MID_SHOW_ROUTE_NOLOOPS
Show vehicle's future route (without loops)
@ MID_HIDE_ROUTE_NOLOOPS
Hide vehicle's future route (without loops)
@ MID_TOGGLE_STOP
toggle stop state of a vehicle or person
@ MID_REMOVE_OBJECT
remove a vehicle or person
@ MID_SHOW_FUTUREROUTE
Show vehicle's future route.
@ MID_HIDE_FUTUREROUTE
Hide vehicle's future route.
@ MID_SHOW_CURRENTROUTE
Show vehicle's current route.
@ MID_STOP_TRACK
Stop to track a vehicle.
@ MID_SELECT_TRANSPORTED
select transportables of a vehicle
FXDEFMAP(GUIBaseVehicle::GUIBaseVehiclePopupMenu) GUIBaseVehiclePopupMenuMap[]
GUISelectedStorage gSelected
A global holder of selected objects.
GUIIcon
An enumeration of icons used by the gui applications.
#define WRITE_WARNINGF(...)
#define WRITE_WARNING(msg)
std::shared_ptr< const MSRoute > ConstMSRoutePtr
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
const long long int VTYPEPARS_COLOR_SET
@ RAIL_CARGO
render as a cargo train
@ EMERGENCY
render as an emergency vehicle
@ SCOOTER
render as a scooter
@ RAIL_CAR
render as a (city) rail without locomotive
@ SHIP
render as a arbitrary ship
@ BICYCLE
render as a bicycle
@ MOTORCYCLE
render as a motorcycle
@ ANT
render as a giant ant
@ AIRCRAFT
render as aircraft
@ FIREBRIGADE
render as a fire brigade
@ POLICE
render as a police car
@ PEDESTRIAN
render as a pedestrian
const int VEHPARS_COLOR_SET
const int VEHPARS_ARRIVALPOS_SET
const double SUMO_const_waitingContainerWidth
const double SUMO_const_waitingPersonWidth
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
Position getCenter() const
Returns the center of the boundary.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
double ymin() const
Returns minimum y-coordinate.
double xmin() const
Returns minimum x-coordinate.
Boundary & grow(double by)
extends the boundary by the given amount
double ymax() const
Returns maximum y-coordinate.
double xmax() const
Returns maximum x-coordinate.
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static void drawOutlineCircle(double radius, double iRadius, int steps=8)
Draws an unfilled circle around (0,0)
static void pushName(unsigned int name)
push Name
static void drawFilledCircle(const double widradiusth, const int steps=8)
Draws a filled circle around (0,0)
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 void popName()
pop Name
static void pushMatrix()
push matrix
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, const int align=0, double width=-1)
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 bool drawAction_drawVehicleAsImage(const GUIVisualizationSettings &s, const std::string &file, const GUIGlObject *o, const double width, double length)
try to draw vehicle as raster image and return true if successful
static void drawAction_drawVehicleAsCircle(const double width, double detail)
draw vehicle as a circle
static void drawAction_drawVehicleAsTrianglePlus(const double width, const double length, bool amReversed=false)
draw vehicle as a triangle
static void drawAction_drawVehicleAsPoly(const GUIVisualizationSettings &s, const SUMOVehicleShape shape, const double width, const double length, int carriageIndex=-1, bool isStopped=false, bool amReversed=false)
draw vehicle as a polygon
static void drawAction_drawVehicleAsBoxPlus(const double width, const double length, bool amReversed=false)
draw vehicle as a Box
A MSVehicle extended by some values for usage within the gui.
void drawParkingInfo(const GUIVisualizationSettings &s, const RGBColor &col) const
const Seat & getContainerPosition(int containerIndex) const
static bool setFunctionalColor(int activeScheme, const MSBaseVehicle *veh, RGBColor &col)
sets the color according to the current scheme index and some vehicle function
const std::string getOptionalName() const
Returns the value for generic parameter 'name' or ''.
virtual void drawAction_drawLinkItems(const GUIVisualizationSettings &) const
const Seat & getSeatPosition(int personIndex) const
returns the seat position for the person with the given index
RGBColor setColor(const GUIVisualizationSettings &s) const
sets the color according to the current settings
int getNumContainers() const
return the number of passengers
void drawOnPos(const GUIVisualizationSettings &s, const Position &pos, const double angle) const
Draws the object on the specified position with the specified angle.
GUIGLObjectPopupMenu * myPopup
current popup (to clean up in destructor). GUIBaseVehicle is not responsible for removal
GUIBaseVehicle(MSBaseVehicle &vehicle)
const MSBaseVehicle & getVehicle()
MSDevice_Vehroutes * myRoutes
virtual void drawAction_drawPersonsAndContainers(const GUIVisualizationSettings &s) const
bool hasActiveAddVisualisation(GUISUMOAbstractView *const parent, int which) const
Returns whether the named feature is enabled in the given view.
virtual void drawRouteHelper(const GUIVisualizationSettings &s, ConstMSRoutePtr r, bool future, bool noLoop, const RGBColor &col) const =0
Draws the route.
void removeActiveAddVisualisation(GUISUMOAbstractView *const parent, int which)
Adds the named visualisation feature to the given view.
void drawRoute(const GUIVisualizationSettings &s, int routeNo, double darken, bool future=false, bool noLoop=false) const
Chooses the route to draw and draws it, darkening it as given.
virtual Position getVisualPosition(bool s2, const double offset=0) const =0
Return current position taking into account secondary shape.
std::vector< Seat > Seats
MSBaseVehicle & myVehicle
The vehicle to which all calls should be delegated.
virtual void drawAction_drawVehicleBlinker(double) const
void removedPopupMenu()
notify object about popup menu removal
void addActiveAddVisualisation(GUISUMOAbstractView *const parent, int which)
Adds the named visualisation feature to the given view.
static void drawLinkItem(const Position &pos, SUMOTime arrivalTime, SUMOTime leaveTime, double exagerate)
double getScaleValue(const GUIVisualizationSettings &s, int activeScheme) const
gets the size multiplier value according to the current scheme index
virtual void drawBestLanes() const
Draws the vehicle's best lanes.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
virtual Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
@ VO_SHOW_LFLINKITEMS
LFLinkItems.
@ VO_SHOW_ALL_ROUTES
show all vehicle's routes
@ VO_TRACK
track the vehicle (only needed for cleaning up)
@ VO_SHOW_ROUTE_NOLOOP
show vehicle's routes without loops
@ VO_SHOW_FUTURE_ROUTE
show vehicle's current continued from the current position
@ VO_SHOW_ROUTE
show vehicle's current route
@ VO_SHOW_BEST_LANES
show vehicle's best lanes
virtual void drawAction_drawCarriageClass(const GUIVisualizationSettings &s, bool asImage) const =0
draws the given guiShape with distinct carriages/modules
virtual void drawGLAdditional(GUISUMOAbstractView *const parent, const GUIVisualizationSettings &s) const
Draws additionally triggered visualisations.
Seats myContainerPositions
bool drawReversed(const GUIVisualizationSettings &s) const
whether to reverse trains in their reversed state
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
FXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
virtual void drawAction_drawVehicleBrakeLight(double length, bool onlyOne=false) const
void computeSeats(const Position &front, const Position &back, double seatOffset, int maxSeats, double exaggeration, int &requiredSeats, Seats &into, double extraOffset=0) const
add seats to mySeatPositions and update requiredSeats
virtual double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const =0
gets the color value according to the current scheme index
int getNumPassengers() const
return the number of passengers
bool drawAction_drawVehicleAsPolyWithCarriagges(const GUIVisualizationSettings &s, double scaledLength, bool asImage=false) const
draw vehicle body and return whether carriages are being drawn
~GUIBaseVehicle()
destructor
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated with this GLObject
virtual void drawAction_drawVehicleBlueLight() const
std::map< GUISUMOAbstractView *, int > myAdditionalVisualizations
Enabled visualisations, per view.
virtual void selectBlockingFoes() const =0
adds the blocking foes to the current selection
void drawStopLabels(const GUIVisualizationSettings &s, bool noLoop, const RGBColor &col) const
Seats mySeatPositions
positions of seats in the vehicle (updated at every drawing step)
std::string getDeviceDescription()
lists equipped device (types) for the current vehicle
const MSVehicleType & getVType() const
A shortcut to myVehicle.myType.
virtual double getVisualAngle(bool s2) const =0
Returns the vehicle's direction in radians taking into account secondary shape.
void setPositionInVehicle(const GUIBaseVehicle::Seat &pos)
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
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 bool gSecondaryShape
whether secondary shapes are currently being drawn
A MSNet extended by some values for usage within the gui.
A lane area vehicles can halt at (gui-version)
const Position & getSignPos() const
void setPositionInVehicle(const GUIBaseVehicle::Seat &pos)
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.
void destroyPopup()
destroys the popup
bool addAdditionalGLVisualisation(GUIGlObject *const which)
Adds an object to call its additional visualisation method.
virtual GUIGlID getTrackedID() const
get tracked id
void select(GUIGlID id, bool update=true)
Adds the object with the given id.
Stores the information about how to visualize structures.
GUIVisualizationTextSettings vehicleName
GUIVisualizationSizeSettings vehicleSize
bool showBlinker
Information whether vehicle blinkers shall be drawn.
GUIColorer vehicleColorer
The vehicle colorer.
GUIVisualizationTextSettings vehicleScaleValue
std::string vehicleScaleParam
key for scaling by vehicle parameter
bool showParkingInfo
Set whether parking related information should be shown.
GUIVisualizationTextSettings vehicleValue
int vehicleQuality
The quality of vehicle drawing.
double laneWidthExaggeration
The lane exaggeration (upscale thickness)
std::string vehicleTextParam
key for rendering vehicle textual parameter
bool scaleLength
Whether vehicle length shall be scaled with length/geometry factor.
GUIScaler vehicleScaler
The size scaling settings for vehicles.
double scale
information about a lane's width (temporary, used for a single view)
bool secondaryShape
whether secondary lane shape shall be drawn
bool drawMinGap
Information whether the minimum gap shall be drawn.
GUIVisualizationTextSettings vehicleText
bool showBTRange
Information whether the communication range shall be drawn.
bool drawReversed
Whether to draw reversed vehicles in their reversed state.
bool drawBrakeGap
Information whether the brake gap shall be drawn.
bool drawLaneChangePreference
Information whether the lane change preference shall be drawn.
double angle
The current view rotation angle.
static double naviDegree(const double angle)
void vaporizeCar(MEVehicle *v, MSMoveReminder::Notification reason)
remove the given car and clean up the relevant data structures
A vehicle from the mesoscopic point of view.
The base class for microscopic and mesoscopic vehicles.
ConstMSRoutePtr getRoutePtr() const
Returns the current route.
virtual bool isSelected() const
whether this vehicle is selected in the GUI
const MSDevice_Transportable * getPersonDevice() const
const std::vector< MSTransportable * > & getPersons() const
retrieve riding persons
std::map< const MSParkingArea *, PaMemory, ComparatorIdLess > ParkingMemory
virtual double getArrivalPos() const
Returns this vehicle's desired arrivalPos for its current route (may change on reroute)
virtual double getStopDelay() const
Returns the estimated public transport stop (departure) delay in seconds.
MoveReminderCont myMoveReminders
Currently relevant move reminders.
const std::list< MSStop > & getStops() const
const SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition)
int getNumberParkingReroutes() const
std::vector< MSVehicleDevice * > myDevices
The devices this vehicle has.
bool isReversed() const
Returns whether the logical state of the vehicle is reversed - for drawing.
virtual double getTimeLossSeconds() const
Returns the time loss in seconds.
virtual const MSEdge * getCurrentEdge() const
Returns the edge the vehicle is currently at (possibly an internal edge)
bool isParking() const
Returns whether the vehicle is parking.
const MSEdge * getEdge() const
Returns the edge the vehicle is currently at.
virtual int getArrivalLane() const
const MSDevice_Transportable * getContainerDevice() const
MSDevice_Transportable * myContainerDevice
The containers this vehicle may have.
double getWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s)
const MSRouteIterator & getCurrentRouteEdge() const
Returns an iterator pointing to the current edge in this vehicles route.
MSDevice_Transportable * myPersonDevice
The passengers this vehicle may have.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
const ParkingMemory * getParkingMemory() const
std::string getPrefixedParameter(const std::string &key, std::string &error) const
retrieve parameters of devices, models and the vehicle itself
virtual double getStopArrivalDelay() const
Returns the estimated public transport stop arrival delay in seconds.
bool isStoppedTriggered() const
Returns whether the vehicle is on a triggered stop.
const std::vector< MSVehicleDevice * > & getDevices() const
Returns this vehicle's devices.
virtual double getAcceleration() const
Returns the vehicle's acceleration.
virtual double getRightSideOnEdge(const MSLane *lane=0) const
Get the vehicle's lateral position on the edge of the given lane (or its current edge if lane == 0)
SUMOTime getDepartDelay() const
Returns the depart delay.
int getNumberReroutes() const
Returns the number of new routes this vehicle got.
virtual bool isOnRoad() const
Returns the information whether the vehicle is on a road (is simulated)
const std::vector< MSTransportable * > & getContainers() const
retrieve riding containers
const MSRoute & getRoute() const
Returns the current route.
bool isStopped() const
Returns whether the vehicle is at a stop.
MSDevice * getDevice(const std::type_info &type) const
Returns a device of the given type if it exists, nullptr otherwise.
double brakeGap(const double speed) const
Returns the distance the vehicle needs to halt including driver's reaction time tau (i....
static double getRange()
Returns the configured range.
const std::vector< MSTransportable * > & getTransportables() const
Returns the list of transportables using this vehicle.
int size() const
Return the number of passengers / containers.
ConstMSRoutePtr getRoute(int index) const
Called on route retrieval.
static MSDevice_Vehroutes * buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into, int maxRoutes=std::numeric_limits< int >::max())
Build devices for the given vehicle, if needed.
Abstract in-vehicle / in-person device.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
double getWidth() const
Returns the edges's width (sum over all lanes)
double getVehicleMaxSpeed(const SUMOTrafficObject *const veh) const
Returns the maximum speed the vehicle may use on this edge.
static MELoop * gMesoNet
mesoscopic simulation infrastructure
static bool gLefthand
Whether lefthand-drive is being simulated.
static bool gUseStopEnded
whether the simulation should replay previous stop times
Representation of a lane in the micro simulation.
virtual MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification, bool notify=true)
virtual const VehCont & getVehiclesSecure() const
Returns the vehicles container; locks it for microsimulation.
virtual double getLengthGeometryFactor(bool) const
double getVehicleMaxSpeed(const SUMOTrafficObject *const veh) const
Returns the lane's maximum speed, given a vehicle's speed limit adaptation.
virtual void releaseVehicles() const
Allows to use the container for microsimulation again.
double getWidth() const
Returns the lane's width.
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
virtual const PositionVector & getShape(bool) const
@ NOTIFICATION_VAPORIZED_GUI
The vehicle got removed via the GUI.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
const RGBColor & getColor() const
Returns the color.
const ConstMSEdgeVector & getEdges() const
double getUpscaleLength() const
void scheduleVehicleRemoval(SUMOVehicle *veh, bool checkDuplicate=false)
Removes a vehicle after it has ended.
Representation of a vehicle in the micro simulation.
double getTimeGapOnLane() const
Returns the time gap in seconds to the leader of the vehicle on the same lane.
PositionVector getBoundingPoly(double offset=0) const
get bounding polygon
double getAccumulatedWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s) within the last millisecs.
MSAbstractLaneChangeModel & getLaneChangeModel()
MSLane * getMutableLane() const
Returns the lane the vehicle is on Non const version indicates that something volatile is going on.
bool addTraciStop(SUMOVehicleParameter::Stop stop, std::string &errorMsg)
PositionVector getBoundingBox(double offset=0) const
get bounding rectangle
void onRemovalFromNet(const MSMoveReminder::Notification reason)
Called when the vehicle is removed from the network.
bool resumeFromStopping()
int getBestLaneOffset() const
std::pair< const MSLane *, double > getLanePosAfterDist(double distance) const
return lane and position along bestlanes at the given distance
double getSpeed() const
Returns the vehicle's current speed.
const MSLane * getLane() const
Returns the lane the vehicle is on.
const MSCFModel & getCarFollowModel() const
Returns the vehicle's car following model definition.
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
double getSeatingWidth() const
Get the width of the passenger compartment when being drawn.
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.
const RGBColor & getColor() const
Returns this type's color.
double getFrontSeatPos() const
Get offset of first seat from vehicle front.
double getLength() const
Get vehicle's length [m].
SUMOVehicleShape getGuiShape() const
Get this vehicle type's shape.
const std::string & getID() const
Returns the id.
virtual const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
A point in 2D or 3D with translation and scaling methods.
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
double x() const
Returns the x-position.
double angleTo2D(const Position &other) const
returns the angle in the plane of the vector pointing from here to the other position (in radians bet...
double y() const
Returns the y-position.
PositionVector getOrthogonal(const Position &p, double extend, bool before, double length=1.0, double deg=90) const
return orthogonal through p (extending this vector if necessary)
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
static const RGBColor WHITE
static const RGBColor BLUE
unsigned char alpha() const
Returns the alpha-amount of the color.
RGBColor multiply(double factor) const
Returns a new color with altered brightness.
static const RGBColor GREEN
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb, inspired by http://alvyray.com/Papers/CG/hsv2rgb....
static const RGBColor BLACK
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
static const RGBColor DEFAULT_COLOR
The default color (for vehicle types and vehicles)
static const RGBColor RED
named colors
virtual double getSpeed() const =0
Returns the object's current speed.
virtual const MSLane * getLane() const =0
Returns the lane the object is currently at.
virtual double getPositionOnLane() const =0
Get the object's position along the lane.
virtual double getAngle() const =0
Get the vehicle's angle.
Definition of vehicle stop (position and duration)
std::string lane
The lane to stop at.
double startPos
The stopping position start.
double endPos
The stopping position end.
SUMOTime duration
The stopping duration.
RGBColor color
The vehicle's color, TraCI may change this.
bool wasSet(int what) const
Returns whether the given parameter was set.
int arrivalEdge
(optional) The final edge within the route of the vehicle
std::string line
The vehicle's line (mainly for public transport)
static const int NEWLINE
identifier for splitting the given string at all newline characters
std::vector< std::string > getVector()
return vector of strings
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
bool constantSizeSelected
whether only selected objects shall be drawn with constant
bool show(const GUIGlObject *o) const
whether to show the text
double scaledSize(double scale, double constFactor=0.1) const
get scale size