00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef __OBJ_Rivet__
00026 #define __OBJ_Rivet__
00027
00028 #include "OBJ_API.h"
00029 #include <UT/UT_Vector2.h>
00030 #include <UT/UT_Vector3Array.h>
00031 #include <GU/GU_DetailHandle.h>
00032 #include "OBJ_Null.h"
00033
00034 class UT_FloatArray;
00035
00036
00037 enum OBJ_RivetIndex
00038 {
00039 I_RIVET_GEOPATH = I_N_NULL_INDICES,
00040 I_RIVET_POINTGROUP,
00041 I_RIVET_POINTWEIGHTS,
00042 I_RIVET_USEATTRIBS,
00043 I_RIVET_XATTRIBS,
00044 I_RIVET_ZATTRIBS,
00045
00046 I_N_RIVET_INDICES
00047 };
00048
00049
00050 class OBJ_API OBJ_Rivet : public OBJ_Null
00051 {
00052 public:
00053 OBJ_Rivet(OP_Network *net,
00054 const char *name,
00055 OP_Operator *op);
00056 virtual ~OBJ_Rivet();
00057
00058 virtual OBJ_OBJECT_TYPE getObjectType() const;
00059
00060 static OP_Node *myConstructor(OP_Network *net,
00061 const char *name,
00062 OP_Operator *entry);
00063
00064 static PRM_Template *getTemplateList();
00065 virtual OBJ_Rivet *castToOBJRivet() { return this; }
00066 virtual unsigned disableParms();
00067
00068
00069
00070 void RIVET_GEOPATH( UT_String &str, float t )
00071 {
00072 evalString(str, "rivetsop", 0, t);
00073 }
00074 void RIVET_POINTGROUP(UT_String &str, float t)
00075 {
00076 evalString(str, "rivetgroup", 0, t);
00077 }
00078 bool RIVET_USE_ATTRIBS()
00079 {
00080 return evalInt("rivetuseattribs", 0, 0.0f);
00081 }
00082 void RIVET_X_ATTRIB_NAME(UT_String &str, float t)
00083 {
00084 evalString(str, "rivetxattrib", 0, t);
00085 }
00086 void RIVET_Z_ATTRIB_NAME(UT_String &str, float t)
00087 {
00088 evalString(str, "rivetzattrib", 0, t);
00089 }
00090
00091 void setRIVET_GEOPATH(UT_String &str,
00092 CH_StringMeaning meaning, float t)
00093 {
00094 setString(str, meaning, "rivetsop", 0, t);
00095 }
00096 void setRIVET_POINTGROUP(UT_String &str,
00097 CH_StringMeaning meaning, float t)
00098 {
00099 setString(str, meaning, "rivetgroup", 0,t);
00100 }
00101
00102 protected:
00103
00104 virtual int *getIndirect() const
00105 { return rivetIndirect; }
00106
00107 virtual OP_ERROR cookMyObj(OP_Context &context);
00108
00109 GU_DetailHandle getStuckGdp(float t);
00110
00111 virtual void buildPointGroupMenu( PRM_Name *menu,
00112 int size,
00113 const PRM_SpareData *spare,
00114 PRM_Parm *parm);
00115 float RIVET_POINTWEIGHT( float t, int k )
00116 {
00117 return evalFloat("rivetweights", k, t);
00118 }
00119
00120 private:
00121
00122
00123
00124 void getRivetPoints( OP_Context &context,
00125 SOP_Node *sop,
00126 UT_Vector3Array &points,
00127 UT_Vector3Array &tangents,
00128 UT_Vector3Array &normals );
00129
00130
00131 void getPointWeights( float t,
00132 UT_FloatArray &weights,
00133 int point_count);
00134
00135 private:
00136 static int *rivetIndirect;
00137 };
00138
00139 #endif
00140