TDME2  1.9.200
WFObjWriter.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 
6 #include <tdme/tdme.h>
8 #include <tdme/math/Vector3.h>
9 
10 using std::string;
11 using std::vector;
12 
14 
15 /**
16  * Wavefront object model writer
17  * @author andreas.drewke
18  */
20 {
21 private:
22  vector<Vector3> vertices;
23  vector<Vector3> normals;
24  vector<vector<array<int, 2>>> faces;
25 public:
26  /**
27  * Public constructor
28  */
29  WFObjWriter();
30 
31  /**
32  * Adds a vertex
33  * @param vertex vertex
34  */
35  void addVertex(const Vector3& vertex);
36 
37  /**
38  * Adds a face
39  * @param faceVertexIndices face vertex indices
40  */
41  void addFace(vector<int> faceVertexIndices);
42 
43  /**
44  * Writes this wave front object file
45  * @param pathName path name
46  * @param fileName file name
47  * @return model
48  * @throws tdme::os::filesystem::FileSystemException
49  */
50  void write(const string& pathName, const string& fileName);
51 
52 };
Wavefront object model writer.
Definition: WFObjWriter.h:20
void write(const string &pathName, const string &fileName)
Writes this wave front object file.
Definition: WFObjWriter.cpp:59
void addVertex(const Vector3 &vertex)
Adds a vertex.
Definition: WFObjWriter.cpp:30
vector< vector< array< int, 2 > > > faces
Definition: WFObjWriter.h:24
void addFace(vector< int > faceVertexIndices)
Adds a face.
Definition: WFObjWriter.cpp:34
Vector3 class representing vector3 mathematical structure and operations with x, y,...
Definition: Vector3.h:20