Flair
Framework Libre Air
Gui.h
1 // %flair:license{
2 // This file is part of the Flair framework distributed under the
3 // CECILL-C License, Version 1.0.
4 // %flair:license}
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 <Vector3D.h>
22 #include <EDriverTypes.h>
23 #include <vector3d.h>
24 
25 namespace irr {
26 class IrrlichtDevice;
27 namespace video {
28 class ITexture;
29 }
30 namespace scene {
31 class IAnimatedMesh;
32 class ISceneManager;
33 }
34 }
35 
36 namespace flair {
37  namespace core {
38  class Object;
39  class Euler;
40  class Quaternion;
41  }
42  namespace simulator {
43  class Model;
44  }
45 }
46 
47 class Gui_impl;
48 class Simulator_impl;
49 class Model_impl;
50 
51 namespace flair {
52 namespace simulator {
53 
54 class Gui: public core::Object {
55  friend class ::Simulator_impl;
56  friend class VisualizationCamera;
57 
58 public:
59  Gui(std::string name, int app_width, int app_height,
60  int scene_width, int scene_height, std::string media_path,
61  irr::video::E_DRIVER_TYPE driver_type = irr::video::EDT_OPENGL);
62  ~Gui();
63  irr::core::vector3df getRotation(void) const;
64  irr::video::ITexture *getTexture(std::string filename) const;
65  irr::scene::IAnimatedMesh *getMesh(std::string filename) const;
66  irr::scene::ISceneManager *getSceneManager(void) const;
67  irr::IrrlichtDevice *getDevice(void) const;
68  float getAspectRatio(void) const;
69  void setVisualizationCamera(Model* model);
70 
71 protected:
72  void setMesh(std::string file,
73  irr::core::vector3df position = irr::core::vector3df(0, 0, 0),
74  irr::core::vector3df rotation = irr::core::vector3df(0, 0, 0),
75  irr::core::vector3df scale = irr::core::vector3df(1, 1, 1));
76 
77 private:
78  Gui_impl *pimpl_;
79 };
80 
86 Gui *getGui(void);
87 
88 bool noGui(void);
89 
90 bool isGlExtensionSupported(
91  const std::string &ext); // check if a extension is supported
92 
100 float ToIrrlichtScale(float value);
101 
109 float ToSimulatorScale(float value);
110 
120 irr::core::vector3df ToIrrlichtCoordinates(irr::core::vector3df vect);
121 
131 template<typename T> irr::core::vector3df ToIrrlichtCoordinates(core::Vector3D<T> vect);
132 
142 core::Vector3Df ToSimulatorCoordinates(irr::core::vector3df vect);
143 
154 
155 } // end namespace simulator
156 } // end namespace flair
157 #endif // GUI_H
core::Quaternion ToIrrlichtOrientation(core::Quaternion quat)
Convert to irrlicht orientation.
Base class for all Framework's classes.
Definition: Object.h:84
namespace of the flair Framework
Definition: Ahrs.h:19
Class defining a 3D vector.
Definition: Vector3D.h:29
Definition: VisualizationCamera.h:41
core::Vector3Df ToSimulatorCoordinates(irr::core::vector3df vect)
Convert to simulator coordinates.
Class defining a 3D vector.
Definition: Ball.h:22
Definition: Gui.h:54
Definition: Model.h:57
Base class for all Framework's classes.
irr::core::vector3df ToIrrlichtCoordinates(irr::core::vector3df vect)
Convert to irrlicht coordinates.
float ToIrrlichtScale(float value)
Convert to irrlicht scale.
Class defining a quaternion.
Definition: Quaternion.h:26
Gui * getGui(void)
get Gui
float ToSimulatorScale(float value)
Convert to simulator scale.