Hauptseite | Liste aller Namensbereiche | Klassenhierarchie | Alphabetische Liste | Datenstrukturen | Auflistung der Dateien | Datenstruktur-Elemente | Datei-Elemente

Integrator.h

gehe zur Dokumentation dieser Datei
00001 /*
00002 Autor: $Author: kunkel $ State: $State: Exp $
00003 Datum: $Date: 2005/05/30 12:35:25 $
00004 Version: $Revision: 1.1 $
00005 */
00006 
00007 
00013 #ifndef INTEGRATOR_H
00014 #define INTEGRATOR_H
00015 
00016 #include <sys/time.h>
00017 #include "config.h"
00018 #include "CollisionsManager.h"
00019 #include "ObjectManager.h"
00020 
00028 class Integrator {
00029 private:
00030     static void AttributeMenuCallback(int i);
00031 
00032 protected:
00033 
00034     // Button im EditAttributeWindow
00035     enum button {CANCEL,OK};
00036 
00037     // Klasse zur Verwaltung des AttributeWindows
00038     class classWindowEditAttributes {
00039     public:
00040         GLUI * attributeWindow;
00041         void * additionalInformation;
00042         // Zeiger auf aktuellen Integrator
00043         Integrator * my;
00044     };
00045 
00046     // Zeiger auf AttributeWindow-Verwaltungsklasse
00047     static classWindowEditAttributes * editAttributes;
00048 
00049     void createBasisAttributeWindow();
00050 
00055     inline double abs(double a) {
00056         return a < 0 ? -a : a;
00057     }
00058 
00064     inline double MAX(double a, double b) {
00065         return a > b ? a : b;
00066     }
00067 
00073     inline float MAX(float a, float b) {
00074         return a > b ? a : b;
00075     }
00076 
00082     inline double MIN(double a, double b) {
00083         return a < b ? a : b;
00084     }
00085 
00091     inline float MIN(float a, float b) {
00092         return a < b ? a : b;
00093     }
00094 
00099     inline double sqr(double x) {
00100         return ((x)*(x));
00101     }
00102 
00107     inline float sqr(float x) {
00108         return ((x)*(x));
00109     }
00110 
00115     inline double cubic(double x) {
00116         return ((x)*(x)*(x));
00117     }
00118 
00123     inline float cubic(float x) {
00124         return ((x)*(x)*(x));
00125     }
00126 
00131     objectList *objects;
00132 
00137     virtual void deleteAdditionalInformation(void * additionalInformation)=0;
00138 
00142     virtual void saveAttributes()=0;
00143 
00147     virtual void loadAttributes()=0;
00148 
00149 public:
00150 
00156     class Error {
00157     private:
00158 
00159         // nimmt Fehlernachricht auf
00160         string message;
00161     public:
00162 
00163         // Konstruktor, dem Fehlernachricht uebergeben wird
00164         Error(const string & msg) {
00165             message = msg;
00166         }
00167 
00168         // Funktion zum Ausgeben der Fehlernachricht
00169         void print();
00170 
00171     };
00172 
00173     static char * NumToType(const int typenum);
00174 
00175     static int TypeToInt(const string & intType);
00176 
00177     static int getTypeCount();
00178 
00179     static Integrator * createIntegrator(const string &  name);
00180 
00181     static void closeAttributeWindow();
00182 
00183 
00184     virtual double integrate(double time)=0;
00185     virtual list<Collisionspair>* getCollisionslist()=0;
00186 
00187     virtual string getName()=0;
00188     virtual double getTime()=0;
00189 
00190     virtual void save(ostream & FILE)=0;
00191     virtual void load(istream & FILE)=0;
00192     virtual void createAttributeWindow()=0;
00193 
00198     void setObjects(objectList * objList) {
00199         objects = objList;
00200     }
00201 
00202     // Destructor, der das AttributeWindow schliesst
00203     virtual ~Integrator() {
00204         closeAttributeWindow();
00205     }
00206 };
00207 
00208 #endif

Erzeugt am Mon May 30 14:31:15 2005 für Sunsystembuildingandsimulation von doxygen 1.3.6