Changeset 15 in flair-src for trunk/lib/FlairSimulator/src/unexported


Ignore:
Timestamp:
04/08/16 15:40:57 (6 years ago)
Author:
Bayard Gildas
Message:

sources reformatted with flair-format-dir script

Location:
trunk/lib/FlairSimulator/src/unexported
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairSimulator/src/unexported/AnimPoursuite.h

    r10 r15  
    2222#include <vector3d.h>
    2323
    24 namespace flair
    25 {
    26 namespace simulator
    27 {
     24namespace flair {
     25namespace simulator {
    2826
    29     class AnimPoursuite : public irr::scene::ISceneNodeAnimator
    30     {
    31         public:
    32             AnimPoursuite(const irr::scene::ISceneNode* parent,float rotateSpeed = -500.0f, float zoomSpeed = 4.0f);
    33             ~AnimPoursuite();
     27class AnimPoursuite : public irr::scene::ISceneNodeAnimator {
     28public:
     29  AnimPoursuite(const irr::scene::ISceneNode *parent,
     30                float rotateSpeed = -500.0f, float zoomSpeed = 4.0f);
     31  ~AnimPoursuite();
    3432
    35             void animateNode(irr::scene::ISceneNode* node, irr::u32 timeMs);
    36             ISceneNodeAnimator* createClone(irr::scene::ISceneNode* node,irr::scene::ISceneManager* newManager=0);
    37             bool MouseMoved(const irr::SEvent& event,irr::core::position2df MousePos);
    38             void setPositionOffset(irr::core::vector3df newpos);
    39             void setTargetOffset(irr::core::vector3df newpos);
     33  void animateNode(irr::scene::ISceneNode *node, irr::u32 timeMs);
     34  ISceneNodeAnimator *createClone(irr::scene::ISceneNode *node,
     35                                  irr::scene::ISceneManager *newManager = 0);
     36  bool MouseMoved(const irr::SEvent &event, irr::core::position2df MousePos);
     37  void setPositionOffset(irr::core::vector3df newpos);
     38  void setTargetOffset(irr::core::vector3df newpos);
    4039
    41         private:
    42             virtual bool isEventReceiverEnabled(void) const
    43             {
    44                 return true;
    45             }
     40private:
     41  virtual bool isEventReceiverEnabled(void) const { return true; }
    4642
    47             irr::core::vector3df pos_offset,target_offset;
    48             bool LMouseKey;
    49             irr::core::position2df RotateStart;
    50             irr::core::position2df MousePos;
    51             const irr::scene::ISceneNode* parent;
    52             bool Rotating;
    53             float RotY,RotZ;
    54             float rotateSpeed;
    55             float zoomSpeed;
    56             float currentZoom;
    57             float sat(float value);
    58     };
     43  irr::core::vector3df pos_offset, target_offset;
     44  bool LMouseKey;
     45  irr::core::position2df RotateStart;
     46  irr::core::position2df MousePos;
     47  const irr::scene::ISceneNode *parent;
     48  bool Rotating;
     49  float RotY, RotZ;
     50  float rotateSpeed;
     51  float zoomSpeed;
     52  float currentZoom;
     53  float sat(float value);
     54};
    5955
    6056} // end namespace simulator
  • trunk/lib/FlairSimulator/src/unexported/GenericObject.h

    r10 r15  
    3535#include <Vector3D.h>
    3636
    37 
    3837#include <aabbox3d.h>
    3938#include <IMeshSceneNode.h>
    4039
    41 namespace irr
    42 {
    43     class SEvent;
    44     namespace scene
    45     {
    46         class IMesh;
    47         class ISceneManager;
    48         class ITriangleSelector;
    49         class IMetaTriangleSelector;
    50         class ISceneNodeAnimatorCollisionResponse;
    51     }
     40namespace irr {
     41class SEvent;
     42namespace scene {
     43class IMesh;
     44class ISceneManager;
     45class ITriangleSelector;
     46class IMetaTriangleSelector;
     47class ISceneNodeAnimatorCollisionResponse;
     48}
    5249}
    5350
     
    5552class Simulator_impl;
    5653
    57 namespace flair
    58 {
    59 namespace core
    60 {
     54namespace flair {
     55namespace core {
    6156class ConditionVariable;
    6257}
    63 namespace simulator
    64 {
     58namespace simulator {
    6559class Simulator;
    6660class AnimPoursuite;
    6761
    68 class GenericObject : public irr::scene::IMeshSceneNode
    69 {
    70     friend class ::Simulator_impl;
     62class GenericObject : public irr::scene::IMeshSceneNode {
     63  friend class ::Simulator_impl;
    7164
    7265public:
    73     GenericObject(Simulator* parent,std::string name, irr::scene::ISceneManager* sceneManager);
    74     virtual ~GenericObject();
     66  GenericObject(Simulator *parent, std::string name,
     67                irr::scene::ISceneManager *sceneManager);
     68  virtual ~GenericObject();
    7569
    76     //FROM IMPL
    77     irr::scene::ITriangleSelector* TriangleSelector(void);
    78     irr::core::aabbox3d<irr::f32> box;
    79     //END FROM IMPL
     70  // FROM IMPL
     71  irr::scene::ITriangleSelector *TriangleSelector(void);
     72  irr::core::aabbox3d<irr::f32> box;
     73  // END FROM IMPL
    8074
    81     irr::scene::ISceneNode* getSceneNode();
    82     virtual const irr::core::aabbox3d<irr::f32>& getBoundingBox(void) const
    83     {
    84         return box;
    85     }
     75  irr::scene::ISceneNode *getSceneNode();
     76  virtual const irr::core::aabbox3d<irr::f32> &getBoundingBox(void) const {
     77    return box;
     78  }
    8679
    87     void setPosition(irr::core::vector3df position);
    88     void setScale(float value);
    89     void setScale(irr::core::vector3df scale);
    90     void setRotation(irr::core::vector3df rotation);
    91     void OnRegisterSceneNode(void);
    92     void setMesh(irr::scene::IMesh* mesh);
    93     irr::scene::IMesh* getMesh(void);
    94     void render(void);
    95     virtual void setReadOnlyMaterials(bool readonly){};
    96     virtual bool isReadOnlyMaterials(void) const
    97     {
    98         return false;
    99     }
    100     virtual irr::scene::IShadowVolumeSceneNode* addShadowVolumeSceneNode(const irr::scene::IMesh* shadowMesh=0,
    101             irr::s32 id=-1, bool zfailmethod=true, irr::f32 infinity=1000.0f)
    102     {
    103         return NULL;
    104     }
     80  void setPosition(irr::core::vector3df position);
     81  void setScale(float value);
     82  void setScale(irr::core::vector3df scale);
     83  void setRotation(irr::core::vector3df rotation);
     84  void OnRegisterSceneNode(void);
     85  void setMesh(irr::scene::IMesh *mesh);
     86  irr::scene::IMesh *getMesh(void);
     87  void render(void);
     88  virtual void setReadOnlyMaterials(bool readonly){};
     89  virtual bool isReadOnlyMaterials(void) const { return false; }
     90  virtual irr::scene::IShadowVolumeSceneNode *
     91  addShadowVolumeSceneNode(const irr::scene::IMesh *shadowMesh = 0,
     92                           irr::s32 id = -1, bool zfailmethod = true,
     93                           irr::f32 infinity = 1000.0f) {
     94    return NULL;
     95  }
    10596
    10697private:
    107     void UpdateFrom(core::io_data *data) {};
    108     irr::scene::IMesh *mesh;
    109     irr::scene::ITriangleSelector* selector;
    110     flair::core::ConditionVariable* cond;
    111     irr::video::SMaterial Material;
    112 
     98  void UpdateFrom(core::io_data *data){};
     99  irr::scene::IMesh *mesh;
     100  irr::scene::ITriangleSelector *selector;
     101  flair::core::ConditionVariable *cond;
     102  irr::video::SMaterial Material;
    113103};
    114104} // end namespace simulator
  • trunk/lib/FlairSimulator/src/unexported/Gui_impl.h

    r10 r15  
    2424#include <vector3d.h>
    2525
    26 namespace irr
    27 {
    28     class IrrlichtDevice;
    29     namespace scene
    30     {
    31         class ISceneManager;
    32         class IMeshSceneNode;
    33         class ITriangleSelector;
    34     }
    35     namespace video
    36     {
    37         class IVideoDriver;
    38     }
    39     namespace gui
    40     {
    41         class IGUIFont;
    42         class IGUIEnvironment;
    43     }
     26namespace irr {
     27class IrrlichtDevice;
     28namespace scene {
     29class ISceneManager;
     30class IMeshSceneNode;
     31class ITriangleSelector;
     32}
     33namespace video {
     34class IVideoDriver;
     35}
     36namespace gui {
     37class IGUIFont;
     38class IGUIEnvironment;
     39}
    4440}
    4541
    46 namespace flair
    47 {
    48     namespace core
    49     {
    50         class Object;
    51     }
    52     namespace simulator
    53     {
    54         class Model;
    55         class GenericObject;
    56         class Gui;
    57     }
     42namespace flair {
     43namespace core {
     44class Object;
     45}
     46namespace simulator {
     47class Model;
     48class GenericObject;
     49class Gui;
     50}
    5851}
    5952
    6053class MyEventReceiver;
    6154
    62 class Gui_impl
    63 {
    64     public:
    65         Gui_impl(flair::simulator::Gui* self,int app_width, int app_height,int scene_width, int scene_height,std::string media_path,irr::video::E_DRIVER_TYPE driver_type=irr::video::EDT_OPENGL);
    66         ~Gui_impl();
    67         void RunGui(std::vector<flair::simulator::Model*> modeles,std::vector<flair::simulator::GenericObject*> objects);
    68         void setMesh(std::string file,irr::core::vector3df position = irr::core::vector3df(0,0,0),irr::core::vector3df rotation= irr::core::vector3df(0,0,0),irr::core::vector3df scale= irr::core::vector3df(1,1,1));
     55class Gui_impl {
     56public:
     57  Gui_impl(flair::simulator::Gui *self, 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_impl();
     61  void RunGui(std::vector<flair::simulator::Model *> modeles,
     62              std::vector<flair::simulator::GenericObject *> objects);
     63  void setMesh(std::string file,
     64               irr::core::vector3df position = irr::core::vector3df(0, 0, 0),
     65               irr::core::vector3df rotation = irr::core::vector3df(0, 0, 0),
     66               irr::core::vector3df scale = irr::core::vector3df(1, 1, 1));
    6967
    70         irr::scene::IMeshSceneNode* node;
    71         irr::IrrlichtDevice *device;
    72         std::string media_path;
    73         irr::video::IVideoDriver* driver;
    74         irr::scene::ISceneManager* smgr;
    75         int scene_width,scene_height;
     68  irr::scene::IMeshSceneNode *node;
     69  irr::IrrlichtDevice *device;
     70  std::string media_path;
     71  irr::video::IVideoDriver *driver;
     72  irr::scene::ISceneManager *smgr;
     73  int scene_width, scene_height;
    7674
    77     private:
    78         MyEventReceiver *receiver;
    79         irr::scene::ITriangleSelector* selector;
    80         irr::gui::IGUIFont* font;
    81         irr::gui::IGUIEnvironment* env;
    82         void setWindowCaption(flair::core::Object* object, int fps);
    83         void takeScreenshot(void);
    84         hdfile_t *dbtFile_r,*dbtFile_w;
    85         size_t dbtSize(std::vector<flair::simulator::Model*> modeles);
    86         char* dbtbuf;
    87         flair::simulator::Gui *self;
     75private:
     76  MyEventReceiver *receiver;
     77  irr::scene::ITriangleSelector *selector;
     78  irr::gui::IGUIFont *font;
     79  irr::gui::IGUIEnvironment *env;
     80  void setWindowCaption(flair::core::Object *object, int fps);
     81  void takeScreenshot(void);
     82  hdfile_t *dbtFile_r, *dbtFile_w;
     83  size_t dbtSize(std::vector<flair::simulator::Model *> modeles);
     84  char *dbtbuf;
     85  flair::simulator::Gui *self;
    8886};
    8987
  • trunk/lib/FlairSimulator/src/unexported/Model_impl.h

    r10 r15  
    2323#include "Quaternion.h"
    2424
    25 namespace flair
    26 {
    27     namespace core
    28     {
    29         class cvmatrix;
    30         class Mutex;
    31         class ConditionVariable;
    32     }
    33     namespace gui
    34     {
    35         class TabWidget;
    36         class CheckBox;
    37         class DoubleSpinBox;
    38         class SpinBox;
    39         class Vector3DSpinBox;
    40     }
    41     namespace simulator
    42     {
    43         class Simulator;
    44         class AnimPoursuite;
    45     }
     25namespace flair {
     26namespace core {
     27class cvmatrix;
     28class Mutex;
     29class ConditionVariable;
     30}
     31namespace gui {
     32class TabWidget;
     33class CheckBox;
     34class DoubleSpinBox;
     35class SpinBox;
     36class Vector3DSpinBox;
     37}
     38namespace simulator {
     39class Simulator;
     40class AnimPoursuite;
     41}
    4642}
    4743
     
    5046#include <IMeshSceneNode.h>
    5147
    52 namespace irr
    53 {
    54     namespace scene
    55     {
    56         class ISceneManager;
    57         class ITriangleSelector;
    58         class IMetaTriangleSelector;
    59         class ISceneNodeAnimatorCollisionResponse;
    60         class ICameraSceneNode;
    61     }
     48namespace irr {
     49namespace scene {
     50class ISceneManager;
     51class ITriangleSelector;
     52class IMetaTriangleSelector;
     53class ISceneNodeAnimatorCollisionResponse;
     54class ICameraSceneNode;
     55}
    6256}
    6357#endif
    6458
    6559#ifdef GL
    66 class Model_impl : public irr::scene::ISceneNode,public flair::core::Thread,private vrpn_Tracker
     60class Model_impl : public irr::scene::ISceneNode,
     61                   public flair::core::Thread,
     62                   private vrpn_Tracker
    6763#else
    68 class Model_impl : public flair::core::Thread, private vrpn_Tracker
     64class Model_impl : public flair::core::Thread,
     65                   private vrpn_Tracker
    6966#endif
    70 {
    71     public:
     67                   {
     68public:
    7269#ifdef GL
    73         Model_impl(flair::simulator::Model* self,std::string name,irr::scene::ISceneManager* scenemanager,vrpn_Connection_IP* vrpn);
     70  Model_impl(flair::simulator::Model *self, std::string name,
     71             irr::scene::ISceneManager *scenemanager, vrpn_Connection_IP *vrpn);
    7472#else
    75         Model_impl(flair::simulator::Model* self,std::string name,vrpn_Connection_IP* vrpn);
     73  Model_impl(flair::simulator::Model *self, std::string name,
     74             vrpn_Connection_IP *vrpn);
    7675#endif
    77         ~Model_impl();
     76  ~Model_impl();
    7877
    7978#ifdef GL
    80         void OnRegisterSceneNode(void);
    81         void render(void);
    82         void Draw(void){printf("CA MARCHE PAS PUNAISE\r\n");ExtraDraw();};
    83         void ExtraDraw(void){printf("nope\r\n");};
     79  void OnRegisterSceneNode(void);
     80  void render(void);
     81  void Draw(void) {
     82    printf("CA MARCHE PAS PUNAISE\r\n");
     83    ExtraDraw();
     84  };
     85  void ExtraDraw(void) { printf("nope\r\n"); };
    8486
    85         const irr::core::aabbox3d<irr::f32>& getBoundingBox(void) const
    86         {
    87             return box;
    88         }
    89         void UpdatePos(void);
    90         void CheckCollision(void);
    91         irr::scene::ITriangleSelector* TriangleSelector(void);
    92         irr::scene::IMetaTriangleSelector* MetaTriangleSelector(void);
    93         irr::core::aabbox3d<irr::f32> box;
    94         void SynchronizationPoint();
    95         irr::scene::ICameraSceneNode* camera;
    96         flair::simulator::AnimPoursuite* animator;
    97         irr::scene::ITriangleSelector* selector;
     87  const irr::core::aabbox3d<irr::f32> &getBoundingBox(void) const {
     88    return box;
     89  }
     90  void UpdatePos(void);
     91  void CheckCollision(void);
     92  irr::scene::ITriangleSelector *TriangleSelector(void);
     93  irr::scene::IMetaTriangleSelector *MetaTriangleSelector(void);
     94  irr::core::aabbox3d<irr::f32> box;
     95  void SynchronizationPoint();
     96  irr::scene::ICameraSceneNode *camera;
     97  flair::simulator::AnimPoursuite *animator;
     98  irr::scene::ITriangleSelector *selector;
    9899#endif
    99         void mainloop(void);
     100  void mainloop(void);
    100101
    101         flair::gui::TabWidget *tabwidget;
    102         flair::gui::DoubleSpinBox *dT;
     102  flair::gui::TabWidget *tabwidget;
     103  flair::gui::DoubleSpinBox *dT;
    103104
    104     private:
    105         flair::gui::Vector3DSpinBox* pos_init;
    106         flair::gui::SpinBox *yaw_init;
    107         flair::gui::CheckBox *enable_opti;
    108         flair::simulator::Model* self;
    109         flair::core::cvmatrix* output;
    110         flair::core::Mutex *states_mutex;
     105private:
     106  flair::gui::Vector3DSpinBox *pos_init;
     107  flair::gui::SpinBox *yaw_init;
     108  flair::gui::CheckBox *enable_opti;
     109  flair::simulator::Model *self;
     110  flair::core::cvmatrix *output;
     111  flair::core::Mutex *states_mutex;
    111112
    112         struct timeval _timestamp;
    113         void Run(void);
    114         flair::core::Quaternion ComputeInitRotation(flair::core::Quaternion quat_in);
     113  struct timeval _timestamp;
     114  void Run(void);
     115  flair::core::Quaternion ComputeInitRotation(flair::core::Quaternion quat_in);
    115116#ifdef GL
    116         void CollisionHandler(void);
     117  void CollisionHandler(void);
    117118
    118         irr::scene::IMetaTriangleSelector* meta_selector;
    119         irr::scene::ISceneNodeAnimatorCollisionResponse* anim;
     119  irr::scene::IMetaTriangleSelector *meta_selector;
     120  irr::scene::ISceneNodeAnimatorCollisionResponse *anim;
    120121
    121         bool position_init;
     122  bool position_init;
    122123
    123         flair::core::ConditionVariable* cond;
    124         int sync_count;
     124  flair::core::ConditionVariable *cond;
     125  int sync_count;
    125126
    126         flair::core::Mutex *collision_mutex;
    127         bool collision_occured;
    128         flair::core::Vector3D collision_point;
     127  flair::core::Mutex *collision_mutex;
     128  bool collision_occured;
     129  flair::core::Vector3D collision_point;
    129130#endif
    130 
    131131};
    132132
  • trunk/lib/FlairSimulator/src/unexported/Simulator_impl.h

    r10 r15  
    2121#include <Thread.h>
    2222
    23 
    24 namespace flair
    25 {
    26     namespace simulator
    27     {
    28         class Simulator;
    29         class Model;
    30         class GenericObject;
    31     }
     23namespace flair {
     24namespace simulator {
     25class Simulator;
     26class Model;
     27class GenericObject;
     28}
    3229}
    3330
    34 class Simulator_impl: public vrpn_Connection_IP, private flair::core::Thread
    35 {
    36     friend class flair::simulator::Model;
    37     friend class flair::simulator::GenericObject;
     31class Simulator_impl : public vrpn_Connection_IP, private flair::core::Thread {
     32  friend class flair::simulator::Model;
     33  friend class flair::simulator::GenericObject;
    3834
    39     public:
    40         Simulator_impl(flair::simulator::Simulator* self,int optitrack_mstime=10,float yaw_deg=30);
    41         ~Simulator_impl();
     35public:
     36  Simulator_impl(flair::simulator::Simulator *self, int optitrack_mstime = 10,
     37                 float yaw_deg = 30);
     38  ~Simulator_impl();
    4239
    43         void RunSimu(void);
    44         float yaw_rad;
     40  void RunSimu(void);
     41  float yaw_rad;
    4542
    46     private:
    47         void Run(void);
    48         flair::simulator::Simulator* self;
    49         std::vector<flair::simulator::Model*> models;
    50         std::vector<flair::simulator::GenericObject*> objects;
    51         int optitrack_mstime;
     43private:
     44  void Run(void);
     45  flair::simulator::Simulator *self;
     46  std::vector<flair::simulator::Model *> models;
     47  std::vector<flair::simulator::GenericObject *> objects;
     48  int optitrack_mstime;
    5249};
    5350
Note: See TracChangeset for help on using the changeset viewer.