Changeset 13 in flair-dev for trunk/include/FlairSimulator/Model.h


Ignore:
Timestamp:
Apr 8, 2016, 3:39:24 PM (6 years ago)
Author:
Bayard Gildas
Message:

formatting script + include reformatted

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/FlairSimulator/Model.h

    r9 r13  
    2525#ifdef GL
    2626#include <aabbox3d.h>
    27 namespace irr
    28 {
    29     class SEvent;
    30     namespace scene
    31     {
    32         class ISceneManager;
    33         class ISceneNode;
    34         class ITriangleSelector;
    35     }
     27namespace irr {
     28class SEvent;
     29namespace scene {
     30class ISceneManager;
     31class ISceneNode;
     32class ITriangleSelector;
     33}
    3634}
    3735#endif
    3836
    39 namespace flair
    40 {
    41     namespace gui
    42     {
    43         class TabWidget;
    44     }
    45     namespace sensor
    46     {
    47         class SensorGL;
    48     }
     37namespace flair {
     38namespace gui {
     39class TabWidget;
     40}
     41namespace sensor {
     42class SensorGL;
     43}
    4944}
    5045
     
    5348class Model_impl;
    5449
    55 namespace flair
    56 {
    57 namespace simulator
    58 {
    59     class Simulator;
    60     class AnimPoursuite;
     50namespace flair {
     51namespace simulator {
     52class Simulator;
     53class AnimPoursuite;
    6154
    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;
     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;
    6961
    70         public:
    71             Model(const Simulator* parent,std::string name);
    72             virtual ~Model();
     62public:
     63  Model(const Simulator *parent, std::string name);
     64  virtual ~Model();
    7365
     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;
    7472
    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;
    8176
    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;
    8583
    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;
    9289
    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;
     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
    98101
    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     };
     102private:
     103  void UpdateFrom(const core::io_data *data){};
     104  class Model_impl *pimpl_;
     105};
    115106} // end namespace simulator
    116107} // end namespace flair
Note: See TracChangeset for help on using the changeset viewer.