Line | |
---|
1 | #ifndef _PLYCONVERTER_H
|
---|
2 | #define _PLYCONVERTER_H
|
---|
3 |
|
---|
4 | #include "SimpleVec.h"
|
---|
5 | #include <string>
|
---|
6 | #include <vector>
|
---|
7 | #include <map>
|
---|
8 |
|
---|
9 |
|
---|
10 | static std::string model_path("data/city/model/");
|
---|
11 |
|
---|
12 |
|
---|
13 | typedef std::vector<SimpleVec> VertexArray;
|
---|
14 | typedef std::pair<float, float> Texcoord;
|
---|
15 | typedef std::vector<SimpleVec> TexcoordArray;
|
---|
16 | typedef std::map<std::string, int> TextureTable;
|
---|
17 | typedef std::vector<std::string> TextureArray;
|
---|
18 |
|
---|
19 |
|
---|
20 | class ogzstream;
|
---|
21 |
|
---|
22 |
|
---|
23 |
|
---|
24 | /** Converts obj format into objects readable by our format
|
---|
25 | */
|
---|
26 | class PlyConverter
|
---|
27 | {
|
---|
28 | public:
|
---|
29 |
|
---|
30 | ~PlyConverter();
|
---|
31 |
|
---|
32 | bool Convert(const std::string &inputFilename,
|
---|
33 | const std::string &outputFilename);
|
---|
34 | // const std::string textureFilename) const;
|
---|
35 |
|
---|
36 |
|
---|
37 | protected:
|
---|
38 |
|
---|
39 | void LoadShape(const VertexArray &faceVertices,
|
---|
40 | const VertexArray &faceNormals,
|
---|
41 | const std::vector<Texcoord> &faceTexcoords
|
---|
42 | );
|
---|
43 |
|
---|
44 | struct Geometry
|
---|
45 | {
|
---|
46 | VertexArray mVertices;
|
---|
47 | VertexArray mNormals;
|
---|
48 | TexcoordArray mTexcoords;
|
---|
49 | };
|
---|
50 |
|
---|
51 | typedef std::vector<Geometry *> GeometryArray;
|
---|
52 |
|
---|
53 | void WriteGeometry(ogzstream &str, Geometry *geom);
|
---|
54 |
|
---|
55 | bool ReadFile(const std::string &inputFilename);
|
---|
56 | bool WriteFile(const std::string &outputFilename);
|
---|
57 |
|
---|
58 |
|
---|
59 | TextureTable mTextureTable;
|
---|
60 |
|
---|
61 | TextureArray mTextures;
|
---|
62 | GeometryArray mGeometry;
|
---|
63 |
|
---|
64 | int mNumShapes;
|
---|
65 | };
|
---|
66 |
|
---|
67 |
|
---|
68 |
|
---|
69 | #endif
|
---|
Note: See
TracBrowser
for help on using the repository browser.