-
Notifications
You must be signed in to change notification settings - Fork 4
/
ObjFile.h
71 lines (44 loc) · 1.23 KB
/
ObjFile.h
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef __OBJFILE_H_
#define __OBJFILE_H_
#include "../../MainLib/InterceptPluginInterface.h"
#include <string>
#include <vector>
#include <deque>
#include "ogle.h"
class ObjFile : public Interface {
public:
class Element {
public:
int vid, nid, tid;
Element(int _vid = 0, int _nid = 0, int _tid = 0)
: vid(_vid), nid(_nid), tid(_tid) {}
};
class Face : public Interface {
public:
void addElement(Element v);
void shiftElements(int n = 1);
void clear();
deque<Element> elements;
};
typedef Ptr<Face> FacePtr;
ObjFile(string _objFileName);
~ObjFile();
void addSet(OGLE::ElementSetPtr set);
void printSet(OGLE::ElementSetPtr set);
Element generateElement(OGLE::ElementPtr e);
void printVertex(OGLE::VertexPtr v, const char *typeStr, int n = 0);
void printFace(FacePtr face, bool flip = 0);
FILE *f;
string objFileName;
static void init();
static int nextVertexID();
static int nextNormalID();
static int nextTexCoordID();
static int nextGroupID();
static int vertexCount;
static int normalCount;
static int texCoordCount;
static int groupCount;
};
typedef Ptr<ObjFile> ObjFilePtr;
#endif // __OBJFILE_H_