source: flair-dev/trunk/include/FlairSimulator/Model.h@ 23

Last change on this file since 23 was 13, checked in by Bayard Gildas, 6 years ago

formatting script + include reformatted

File size: 2.4 KB
Line 
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/25
6// filename: Model.h
7//
8// author: Guillaume Sanahuja
9// Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11// version: $Id: $
12//
13// purpose: classe definissant un modele a simuler
14//
15/*********************************************************************/
16
17#ifndef MODEL_H
18#define MODEL_H
19
20#include <IODevice.h>
21#include <Quaternion.h>
22#include <Vector3D.h>
23#include <DiscreteTimeVariable.h>
24
25#ifdef GL
26#include <aabbox3d.h>
27namespace irr {
28class SEvent;
29namespace scene {
30class ISceneManager;
31class ISceneNode;
32class ITriangleSelector;
33}
34}
35#endif
36
37namespace flair {
38namespace gui {
39class TabWidget;
40}
41namespace sensor {
42class SensorGL;
43}
44}
45
46class Gui_impl;
47class Simulator_impl;
48class Model_impl;
49
50namespace flair {
51namespace simulator {
52class Simulator;
53class AnimPoursuite;
54
55class Model : public core::IODevice {
56 friend class ::Gui_impl;
57 friend class ::Simulator_impl;
58 friend class ::Model_impl;
59 friend class AnimPoursuite;
60 friend class sensor::SensorGL;
61
62public:
63 Model(const Simulator *parent, std::string name);
64 virtual ~Model();
65
66 typedef struct simu_state {
67 core::Quaternion Quat;
68 core::Vector3D W;
69 core::Vector3D Pos;
70 core::Vector3D Vel;
71 } simu_state_t;
72
73#ifdef GL
74 irr::scene::ISceneNode *getSceneNode() const;
75 irr::core::aabbox3d<irr::f32> *Box() const;
76
77 virtual size_t dbtSize(void) const = 0;
78 virtual void Draw(void){};
79 virtual void ExtraDraw(void){};
80 virtual void WritedbtBuf(char *dbtbuf) = 0;
81 virtual void ReaddbtBuf(char *dbtbuf) = 0;
82 virtual bool OnEvent(const irr::SEvent &event) = 0;
83
84 //! Sets the value of the camera's far clipping plane (default: 2000.0f)
85 /** \param zf: New z far value. */
86 void setCameraFarValue(float zf);
87#endif
88 gui::TabWidget *GetTabWidget(void) const;
89
90protected:
91 DiscreteTimeVariable<simu_state_t, 3> state;
92 float dT(void) const;
93 virtual void CalcModel(void) = 0;
94#ifdef GL
95 AnimPoursuite *getCamera(void) const;
96 virtual void AnimateModel(void) = 0;
97 // void setPosition(core::Vector3D pos);
98 void setScale(float value);
99 void setTriangleSelector(irr::scene::ITriangleSelector *selector);
100#endif
101
102private:
103 void UpdateFrom(const core::io_data *data){};
104 class Model_impl *pimpl_;
105};
106} // end namespace simulator
107} // end namespace flair
108#endif // MODEL_H
Note: See TracBrowser for help on using the repository browser.