259 if (microVeh !=
nullptr) {
261 if (lane !=
nullptr) {
266 if (lane !=
nullptr) {
284 if (microVeh !=
nullptr) {
288 std::string errorOut;
291 if (stopPos.first !=
nullptr) {
293 stop.
lane = stopPos.first->getID();
295 stop.
endPos = stopPos.second + POSITION_EPS;
298 if (errorOut !=
"") {
330 if (i->first->getTrackedID() ==
getGlID()) {
331 i->first->stopTrack();
333 while (i->first->removeAdditionalGLVisualisation(
this));
368 showLoops->setCheck(
false);
371 showLoops->setCheck(
true);
383 new FXMenuSeparator(ret);
396 new FXMenuSeparator(ret);
439 const double degAngle =
RAD2DEG(angle +
M_PI / 2.);
442 glTranslated(p1.
x(), p1.
y(), p1.
z() + 1);
446 glRotated(degAngle, 0, 0, 1);
459 glScaled(upscale, upscaleLength, 1);
471 bool drawCarriages =
false;
478 double scaledLength = length * geometryFactor;
479 if (col.
alpha() != 0) {
491 glTranslated(0, 0, .1);
500 const double w = 1.8 * sqrt(
getVType().getWidth() / 1.8);
511 glColor3d(0., 1., 0.);
514 glVertex2d(0., minGap);
515 glVertex2d(-.5, minGap);
516 glVertex2d(.5, minGap);
522 glColor3d(1., 0., 0.);
525 glVertex2d(0., brakeGap);
526 glVertex2d(-.5, brakeGap);
527 glVertex2d(.5, brakeGap);
532 if (dev !=
nullptr) {
533 glColor3d(1., 0., 0.);
539 glTranslated(0, 0, .1);
562 if (!drawCarriages) {
595 glTranslated(0,
MIN2(scaledLength / 2,
double(5)), -
getType());
596 glScaled(1 / upscale, 1 / upscaleLength, 1);
597 glRotated(-degAngle, 0, 0, 1);
600 glRotated(-s.
angle, 0, 0, 1);
602 glRotated(s.
angle, 0, 0, 1);
606 glRotated(-s.
angle, 0, 0, 1);
608 glRotated(s.
angle, 0, 0, 1);
615 glRotated(-s.
angle, 0, 0, 1);
617 glRotated(s.
angle, 0, 0, 1);
628 glRotated(-s.
angle, 0, 0, 1);
630 glRotated(s.
angle, 0, 0, 1);
631 for (std::string& line : lines) {
633 glRotated(-s.
angle, 0, 0, 1);
635 glRotated(s.
angle, 0, 0, 1);
641 glRotated(-s.
angle, 0, 0, 1);
643 glRotated(s.
angle, 0, 0, 1);
648 if (!drawCarriages) {
653 const Position back = (p1 +
Position(-scaledLength * upscaleLength, 0)).rotateAround2D(angle, p1);
654 double extraOffset = scaledLength * 0.15;
678 glTranslated(0, 0,
getType() - .1);
692 for (
int i = noReroutePlus1 - 1; i >= 0; i--) {
693 double darken = double(0.4) / double(noReroutePlus1) * double(i);
710 glTranslated(pos.
x(), pos.
y(), -.1);
714 glTranslated(-pos.
x(), -pos.
y(), .1);
732 switch (activeScheme) {
788 double hue = 180. + atan2(center.
x() - p.
x(), center.
y() - p.
y()) * 180. /
M_PI;
797 double hue = 180. + atan2(center.
x() - p.
x(), center.
y() - p.
y()) * 180. /
M_PI;
806 double hue = 180. + atan2(pb.
x() - pe.
x(), pb.
y() - pe.
y()) * 180. /
M_PI;
814 std::hash<const MSBaseVehicle*> ptr_hash;
815 const double hue = (double)(ptr_hash(veh) % 360);
816 const double sat = (double)((ptr_hash(veh) / 360) % 67) / 100.0 + 0.33;
832 switch (activeScheme) {
856 return (microVeh !=
nullptr
887 WRITE_WARNINGF(
TL(
"Vehicle parameter '%' key '%' is not a number for vehicle '%'."),
931 darker = vehColor.
multiply(1 - darken);
939 if (route !=
nullptr) {
948 std::map<const MSLane*, int> repeat;
952 if (stop.getSpeed() > 0) {
953 stopLanePos = stop.reached ? stop.pars.endPos : stop.pars.startPos;
957 if (stop.isOpposite && !stop.reached) {
958 stopLanePos = stop.lane->getLength() - stopLanePos;
960 Position pos = stop.lane->geometryPositionAtOffset(stopLanePos);
963 std::string label = (stop.getSpeed() > 0
964 ? (stop.reached ?
"passing waypoint" :
"waypoint ")
965 : (stop.reached ?
"stopped" :
"stop "));
970 if (stop.isOpposite) {
971 label +=
" (opposite)";
977 label +=
" triggered:";
978 if (stop.triggered) {
980 if (stop.numExpectedPerson > 0) {
981 label +=
"(" +
toString(stop.numExpectedPerson) +
")";
984 if (stop.containerTriggered) {
985 label +=
"container";
986 if (stop.numExpectedContainer > 0) {
987 label +=
"(" +
toString(stop.numExpectedContainer) +
")";
990 if (stop.joinTriggered) {
992 if (stop.pars.join !=
"") {
993 label +=
"(" + stop.pars.join +
")";
999 }
else if (stop.pars.until >= 0) {
1000 label +=
" until:" +
time2string(stop.pars.until);
1002 if (stop.duration >= 0 || stop.pars.duration > 0) {
1004 label +=
" duration:1day+";
1006 label +=
" duration:" +
time2string(stop.duration);
1009 if (stop.getSpeed() > 0) {
1010 if (stop.skipOnDemand) {
1011 label +=
" onDemand (skipped)";
1013 label +=
" speed:" +
toString(stop.getSpeed());
1016 if (stop.pars.actType !=
"") {
1017 label +=
" actType:" + stop.pars.actType;
1021 if (noLoop && repeat[stop.lane] > 0) {
1025 repeat[stop.lane]++;
1047 if (pm !=
nullptr) {
1048 for (
auto item : *pm) {
1050 if (item.second.blockedAtTime >= 0) {
1057 if (item.second.score !=
"") {
1071 if (pm !=
nullptr) {
1072 for (
auto item : *pm) {
1074 if (item.second.blockedAtTime >= 0) {
1078 if (item.second.score !=
"") {
1103 FXMutexLock locker(
myLock);
1106 int personIndex = 0;
1107 for (std::vector<MSTransportable*>::const_iterator i = ps.begin(); i != ps.end(); ++i) {
1109 assert(person != 0);
1116 int containerIndex = 0;
1117 for (std::vector<MSTransportable*>::const_iterator i = cs.begin(); i != cs.end(); ++i) {
1119 assert(container != 0);
1124#ifdef DRAW_BOUNDING_BOX
1129 glTranslated(0, 0,
getType());
1131 glColor3d(0.5, .8, 0);
1133 glTranslated(0, 0, 0.1);
1135 boundingBox.push_back(boundingBox.front());
1151 if (
getVType().getParameter().carriageLength > 0 &&
1185 std::vector<std::string> devs;
1187 devs.push_back(d->deviceName());
1195 if (requiredSeats <= 0) {
1198 maxSeats =
MAX2(maxSeats, 1);
1199 seatOffset *= exaggeration;
1202 const int rowSize =
MAX2(1, (
int)floor(vehWidth / seatOffset));
1204 const double rowOffset =
MAX2(1.0, (length - frontSeatPos - 1)) / ceil((
double)maxSeats / rowSize);
1205 const double sideOffset = (rowSize - 1) / 2.0 * seatOffset;
1206 double rowPos = frontSeatPos - rowOffset;
1210 for (
int i = 0; requiredSeats > 0 && i < maxSeats; i++) {
1211 int seat = (i % rowSize);
1213 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)
constexpr SUMOTime TIME2STEPS(double x)
const long long int VTYPEPARS_COLOR_SET
@ RAIL_CARGO
render as a cargo train
@ CABLE_CAR
render as a cable car
@ 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
@ BICYCLE_CARGO
render as a front-loading cargo bicycle
@ MOTORCYCLE
render as a motorcycle
@ ANT
render as a giant ant
@ AIRCRAFT
render as aircraft
@ FIREBRIGADE
render as a fire brigade
@ WHEELCHAIR
render as a wheelchair
@ POLICE
render as a police car
@ PEDESTRIAN
render as a pedestrian
const long long int VEHPARS_COLOR_SET
const long long 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.
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
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.
double getExaggeration(const GUIVisualizationSettings &s) const override
return exaggeration associated with this GLObject
GUIGLObjectPopupMenu * myPopup
current popup (to clean up in destructor). GUIBaseVehicle is not responsible for removal
void drawParkingInfo(const GUIVisualizationSettings &s) const
GUIBaseVehicle(MSBaseVehicle &vehicle)
MSDevice_Vehroutes * myRoutes
virtual void drawAction_drawPersonsAndContainers(const GUIVisualizationSettings &s) const
virtual void drawAction_drawCarriageClass(const GUIVisualizationSettings &s, double scaledLength, bool asImage) const =0
draws the given guiShape with distinct carriages/modules
void removedPopupMenu() override
notify object about popup menu removal
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 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
virtual Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
const std::string getOptionalName() const override
Returns the value for generic parameter 'name' or ''.
virtual void drawGLAdditional(GUISUMOAbstractView *const parent, const GUIVisualizationSettings &s) const override
Draws additionally triggered visualisations.
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.
void drawChargingInfo(const GUIVisualizationSettings &s) const
@ 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
Seats myContainerPositions
void removeActiveAddVisualisation(GUISUMOAbstractView *const parent, int which) override
Adds the named visualisation feature to the given view.
bool drawReversed(const GUIVisualizationSettings &s) const
whether to reverse trains in their reversed state
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
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
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
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own popup-menu.
void drawStopLabels(const GUIVisualizationSettings &s, bool noLoop, const RGBColor &col) const
Seats mySeatPositions
positions of seats in the vehicle (updated at every drawing step)
const MSBaseVehicle & getVehicle()
std::string getDeviceDescription()
lists equipped device (types) for the current vehicle
virtual double getVisualAngle(bool s2) const =0
Returns the vehicle's direction in radians taking into account secondary shape.
const MSVehicleType & getVType() const
A shortcut to myVehicle.myType.
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.
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel, const bool disable=false)
build menu command
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, const GUIMainWindow &app, bool addSeparator=true) const
Builds an entry which allows to copy the cursor position if geo projection is used,...
virtual double getColorValue(const GUIVisualizationSettings &, int) const
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.
GUIGlObject * myParent
parent of this GLObject (usually used for lanes and edges)
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.
static const double MISSING_DATA
GUIColorer vehicleColorer
The vehicle colorer.
GUIVisualizationTextSettings vehicleScaleValue
bool trueZ
drawl all objects according to their z data
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.
bool showChargingInfo
Set whether the charging search related information should be shown.
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 StoppingPlaceMemory * getParkingMemory() const
const std::vector< MSTransportable * > & getPersons() const
retrieve riding persons
const std::vector< MSVehicleDevice * > & getDevices() const
Returns this vehicle's devices.
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 SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition)
int getNumberParkingReroutes() const
std::vector< MSVehicleDevice * > myDevices
The devices this vehicle has.
virtual const MSEdge * getCurrentEdge() const
Returns the edge the vehicle is currently at (possibly an internal edge)
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.
const MSRouteIterator & getCurrentRouteEdge() const
Returns an iterator pointing to the current edge in this vehicles route.
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
MSDevice_Transportable * myContainerDevice
The containers this vehicle may have.
const std::list< MSStop > & getStops() const
double getWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s)
const MSDevice_Transportable * getPersonDevice() const
MSDevice_Transportable * myPersonDevice
The passengers this vehicle may have.
const MSStop & getNextStop() 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.
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)
const MSRoute & getRoute() const
Returns the current route.
const MSDevice_Transportable * getContainerDevice() const
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 StoppingPlaceMemory * getChargingMemory() const
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
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 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 const VehCont & getVehiclesSecure() const
Returns the vehicles container; locks it for microsimulation.
virtual void releaseVehicles() const
Allows to use the container for microsimulation again.
virtual const PositionVector & getShape(bool) const
double getWidth() const
Returns the lane's width.
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) 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.
bool parkOnRoad() const
whether vehicles park on the road
const ConstMSEdgeVector & getEdges() const
const RGBColor & getColor() const
Returns the color.
MSParkingArea * parkingarea
(Optional) parkingArea if one is assigned to the stop
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()
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
const MSLane * getLane() const
Returns the lane the vehicle is on.
MSLane * getMutableLane() const
Returns the lane the vehicle is on Non const version indicates that something volatile is going on.
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 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.
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 RGBColor & getColor() const
Returns this type's color.
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 dimensions
double x() const
Returns the x-position.
double z() const
Returns the z-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, bool extrapolateBeyond=false) 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 RGBColor fromHSV(double h, double s, double v, bool random=false)
Converts the given hsv-triplet to rgb, inspired by http://alvyray.com/Papers/CG/hsv2rgb....
static const RGBColor GREEN
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 const MSLane * getLane() const =0
Returns the lane the object is currently at.
virtual double getSpeed() const =0
Returns the object's current speed.
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.
bool wasSet(long long int what) const
Returns whether the given parameter was set.
RGBColor color
The vehicle's color, TraCI may change this.
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