00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __GU_Creep_h__
00021 #define __GU_Creep_h__
00022
00023 #include "GU_API.h"
00024 #include <SYS/SYS_Types.h>
00025 #include <UT/UT_Vector3.h>
00026 #include <UT/UT_String.h>
00027 #include <UT/UT_PtrArray.h>
00028
00029 class gu_CreepAttribMap;
00030 class GB_PointGroup;
00031 class GEO_Primitive;
00032 class GU_Detail;
00033
00034 class GU_API GU_CreepParms
00035 {
00036 public:
00037 GU_CreepParms();
00038 ~GU_CreepParms();
00039
00040 enum GU_AttribOp {
00041 GU_SET_ATTRIB,
00042 GU_ADD_ATTRIB,
00043 GU_SUB_ATTRIB,
00044 GU_MUL_ATTRIB
00045 };
00046
00047
00048
00049
00050
00051 void setPointAttrib(const char *pattern, GU_AttribOp op);
00052 void setPrimAttrib(const char *pattern, GU_AttribOp op);
00053 void setVertexAttrib(const char *pattern, GU_AttribOp op);
00054
00055
00056 void clearAttribMaps();
00057
00058 void setT(fpreal x, fpreal y, fpreal z)
00059 { myT.assign(x, y, z); }
00060 void setR(fpreal x, fpreal y, fpreal z)
00061 { myR.assign(x, y, z); }
00062 void setS(fpreal x, fpreal y, fpreal z)
00063 { myS.assign(x, y, z); }
00064 void setP(fpreal x, fpreal y, fpreal z)
00065 { myP.assign(x, y, z); }
00066
00067 void identity()
00068 {
00069 setT(0, 0, 0);
00070 setR(0, 0, 0);
00071 setS(1, 1, 1);
00072 setP(0, 0, 0);
00073 }
00074
00075 const UT_Vector3 &getT() const { return myT; }
00076 const UT_Vector3 &getR() const { return myR; }
00077 const UT_Vector3 &getS() const { return myS; }
00078 const UT_Vector3 &getP() const { return myP; }
00079
00080 void setUVAttribute(const char *name)
00081 { myUVAttrib.harden(name); }
00082
00083 bool doInitFill() const { return myInitFill; }
00084 bool doInitUndistort() const { return myInitUndistort; }
00085
00086 void setInitFill(bool f) { myInitFill = f; }
00087 void setInitUndistort(bool f) { myInitUndistort = f; }
00088
00089 void setSource(const GU_Detail *g) { mySourceGdp = g; }
00090 void setSourceGroup(const GB_PointGroup *g) { mySourceGroup = g; }
00091 void setPath(const GU_Detail *g) { myPathGdp = g; }
00092 void setPathPrim(const GEO_Primitive *p) { myPathPrim = p; }
00093
00094 const GU_Detail *getSource() const { return mySourceGdp; }
00095 const GB_PointGroup *getSourceGroup() const { return mySourceGroup; }
00096
00097 const GU_Detail *getPath() const { return myPathGdp; }
00098 const GEO_Primitive *getPathPrim() const { return myPathPrim; }
00099
00100 private:
00101 const GU_Detail *myPathGdp;
00102 const GEO_Primitive *myPathPrim;
00103 const GU_Detail *mySourceGdp;
00104 const GB_PointGroup *mySourceGroup;
00105
00106 UT_Vector3 myT, myR, myS, myP;
00107 UT_PtrArray<gu_CreepAttribMap *> myPointMap;
00108 UT_PtrArray<gu_CreepAttribMap *> myVertexMap;
00109 UT_PtrArray<gu_CreepAttribMap *> myPrimMap;
00110 UT_String myUVAttrib;
00111 bool myInitFill;
00112 bool myInitUndistort;
00113
00114 friend class GU_Detail;
00115 };
00116
00117 #endif