Changeset 15 in flair-src for trunk/lib/FlairSimulator/src/Model.h
- Timestamp:
- Apr 8, 2016, 3:40:57 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairSimulator/src/Model.h
r10 r15 25 25 #ifdef GL 26 26 #include <aabbox3d.h> 27 namespace irr 28 { 29 class SEvent; 30 namespace scene 31 { 32 class ISceneManager; 33 class ISceneNode; 34 class ITriangleSelector; 35 } 27 namespace irr { 28 class SEvent; 29 namespace scene { 30 class ISceneManager; 31 class ISceneNode; 32 class ITriangleSelector; 33 } 36 34 } 37 35 #endif 38 36 39 namespace flair 40 { 41 namespace gui 42 { 43 class TabWidget; 44 } 45 namespace sensor 46 { 47 class SensorGL; 48 } 37 namespace flair { 38 namespace gui { 39 class TabWidget; 40 } 41 namespace sensor { 42 class SensorGL; 43 } 49 44 } 50 45 … … 53 48 class Model_impl; 54 49 55 namespace flair 56 { 57 namespace simulator 58 { 59 class Simulator; 60 class AnimPoursuite; 50 namespace flair { 51 namespace simulator { 52 class Simulator; 53 class AnimPoursuite; 61 54 62 class Model : public core::IODevice 63 { 64 friend class ::Gui_impl; 65 friend class ::Simulator_impl; 66 friend class ::Model_impl; 67 friend class AnimPoursuite; 68 friend class sensor::SensorGL; 55 class 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; 69 61 70 71 Model(const Simulator* parent,std::string name);72 62 public: 63 Model(const Simulator *parent, std::string name); 64 virtual ~Model(); 73 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; 74 72 75 typedef struct simu_state { 76 core::Quaternion Quat; 77 core::Vector3D W; 78 core::Vector3D Pos; 79 core::Vector3D Vel; 80 } simu_state_t; 73 #ifdef GL 74 irr::scene::ISceneNode *getSceneNode() const; 75 irr::core::aabbox3d<irr::f32> *Box() const; 81 76 82 #ifdef GL 83 irr::scene::ISceneNode* getSceneNode() const; 84 irr::core::aabbox3d<irr::f32>* Box() const; 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; 85 83 86 virtual size_t dbtSize(void) const =0; 87 virtual void Draw(void){}; 88 virtual void ExtraDraw(void){}; 89 virtual void WritedbtBuf(char* dbtbuf)=0; 90 virtual void ReaddbtBuf(char* dbtbuf)=0; 91 virtual bool OnEvent(const irr::SEvent& event)=0; 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; 92 89 93 //! Sets the value of the camera's far clipping plane (default: 2000.0f) 94 /** \param zf: New z far value. */ 95 void setCameraFarValue(float zf); 96 #endif 97 gui::TabWidget* GetTabWidget(void) const; 90 protected: 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 98 101 99 protected: 100 DiscreteTimeVariable<simu_state_t,3> state; 101 float dT(void) const; 102 virtual void CalcModel(void)=0; 103 #ifdef GL 104 AnimPoursuite* getCamera(void) const; 105 virtual void AnimateModel(void)=0; 106 //void setPosition(core::Vector3D pos); 107 void setScale(float value); 108 void setTriangleSelector(irr::scene::ITriangleSelector* selector); 109 #endif 110 111 private: 112 void UpdateFrom(const core::io_data *data){}; 113 class Model_impl* pimpl_; 114 }; 102 private: 103 void UpdateFrom(const core::io_data *data){}; 104 class Model_impl *pimpl_; 105 }; 115 106 } // end namespace simulator 116 107 } // end namespace flair
Note:
See TracChangeset
for help on using the changeset viewer.