use spaces not tabs!
git-svn-id: svn://anubis/misc/wfobj@133 bd8a9e45-a331-0410-811e-c64571078777
This commit is contained in:
parent
049cb20c7c
commit
59f7e83a3f
100
WFObj.hh
100
WFObj.hh
@ -7,67 +7,67 @@
|
||||
class WFObj
|
||||
{
|
||||
public:
|
||||
typedef GLuint (*loadTextureFunc_t)(const char * texture);
|
||||
typedef void * (*loadFileFunc_t)(const char * filename,
|
||||
unsigned int * length);
|
||||
bool load(const std::string & filename,
|
||||
loadTextureFunc_t loadTexture = NULL,
|
||||
loadFileFunc_t loadFile = NULL);
|
||||
GLuint render(bool doTextureInfo = true);
|
||||
const float * const getAABB() { return m_aabb; }
|
||||
typedef GLuint (*loadTextureFunc_t)(const char * texture);
|
||||
typedef void * (*loadFileFunc_t)(const char * filename,
|
||||
unsigned int * length);
|
||||
bool load(const std::string & filename,
|
||||
loadTextureFunc_t loadTexture = NULL,
|
||||
loadFileFunc_t loadFile = NULL);
|
||||
GLuint render(bool doTextureInfo = true);
|
||||
const float * const getAABB() { return m_aabb; }
|
||||
|
||||
protected:
|
||||
/* types */
|
||||
class Vertex
|
||||
{
|
||||
public:
|
||||
float operator[](int idx) const { return data[idx]; }
|
||||
float & operator[](int idx) { return data[idx]; }
|
||||
float * getData() { return data; }
|
||||
private:
|
||||
float data[4];
|
||||
};
|
||||
/* types */
|
||||
class Vertex
|
||||
{
|
||||
public:
|
||||
float operator[](int idx) const { return data[idx]; }
|
||||
float & operator[](int idx) { return data[idx]; }
|
||||
float * getData() { return data; }
|
||||
private:
|
||||
float data[4];
|
||||
};
|
||||
|
||||
/* methods */
|
||||
void clear();
|
||||
int filesize(const char * filename);
|
||||
void processInputLine(const std::string & input);
|
||||
Vertex readVertex(const std::vector<std::string> & parts);
|
||||
void parseVertexIndices(const std::string & vtxref, int * ret);
|
||||
void updateAABB(const float * const vertex);
|
||||
bool load(std::istream & istr, unsigned int size);
|
||||
/* methods */
|
||||
void clear();
|
||||
int filesize(const char * filename);
|
||||
void processInputLine(const std::string & input);
|
||||
Vertex readVertex(const std::vector<std::string> & parts);
|
||||
void parseVertexIndices(const std::string & vtxref, int * ret);
|
||||
void updateAABB(const float * const vertex);
|
||||
bool load(std::istream & istr, unsigned int size);
|
||||
|
||||
/* variables */
|
||||
std::vector< std::vector<std::string> > m_data;
|
||||
loadTextureFunc_t m_loadTexture;
|
||||
loadFileFunc_t m_loadFile;
|
||||
std::string m_fileName;
|
||||
float m_aabb[6];
|
||||
bool m_loadedVertex;
|
||||
/* variables */
|
||||
std::vector< std::vector<std::string> > m_data;
|
||||
loadTextureFunc_t m_loadTexture;
|
||||
loadFileFunc_t m_loadFile;
|
||||
std::string m_fileName;
|
||||
float m_aabb[6];
|
||||
bool m_loadedVertex;
|
||||
};
|
||||
|
||||
|
||||
class WFMtl
|
||||
{
|
||||
public:
|
||||
bool load(const std::string & filename,
|
||||
WFObj::loadTextureFunc_t loadTexture = NULL,
|
||||
WFObj::loadFileFunc_t loadFile = NULL);
|
||||
void renderBegin(const std::string & mtlname, bool doTextureInfo = true);
|
||||
void renderEnd(const std::string & mtlname, bool doTextureInfo = true);
|
||||
bool load(const std::string & filename,
|
||||
WFObj::loadTextureFunc_t loadTexture = NULL,
|
||||
WFObj::loadFileFunc_t loadFile = NULL);
|
||||
void renderBegin(const std::string & mtlname, bool doTextureInfo = true);
|
||||
void renderEnd(const std::string & mtlname, bool doTextureInfo = true);
|
||||
|
||||
protected:
|
||||
/* methods */
|
||||
void clear();
|
||||
int filesize(const char * filename);
|
||||
void processInputLine(const std::string & input);
|
||||
void pushAttributes();
|
||||
bool load(std::istream & istr, unsigned int size);
|
||||
/* methods */
|
||||
void clear();
|
||||
int filesize(const char * filename);
|
||||
void processInputLine(const std::string & input);
|
||||
void pushAttributes();
|
||||
bool load(std::istream & istr, unsigned int size);
|
||||
|
||||
/* variables */
|
||||
std::map< std::string, std::vector< std::vector<std::string> > > m_data;
|
||||
std::string m_currentMaterialName;
|
||||
bool m_attributesPushed;
|
||||
WFObj::loadTextureFunc_t m_loadTexture;
|
||||
std::string m_fileName;
|
||||
/* variables */
|
||||
std::map< std::string, std::vector< std::vector<std::string> > > m_data;
|
||||
std::string m_currentMaterialName;
|
||||
bool m_attributesPushed;
|
||||
WFObj::loadTextureFunc_t m_loadTexture;
|
||||
std::string m_fileName;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user