#ifndef _OBJCONVERTER_H #define _OBJCONVERTER_H #include "SimpleVec.h" #include #include /*struct SimpleVec { SimpleVec() {} SimpleVec(float _x, float _y, float _z): x(_x), y(_y), z(_z) {} float x, y, z; };*/ typedef std::vector VertexArray; typedef std::pair Texcoord; class ogzstream; /** Converts obj format into objects readable by our format */ class ObjConverter { public: ObjConverter(); bool Convert(const std::string &inputFilename, const std::string &outputFilename); // const std::string textureFilename) const; ~ObjConverter(); protected: struct Geometry { SimpleVec *mVertices; SimpleVec *mNormals; Texcoord *mTexcoords; int mVertexCount; int mTexcoordCount; }; void LoadShape(const VertexArray &faceVertices, const VertexArray &faceNormals, const std::vector &faceTexcoords); void WriteGeometry(ogzstream &str, Geometry *geom); bool ReadFile(const std::string &inputFilename); bool WriteFile(const std::string &outputFilename); std::vector mGeometry; int mNumShapes; }; #endif