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