00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __GU_UVSew_h__
00024 #define __GU_UVSew_h__
00025
00026 #include "GU_API.h"
00027
00028 #include <UT/UT_PtrArray.h>
00029 #include <UT/UT_IntArray.h>
00030 #include <UT/UT_HashTable.h>
00031 #include <GEO/GEO_PrimClassifier.h>
00032
00033 class UT_BitArray;
00034 class UT_IntArray;
00035 class UT_Matrix4;
00036 class UT_Vector3;
00037 class UT_Vector2;
00038 class GB_Edge;
00039 class GB_EdgeGroup;
00040 class GB_Primitive;
00041 class GB_VertexData;
00042 class GB_VertexGroup;
00043 class GEO_Delta;
00044 class GEO_Primitive;
00045 class GEO_PrimPoly;
00046 class GEO_PrimConnectorUV;
00047 class GEO_Point;
00048 class GU_Detail;
00049 class gu_SuperVertex;
00050 class gu_VertexTransform;
00051 class gu_ClassEdges;
00052
00053 class GU_API GU_UVSew
00054 {
00055 public:
00056
00057 GU_UVSew(GU_Detail &gdp, GEO_Delta *geodelta);
00058 ~GU_UVSew();
00059
00060
00061
00062
00063 void sew(GB_EdgeGroup *edge_grp);
00064
00065
00066 protected:
00067
00068
00069
00070 void sew(GEO_PrimPoly &from_poly, GEO_PrimPoly &to_poly,
00071 GB_Edge &edge);
00072
00073
00074
00075
00076
00077 void fillSuperVertexArray(const GEO_Primitive &prim);
00078
00079
00080
00081
00082 void processConnectedVertices(int svtx_idx,
00083 const UT_Vector2 &translate,
00084 float rotation,
00085 const UT_Vector2 &scales,
00086 const UT_Vector2 &pivot,
00087 const UT_Vector3 &p0,
00088 const UT_Vector3 &p1);
00089
00090
00091 int getSuperVertexIndex(const GB_Primitive &prim,
00092 int vtx);
00093
00094
00095 void insertVertexToSuperVertex(int svtx_idx,
00096 const GEO_Primitive &prim,
00097 int vtx);
00098
00099
00100
00101
00102 void getVertexUV(const GEO_Primitive &prim,
00103 int vtx, UT_Vector3 &uv);
00104 bool getSuperVertexUV(int svtx_idx, UT_Vector3 &uv);
00105
00106
00107
00108 void addSuperVertexToGroup(int svtx_idx,
00109 GB_VertexGroup &group);
00110
00111
00112
00113 void applyAndRemoveSuperTransforms();
00114
00115
00116
00117 void transformSuperVertex(int svtx_idx,
00118 const UT_Vector2 &translate,
00119 float rotation,
00120 const UT_Vector2 &scales,
00121 const UT_Vector2 &pivots,
00122 bool locked,
00123 float weight);
00124 void translateSuperVertex(int svtx_idx,
00125 const UT_Vector2 &translate,
00126 bool locked,
00127 float weight);
00128
00129
00130
00131 void getConnectedSuperVertices(int svtx_idx,
00132 UT_IntArray &connected);
00133
00134
00135
00136
00137 void buildMainClasses(GB_EdgeGroup *edge_grp);
00138
00139
00140
00141
00142 void resolveToEdges(GB_EdgeGroup *edge_grp);
00143
00144
00145 void clearSuperTransforms();
00146
00147
00148 GEO_PrimPoly *getMainPoly(GB_Edge &edge, const UT_IntArray &polys);
00149
00150
00151 void resetConnectivityStructures();
00152
00153 private:
00154 GU_Detail &myGdp;
00155 GEO_Delta *myDelta;
00156 int myVertexUVOffset;
00157 GEO_PrimClassifier myUVClassifier;
00158 GEO_PrimConnectorUV *myUVConnector;
00159 UT_PtrArray<gu_SuperVertex *> mySuperVertices;
00160 UT_PtrArray<gu_VertexTransform *> mySuperTransforms;
00161 UT_HashTable myVertexToSuperVertexTable;
00162 UT_PtrArray<gu_ClassEdges *> myMainClassEdges;
00163 };
00164
00165 #endif