| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
#ifndef _OBJMESHBINARYLOADER_H_ |
| 35 |
#define _OBJMESHBINARYLOADER_H_ |
| 36 |
|
| 37 |
#include "objMesh.h" |
| 38 |
#include <string> |
| 39 |
|
| 40 |
class ObjMeshBinaryLoader |
| 41 |
{ |
| 42 |
public: |
| 43 |
static int readFromBinaryFile(ObjMesh ** objMesh, const std::string & filename); |
| 44 |
static int writeToBinaryFile(ObjMesh * objMesh, const std::string & filename); |
| 45 |
|
| 46 |
protected: |
| 47 |
static int readFromBinary(ObjMesh::Vertex ** vertex, std::ifstream * fin); |
| 48 |
static int readFromBinary(ObjMesh::Face ** face, std::ifstream * fin); |
| 49 |
static int readFromBinary(ObjMesh::Group ** group, std::ifstream * fin); |
| 50 |
static int readFromBinary(ObjMesh::Material ** material, std::ifstream * fin); |
| 51 |
static int writeToBinary(ObjMesh::Vertex * vertex, std::ofstream * fout); |
| 52 |
static int writeToBinary(ObjMesh::Face * face, std::ofstream * fout); |
| 53 |
static int writeToBinary(ObjMesh::Group * group, std::ofstream * fout); |
| 54 |
static int writeToBinary(ObjMesh::Material * material, std::ofstream * fout); |
| 55 |
|
| 56 |
static int readStringFromBinary(std::string & name, std::ifstream * fin); |
| 57 |
static int readVec3dFromBinary(Vec3d & vec, std::ifstream * fin); |
| 58 |
static int writeStringToBinary(const std::string name, std::ofstream * fout); |
| 59 |
static int writeVec3dToBinary(Vec3d & vec, std::ofstream * fout); |
| 60 |
}; |
| 61 |
|
| 62 |
#endif |
| 63 |
|