ObjetSimule.h

Aller à la documentation de ce fichier.
00001 // ==========================================================================
00002 // (c) projet SAPPE
00003 // Author : F. Zara
00004 //
00005 // ==========================================================================
00006 
00007 
00012 #ifndef OBJET_SIMULE_H
00013 #define OBJET_SIMULE_H
00014 
00015 
00016 
00018 #include <stdio.h>
00019 #include <vector>
00020 #include <string.h>
00021 #include <fstream>
00022 
00023 #include "Donnees.h"
00024 #include "Noeuds.h"
00025 #include "Mesh.h"
00026 
00027 
00031 class ObjetSimule: public Noeud
00032 {
00033  public:
00034 
00036   ObjetSimule(std::string fich_param);
00037         
00039   void Param_mesh(std::string fich_param);
00040         
00042   void setOpenFile();
00043 
00046   void setInit();
00047 
00049    void init();
00050 
00052    void CalculForce();
00053 
00055    void CalculAccel(Coord g); 
00056    
00058    void CalculPositionVitesseTps0(float visco);
00059    
00061    void CalculPositionVitesse(float visco);
00062 
00064    void Simulation(Coord gravite, float viscosite, int Tps);
00065    
00067    void AffichagePos(int tps);
00068    
00070    void affiche();
00071    
00073    void setNormals();
00074    
00076    void NormaleFace(Coord &normale, int a, int b, int c);   
00077    
00079    inline void setNSize(int size) {_NSize = size;}
00080 
00082   inline Mesh* GetMesh() {return Maillage;}
00083 
00085   inline int GetNbPart() {return _Nb_Particules;}
00086   
00088   inline const float *normals() const {return _Normals;}
00089   
00091   inline const unsigned int nsize() const {return _NSize;}
00092   
00094   inline Coord GetTissuSize() {return _Size;}
00095 
00097   inline std::string GetFacette() {return _Fich_FaceSet;}
00098 
00100   inline virtual ~ObjetSimule();
00101   
00102           
00103           
00104  protected:
00105   
00107 
00108   std::string _Fich_Points;
00109 
00111   std::string _Fich_FaceSet;
00112 
00114   std::string _Fich_Masses;
00115 
00116   
00118 
00119   float _delta_t;   
00120 
00121   
00123 
00124   int _Nb_Particules;
00125 
00127   int _Nb_Ressorts;
00128 
00130   Spring _RessOS;
00131 
00133   Coord _Size;
00134 
00135  
00137 
00138   std::vector<Coord> P;
00139   
00141   std::vector<Coord> V;
00142   
00144   std::vector<Coord> A;
00145 
00147   std::vector<float> M;
00148 
00150   std::vector<Coord> Force;
00151   
00153   Mesh *Maillage;
00154   
00156   float *_Normals;
00157   
00159   unsigned int _NSize;
00160   
00161  
00162 };
00163 
00164 
00168 ObjetSimule::~ObjetSimule()
00169 {
00170         // Liberation du tableau des normales
00171         if (0 != _Normals)
00172         {
00173                 delete [] _Normals;
00174                 _Normals = 0;
00175         }
00176         
00177 }
00178 
00179 #endif

Généré le Thu Jan 24 19:11:42 2008 pour Animation 3D par  doxygen 1.5.1