[10] | 1 | // %flair:license{
|
---|
[15] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[10] | 4 | // %flair:license}
|
---|
[8] | 5 | // created: 2013/03/27
|
---|
| 6 | // filename: Gui.h
|
---|
| 7 | //
|
---|
| 8 | // author: Guillaume Sanahuja
|
---|
| 9 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 10 | //
|
---|
| 11 | // version: $Id: $
|
---|
| 12 | //
|
---|
| 13 | // purpose: classe definissant une Gui
|
---|
| 14 | //
|
---|
| 15 | /*********************************************************************/
|
---|
| 16 |
|
---|
| 17 | #ifndef GUI_H
|
---|
| 18 | #define GUI_H
|
---|
| 19 |
|
---|
| 20 | #include <Object.h>
|
---|
| 21 | #include <EDriverTypes.h>
|
---|
| 22 | #include <vector3d.h>
|
---|
| 23 |
|
---|
[15] | 24 | namespace irr {
|
---|
| 25 | class IrrlichtDevice;
|
---|
| 26 | namespace video {
|
---|
| 27 | class ITexture;
|
---|
[8] | 28 | }
|
---|
[15] | 29 | namespace scene {
|
---|
| 30 | class IAnimatedMesh;
|
---|
| 31 | class ISceneManager;
|
---|
| 32 | }
|
---|
| 33 | }
|
---|
[8] | 34 |
|
---|
[15] | 35 | namespace flair {
|
---|
| 36 | namespace core {
|
---|
| 37 | class Object;
|
---|
| 38 | class Vector3D;
|
---|
| 39 | class Euler;
|
---|
| 40 | class Quaternion;
|
---|
[8] | 41 | }
|
---|
[15] | 42 | }
|
---|
[8] | 43 |
|
---|
| 44 | class Gui_impl;
|
---|
| 45 | class Simulator_impl;
|
---|
| 46 | class Model_impl;
|
---|
| 47 |
|
---|
[15] | 48 | namespace flair {
|
---|
| 49 | namespace simulator {
|
---|
| 50 | class Simulator;
|
---|
[8] | 51 |
|
---|
[15] | 52 | class Gui : public core::Object {
|
---|
| 53 | friend class ::Simulator_impl;
|
---|
[8] | 54 |
|
---|
[15] | 55 | public:
|
---|
| 56 | Gui(const Simulator *parent, std::string name, int app_width, int app_height,
|
---|
| 57 | int scene_width, int scene_height, std::string media_path,
|
---|
| 58 | irr::video::E_DRIVER_TYPE driver_type = irr::video::EDT_OPENGL);
|
---|
| 59 | ~Gui();
|
---|
| 60 | irr::core::vector3df getRotation(void) const;
|
---|
| 61 | irr::video::ITexture *getTexture(std::string filename) const;
|
---|
| 62 | irr::scene::IAnimatedMesh *getMesh(std::string filename) const;
|
---|
| 63 | irr::scene::ISceneManager *getSceneManager(void) const;
|
---|
| 64 | float getAspectRatio(void) const;
|
---|
[8] | 65 |
|
---|
[15] | 66 | protected:
|
---|
| 67 | irr::IrrlichtDevice *getDevice(void) const;
|
---|
| 68 | void setMesh(std::string file,
|
---|
| 69 | irr::core::vector3df position = irr::core::vector3df(0, 0, 0),
|
---|
| 70 | irr::core::vector3df rotation = irr::core::vector3df(0, 0, 0),
|
---|
| 71 | irr::core::vector3df scale = irr::core::vector3df(1, 1, 1));
|
---|
[8] | 72 |
|
---|
[15] | 73 | private:
|
---|
| 74 | Gui_impl *pimpl_;
|
---|
| 75 | };
|
---|
[8] | 76 |
|
---|
[15] | 77 | /*!
|
---|
| 78 | * \brief get Gui
|
---|
| 79 | *
|
---|
| 80 | * \return the Gui
|
---|
| 81 | */
|
---|
| 82 | Gui *getGui(void);
|
---|
[8] | 83 |
|
---|
[15] | 84 | bool noGui(void);
|
---|
[8] | 85 |
|
---|
[15] | 86 | bool isGlExtensionSupported(
|
---|
| 87 | const std::string &ext); // check if a extension is supported
|
---|
[8] | 88 |
|
---|
[15] | 89 | /*!
|
---|
| 90 | * \brief Convert to irrlicht scale
|
---|
| 91 | *
|
---|
| 92 | * \param value value in simulator scale
|
---|
| 93 | *
|
---|
| 94 | * \return value in irrlicht scale
|
---|
| 95 | */
|
---|
| 96 | float ToIrrlichtScale(float value);
|
---|
[8] | 97 |
|
---|
[15] | 98 | /*!
|
---|
| 99 | * \brief Convert to simulator scale
|
---|
| 100 | *
|
---|
| 101 | * \param value value in irrlicht scale
|
---|
| 102 | *
|
---|
| 103 | * \return value in simulator scale
|
---|
| 104 | */
|
---|
| 105 | float ToSimulatorScale(float value);
|
---|
[8] | 106 |
|
---|
[15] | 107 | /*!
|
---|
| 108 | * \brief Convert to irrlicht coordinates
|
---|
| 109 | *
|
---|
| 110 | * irrlicht is left handed and as a different scale
|
---|
| 111 | *
|
---|
| 112 | * \param vect vector in simulator coordinates
|
---|
| 113 | *
|
---|
| 114 | * \return vector in irrlicht coordinates
|
---|
| 115 | */
|
---|
| 116 | irr::core::vector3df ToIrrlichtCoordinates(irr::core::vector3df vect);
|
---|
[8] | 117 |
|
---|
[15] | 118 | /*!
|
---|
| 119 | * \brief Convert to irrlicht coordinates
|
---|
| 120 | *
|
---|
| 121 | * irrlicht is left handed and as a different scale
|
---|
| 122 | *
|
---|
| 123 | * \param vect vector in simulator coordinates
|
---|
| 124 | *
|
---|
| 125 | * \return vector in irrlicht coordinates
|
---|
| 126 | */
|
---|
| 127 | irr::core::vector3df ToIrrlichtCoordinates(core::Vector3D vect);
|
---|
[8] | 128 |
|
---|
[15] | 129 | /*!
|
---|
| 130 | * \brief Convert to simulator coordinates
|
---|
| 131 | *
|
---|
| 132 | * irrlicht is left handed and as a different scale
|
---|
| 133 | *
|
---|
| 134 | * \param vect vector in irrlicht coordinates
|
---|
| 135 | *
|
---|
| 136 | * \return vector in simulator coordinates
|
---|
| 137 | */
|
---|
| 138 | core::Vector3D ToSimulatorCoordinates(irr::core::vector3df vect);
|
---|
[8] | 139 |
|
---|
[15] | 140 | /*!
|
---|
| 141 | * \brief Convert to irrlicht orientation
|
---|
| 142 | *
|
---|
| 143 | * irrlicht is left handed
|
---|
| 144 | *
|
---|
| 145 | * \param quat quaternion in simulator frame
|
---|
| 146 | *
|
---|
| 147 | * \return quaternion in irrlicht frame
|
---|
| 148 | */
|
---|
| 149 | core::Quaternion ToIrrlichtOrientation(core::Quaternion quat);
|
---|
| 150 |
|
---|
[8] | 151 | } // end namespace simulator
|
---|
| 152 | } // end namespace flair
|
---|
| 153 | #endif // GUI_H
|
---|