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 GEO_Primitive;
00026 class GU_Detail;
00027 class GB_Basis;
00028
00029 void obj_getHullIndexFromUV(int &r, int &c, float &fracu, float &fracv,
00030 const GEO_Hull *hull, float u, float v);
00031
00032 void obj_findGreville(const GB_Basis *basis, bool iswrapped, float u,
00033 int numidx, int &idx, float &frac);
00034
00035 class OBJ_UVCache
00036 {
00037 public:
00038 OBJ_UVCache(const GU_Detail *gdp, const char *uvname,
00039 bool wrapu, float minu, float maxu,
00040 bool wrapv, float minv, float maxv);
00041 ~OBJ_UVCache();
00042
00043 bool isCacheValid(const GU_Detail *gdp,
00044 const char *uvname,
00045 bool assumeuvconstant,
00046 bool wrapu, float minu, float maxu,
00047 bool wrapv, float minv, float maxv) const;
00048
00049 void addPrimitive(const GEO_Primitive *prim, int uvoff,
00050 bool isvertex);
00051
00052 void wrapUV(float &newu, float &newv,
00053 float oldu, float oldv);
00054 bool getCell(float u, float v, int &cu, int &cv);
00055
00056
00057
00058
00059 int getPrimitive(const GU_Detail *gdp,
00060 float u, float v, float &pu, float &pv);
00061
00062
00063
00064
00065 bool testPolygon(const GEO_PrimPoly *poly,
00066 int uvoff, bool isvertex,
00067 float u, float v,
00068 float &pu, float &pv);
00069
00070
00071 bool testHull(const GEO_Hull *hull,
00072 int uvoff, bool isvertex,
00073 float u, float v,
00074 float &pu, float &pv);
00075
00076 protected:
00077 UT_String myUVName;
00078 int myNumPoly;
00079 float myMinU, myMaxU;
00080 float myMinV, myMaxV;
00081 bool myWrapU, myWrapV;
00082 int myResU, myResV;
00083
00084
00085
00086 UT_IntArray ***myPrimTable;
00087
00088 int myGdpID, myGdpMetaCount;
00089 };
00090