00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __OBJ_Muscle__
00021 #define __OBJ_Muscle__
00022
00023 #include <CH/CH_Channel.h>
00024 #include <UT/UT_RefArray.h>
00025 #include <UT/UT_Vector3Array.h>
00026 #include "OBJ_API.h"
00027 #include "OBJ_Geometry.h"
00028
00029 class SOP_Muscle;
00030 class UT_String;
00031 class GEO_PrimPoly;
00032
00033 enum OBJ_MuscleIndex {
00034
00035 I_MUSCLE_NAME = I_N_GEO_INDICES,
00036 I_MUSCLE_RESTANCHOR,
00037 I_MUSCLE_POSITIONBIAS,
00038 I_MUSCLE_SCALE,
00039
00040
00041 I_MUSCLE_HANDLEHEADING,
00042 I_MUSCLE_PRIMSPERSEGMENT,
00043 I_MUSCLE_CONTROL1,
00044 I_MUSCLE_CONTROL1SCALE,
00045 I_MUSCLE_SEPARATOR1,
00046 I_MUSCLE_CONTROL2,
00047 I_MUSCLE_CONTROL2SCALE,
00048 I_MUSCLE_CONTROL2POS,
00049 I_MUSCLE_SEPARATOR2,
00050 I_MUSCLE_CONTROL3,
00051 I_MUSCLE_CONTROL3SCALE,
00052 I_MUSCLE_CONTROL3POS,
00053 I_MUSCLE_SEPARATOR3,
00054 I_MUSCLE_CONTROL4,
00055 I_MUSCLE_CONTROL4SCALE,
00056 I_MUSCLE_CONTROL4POS,
00057 I_MUSCLE_SEPARATOR4,
00058 I_MUSCLE_CONTROL5,
00059 I_MUSCLE_CONTROL5SCALE,
00060
00061 I_MUSCLE_ENDSEPARATOR,
00062
00063
00064 I_MUSCLE_TYPE,
00065 I_MUSCLE_DOCOLOR,
00066 I_MUSCLE_COLOR,
00067 I_MUSCLE_ENABLEGRADIENT,
00068 I_MUSCLE_GRADIENT,
00069
00070
00071 I_MUSCLE_BASIS,
00072 I_MUSCLE_SAMPLEDIVS,
00073 I_MUSCLE_FIRSTCV,
00074 I_MUSCLE_LASTCV,
00075 I_MUSCLE_TENSION,
00076
00077 I_N_MUSCLE_INDICES
00078 };
00079
00080 class OBJ_API OBJ_Muscle : public OBJ_Geometry
00081 {
00082 public:
00083 OBJ_Muscle(OP_Network *net,
00084 const char *name,
00085 OP_Operator *op);
00086 virtual ~OBJ_Muscle();
00087
00088 static OP_Node *myConstructor(OP_Network *net,
00089 const char *name,
00090 OP_Operator *entry);
00091
00092 static PRM_Template *getTemplateList();
00093
00094 virtual unsigned disableParms();
00095 virtual OBJ_OBJECT_TYPE getObjectType() const { return OBJ_STD_MUSCLE; }
00096
00097
00098
00099
00100 virtual void inputConnectChanged(int which);
00101
00102 bool getTranslates(OP_Context &context,
00103 UT_RefArray<UT_Matrix4>
00104 &translates);
00105
00106 bool getRotates(OP_Context &context,
00107 UT_RefArray<UT_Matrix4> &rotates);
00108
00109 const GEO_PrimPoly *getCenterCurve(OP_Context &context);
00110
00111 void getCurrColorValues(UT_Vector3 &color);
00112
00113 protected:
00114
00115 virtual int *getIndirect() const
00116 { return muscleIndirect; }
00117
00118 virtual int isObjectRenderable() const;
00119
00120 virtual OP_ERROR cookMyObj(OP_Context &context);
00121
00122
00123
00124 virtual void checkChannelDependencies(
00125 CH_Channel *ch,
00126 CH_CHANGE_TYPE reason);
00127
00128 private:
00129
00130
00131 SOP_Muscle *getSOPMuscle();
00132
00133 void verifyNames();
00134
00135
00136 bool DOPROFILES()
00137 {
00138 return evalInt("profiletoggle", 0, 0);
00139 }
00140
00141 bool DOCOLOR()
00142 {
00143 return evalInt("togglecolor", 0, 0);
00144 }
00145
00146 bool DOGRADIENT()
00147 {
00148 return evalInt("enablegradient", 0, 0);
00149 }
00150
00151 void MUSCLENAME(UT_String &str)
00152 {
00153 evalString(str, "musclename", 0, 0);
00154 }
00155
00156 bool USEHANDLES()
00157 {
00158 return (evalInt("typeswitcher", 0, 0) == 1);
00159 }
00160
00161 private:
00162 static int *muscleIndirect;
00163
00164 UT_RefArray<UT_String> myInputNames;
00165
00166
00167 int myNumInputs;
00168
00169
00170
00171 int myNumConnectedInputs;
00172
00173 };
00174
00175 #endif