33 #pragma warning(disable: 4127)
34 #pragma warning(disable: 4275)
36 #include <osgViewer/Viewer>
37 #include <osgViewer/ViewerEventHandlers>
38 #include <osgGA/NodeTrackerManipulator>
39 #include <osgDB/ReadFile>
40 #include <osg/PositionAttitudeTransform>
42 #include <osg/ShapeDrawable>
84 FXDEFMAP(GUIOSGView) GUIOSGView_Map[] = {
86 FXMAPFUNC(SEL_CHORE,
MID_CHORE, GUIOSGView::OnIdle)
92 operator<<(std::ostream& os,
const osg::Vec3d& v) {
93 return os << v.x() <<
"," << v.y() <<
"," << v.z();
100 GUIOSGView::Command_TLSChange::Command_TLSChange(
const MSLink*
const link, osg::Switch* switchNode)
106 GUIOSGView::Command_TLSChange::~Command_TLSChange() {}
110 GUIOSGView::Command_TLSChange::execute() {
111 switch (myLink->getState()) {
114 mySwitch->setSingleChildOn(0);
118 mySwitch->setSingleChildOn(1);
121 mySwitch->setSingleChildOn(2);
124 mySwitch->setSingleChildOn(3);
127 mySwitch->setAllChildrenOff();
129 myLastState = myLink->getState();
137 GUIOSGView::GUIOSGView(
141 GUINet& net, FXGLVisual* glVis,
144 myTracked(0), myCameraManipulator(new SUMOTerrainManipulator()), myLastUpdate(-1) {
152 myAdapter =
new FXOSGAdapter(
this,
new FXCursor(parent->getApp(), CURSOR_CROSS));
154 myViewer =
new osgViewer::Viewer();
155 myViewer->getCamera()->setGraphicsContext(myAdapter);
156 myViewer->getCamera()->setViewport(0, 0, w, h);
157 myViewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);
159 const char* sumoPath = getenv(
"SUMO_HOME");
161 std::string newPath = std::string(sumoPath) +
"/data/3D";
163 osgDB::FilePathList path = osgDB::Registry::instance()->getDataFilePathList();
164 path.push_back(newPath);
165 osgDB::Registry::instance()->setDataFilePathList(path);
169 myGreenLight = osgDB::readNodeFile(
"tlg.obj");
170 myYellowLight = osgDB::readNodeFile(
"tly.obj");
171 myRedLight = osgDB::readNodeFile(
"tlr.obj");
172 myRedYellowLight = osgDB::readNodeFile(
"tlu.obj");
173 if (myGreenLight == 0 || myYellowLight == 0 || myRedLight == 0 || myRedYellowLight == 0) {
174 WRITE_ERROR(
"Could not load traffic light files.");
176 myRoot = GUIOSGBuilder::buildOSGScene(myGreenLight, myYellowLight, myRedLight, myRedYellowLight);
178 myViewer->addEventHandler(
new osgViewer::StatsHandler());
179 myViewer->setSceneData(myRoot);
180 myViewer->setCameraManipulator(myCameraManipulator);
181 osg::Vec3d lookFrom, lookAt, up;
182 myCameraManipulator->getHomePosition(lookFrom, lookAt, up);
183 double z = lookFrom[2];
184 lookFrom[2] = -lookFrom.y();
186 myCameraManipulator->setHomePosition(lookFrom, lookAt, up);
192 GUIOSGView::~GUIOSGView() {
194 myViewer->setDone(
true);
206 for (std::vector<std::string>::const_iterator i = names.begin(); i != names.end(); ++i) {
208 if ((*i) == myVisualizationSettings->name) {
216 "\tLocate Junction\tLocate a junction within the network.",
218 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
221 "\tLocate Street\tLocate a street within the network.",
223 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
226 "\tLocate Vehicle\tLocate a vehicle within the network.",
228 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
231 "\tLocate Person\tLocate a person within the network.",
233 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
236 "\tLocate Container\tLocate a container within the network.",
238 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
241 "\tLocate TLS\tLocate a tls within the network.",
243 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
246 "\tLocate Additional\tLocate an additional structure within the network.",
248 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
251 "\tLocate POI\tLocate a POI within the network.",
253 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
256 "\tLocate Polygon\tLocate a Polygon within the network.",
258 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
263 GUIOSGView::recenterView() {
265 Position center = myGrid->getCenter();
266 osg::Vec3d lookFromOSG, lookAtOSG, up;
267 myViewer->getCameraManipulator()->getHomePosition(lookFromOSG, lookAtOSG, up);
268 lookFromOSG[0] = center.
x();
269 lookFromOSG[1] = center.
y();
270 lookFromOSG[2] = myChanger->zoom2ZPos(100);
271 lookAtOSG[0] = center.
x();
272 lookAtOSG[1] = center.
y();
274 myViewer->getCameraManipulator()->setHomePosition(lookFromOSG, lookAtOSG, up);
280 GUIOSGView::centerTo(
GUIGlID id,
bool ,
double ) {
286 GUIOSGView::setColorScheme(
const std::string& name) {
290 if (myVisualizationChanger != 0) {
291 if (myVisualizationChanger->getCurrentScheme() != name) {
292 myVisualizationChanger->setCurrentScheme(name);
296 myVisualizationSettings->
gaming = myApp->isGaming();
303 GUIOSGView::onPaint(FXObject*, FXSelector,
void*) {
309 if (!d.initialised) {
310 if (d.filename.length() == 6 && d.filename.substr(0, 5) ==
"light") {
311 GUIOSGBuilder::buildLight(d, *myRoot);
312 }
else if (d.filename.length() > 3 && d.filename.substr(0, 3) ==
"tl:") {
313 const int linkStringIdx = (int)d.filename.find(
':', 3);
318 if (linkIdx < 0 || linkIdx >=
static_cast<int>(vars.
getActive()->
getLinks().size())) {
322 osg::Switch* switchNode =
new osg::Switch();
323 switchNode->addChild(GUIOSGBuilder::getTrafficLight(d, d.layer < 0 ? 0 : myGreenLight, osg::Vec4d(0., 1., 0., .3)),
false);
324 switchNode->addChild(GUIOSGBuilder::getTrafficLight(d, d.layer < 0 ? 0 : myYellowLight, osg::Vec4d(1., 1., 0., .3)),
false);
325 switchNode->addChild(GUIOSGBuilder::getTrafficLight(d, d.layer < 0 ? 0 : myRedLight, osg::Vec4d(1., 0., 0., .3)),
false);
326 switchNode->addChild(GUIOSGBuilder::getTrafficLight(d, d.layer < 0 ? 0 : myRedYellowLight, osg::Vec4d(1., .5, 0., .3)),
false);
327 myRoot->addChild(switchNode);
330 WRITE_ERROR(
"Invalid link index in '" + d.filename +
"'.");
332 WRITE_ERROR(
"Unknown traffic light in '" + d.filename +
"'.");
335 GUIOSGBuilder::buildDecal(d, *myRoot);
337 d.initialised =
true;
340 myDecalsLock.unlock();
343 for (
auto& item : myVehicles) {
344 item.second.active =
false;
351 auto itVeh = myVehicles.find(veh);
352 if (itVeh == myVehicles.end()) {
353 myVehicles[veh] = GUIOSGBuilder::buildMovable(veh->
getVehicleType());
354 myRoot->addChild(myVehicles[veh].pos);
356 itVeh->second.active =
true;
358 osg::PositionAttitudeTransform* n = myVehicles[veh].pos;
361 const double slope = veh->
getSlope();
362 n->setAttitude(osg::Quat(dir, osg::Vec3d(0, 0, 1)) *
363 osg::Quat(osg::DegreesToRadians(slope), osg::Vec3d(0, 1, 0)));
375 const RGBColor& col = myVisualizationSettings->vehicleColorer.getScheme().getColor(veh->
getColorValue(*myVisualizationSettings, myVisualizationSettings->vehicleColorer.getActive()));
376 myVehicles[veh].geom->setColor(osg::Vec4d(col.
red() / 255., col.
green() / 255., col.
blue() / 255., col.
alpha() / 255.));
382 for (
auto veh = myVehicles.begin(); veh != myVehicles.end();) {
383 if (!veh->second.active) {
384 removeVeh((veh++)->first);
391 if (now != myLastUpdate || (myVisualizationChanger != 0 && myVisualizationChanger->shown())) {
394 if (now != myLastUpdate && myTracked != 0) {
395 osg::Vec3d lookFrom, lookAt, up;
396 lookAt[0] = myTracked->getPosition().x();
397 lookAt[1] = myTracked->getPosition().y();
398 lookAt[2] = myTracked->getPosition().z();
399 const double angle = myTracked->getAngle();
400 lookFrom[0] = lookAt[0] + 50. * cos(angle);
401 lookFrom[1] = lookAt[1] + 50. * sin(angle);
402 lookFrom[2] = lookAt[2] + 10.;
404 m.makeLookAt(lookFrom, lookAt, osg::Z_AXIS);
405 myCameraManipulator->setByInverseMatrix(m);
409 for (
auto& item : myPersons) {
410 item.second.active =
false;
419 auto itPers = myPersons.find(person);
420 if (itPers == myPersons.end()) {
421 myPersons[person] = GUIOSGBuilder::buildMovable(person->
getVehicleType());
422 myRoot->addChild(myPersons[person].pos);
424 itPers->second.active =
true;
426 osg::PositionAttitudeTransform* n = myPersons[person].pos;
428 n->setPosition(osg::Vec3d(pos.
x(), pos.
y(), pos.
z()));
430 n->setAttitude(osg::Quat(dir, osg::Vec3d(0, 0, 1)));
433 for (
auto person = myPersons.begin(); person != myPersons.end();) {
434 if (!person->second.active) {
435 removeTransportable((person++)->first);
442 if (myAdapter->makeCurrent()) {
453 if (myTracked == veh) {
456 std::map<MSVehicle*, OSGMovable>::iterator i = myVehicles.find(veh);
457 if (i != myVehicles.end()) {
458 myRoot->removeChild(i->second.pos);
466 std::map<MSTransportable*, OSGMovable>::iterator i = myPersons.find(t);
467 if (i != myPersons.end()) {
468 myRoot->removeChild(i->second.pos);
475 GUIOSGView::showViewportEditor() {
477 osg::Vec3d lookFromOSG, lookAtOSG, up;
478 myViewer->getCameraManipulator()->getInverseMatrix().getLookAt(lookFromOSG, lookAtOSG, up);
479 Position from(lookFromOSG[0], lookFromOSG[1], lookFromOSG[2]), at(lookAtOSG[0], lookAtOSG[1], lookAtOSG[2]);
480 myViewportChooser->setOldValues(from, at, 0);
481 myViewportChooser->show();
486 GUIOSGView::setViewportFromToRot(
const Position& lookFrom,
const Position& lookAt,
double ) {
487 osg::Vec3d lookFromOSG, lookAtOSG, up;
488 myViewer->getCameraManipulator()->getHomePosition(lookFromOSG, lookAtOSG, up);
489 lookFromOSG[0] = lookFrom.
x();
490 lookFromOSG[1] = lookFrom.
y();
491 lookFromOSG[2] = lookFrom.
z();
492 lookAtOSG[0] = lookAt.
x();
493 lookAtOSG[1] = lookAt.
y();
494 lookAtOSG[2] = lookAt.
z();
495 myViewer->getCameraManipulator()->setHomePosition(lookFromOSG, lookAtOSG, up);
503 osg::Vec3d lookFrom, lookAt, up;
504 myCameraManipulator->getHomePosition(lookFrom, lookAt, up);
506 Position(lookAt[0], lookAt[1], lookAt[2]), 0);
512 GUIOSGView::startTrack(
int id) {
513 if (myTracked == 0 || (
int)myTracked->getGlID() !=
id) {
518 if ((
int)veh->
getGlID() == id) {
519 if (!veh->
isOnRoad() || myVehicles.find(veh) == myVehicles.end()) {
526 if (myTracked != 0) {
527 osg::Vec3d lookFrom, lookAt, up;
529 lookAt[1] = myTracked->getPosition().y();
530 lookAt[2] = myTracked->getPosition().z();
531 lookFrom[0] = lookAt[0] + 50.;
532 lookFrom[1] = lookAt[1] + 50.;
533 lookFrom[2] = lookAt[2] + 10.;
535 m.makeLookAt(lookFrom, lookAt, osg::Z_AXIS);
536 myCameraManipulator->setByInverseMatrix(m);
543 GUIOSGView::stopTrack() {
549 GUIOSGView::getTrackedID()
const {
555 GUIOSGView::onGamingClick(
Position pos) {
558 double minDist = std::numeric_limits<double>::infinity();
563 if (lanes.size() > 0) {
564 const Position& endPos = lanes[0]->getShape().back();
574 const std::vector<MSTrafficLightLogic*> logics = vars.
getAllLogics();
575 if (logics.size() > 1) {
577 for (
int i = 0; i < (int)logics.size() - 1; i++) {
578 if (minTll->
getProgramID() == logics[i]->getProgramID()) {
583 if (l == logics[0]) {
594 GUIOSGView::getCurrentTimeStep()
const {
599 long GUIOSGView::onConfigure(FXObject* sender, FXSelector sel,
void* ptr) {
601 myAdapter->getEventQueue()->windowResize(0, 0, getWidth(), getHeight());
602 myAdapter->resized(0, 0, getWidth(), getHeight());
604 return FXGLCanvas::onConfigure(sender, sel, ptr);
607 long GUIOSGView::onKeyPress(FXObject* sender, FXSelector sel,
void* ptr) {
608 int key = ((FXEvent*)ptr)->code;
609 myAdapter->getEventQueue()->keyPress(key);
611 return FXGLCanvas::onKeyPress(sender, sel, ptr);
614 long GUIOSGView::onKeyRelease(FXObject* sender, FXSelector sel,
void* ptr) {
615 int key = ((FXEvent*)ptr)->code;
616 myAdapter->getEventQueue()->keyRelease(key);
618 return FXGLCanvas::onKeyRelease(sender, sel, ptr);
621 long GUIOSGView::onLeftBtnPress(FXObject* sender, FXSelector sel,
void* ptr) {
622 handle(
this, FXSEL(SEL_FOCUS_SELF, 0), ptr);
624 FXEvent*
event = (FXEvent*)ptr;
625 myAdapter->getEventQueue()->mouseButtonPress((
float)
event->click_x, (float)event->click_y, 1);
626 if (myApp->isGaming()) {
627 onGamingClick(getPositionInformation());
630 return FXGLCanvas::onLeftBtnPress(sender, sel, ptr);
633 long GUIOSGView::onLeftBtnRelease(FXObject* sender, FXSelector sel,
void* ptr) {
634 FXEvent*
event = (FXEvent*)ptr;
635 myAdapter->getEventQueue()->mouseButtonRelease((
float)
event->click_x, (float)event->click_y, 1);
637 return FXGLCanvas::onLeftBtnRelease(sender, sel, ptr);
640 long GUIOSGView::onMiddleBtnPress(FXObject* sender, FXSelector sel,
void* ptr) {
641 handle(
this, FXSEL(SEL_FOCUS_SELF, 0), ptr);
643 FXEvent*
event = (FXEvent*)ptr;
644 myAdapter->getEventQueue()->mouseButtonPress((
float)
event->click_x, (float)event->click_y, 2);
646 return FXGLCanvas::onMiddleBtnPress(sender, sel, ptr);
649 long GUIOSGView::onMiddleBtnRelease(FXObject* sender, FXSelector sel,
void* ptr) {
650 FXEvent*
event = (FXEvent*)ptr;
651 myAdapter->getEventQueue()->mouseButtonRelease((
float)
event->click_x, (float)event->click_y, 2);
653 return FXGLCanvas::onMiddleBtnRelease(sender, sel, ptr);
656 long GUIOSGView::onRightBtnPress(FXObject* sender, FXSelector sel,
void* ptr) {
657 handle(
this, FXSEL(SEL_FOCUS_SELF, 0), ptr);
659 FXEvent*
event = (FXEvent*)ptr;
660 myAdapter->getEventQueue()->mouseButtonPress((
float)
event->click_x, (float)event->click_y, 3);
662 return FXGLCanvas::onRightBtnPress(sender, sel, ptr);
665 long GUIOSGView::onRightBtnRelease(FXObject* sender, FXSelector sel,
void* ptr) {
666 FXEvent*
event = (FXEvent*)ptr;
667 myAdapter->getEventQueue()->mouseButtonRelease((
float)
event->click_x, (float)event->click_y, 3);
669 return FXGLCanvas::onRightBtnRelease(sender, sel, ptr);
673 GUIOSGView::onMouseMove(FXObject* sender, FXSelector sel,
void* ptr) {
674 FXEvent*
event = (FXEvent*)ptr;
675 myAdapter->getEventQueue()->mouseMotion((
float)
event->win_x, (float)event->win_y);
677 return FXGLCanvas::onMotion(sender, sel, ptr);
681 GUIOSGView::OnIdle(FXObject* , FXSelector ,
void*) {
691 : myParent(parent), myOldCursor(cursor) {
692 _traits =
new GraphicsContext::Traits();
695 _traits->width = parent->getWidth();
696 _traits->height = parent->getHeight();
697 _traits->windowDecoration =
false;
698 _traits->doubleBuffer =
true;
699 _traits->sharedContext = 0;
701 setState(
new osg::State());
702 getState()->setGraphicsContext(
this);
703 if (_traits.valid() && _traits->sharedContext != 0) {
704 getState()->setContextID(_traits->sharedContext->getState()->getContextID());
705 incrementContextIDUsageCount(getState()->getContextID());
707 getState()->setContextID(createNewContextID());
713 GUIOSGView::FXOSGAdapter::~FXOSGAdapter() {
718 void GUIOSGView::FXOSGAdapter::grabFocus() {
720 myParent->setFocus();
723 void GUIOSGView::FXOSGAdapter::useCursor(
bool cursorOn) {
725 myParent->setDefaultCursor(myOldCursor);
727 myParent->setDefaultCursor(NULL);
731 bool GUIOSGView::FXOSGAdapter::makeCurrentImplementation() {
732 myParent->makeCurrent();
736 bool GUIOSGView::FXOSGAdapter::releaseContext() {
737 myParent->makeNonCurrent();
741 void GUIOSGView::FXOSGAdapter::swapBuffersImplementation() {
742 myParent->swapBuffers();
@ MID_LOCATEPERSON
Locate person - button.
@ MID_LOCATEJUNCTION
Locate junction - button.
@ MID_LOCATEPOLY
Locate polygons - button.
@ MID_LOCATEADD
Locate addtional structure - button.
@ MID_LOCATEPOI
Locate poi - button.
@ MID_LOCATEEDGE
Locate edge - button.
@ MID_LOCATEVEHICLE
Locate vehicle - button.
@ MID_LOCATETLS
Locate TLS - button.
@ MID_LOCATECONTAINER
Locate container - button.
GUICompleteSchemeStorage gSchemeStorage
FXDEFMAP(GUIDialog_AppSettings) GUIDialog_AppSettingsMap[]
std::ostream & operator<<(std::ostream &out, MSDevice_SSM::EncounterType type)
Nicer output for EncounterType enum.
@ LINKSTATE_TL_REDYELLOW
The link has red light (must brake) but indicates upcoming green.
@ LINKSTATE_TL_YELLOW_MAJOR
The link has yellow light, may pass.
@ LINKSTATE_TL_GREEN_MAJOR
The link has green light, may pass.
@ LINKSTATE_TL_YELLOW_MINOR
The link has yellow light, has to brake anyway.
@ LINKSTATE_TL_RED
The link has red light (must brake)
@ LINKSTATE_TL_GREEN_MINOR
The link has green light, has to brake.
@ LINKSTATE_TL_OFF_NOSIGNAL
The link is controlled by a tls which is off, not blinking, may pass.
static bool isReadable(std::string path)
Checks whether the given file is readable.
bool contains(const std::string &name) const
Returns the information whether a setting with the given name is stored.
GUIVisualizationSettings & get(const std::string &name)
Returns the named scheme.
const std::vector< std::string > & getNames() const
Returns a list of stored settings names.
FXComboBox * getColoringSchemesCombo()
return combobox with the current coloring schemes (standard, fastest standard, real world....
FXPopup * getLocatorPopup()
@ brief return a pointer to locator popup
static const GUIGlID INVALID_ID
GUIGlID getGlID() const
Returns the numerical id of the object.
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
A MSNet extended by some values for usage within the gui.
static GUINet * getGUIInstance()
Returns the pointer to the unique instance of GUINet (singleton).
virtual void setViewportFromToRot(const Position &lookFrom, const Position &lookAt, double rotation)
applies the given viewport settings
A single child window which contains a view of the simulation area.
A MSVehicle extended by some values for usage within the gui.
double getAngle() const
Return current angle.
Position getPosition(const double offset=0) const
Return current position (x/y, cartesian)
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
gets the color value according to the current scheme index
bool gaming
whether the application is in gaming mode or not
bool isParking() const
Returns whether the vehicle is parking.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
MSTLLogicControl & getTLSControl()
Returns the tls logics control.
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
virtual MSTransportableControl & getPersonControl()
Returns the person control.
SUMOTime duration
The duration of the phase.
A fixed traffic light logic.
const MSPhaseDefinition & getPhase(int givenstep) const
Returns the definition of the phase from the given position within the plan.
void changeStepAndDuration(MSTLLogicControl &tlcontrol, SUMOTime simStep, int step, SUMOTime stepDuration)
Changes the current phase and her duration.
Storage for all programs of a single tls.
void addSwitchCommand(OnSwitchAction *c)
std::vector< MSTrafficLightLogic * > getAllLogics() const
MSTrafficLightLogic * getActive() const
A class that stores and controls tls and switching of their programs.
std::vector< MSTrafficLightLogic * > getAllLogics() const
Returns a vector which contains all logics.
void switchTo(const std::string &id, const std::string &programID)
Switches the named (id) tls to the named (programID) program.
TLSLogicVariants & get(const std::string &id) const
Returns the variants of a named tls.
bool isActive(const MSTrafficLightLogic *tl) const
Returns whether the given tls program is the currently active for his tls.
The parent class for traffic light logics.
const LinkVector & getLinksAt(int i) const
Returns the list of links that are controlled by the signals at the given position.
std::vector< MSLane * > LaneVector
Definition of the list of arrival lanes subjected to this tls.
const LinkVectorVector & getLinks() const
Returns the list of lists of all affected links.
const std::string & getProgramID() const
Returns this tl-logic's id.
constVehIt loadedEnd() const
Returns the end of the internal transportables map.
bool hasDeparted() const
return whether the transportable has started it's plan
virtual double getAngle() const
return the current angle of the transportable
const MSVehicleType & getVehicleType() const
Returns the object's "vehicle" type.
Position getPosition(const double) const
Return current position (x/y, cartesian)
bool hasArrived() const
return whether the person has reached the end of its plan
std::map< std::string, SUMOVehicle * >::const_iterator constVehIt
Definition of the internal vehicles map iterator.
constVehIt loadedVehBegin() const
Returns the begin of the internal vehicle map.
constVehIt loadedVehEnd() const
Returns the end of the internal vehicle map.
Representation of a vehicle in the micro simulation.
bool wasRemoteControlled(SUMOTime lookBack=DELTA_T) const
Returns the information whether the vehicle is fully controlled via TraCI within the lookBack time.
bool isOnRoad() const
Returns the information whether the vehicle is on a road (is simulated)
bool signalSet(int which) const
Returns whether the given signal is on.
@ VEH_SIGNAL_BLINKER_RIGHT
Right blinker lights are switched on.
@ VEH_SIGNAL_BRAKELIGHT
The brake lights are on.
@ VEH_SIGNAL_BLINKER_LEFT
Left blinker lights are switched on.
@ VEH_SIGNAL_BLINKER_EMERGENCY
Blinker lights on both sides are switched on.
double getSlope() const
Returns the slope of the road at vehicle's position in degrees.
const std::string & getID() const
Returns the id.
A point in 2D or 3D with translation and scaling methods.
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
double x() const
Returns the x-position.
double z() const
Returns the z-position.
double y() const
Returns the y-position.
unsigned char red() const
Returns the red-amount of the color.
unsigned char alpha() const
Returns the alpha-amount of the color.
unsigned char green() const
Returns the green-amount of the color.
unsigned char blue() const
Returns the blue-amount of the color.
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter,...
A decal (an image) that can be shown.