67 FXDEFMAP(GUIOSGView) GUIOSGView_Map[] = {
69 FXMAPFUNC(SEL_CHORE,
MID_CHORE, GUIOSGView::OnIdle)
75 operator<<(std::ostream& os,
const osg::Vec3d& v) {
76 return os << v.x() <<
"," << v.y() <<
"," << v.z();
83 GUIOSGView::Command_TLSChange::Command_TLSChange(
const MSLink*
const link, osg::Switch* switchNode)
89 GUIOSGView::Command_TLSChange::~Command_TLSChange() {}
93 GUIOSGView::Command_TLSChange::execute() {
94 switch (myLink->getState()) {
97 mySwitch->setSingleChildOn(0);
101 mySwitch->setSingleChildOn(1);
104 mySwitch->setSingleChildOn(2);
107 mySwitch->setSingleChildOn(3);
110 mySwitch->setAllChildrenOff();
112 myLastState = myLink->getState();
119 GUIOSGView::GUIOSGView(
123 GUINet& net, FXGLVisual* glVis,
126 myTracked(0), myCameraManipulator(new SUMOTerrainManipulator()), myLastUpdate(-1) {
134 myAdapter =
new FXOSGAdapter(
this,
new FXCursor(parent->getApp(), CURSOR_CROSS));
136 myViewer =
new osgViewer::Viewer();
137 myViewer->getCamera()->setGraphicsContext(myAdapter);
138 myViewer->getCamera()->setViewport(0, 0, w, h);
139 myViewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);
141 const char* sumoPath = getenv(
"SUMO_HOME");
143 std::string newPath = std::string(sumoPath) +
"/data/3D";
145 osgDB::FilePathList path = osgDB::Registry::instance()->getDataFilePathList();
146 path.push_back(newPath);
147 osgDB::Registry::instance()->setDataFilePathList(path);
151 myGreenLight = osgDB::readNodeFile(
"tlg.obj");
152 myYellowLight = osgDB::readNodeFile(
"tly.obj");
153 myRedLight = osgDB::readNodeFile(
"tlr.obj");
154 myRedYellowLight = osgDB::readNodeFile(
"tlu.obj");
155 if (myGreenLight == 0 || myYellowLight == 0 || myRedLight == 0 || myRedYellowLight == 0) {
156 WRITE_ERROR(
"Could not load traffic light files.");
158 myRoot = GUIOSGBuilder::buildOSGScene(myGreenLight, myYellowLight, myRedLight, myRedYellowLight);
160 myViewer->addEventHandler(
new osgViewer::StatsHandler());
161 myViewer->setSceneData(myRoot);
162 myViewer->setCameraManipulator(myCameraManipulator);
163 osg::Vec3d lookFrom, lookAt, up;
164 myCameraManipulator->getHomePosition(lookFrom, lookAt, up);
165 double z = lookFrom[2];
166 lookFrom[2] = -lookFrom.y();
168 myCameraManipulator->setHomePosition(lookFrom, lookAt, up);
174 GUIOSGView::~GUIOSGView() {
176 myViewer->setDone(
true);
184 GUIOSGView::recalculateBoundaries() {
194 for (std::vector<std::string>::const_iterator i = names.begin(); i != names.end(); ++i) {
196 if ((*i) == myVisualizationSettings->name) {
204 "\tLocate Junction\tLocate a junction within the network.",
206 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
209 "\tLocate Street\tLocate a street within the network.",
211 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
214 "\tLocate Vehicle\tLocate a vehicle within the network.",
216 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
219 "\tLocate Person\tLocate a person within the network.",
221 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
224 "\tLocate Container\tLocate a container within the network.",
226 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
229 "\tLocate TLS\tLocate a tls within the network.",
231 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
234 "\tLocate Additional\tLocate an additional structure within the network.",
236 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
239 "\tLocate POI\tLocate a POI within the network.",
241 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
244 "\tLocate Polygon\tLocate a Polygon within the network.",
246 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
251 GUIOSGView::recenterView() {
253 Position center = myGrid->getCenter();
254 osg::Vec3d lookFromOSG, lookAtOSG, up;
255 myViewer->getCameraManipulator()->getHomePosition(lookFromOSG, lookAtOSG, up);
256 lookFromOSG[0] = center.
x();
257 lookFromOSG[1] = center.
y();
258 lookFromOSG[2] = myChanger->zoom2ZPos(100);
259 lookAtOSG[0] = center.
x();
260 lookAtOSG[1] = center.
y();
262 myViewer->getCameraManipulator()->setHomePosition(lookFromOSG, lookAtOSG, up);
268 GUIOSGView::centerTo(
GUIGlID id,
bool ,
double ) {
274 GUIOSGView::setColorScheme(
const std::string& name) {
278 if (myVisualizationChanger != 0) {
279 if (myVisualizationChanger->getCurrentScheme() != name) {
280 myVisualizationChanger->setCurrentScheme(name);
284 myVisualizationSettings->
gaming = myApp->isGaming();
291 GUIOSGView::onPaint(FXObject*, FXSelector,
void*) {
297 if (!d.initialised) {
298 if (d.filename.length() == 6 && d.filename.substr(0, 5) ==
"light") {
299 GUIOSGBuilder::buildLight(d, *myRoot);
300 }
else if (d.filename.length() > 3 && d.filename.substr(0, 3) ==
"tl:") {
301 const int linkStringIdx = (int)d.filename.find(
':', 3);
306 if (linkIdx < 0 || linkIdx >=
static_cast<int>(vars.
getActive()->
getLinks().size())) {
310 osg::Switch* switchNode =
new osg::Switch();
311 switchNode->addChild(GUIOSGBuilder::getTrafficLight(d, d.layer < 0 ? 0 : myGreenLight, osg::Vec4d(0., 1., 0., .3)),
false);
312 switchNode->addChild(GUIOSGBuilder::getTrafficLight(d, d.layer < 0 ? 0 : myYellowLight, osg::Vec4d(1., 1., 0., .3)),
false);
313 switchNode->addChild(GUIOSGBuilder::getTrafficLight(d, d.layer < 0 ? 0 : myRedLight, osg::Vec4d(1., 0., 0., .3)),
false);
314 switchNode->addChild(GUIOSGBuilder::getTrafficLight(d, d.layer < 0 ? 0 : myRedYellowLight, osg::Vec4d(1., .5, 0., .3)),
false);
315 myRoot->addChild(switchNode);
318 WRITE_ERROR(
"Invalid link index in '" + d.filename +
"'.");
320 WRITE_ERROR(
"Unknown traffic light in '" + d.filename +
"'.");
323 GUIOSGBuilder::buildDecal(d, *myRoot);
325 d.initialised =
true;
328 myDecalsLock.unlock();
331 for (
auto& item : myVehicles) {
332 item.second.active =
false;
339 auto itVeh = myVehicles.find(veh);
340 if (itVeh == myVehicles.end()) {
341 myVehicles[veh] = GUIOSGBuilder::buildMovable(veh->
getVehicleType());
342 myRoot->addChild(myVehicles[veh].pos);
344 itVeh->second.active =
true;
346 osg::PositionAttitudeTransform* n = myVehicles[veh].pos;
349 const double slope = veh->
getSlope();
350 n->setAttitude(osg::Quat(dir, osg::Vec3d(0, 0, 1)) *
351 osg::Quat(osg::DegreesToRadians(slope), osg::Vec3d(0, 1, 0)));
363 const RGBColor& col = myVisualizationSettings->vehicleColorer.getScheme().getColor(veh->
getColorValue(*myVisualizationSettings, myVisualizationSettings->vehicleColorer.getActive()));
364 myVehicles[veh].geom->setColor(osg::Vec4d(col.
red() / 255., col.
green() / 255., col.
blue() / 255., col.
alpha() / 255.));
370 for (
auto veh = myVehicles.begin(); veh != myVehicles.end();) {
371 if (!veh->second.active) {
372 removeVeh((veh++)->first);
379 if (now != myLastUpdate || (myVisualizationChanger != 0 && myVisualizationChanger->shown())) {
382 if (now != myLastUpdate && myTracked != 0) {
383 osg::Vec3d lookFrom, lookAt, up;
384 lookAt[0] = myTracked->getPosition().x();
385 lookAt[1] = myTracked->getPosition().y();
386 lookAt[2] = myTracked->getPosition().z();
387 const double angle = myTracked->getAngle();
388 lookFrom[0] = lookAt[0] + 50. * cos(angle);
389 lookFrom[1] = lookAt[1] + 50. * sin(angle);
390 lookFrom[2] = lookAt[2] + 10.;
392 m.makeLookAt(lookFrom, lookAt, osg::Z_AXIS);
393 myCameraManipulator->setByInverseMatrix(m);
397 for (
auto& item : myPersons) {
398 item.second.active =
false;
407 auto itPers = myPersons.find(person);
408 if (itPers == myPersons.end()) {
409 myPersons[person] = GUIOSGBuilder::buildMovable(person->
getVehicleType());
410 myRoot->addChild(myPersons[person].pos);
412 itPers->second.active =
true;
414 osg::PositionAttitudeTransform* n = myPersons[person].pos;
416 n->setPosition(osg::Vec3d(pos.
x(), pos.
y(), pos.
z()));
418 n->setAttitude(osg::Quat(dir, osg::Vec3d(0, 0, 1)));
421 for (
auto person = myPersons.begin(); person != myPersons.end();) {
422 if (!person->second.active) {
423 removeTransportable((person++)->first);
430 if (myAdapter->makeCurrent()) {
441 if (myTracked == veh) {
444 std::map<MSVehicle*, OSGMovable>::iterator i = myVehicles.find(veh);
445 if (i != myVehicles.end()) {
446 myRoot->removeChild(i->second.pos);
454 std::map<MSTransportable*, OSGMovable>::iterator i = myPersons.find(t);
455 if (i != myPersons.end()) {
456 myRoot->removeChild(i->second.pos);
463 GUIOSGView::showViewportEditor() {
465 osg::Vec3d lookFromOSG, lookAtOSG, up;
466 myViewer->getCameraManipulator()->getInverseMatrix().getLookAt(lookFromOSG, lookAtOSG, up);
467 Position from(lookFromOSG[0], lookFromOSG[1], lookFromOSG[2]), at(lookAtOSG[0], lookAtOSG[1], lookAtOSG[2]);
468 myViewportChooser->setOldValues(from, at, 0);
469 myViewportChooser->show();
474 GUIOSGView::setViewportFromToRot(
const Position& lookFrom,
const Position& lookAt,
double ) {
475 osg::Vec3d lookFromOSG, lookAtOSG, up;
476 myViewer->getCameraManipulator()->getHomePosition(lookFromOSG, lookAtOSG, up);
477 lookFromOSG[0] = lookFrom.
x();
478 lookFromOSG[1] = lookFrom.
y();
479 lookFromOSG[2] = lookFrom.
z();
480 lookAtOSG[0] = lookAt.
x();
481 lookAtOSG[1] = lookAt.
y();
482 lookAtOSG[2] = lookAt.
z();
483 myViewer->getCameraManipulator()->setHomePosition(lookFromOSG, lookAtOSG, up);
490 osg::Vec3d lookFrom, lookAt, up;
491 myCameraManipulator->getHomePosition(lookFrom, lookAt, up);
493 Position(lookAt[0], lookAt[1], lookAt[2]), 0);
498 GUIOSGView::startTrack(
int id) {
499 if (myTracked == 0 || (
int)myTracked->getGlID() !=
id) {
504 if ((
int)veh->
getGlID() == id) {
505 if (!veh->
isOnRoad() || myVehicles.find(veh) == myVehicles.end()) {
512 if (myTracked != 0) {
513 osg::Vec3d lookFrom, lookAt, up;
515 lookAt[1] = myTracked->getPosition().y();
516 lookAt[2] = myTracked->getPosition().z();
517 lookFrom[0] = lookAt[0] + 50.;
518 lookFrom[1] = lookAt[1] + 50.;
519 lookFrom[2] = lookAt[2] + 10.;
521 m.makeLookAt(lookFrom, lookAt, osg::Z_AXIS);
522 myCameraManipulator->setByInverseMatrix(m);
529 GUIOSGView::stopTrack() {
535 GUIOSGView::getTrackedID()
const {
541 GUIOSGView::onGamingClick(
Position pos) {
544 double minDist = std::numeric_limits<double>::infinity();
549 if (lanes.size() > 0) {
550 const Position& endPos = lanes[0]->getShape().back();
560 const std::vector<MSTrafficLightLogic*> logics = vars.
getAllLogics();
561 if (logics.size() > 1) {
563 for (
int i = 0; i < (int)logics.size() - 1; i++) {
564 if (minTll->
getProgramID() == logics[i]->getProgramID()) {
569 if (l == logics[0]) {
580 GUIOSGView::getCurrentTimeStep()
const {
585 long GUIOSGView::onConfigure(FXObject* sender, FXSelector sel,
void* ptr) {
587 myAdapter->getEventQueue()->windowResize(0, 0, getWidth(), getHeight());
588 myAdapter->resized(0, 0, getWidth(), getHeight());
590 return FXGLCanvas::onConfigure(sender, sel, ptr);
594 long GUIOSGView::onKeyPress(FXObject* sender, FXSelector sel,
void* ptr) {
595 int key = ((FXEvent*)ptr)->code;
596 myAdapter->getEventQueue()->keyPress(key);
598 return FXGLCanvas::onKeyPress(sender, sel, ptr);
602 long GUIOSGView::onKeyRelease(FXObject* sender, FXSelector sel,
void* ptr) {
603 int key = ((FXEvent*)ptr)->code;
604 myAdapter->getEventQueue()->keyRelease(key);
606 return FXGLCanvas::onKeyRelease(sender, sel, ptr);
610 long GUIOSGView::onLeftBtnPress(FXObject* sender, FXSelector sel,
void* ptr) {
611 handle(
this, FXSEL(SEL_FOCUS_SELF, 0), ptr);
613 FXEvent*
event = (FXEvent*)ptr;
614 myAdapter->getEventQueue()->mouseButtonPress((
float)
event->click_x, (float)event->click_y, 1);
615 if (myApp->isGaming()) {
616 onGamingClick(getPositionInformation());
619 return FXGLCanvas::onLeftBtnPress(sender, sel, ptr);
623 long GUIOSGView::onLeftBtnRelease(FXObject* sender, FXSelector sel,
void* ptr) {
624 FXEvent*
event = (FXEvent*)ptr;
625 myAdapter->getEventQueue()->mouseButtonRelease((
float)
event->click_x, (float)event->click_y, 1);
627 return FXGLCanvas::onLeftBtnRelease(sender, sel, ptr);
631 long GUIOSGView::onMiddleBtnPress(FXObject* sender, FXSelector sel,
void* ptr) {
632 handle(
this, FXSEL(SEL_FOCUS_SELF, 0), ptr);
634 FXEvent*
event = (FXEvent*)ptr;
635 myAdapter->getEventQueue()->mouseButtonPress((
float)
event->click_x, (float)event->click_y, 2);
637 return FXGLCanvas::onMiddleBtnPress(sender, sel, ptr);
641 long GUIOSGView::onMiddleBtnRelease(FXObject* sender, FXSelector sel,
void* ptr) {
642 FXEvent*
event = (FXEvent*)ptr;
643 myAdapter->getEventQueue()->mouseButtonRelease((
float)
event->click_x, (float)event->click_y, 2);
645 return FXGLCanvas::onMiddleBtnRelease(sender, sel, ptr);
648 long GUIOSGView::onRightBtnPress(FXObject* sender, FXSelector sel,
void* ptr) {
649 handle(
this, FXSEL(SEL_FOCUS_SELF, 0), ptr);
651 FXEvent*
event = (FXEvent*)ptr;
652 myAdapter->getEventQueue()->mouseButtonPress((
float)
event->click_x, (float)event->click_y, 3);
654 return FXGLCanvas::onRightBtnPress(sender, sel, ptr);
658 long GUIOSGView::onRightBtnRelease(FXObject* sender, FXSelector sel,
void* ptr) {
659 FXEvent*
event = (FXEvent*)ptr;
660 myAdapter->getEventQueue()->mouseButtonRelease((
float)
event->click_x, (float)event->click_y, 3);
662 return FXGLCanvas::onRightBtnRelease(sender, sel, ptr);
666 GUIOSGView::onMouseMove(FXObject* sender, FXSelector sel,
void* ptr) {
667 FXEvent*
event = (FXEvent*)ptr;
668 myAdapter->getEventQueue()->mouseMotion((
float)
event->win_x, (float)event->win_y);
670 return FXGLCanvas::onMotion(sender, sel, ptr);
675 GUIOSGView::OnIdle(FXObject* , FXSelector ,
void*) {
684 : myParent(parent), myOldCursor(cursor) {
685 _traits =
new GraphicsContext::Traits();
688 _traits->width = parent->getWidth();
689 _traits->height = parent->getHeight();
690 _traits->windowDecoration =
false;
691 _traits->doubleBuffer =
true;
692 _traits->sharedContext = 0;
694 setState(
new osg::State());
695 getState()->setGraphicsContext(
this);
696 if (_traits.valid() && _traits->sharedContext != 0) {
697 getState()->setContextID(_traits->sharedContext->getState()->getContextID());
698 incrementContextIDUsageCount(getState()->getContextID());
700 getState()->setContextID(createNewContextID());
706 GUIOSGView::FXOSGAdapter::~FXOSGAdapter() {
711 void GUIOSGView::FXOSGAdapter::grabFocus() {
713 myParent->setFocus();
717 void GUIOSGView::FXOSGAdapter::useCursor(
bool cursorOn) {
719 myParent->setDefaultCursor(myOldCursor);
721 myParent->setDefaultCursor(NULL);
726 bool GUIOSGView::FXOSGAdapter::makeCurrentImplementation() {
727 myParent->makeCurrent();
732 bool GUIOSGView::FXOSGAdapter::releaseContext() {
733 myParent->makeNonCurrent();
738 void GUIOSGView::FXOSGAdapter::swapBuffersImplementation() {
739 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.
virtual 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.