Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Frm_Mesh.h
Go to the documentation of this file.
1 // Frm_Mesh.h
3 //
4 //
6 
7 #ifndef FRM_MESH_H
8 #define FRM_MESH_H
9 
10 #include "framework\frm_types.h"
11 #include "framework\frm_3Dmath.h"
12 #include "framework\frm_Material.h"
13 
14 #define DEBUG
15 #include "Toolbox\Mytrace.h"
16 
17 #include <list>
18 #include <vector>
19 
20 namespace Frm {
21 
22 struct Subset {
25  };
26 
27 class Mesh {
28  public:
29  Mesh(void):_nVertices(0), _Vertices(0),
30  _nFaces(0), _Faces(0),
32  _FaceMaterials(0),
33  _nNormals(0), _Normals(0),
34  _nMaterials(0),
35  _FirstVertex(0), //The _Firstxxx series are used
36  _FirstFace(0), //for mesh concatenation
38  _FirstNormal(0),
40  {};
41  ~Mesh(void);
42  Mesh* IsName(std::string &MeshName){if (strcmp(_Name.c_str(), MeshName.c_str())==0) return this; return 0;};
43  void UpdateIndices(void);
44  void CreateSubsets(void);
45  //Vertices
48  //Texture Coords for each vertex
51  //Faces
54  //Subset of a mesh: there is one subset for each material used
55  std::list<Subset*> _Subsets;
56  //Normals
60  //Material index for each face
63  //list of Materials for that Mesh
64  std::list<Material*> _Materials;
65  std::string _Name;
66 };
67 
68 class Model3D {
69  public:
70  Model3D(void){};
71  ~Model3D(void);
72  Mesh* IsMeshName(std::string &pText);
73  void ConcatenateMeshes(void);
74  std::list<Mesh*> _Meshes;
75 };
76 };
77 
78 #endif
Definition: Frm_Mesh.h:27
uint16 _nNormals
Definition: Frm_Mesh.h:57
uint16 _FirstTextureCoord
Definition: Frm_Mesh.h:49
Face * _Faces
Definition: Frm_Mesh.h:53
uint16 * _FaceMaterials
Definition: Frm_Mesh.h:62
uint16 _FirstVertex
Definition: Frm_Mesh.h:46
std::list< Material * > _Materials
Definition: Frm_Mesh.h:64
Face * _FaceNormals
Definition: Frm_Mesh.h:59
uint16 _nMaterials
Definition: Frm_Mesh.h:61
~Mesh(void)
Definition: Frm_Mesh.cpp:11
uint32 _nFaces
Definition: Frm_Mesh.h:52
uint16 _FirstMaterial
Definition: Frm_Mesh.h:61
std::list< Subset * > _Subsets
Definition: Frm_Mesh.h:55
uint16 _nVertices
Definition: Frm_Mesh.h:46
Mesh * IsName(std::string &MeshName)
Definition: Frm_Mesh.h:42
Mesh(void)
Definition: Frm_Mesh.h:29
uint16 _nTextureCoords
Definition: Frm_Mesh.h:49
void CreateSubsets(void)
Definition: Frm_Mesh.cpp:47
uint32 _FirstFace
Definition: Frm_Mesh.h:52
Vertex * _Vertices
Definition: Frm_Mesh.h:47
uint16 _FirstNormal
Definition: Frm_Mesh.h:57
std::string _Name
Definition: Frm_Mesh.h:65
void UpdateIndices(void)
Definition: Frm_Mesh.cpp:27
TCoord * _TextureCoords
Definition: Frm_Mesh.h:50
vector< float > * _Normals
Definition: Frm_Mesh.h:58
Definition: Frm_Mesh.h:68
~Model3D(void)
Definition: Frm_Mesh.cpp:73
void ConcatenateMeshes(void)
Definition: Frm_Mesh.cpp:85
Model3D(void)
Definition: Frm_Mesh.h:70
std::list< Mesh * > _Meshes
Definition: Frm_Mesh.h:74
Mesh * IsMeshName(std::string &pText)
Definition: Frm_Mesh.cpp:78
Definition: Frm.h:12
unsigned short int uint16
Definition: Frm_types.h:14
unsigned long int uint32
Definition: Frm_types.h:15
Definition: Frm_3DMath.h:15
Definition: Frm_Mesh.h:22
uint16 Size
Definition: Frm_Mesh.h:23
Face * Faces
Definition: Frm_Mesh.h:24