Projet d'Informatique 2012
Simulation générique de systèmes physiques simples : vers les machines de Rube Goldberg
include/Parseur.h
Aller à la documentation de ce fichier.
00001 
00005 #ifndef PARSEUR_H
00006 #define PARSEUR_H
00007 
00008 #include <string>
00009 #include <fstream>
00010 #include <iostream>
00011 #include "Vecteur.h"
00012 #include "Systeme.h"
00013 #include "Balle.h"
00014 #include "Balle3d.h"
00015 #include "Pendule.h"
00016 #include "Pendule3d.h"
00017 #include "Ressort.h"
00018 #include "Ressort3d.h"
00019 #include "Plan.h"
00020 #include "Plan3d.h"
00021 #include "PlanFini.h"
00022 #include "PlanFini3d.h"
00023 #include "Brique.h"
00024 #include "Brique3d.h"
00025 #include "Vent.h"
00026 #include "ChampForcesGlobal.h"
00027 #include "Ventilateur.h"
00028 #include "Ventilateur3d.h"
00029 #include "Trampoline.h"
00030 #include "Trampoline3d.h"
00031 
00036 class Parseur
00037 {
00038     public:
00039     
00040         Parseur(std::string const& adresse, Systeme* syst);
00041         ~Parseur();
00042 
00047         static const std::string SYSTEME;
00048         
00053         static const std::string OBJET_MOBILE;
00054         
00059         static const std::string OBSTACLE;
00060         
00065         static const std::string OBJET_COMPOSE;
00066         
00071         static const std::string CHAMP_FORCE;
00072 
00077         static const std::string POSITION;
00078         
00083         static const std::string VITESSE;
00084         
00089         static const std::string FORCE;
00090         
00095         static const std::string RAYON;
00096         
00101         static const std::string MASSE_VOLUMIQUE;
00102         
00107         static const std::string COULEUR;
00108         
00113         static const std::string ANGLE;
00114         
00119         static const std::string VITESSE_ANGULAIRE;
00120         
00125         static const std::string DIRECTION;
00126         
00131         static const std::string ATTACHE;
00132         
00137         static const std::string LONGUEUR;
00138         
00143         static const std::string FROTTEMENT;
00144         
00149         static const std::string RAIDEUR;
00150         
00155         static const std::string ORIGINE;
00156         
00161         static const std::string NORMALE;
00162         
00167         static const std::string COEFFICIENT_REBOND;
00168         
00173         static const std::string LARGEUR;
00174         
00179         static const std::string HAUTEUR;
00180         
00185         static const std::string FACE_A;
00186         
00191         static const std::string FACE_B;
00192         
00197         static const std::string FACE_C;
00198         
00203         static const std::string FACE_D;
00204         
00209         static const std::string FACE_E;
00210         
00215         static const std::string FACE_F;
00216         
00221         static const std::string PROFONDEUR;
00222         
00227         static const std::string INTENSITE;
00228 
00233         static const std::string BALLE;
00234       
00239         static const std::string BALLE3D;
00240       
00245         static const std::string RESSORT;
00246       
00251         static const std::string RESSORT3D;
00252       
00257         static const std::string PENDULE;
00258       
00263         static const std::string PENDULE3D;
00264       
00269         static const std::string PLAN;
00270       
00275         static const std::string PLAN3D;
00276       
00281         static const std::string PLAN_FINI;
00282       
00287         static const std::string PLAN_FINI3D;
00288       
00293         static const std::string BRIQUE;
00294       
00299         static const std::string BRIQUE3D;
00300       
00305         static const std::string VENT;
00306       
00311         static const std::string CHAMP_FORCE_GLOBAL;
00312       
00317         static const std::string VENTILATEUR;
00318       
00323         static const std::string VENTILATEUR3D;
00324       
00329         static const std::string TRAMPOLINE;
00330       
00335         static const std::string TRAMPOLINE3D;
00336 
00341         static const std::string TABULATION;
00342 
00346         void extraire();
00347         
00351         void enregistrer();
00352         
00357                 void setAdresse(std::string const& adresse);
00358 
00359     private:
00360 
00365         double lireDouble();
00366         
00371         Vecteur lireVecteur3D();
00372         
00377         Vecteur lireVecteur1D();
00378         
00383         Couleur lireCouleur();
00384         
00389         void lireBalise();
00390         
00395         void sauterCommentaire();
00396 
00400         void creerBalle();
00401         
00405         void creerPendule();
00406         
00410         void creerRessort();
00411         
00415         void creerPlan();
00416         
00420         void creerPlanFini();
00421         
00425         void creerBrique();
00426         
00430         void creerVent();
00431         
00435         void creerChampForcesGlobal();
00436         
00440         void creerVentilateur();
00441         
00445         void creerTrampoline();
00446 
00450         void creerBalle3D();
00451         
00455         void creerPendule3D();
00456         
00460         void creerRessort3D();
00461         
00465         void creerPlan3D();
00466         
00470         void creerPlanFini3D();
00471         
00475         void creerBrique3D();
00476         
00480         void creerVentilateur3D();
00481         
00485         void creerTrampoline3D();
00486 
00490         void parcourirObjetMobile();
00491 
00495         void parcourirObstacle();
00496 
00500         void parcourirObjetCompose();
00501 
00505         void parcourirChampForces();
00506 
00510         std::string m_adresse;
00511 
00515         std::ifstream m_fichier;
00516 
00520         Systeme* m_systeme;
00521 
00525         std::string m_tampon;
00526 
00527 };
00528 
00529 #endif // PARSEUR_H
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Énumérations Valeurs énumérées Amis