207 myParent->stopTrack();
255 if (microVeh !=
nullptr) {
257 if (microVeh->
getLane() !=
nullptr) {
275 if (microVeh !=
nullptr) {
279 std::string errorOut;
282 if (stopPos.first !=
nullptr) {
284 stop.
lane = stopPos.first->getID();
286 stop.
endPos = stopPos.second + POSITION_EPS;
289 if (errorOut !=
"") {
295 WRITE_WARNING(
"GUI-triggered stop not implemented for meso");
321 while (i->first->removeAdditionalGLVisualisation(
this));
357 showLoops->setCheck(
false);
360 showLoops->setCheck(
true);
372 new FXMenuSeparator(ret);
385 new FXMenuSeparator(ret);
428 const double degAngle =
RAD2DEG(angle +
M_PI / 2.);
431 glRotated(degAngle, 0, 0, 1);
436 double upscaleLength = upscale;
440 const double shrinkFactor =
MIN2(widthLengthFactor, sqrt(upscaleLength));
441 upscaleLength /= shrinkFactor;
443 glScaled(upscale, upscaleLength, 1);
455 bool drawCarriages =
false;
461 double scaledLength = length * geometryFactor;
462 if (col.
alpha() != 0) {
474 glTranslated(0, 0, .1);
492 glColor3d(0., 1., 0.);
495 glVertex2d(0., minGap);
496 glVertex2d(-.5, minGap);
497 glVertex2d(.5, minGap);
503 glColor3d(1., 0., 0.);
506 glVertex2d(0., brakeGap);
507 glVertex2d(-.5, brakeGap);
508 glVertex2d(.5, brakeGap);
513 glColor3d(1., 0., 0.);
518 glTranslated(0, 0, .1);
536 if (!drawCarriages) {
569 glTranslated(0,
MIN2(scaledLength / 2,
double(5)), -
getType());
570 glScaled(1 / upscale, 1 / upscaleLength, 1);
571 glRotated(-degAngle, 0, 0, 1);
574 glRotated(-s.
angle, 0, 0, 1);
576 glRotated(s.
angle, 0, 0, 1);
580 glRotated(-s.
angle, 0, 0, 1);
582 glRotated(s.
angle, 0, 0, 1);
587 glRotated(-s.
angle, 0, 0, 1);
589 glRotated(s.
angle, 0, 0, 1);
598 glRotated(-s.
angle, 0, 0, 1);
600 glRotated(s.
angle, 0, 0, 1);
601 for (std::string& line : lines) {
603 glRotated(-s.
angle, 0, 0, 1);
605 glRotated(s.
angle, 0, 0, 1);
611 glRotated(-s.
angle, 0, 0, 1);
613 glRotated(s.
angle, 0, 0, 1);
618 if (!drawCarriages) {
623 const Position back = (p1 +
Position(-scaledLength * upscaleLength, 0)).rotateAround2D(angle, p1);
647 glTranslated(0, 0,
getType() - .1);
661 for (
int i = noReroutePlus1 - 1; i >= 0; i--) {
662 double darken = double(0.4) / double(noReroutePlus1) * double(i);
679 glTranslated(pos.
x(), pos.
y(), -.1);
683 glTranslated(-pos.
x(), -pos.
y(), .1);
701 switch (activeScheme) {
757 double hue = 180. + atan2(center.
x() - p.
x(), center.
y() - p.
y()) * 180. /
M_PI;
766 double hue = 180. + atan2(center.
x() - p.
x(), center.
y() - p.
y()) * 180. /
M_PI;
775 double hue = 180. + atan2(pb.
x() - pe.
x(), pb.
y() - pe.
y()) * 180. /
M_PI;
783 std::hash<const MSBaseVehicle*> ptr_hash;
784 const double hue = (double)(ptr_hash(veh) % 360);
785 const double sat = ((ptr_hash(veh) / 360) % 67) / 100.0 + 0.33;
801 switch (activeScheme) {
825 return (microVeh !=
nullptr
898 darker = vehColor.
multiply(1 - darken);
906 if (route !=
nullptr) {
915 std::map<std::pair<const MSLane*, double>,
int> repeat;
919 if (stop.pars.speed > 0) {
920 stopLanePos = stop.reached ? stop.pars.endPos : stop.pars.startPos;
924 if (stop.isOpposite && !stop.reached) {
925 stopLanePos = stop.lane->getLength() - stopLanePos;
927 Position pos = stop.lane->geometryPositionAtOffset(stopLanePos);
930 std::string label = (stop.pars.speed > 0
931 ? (stop.reached ?
"passing waypoint" :
"waypoint ")
932 : (stop.reached ?
"stopped" :
"stop "));
937 if (stop.isOpposite) {
938 label +=
" (opposite)";
944 label +=
" triggered:";
945 if (stop.triggered) {
947 if (stop.numExpectedPerson > 0) {
948 label +=
"(" +
toString(stop.numExpectedPerson) +
")";
951 if (stop.containerTriggered) {
952 label +=
"container";
953 if (stop.numExpectedContainer > 0) {
954 label +=
"(" +
toString(stop.numExpectedContainer) +
")";
957 if (stop.joinTriggered) {
959 if (stop.pars.join !=
"") {
960 label +=
"(" + stop.pars.join +
")";
964 if (stop.pars.until >= 0) {
967 if (stop.duration >= 0 || stop.pars.duration > 0) {
969 label +=
" duration:1day+";
971 label +=
" duration:" +
time2string(stop.duration);
974 if (stop.pars.speed > 0) {
975 label +=
" speed:" +
toString(stop.pars.speed);
977 if (stop.pars.actType !=
"") {
978 label +=
" actType:" + stop.pars.actType;
980 std::pair<const MSLane*, double> stopPos = std::make_pair(stop.lane, stopLanePos);
983 if (noLoop && repeat[stopPos] > 0) {
997 for (
auto item : *pm) {
999 if (item.second.blockedAtTime >= 0) {
1006 if (item.second.score !=
"") {
1033 int personIndex = 0;
1034 for (std::vector<MSTransportable*>::const_iterator i = ps.begin(); i != ps.end(); ++i) {
1036 assert(person != 0);
1043 int containerIndex = 0;
1044 for (std::vector<MSTransportable*>::const_iterator i = cs.begin(); i != cs.end(); ++i) {
1046 assert(container != 0);
1051 #ifdef DRAW_BOUNDING_BOX
1056 glTranslated(0, 0,
getType());
1058 glColor3d(0.5, .8, 0);
1060 glTranslated(0, 0, 0.1);
1062 boundingBox.push_back(boundingBox.front());
1074 if (
getVType().getParameter().carriageLength > 0) {
1107 std::vector<std::string> devs;
1109 devs.push_back(d->deviceName());
1117 if (requiredSeats <= 0) {
1120 maxSeats =
MAX2(maxSeats, 1);
1121 seatOffset *= exaggeration;
1124 const int rowSize =
MAX2(1, (
int)floor(vehWidth / seatOffset));
1125 const double rowOffset =
MAX2(1.0, (length -
getVType().getFrontSeatPos() - 1)) / ceil((
double)maxSeats / rowSize);
1126 const double sideOffset = (rowSize - 1) / 2.0 * seatOffset;
1131 for (
int i = 0; requiredSeats > 0 && i < maxSeats; i++) {
1132 int seat = (i % rowSize);
1134 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 vehice or person
@ MID_REMOVE_OBJECT
remove a vehice 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.
#define WRITE_WARNING(msg)
std::string time2string(SUMOTime t)
convert SUMOTime to string
const 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
@ FIREBRIGADE
render as a fire brigade
@ POLICE
render as a police car
@ PEDESTRIAN
render as a pedestrian
const int VEHPARS_COLOR_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 drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
static void pushName(unsigned int name)
push Name
static void drawOutlineCircle(double width, double iwidth, int steps=8)
Draws an unfilled 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 void drawAction_drawVehicleAsCircle(const double width, const double length, double detail)
draw vehicle as a circle
static void drawAction_drawVehicleAsPoly(const GUIVisualizationSettings &s, const SUMOVehicleShape shape, const double width, const double length, int carriageIndex=-1)
draw vehicle as a polygon
static void drawAction_drawVehicleAsTrianglePlus(const double width, const double length)
draw vehicle as a triangle
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 sucessful
static void drawAction_drawVehicleAsBoxPlus(const double width, const double length)
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 currente 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.
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.
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.
void computeSeats(const Position &front, const Position &back, double seatOffset, int maxSeats, double exaggeration, int &requiredSeats, Seats &into) const
add seats to mySeatPositions and update requiredSeats
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_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
virtual double getAngle() const =0
Returns the vehicle's direction in radians.
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
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
virtual Position getPosition(const double offset=0) const =0
Return current position (x/y, cartesian)
~GUIBaseVehicle()
destructor
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration asociated with this GLObject
virtual void drawAction_drawVehicleBlueLight() const
virtual void drawRouteHelper(const GUIVisualizationSettings &s, const MSRoute &r, bool future, bool noLoop, const RGBColor &col) const =0
Draws the route.
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.
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)
build menu command
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used,...
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.
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
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.
const 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()
destoys 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.
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 drawMinGap
Information whether the minimum gap shall be drawn.
GUIVisualizationTextSettings vehicleText
bool showBTRange
Information whether the communication range shall be drawn.
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.
MSVehicleDevice * getDevice(const std::type_info &type) const
Returns a device of the given type if it exists or 0.
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 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.
virtual double getTimeLossSeconds() const
Returns the time loss in seconds.
bool isParking() const
Returns whether the vehicle is parking.
const MSEdge * getEdge() const
Returns the edge the vehicle is currently at.
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.
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.
virtual 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.
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.
const MSRoute * getRoute(int index) const
Called on route retrieval.
Abstract in-vehicle / in-person device.
const std::vector< MSLane * > & getLanes() const
Returns this edge's 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.
Representation of a lane in the micro simulation.
virtual MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification, bool notify=true)
double getVehicleMaxSpeed(const SUMOTrafficObject *const veh) const
Returns the lane's maximum speed, given a vehicle's speed limit adaptation.
double getLengthGeometryFactor() const
return shape.length() / myLength
@ 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
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 getMinGap() const
Get the free space in front of vehicles of this class.
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.
bool wasSet(int what) const
Returns whether the given parameter was set.
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
double y() const
Returns the y-position.
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.
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