#include "globals.h" #include #include #include "Mesh.h" using TXS::UVs; using TXS::TiffImage; namespace CCS { /* * This is a class that runs the tbird UV synthesis procedure over a Mesh. * It assigns appropriate UV coords and txtr pointers to * every face on the mesh. */ class TbirdUvSynth { private: static const int NUM_TBIRD_UVS; /* * The 4 UVs we'll be throwing around * 00 10 11 01 */ vector tbirdUVs; TiffImage *tbirdTxtr; set visitedFaces; /* * This will return false if f was already in the visited list */ bool addVisitedFace(Face* f); /* * Returns the tbird UV number that the neighbor (an edge nbor) * should start with if the current face starts at vertStart * at the shared edge. */ int getStartUvForNbor(int vertStart); /* * The main recursive func */ void synthUVs(Face* f, Vertex* startVert, int startUvNum); public: TbirdUvSynth(); void synth(Mesh *mesh, TiffImage *txtr); }; }