00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <UT/UT_String.h>
00021 #include <UT/UT_IntArray.h>
00022
00023 class GEO_PrimPoly;
00024 class GEO_Hull;
00025 class GB_AttributeRef;
00026 class GEO_Primitive;
00027 class GU_Detail;
00028 class GB_Basis;
00029
00030 void obj_getHullIndexFromUV(int &r, int &c, float &fracu, float &fracv,
00031 const GEO_Hull *hull, float u, float v);
00032
00033 void obj_findGreville(const GB_Basis *basis, bool iswrapped, float u,
00034 int numidx, int &idx, float &frac);
00035
00036 class OBJ_UVCache
00037 {
00038 public:
00039 OBJ_UVCache(const GU_Detail *gdp, const char *uvname,
00040 bool wrapu, float minu, float maxu,
00041 bool wrapv, float minv, float maxv);
00042 ~OBJ_UVCache();
00043
00044 bool isCacheValid(const GU_Detail *gdp,
00045 const char *uvname,
00046 bool assumeuvconstant,
00047 bool wrapu, float minu, float maxu,
00048 bool wrapv, float minv, float maxv) const;
00049
00050 void addPrimitive(const GEO_Primitive *prim,
00051 const GB_AttributeRef &uvoff,
00052 bool isvertex);
00053
00054 void wrapUV(float &newu, float &newv,
00055 float oldu, float oldv);
00056 bool getCell(float u, float v, int &cu, int &cv);
00057
00058
00059
00060
00061 int getPrimitive(const GU_Detail *gdp,
00062 float u, float v, float &pu, float &pv);
00063
00064
00065
00066
00067 bool testPolygon(const GEO_PrimPoly *poly,
00068 const GB_AttributeRef &uvoff, bool isvertex,
00069 float u, float v,
00070 float &pu, float &pv);
00071
00072
00073 bool testHull(const GEO_Hull *hull,
00074 const GB_AttributeRef &uvoff, bool isvertex,
00075 float u, float v,
00076 float &pu, float &pv);
00077
00078 protected:
00079 UT_String myUVName;
00080 int myNumPoly;
00081 float myMinU, myMaxU;
00082 float myMinV, myMaxV;
00083 bool myWrapU, myWrapV;
00084 int myResU, myResV;
00085
00086
00087
00088 UT_IntArray ***myPrimTable;
00089
00090 int myGdpID, myGdpMetaCount;
00091 };
00092