Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
IOModel_X.h
Go to the documentation of this file.
1 // IOModel_X.h
3 // load/save X file descriptions
4 //
6 
7 #ifndef IOMODEL_X
8 #define IOMODEL_X
9 
10 #define DEBUG
11 #include "Toolbox\MyTrace.h"
12 
13 #include "framework\frm_IO.h"
14 #include <fstream>
15 #include <GL\freeglut.h>
16 #include "framework\Frm_Mesh.h"
17 #include "ToolBox\XFileStructs.h"
18 
19 namespace ToolBox {
20 
21 class IO_Model_X: Frm::IO<Frm::Model3D*>{
22  public:
23  IO_Model_X(void){_Type = IO_3DX;};
24  bool Load(std::string pFilename, Frm::Model3D* &pT);
25  bool Save(std::string pFilename, Frm::Model3D* &pT);
26  bool Load(std::string pFilename, std::vector<Frm::Model3D*> &pVT){return false;};
27  bool Save(std::string pFilename, std::vector<Frm::Model3D*> &pVT){return false;};
28 
29  private:
30  ifstream fin;
31  Frm::Mesh* _LoadMesh;
32  Frm::Model3D* _Object;
33 
34  //Utilities
35  int16 ProcessBlock(void);
36  int16 BlockID(std::string &pText);
37  void AvoidTemplate(void);
38  void Find(uchar pChar);
39  //Unique X struct ID in case no name are found
40  //Uses the Windows function GetTickCount
41  char* SetUID(char pType);
42  //structure used by the previous function to quickly
43  //convert a 32 bit number to a non-significant text.
44  union {
46  char Text[5];
47  }_X_UID;
48 
49  //X File struct processing
50  void ProcessBone(void);
51  void ProcessMesh(void);
52  void ProcessMeshTextureCoords(void);
53  void ProcessMeshMaterials(void);
54  void ProcessMeshNormals(void);
55  void ProcessMaterial(void);
56 };
57 
58 };
59 #endif
Definition: Frm_IO.h:17
uchar _Type
Definition: Frm_IO.h:38
Definition: Frm_Mesh.h:27
Definition: Frm_Mesh.h:68
Definition: IOModel_X.h:21
bool Save(std::string pFilename, std::vector< Frm::Model3D * > &pVT)
Definition: IOModel_X.h:27
bool Save(std::string pFilename, Frm::Model3D *&pT)
Definition: ioModel_X.cpp:109
IO_Model_X(void)
Definition: IOModel_X.h:23
char Text[5]
Definition: IOModel_X.h:46
uint32 Integer
Definition: IOModel_X.h:45
bool Load(std::string pFilename, Frm::Model3D *&pT)
Definition: ioModel_X.cpp:44
bool Load(std::string pFilename, std::vector< Frm::Model3D * > &pVT)
Definition: IOModel_X.h:26
Definition: IOTexture_BMP.h:16
unsigned char uchar
Definition: Frm_types.h:16
unsigned long int uint32
Definition: Frm_types.h:15
short int int16
Definition: Frm_types.h:12
#define IO_3DX
Definition: Frm_types.h:30