src/rcrt/loaders/ObjectLoader.h

Go to the documentation of this file.
00001 #ifndef OBJECTLOADER_H_
00002 #define OBJECTLOADER_H_
00003 
00004 #include <vector>
00005 #include "XMLLoader.h"
00006 #include "../primitives/Triangle.h"
00007 #include "../primitives/Vertex.h"
00008 #include "../primitives/Sphere.h"
00009 #include "conversion.hpp"
00010 #include "MaterialLoader.h"
00011 
00012 namespace rcrt
00013 {
00014 
00015 class SolidObject;
00016 
00017 enum AnimType
00018 {
00019         STATIC,
00020         AFFINE,
00021         DYNAMIC
00022 };
00023 
00024 
00031 class ObjectLoader : public XMLLoader
00032 {
00033 private:
00034         MaterialLoader* materials;
00035         SolidObject* object;
00036         std::string name;
00037         AnimType aType;
00038         std::string material;
00039         std::vector<Vertex> vertices;
00040         std::vector<Triangle*> tris;
00041         std::vector<Primitive*> primitives;
00042         
00043         bool initialised;
00044         
00045         void init();
00046         void initMaterials();
00047         void updateMesh();
00048         void initStatic();
00049         void initAffine();
00050         void initDynamic();
00051         void updateMatrix();
00052         
00053 public:
00054         ObjectLoader(std::string path, MaterialLoader* mats = 0);
00055         virtual ~ObjectLoader();
00056         
00057         Object* getObject();
00058         
00059         bool nextFrame();
00060         bool goToFrame(const int& n);
00061         
00062         std::vector<Triangle*>* getTriangles();
00063 };
00064 
00065 }
00066 
00067 #endif /*OBJECTLOADER_H_*/

Generated on Thu Jan 31 19:26:19 2008 for RenderingCompetitionRayTracer by  doxygen 1.5.3