[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;
|
---|
[70] | 54 | friend class VisualizationCamera;
|
---|
[8] | 55 |
|
---|
[15] | 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;
|
---|
[69] | 65 | irr::IrrlichtDevice *getDevice(void) const;
|
---|
[15] | 66 | float getAspectRatio(void) const;
|
---|
[8] | 67 |
|
---|
[15] | 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 |
|
---|
[15] | 74 | private:
|
---|
| 75 | Gui_impl *pimpl_;
|
---|
| 76 | };
|
---|
[8] | 77 |
|
---|
[15] | 78 | /*!
|
---|
| 79 | * \brief get Gui
|
---|
| 80 | *
|
---|
| 81 | * \return the Gui
|
---|
| 82 | */
|
---|
| 83 | Gui *getGui(void);
|
---|
[8] | 84 |
|
---|
[15] | 85 | bool noGui(void);
|
---|
[8] | 86 |
|
---|
[15] | 87 | bool isGlExtensionSupported(
|
---|
| 88 | const std::string &ext); // check if a extension is supported
|
---|
[8] | 89 |
|
---|
[15] | 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 |
|
---|
[15] | 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 |
|
---|
[15] | 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 |
|
---|
[15] | 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 |
|
---|
[15] | 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 |
|
---|
[15] | 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
|
---|