--- ray/src/common/objutil.h 2020/05/02 00:21:13 2.7 +++ ray/src/common/objutil.h 2021/02/12 15:35:07 2.10 @@ -1,4 +1,4 @@ -/* RCSid $Id: objutil.h,v 2.7 2020/05/02 00:21:13 greg Exp $ */ +/* RCSid $Id: objutil.h,v 2.10 2021/02/12 15:35:07 greg Exp $ */ /* * Declarations for .OBJ file utility * @@ -17,9 +17,10 @@ #define POPEN_SUPPORT 1 /* support "!command" i/o */ #endif /* face flags */ -#define FACE_SELECTED 01 -#define FACE_DEGENERATE 02 -#define FACE_DUPLICATE 04 +#define FACE_DEGENERATE 01 +#define FACE_DUPLICATE 02 +#define FACE_SELECTED 04 +#define FACE_CUSTOM(n) (1<<(2+(n))) struct Face; /* forward declaration */ @@ -88,8 +89,8 @@ Scene * newScene(void); /* Add a .OBJ file to a scene */ Scene * loadOBJ(Scene *sc, const char *fspec); -/* Duplicate a scene */ -Scene * dupScene(const Scene *sc); +/* Duplicate a scene, optionally selecting faces */ +Scene * dupScene(const Scene *sc, int flreq, int flexc); /* Transform entire scene */ int xfScene(Scene *sc, int xac, char *xav[]); @@ -98,6 +99,9 @@ int xfmScene(Scene *sc, const char *xfm); /* Add a descriptive comment */ void addComment(Scene *sc, const char *comment); +/* Find index for comment containing the given string (starting from n) */ +int findComment(Scene *sc, const char *match, int n); + /* Clear comments */ void clearComments(Scene *sc); @@ -172,6 +176,9 @@ void setMaterial(Scene *sc, const char *nm); /* Add a new face to our scene, using current group and material */ Face * addFace(Scene *sc, VNDX vid[], int nv); + +/* Delete unreferenced vertices, normals, texture coords */ +void deleteUnreferenced(Scene *sc); /* Free a scene */ void freeScene(Scene *sc);