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 <EDriverTypes.h>
|
---|
22 | #include <vector3d.h>
|
---|
23 |
|
---|
24 | namespace irr {
|
---|
25 | class IrrlichtDevice;
|
---|
26 | namespace video {
|
---|
27 | class ITexture;
|
---|
28 | }
|
---|
29 | namespace scene {
|
---|
30 | class IAnimatedMesh;
|
---|
31 | class ISceneManager;
|
---|
32 | }
|
---|
33 | }
|
---|
34 |
|
---|
35 | namespace flair {
|
---|
36 | namespace core {
|
---|
37 | class Object;
|
---|
38 | class Vector3D;
|
---|
39 | class Euler;
|
---|
40 | class Quaternion;
|
---|
41 | }
|
---|
42 | }
|
---|
43 |
|
---|
44 | class Gui_impl;
|
---|
45 | class Simulator_impl;
|
---|
46 | class Model_impl;
|
---|
47 |
|
---|
48 | namespace flair {
|
---|
49 | namespace simulator {
|
---|
50 | class Simulator;
|
---|
51 |
|
---|
52 | class Gui : public core::Object {
|
---|
53 | friend class ::Simulator_impl;
|
---|
54 | friend class VisualizationCamera;
|
---|
55 |
|
---|
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;
|
---|
65 | irr::IrrlichtDevice *getDevice(void) const;
|
---|
66 | float getAspectRatio(void) const;
|
---|
67 |
|
---|
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));
|
---|
73 |
|
---|
74 | private:
|
---|
75 | Gui_impl *pimpl_;
|
---|
76 | };
|
---|
77 |
|
---|
78 | /*!
|
---|
79 | * \brief get Gui
|
---|
80 | *
|
---|
81 | * \return the Gui
|
---|
82 | */
|
---|
83 | Gui *getGui(void);
|
---|
84 |
|
---|
85 | bool noGui(void);
|
---|
86 |
|
---|
87 | bool isGlExtensionSupported(
|
---|
88 | const std::string &ext); // check if a extension is supported
|
---|
89 |
|
---|
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);
|
---|
98 |
|
---|
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);
|
---|
107 |
|
---|
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);
|
---|
118 |
|
---|
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);
|
---|
129 |
|
---|
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);
|
---|
140 |
|
---|
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 |
|
---|
152 | } // end namespace simulator
|
---|
153 | } // end namespace flair
|
---|
154 | #endif // GUI_H
|
---|