Simulation.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef SOFA_SIMULATION_TREE_SIMULATION_H
00026 #define SOFA_SIMULATION_TREE_SIMULATION_H
00027
00028 #include <sofa/simulation/common/Node.h>
00029 #include <sofa/simulation/tree/GNode.h>
00030 #include <sofa/core/objectmodel/BaseObject.h>
00031 #include <sofa/defaulttype/LaparoscopicRigidTypes.h>
00032 #include <sofa/defaulttype/Vec.h>
00033 #include <sofa/simulation/tree/xml/XML.h>
00034 namespace sofa
00035 {
00036
00037 namespace simulation
00038 {
00039
00040 namespace tree
00041 {
00042
00047 class Simulation: public virtual sofa::core::objectmodel::BaseObject
00048 {
00049 private:
00051 static GNode* loadFromMemory ( const char *filename, const char *data, unsigned int size );
00053 static GNode* loadFromFile ( const char *filename );
00055 static GNode* processXML(xml::BaseElement* xml, const char *filename);
00056 public:
00063 static GNode* load(const char* filename);
00064
00065 Simulation();
00066 virtual ~Simulation();
00067
00069 virtual void print(Node* root);
00070
00072 virtual void printXML(Node* root, const char* fileName=0);
00073
00075 virtual void init(Node* root);
00076
00078 void getInstruments( Node *node);
00079
00081 virtual void animate(Node* root, double dt=0.0);
00082
00084 virtual void reset(Node* root);
00085
00087 virtual void initTextures(Node* root);
00088
00090 virtual void updateContext(Node* root);
00091
00093 virtual void updateVisualContext(Node* root,int FILTER=10);
00094
00096 virtual void computeBBox(Node* root, SReal* minBBox, SReal* maxBBox);
00097
00099 virtual void draw(Node* root);
00100
00102 virtual void drawShadows(Node* root);
00103
00105 virtual void unload(GNode* root);
00106
00108 virtual void exportOBJ(Node* root, const char* filename, bool exportMTL = true);
00109
00111 virtual void exportXML(Node* root, const char* filename);
00112
00114 virtual void dumpState( Node* root, std::ofstream& out );
00115
00117 virtual void initGnuplot( Node* root );
00119 virtual void exportGnuplot( Node* root, double time );
00120
00122 Data<unsigned> numMechSteps;
00123 Data<std::string> gnuplotDirectory;
00124
00125 helper::vector< Node* > instruments;
00126 Data< int > instrumentInUse;
00127 };
00128
00130 void setSimulation(Simulation*);
00131
00135 Simulation* getSimulation();
00136
00137 }
00138
00139 }
00140
00141 }
00142
00143 #endif