00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __GU_Sweep_h__
00021 #define __GU_Sweep_h__
00022
00023 #include "GU_API.h"
00024 #include <UT/UT_WorkBuffer.h>
00025 #include <UT/UT_RefArray.h>
00026 #include <UT/UT_Matrix3.h>
00027 #include <GEO/GEO_Primitive.h>
00028
00029 typedef UT_RefArray<UT_Matrix3> utMatrixArray;
00030
00031 class GB_PrimitiveGroup;
00032
00033 typedef enum GU_SweepFixType {
00034 GU_SWEEP_FIX_NONE = 0,
00035 GU_SWEEP_FIX_ANGLE = 1,
00036 GU_SWEEP_FIX_NOFLIP = 2,
00037 GU_SWEEP_FIX_BOTH = 3
00038 } enum_sweepfixtype;
00039
00040 typedef enum GU_SweepSkinType {
00041 GU_SWEEP_SKIN_OFF = 0,
00042 GU_SWEEP_SKIN_ON = 1,
00043 GU_SWEEP_SKIN_AUTO = 2,
00044 GU_SWEEP_SKIN_PRESERVE_SHAPE_ON = 3,
00045 GU_SWEEP_SKIN_PRESERVE_SHAPE_AUTO = 4
00046 } enum_sweepskintype;
00047
00048 typedef float (*GU_SweepCallBack)(void *data, int pathNumber,
00049 int vertexNumber, int numberOfVertices);
00050
00051 class GU_API GU_SweepParms
00052 {
00053 public:
00054 GU_SweepParms();
00055 ~GU_SweepParms() {}
00056
00057 void reset();
00058 GU_ERROR doIt( GU_Detail *gdp );
00059
00060 GU_Detail *templateGdp;
00061 GU_Detail *paths;
00062 GU_Detail *refpaths;
00063 GU_Detail *xSection;
00064 GU_CrossSectionType cycleType;
00065 GU_SweepFixType fixType;
00066 int skipCoin;
00067 int aimAtRef;
00068 int useVertex;
00069 int vertexNumber;
00070 float scale;
00071 float twist;
00072 float roll;
00073 int outputGroups;
00074 GU_SweepSkinType skinType;
00075 int outputPolys;
00076 char *sweepGrpName;
00077 const GB_PrimitiveGroup *pathGroup;
00078 const GB_PrimitiveGroup *refGroup;
00079 const GB_PrimitiveGroup *xGroup;
00080
00081 GU_SweepCallBack getTwist;
00082 GU_SweepCallBack getScale;
00083 GU_SweepCallBack getRoll;
00084 void *callbackData;
00085
00086
00087 private:
00088
00089 GU_ERROR sweepPaths(GU_Detail* dest,
00090 const GB_PrimitiveGroup *tgroup,
00091 int use_template,
00092 int &template_startpt,
00093 UT_Interrupt *boss, int &stop);
00094
00095 GU_ERROR sweep(GEO_PrimPoly &path,
00096 GEO_PrimPoly *refpath,
00097 const GB_PrimitiveGroup *tGroup,
00098 GU_Detail &dest,
00099 int use_template, int &template_startpt,
00100 UT_Interrupt *boss, int &stop);
00101
00102 int calculateRotations(
00103 const GEO_PrimPoly &path,
00104 const GEO_PrimPoly *refPoly,
00105 int numPathVertices,
00106 UT_Matrix3 &rotOrigin,
00107 UT_Vector3 &tEnd,
00108 float *&refRollArray,
00109 char *&sweepOk);
00110
00111 utMatrixArray dihedralArray;
00112 utMatrixArray stretchArray;
00113 utMatrixArray refTiltArray;
00114
00115 int angleFlag;
00116 int cycleAll;
00117 int cycleOne;
00118 int noFlip;
00119 int sweepGroupCount;
00120
00121 GB_PrimitiveGroup *srcGroup;
00122 GB_PrimitiveGroup *onePrimGroup;
00123 GB_PrimitiveGroup *dest_primgroup;
00124 GB_PointGroup *dest_pointgroup;
00125 GB_PrimitiveGroup *dest_skingroup;
00126 GB_PrimitiveGroup *dest_delgroup;
00127 };
00128
00129 #endif