00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __GU_Pelt_h__
00020 #define __GU_Pelt_h__
00021
00022 #include "GQ_API.h"
00023 #include <GU/GU_Detail.h>
00024 #include <GB/GB_Edge.h>
00025 #include <GB/GB_EdgeGroup.h>
00026 #include <UT/UT_PtrArray.h>
00027
00028 enum {
00029 GQ_PELT_XSOURCE = 0,
00030 GQ_PELT_YSOURCE,
00031 GQ_PELT_ZSOURCE,
00032 GQ_PELT_USOURCE,
00033 GQ_PELT_VSOURCE
00034 };
00035
00036 class GQ_API GQ_Pelt
00037 {
00038 public:
00039 class GQ_API FramePoint
00040 {
00041 public:
00042 float coord[2];
00043 float connectedcoord[2];
00044 };
00045
00046 static void findAllConnectedPrimitives(GU_Detail *gdp,
00047 GEO_Primitive *seed,
00048 GB_PointGroup *visited_points,
00049 GB_PrimitiveGroup *visited_prims,
00050 GB_EdgeGroup *boundary_edges);
00051 static void getEdges(GU_Detail *gdp, const GB_EdgeGroup *group,
00052 UT_IntArray &selections);
00053 static void putEdges(const UT_IntArray &selections, GU_Detail *gdp, GB_EdgeGroup *group);
00054
00055 static void getPrimitives(GU_Detail *gdp, UT_IntArray &data);
00056 static void putPrimitives(const UT_IntArray &data, GU_Detail *gdp);
00057
00058 static void determineCutSection(GU_Detail *gdp,
00059 const GB_EdgeGroup *cuts,
00060 GEO_Primitive *hint_prim,
00061 GB_PointGroup *connected_points,
00062 GB_PrimitiveGroup *connected_prims,
00063 GB_PointGroup *boundary_points);
00064
00065 static FramePoint *createFrame(const GEO_Face *face,
00066 const GU_Detail *gdp,
00067 const GB_PointGroup *boundary_points,
00068 int ufrom,
00069 int vfrom,
00070 float orientation,
00071 const char *density_attribute);
00072 static void destroyFrame(FramePoint *frame);
00073
00074 static void remapCoord(FramePoint *frame, int num_points,
00075 float minuvalue, float maxuvalue,
00076 float minvvalue, float maxvvalue);
00077
00078 static void updateUVs(GU_Detail *gdp, const GB_PointGroup *connected_points,
00079 FramePoint *frame,
00080 const GB_PrimitiveGroup *connected_prims,
00081 const GB_PointGroup *boundary_points, bool do_vertex,
00082 float springconstant, int maxiterations,
00083 bool (*callback_func)(void *),
00084 void *callback_data, const char *tension_attribute);
00085
00086 };
00087
00088 #endif