00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00027 #include <stdlib.h>
00028 #include <stdio.h>
00029 #include <sstream>
00030 #include <string.h>
00031
00032
00034 #include "Properties.h"
00035 #include "Scene.h"
00036 #include "ObjetSimule.h"
00037
00038
00042 #define GET_PARAM(str, var) \
00043 do { \
00044 std::string s = Prop[str]; \
00045 std::istringstream iss(s); \
00046 iss >> var; \
00047 } while (0);
00048
00049
00050
00051
00055 void Scene::Param(std::string Fichier_Param)
00056 {
00058
00059 Properties Prop;
00060
00061
00062 Prop.load(Fichier_Param);
00063
00064
00065 GET_PARAM("viscosite", _visco);
00066
00067
00068 float vargx, vargy, vargz;
00069
00070
00071 GET_PARAM("gx", vargx);
00072 _g.setX(vargx);
00073
00074
00075 GET_PARAM("gy", vargy);
00076 _g.setY(vargy);
00077
00078
00079 GET_PARAM("gz", vargz);
00080 _g.setZ(vargz);
00081
00082
00083 GET_PARAM("nbiter", _nb_iter);
00084
00085 }
00086
00087
00091 void ObjetSimule::Param_mesh(std::string Fichier_Param)
00092 {
00094
00095 Properties Prop;
00096
00097
00098 Prop.load(Fichier_Param);
00099
00100
00101 GET_PARAM("points", _Fich_Points);
00102
00103
00104 GET_PARAM("faceset", _Fich_FaceSet);
00105
00106
00107 GET_PARAM("masses", _Fich_Masses);
00108
00109
00110 GET_PARAM("dt", _delta_t);
00111
00112
00113 GET_PARAM("k", _RessOS._Raideur);
00114
00115
00116 GET_PARAM("nu", _RessOS._Nu);
00117
00118
00119 }