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

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

formatting script + include reformatted

File size: 2.4 KB
RevLine 
[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/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>
[13]27namespace irr {
28class SEvent;
29namespace scene {
30class ISceneManager;
31class ISceneNode;
32class ITriangleSelector;
[8]33}
[13]34}
[8]35#endif
36
[13]37namespace flair {
38namespace gui {
39class TabWidget;
[8]40}
[13]41namespace sensor {
42class SensorGL;
43}
44}
[8]45
46class Gui_impl;
47class Simulator_impl;
48class Model_impl;
49
[13]50namespace flair {
51namespace simulator {
52class Simulator;
53class AnimPoursuite;
[8]54
[13]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;
[8]61
[13]62public:
63 Model(const Simulator *parent, std::string name);
64 virtual ~Model();
[8]65
[13]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;
[8]72
[13]73#ifdef GL
74 irr::scene::ISceneNode *getSceneNode() const;
75 irr::core::aabbox3d<irr::f32> *Box() const;
[8]76
[13]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;
[8]83
[13]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;
[8]89
[13]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
[8]101
[13]102private:
103 void UpdateFrom(const core::io_data *data){};
104 class Model_impl *pimpl_;
105};
[8]106} // end namespace simulator
107} // end namespace flair
108#endif // MODEL_H
Note: See TracBrowser for help on using the repository browser.