17 |
|
#define POPEN_SUPPORT 1 /* support "!command" i/o */ |
18 |
|
#endif |
19 |
|
/* face flags */ |
20 |
< |
#define FACE_SELECTED 01 |
21 |
< |
#define FACE_DEGENERATE 02 |
22 |
< |
#define FACE_DUPLICATE 04 |
20 |
> |
#define FACE_DEGENERATE 01 |
21 |
> |
#define FACE_DUPLICATE 02 |
22 |
> |
#define FACE_SELECTED 04 |
23 |
> |
#define FACE_CUSTOM(n) (1<<(2+(n))) |
24 |
|
|
25 |
|
struct Face; /* forward declaration */ |
26 |
|
|
27 |
+ |
typedef int VNDX[3]; /* vertex indices (point,map,normal) */ |
28 |
+ |
|
29 |
+ |
/* Structure to hold vertex indices and link back to face list */ |
30 |
|
typedef struct { |
31 |
|
int vid; /* vertex id */ |
32 |
|
int tid; /* texture id */ |
89 |
|
/* Add a .OBJ file to a scene */ |
90 |
|
Scene * loadOBJ(Scene *sc, const char *fspec); |
91 |
|
|
92 |
< |
/* Duplicate a scene */ |
93 |
< |
Scene * dupScene(const Scene *sc); |
92 |
> |
/* Duplicate a scene, optionally selecting faces */ |
93 |
> |
Scene * dupScene(const Scene *sc, int flreq, int flexc); |
94 |
|
|
95 |
|
/* Transform entire scene */ |
96 |
|
int xfScene(Scene *sc, int xac, char *xav[]); |
99 |
|
/* Add a descriptive comment */ |
100 |
|
void addComment(Scene *sc, const char *comment); |
101 |
|
|
102 |
+ |
/* Find index for comment containing the given string (starting from n) */ |
103 |
+ |
int findComment(Scene *sc, const char *match, int n); |
104 |
+ |
|
105 |
|
/* Clear comments */ |
106 |
|
void clearComments(Scene *sc); |
107 |
|
|
159 |
|
int changeMaterial(Scene *sc, const char *mname, |
160 |
|
int flreq, int flexc); |
161 |
|
|
162 |
< |
/* Add a vertex to our scene */ |
162 |
> |
/* Add a vertex to our scene, returning index */ |
163 |
|
int addVertex(Scene *sc, double x, double y, double z); |
164 |
|
|
165 |
< |
/* Add a texture coordinate to our scene */ |
165 |
> |
/* Add a texture coordinate to our scene, returning index */ |
166 |
|
int addTexture(Scene *sc, double u, double v); |
167 |
|
|
168 |
< |
/* Add a surface normal to our scene */ |
168 |
> |
/* Add a surface normal to our scene, returning index */ |
169 |
|
int addNormal(Scene *sc, double xn, double yn, double zn); |
170 |
|
|
171 |
< |
/* Set current (last) group */ |
171 |
> |
/* Set current group (sc->lastgrp) to given ID */ |
172 |
|
void setGroup(Scene *sc, const char *nm); |
173 |
|
|
174 |
< |
/* Set current (last) material */ |
174 |
> |
/* Set current material (sc->lastmat) to given ID */ |
175 |
|
void setMaterial(Scene *sc, const char *nm); |
176 |
+ |
|
177 |
+ |
/* Add a new face to our scene, using current group and material */ |
178 |
+ |
Face * addFace(Scene *sc, VNDX vid[], int nv); |
179 |
+ |
|
180 |
+ |
/* Delete unreferenced vertices, normals, texture coords */ |
181 |
+ |
void deleteUnreferenced(Scene *sc); |
182 |
|
|
183 |
|
/* Free a scene */ |
184 |
|
void freeScene(Scene *sc); |