00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef __POP_LocalVar_h__
00015 #define __POP_LocalVar_h__
00016
00017 #include "POP_API.h"
00018 #include "POP_Node.h"
00019
00020
00021
00022 class POP_API POP_LocalVar : public POP_Node
00023 {
00024 public:
00025
00026 static CH_LocalVariable myVariables[];
00027 static OP_VariablePair myVariablePair;
00028
00029 static OP_TemplatePair myTemplatePair;
00030
00031 const GEO_Point *curPoint();
00032 GU_Detail *curGdp() const;
00033
00034 protected:
00035 POP_LocalVar (OP_Network* net, const char* name,
00036 OP_Operator* entry);
00037 virtual ~POP_LocalVar (void);
00038
00039 virtual float getVariableValue (int index, int thread);
00040
00041 void setupDynamicVars (POP_ContextData* data);
00042 void cleanupDynamicVars ();
00043 void setupVars (POP_ContextData* data,
00044 const GB_PointGroup* source = 0);
00045
00046 virtual int isVarDependent (GU_Detail* gdp, POP_FParam param,
00047 float t, int thread);
00048 virtual int isVarDependent (GU_Detail* gdp, POP_IParam param,
00049 float t, int thread);
00050 virtual int isVarDependent (GU_Detail* gdp, POP_SParam param,
00051 float t, int thread);
00052 virtual int isVarDependent (GU_Detail* gdp, EV_EXPRESSION* expr,
00053 int thread);
00054
00055 void allowVar (int val) { myAllowLocalVar = val; };
00056
00057 virtual const CH_LocalVariable *resolveExtraVariableForSyntaxHighlight(
00058 const char *name);
00059
00060 GEO_Point* myCurrPt;
00061 int myCurrIter;
00062 int myVarTest;
00063
00064 private:
00065
00066 void computeBBox (void);
00067
00068 int myNumPoints;
00069 int myNumGroupPoints;
00070 GU_Detail* myBBGdp;
00071 UT_Vector3 myBBOrigin;
00072 UT_Vector3 myBBScale;
00073 float myTimeInc;
00074
00075 int myAllowLocalVar;
00076 int myVarDependent;
00077
00078 int myAccelOffset;
00079 int myAlphaOffset;
00080 int myAngVelOffset;
00081 int myAttractOffset;
00082 int myBounceOffset;
00083 int myChargeOffset;
00084 int myClingOffset;
00085 int myComOffset;
00086 int myDiffuseOffset;
00087 int myDistanceOffset;
00088 int myDragOffset;
00089 int myFDynamicOffset;
00090 int myFStaticOffset;
00091 int myFollowOffset;
00092 int myGenOffset;
00093 int myHitDiffuseOffset;
00094 int myHitForceOffset;
00095 int myHitIDOffset;
00096 int myHitNormalOffset;
00097 int myHitPosOffset;
00098 int myHitPosUVOffset;
00099 int myHitTimeOffset;
00100 int myHitUVOffset;
00101 int myIDOffset;
00102 int myLifeOffset;
00103 int myMassOffset;
00104 int myNearestOffset;
00105 int myNearestDistOffset;
00106 int myNormalOffset;
00107 int myNumHitOffset;
00108 int myNumProximityOffset;
00109 int myOrbitAxisOffset;
00110 int myOrbitCenterOffset;
00111 int myOrbitOffset;
00112 int myOrbitRadiusOffset;
00113 int myOrbitSpeedOffset;
00114 int myOriginOffset;
00115 int myParentOffset;
00116 int myPosPrimOffset;
00117 int myPosUVOffset;
00118 int myPrevVelOffset;
00119 int myRestOffset;
00120 int myRotOffset;
00121 int myScaleOffset;
00122 int myScale3Offset;
00123 int mySpeedOffset;
00124 int mySpeedLimitOffset;
00125 int mySpringKOffset;
00126 int mySpriteRotOffset;
00127 int mySpriteScaleOffset;
00128 int mySpriteUVOffset;
00129 int myStateOffset;
00130 int myTensionOffset;
00131 int myTextureOffset;
00132 int myTorqueOffset;
00133 int myTransOffset;
00134 int myUpOffset;
00135 int myVelocityOffset;
00136
00137 POP_ContextData* myContextData;
00138
00139 POP_UserVarResolveInfo myUserVarResolveInfo;
00140 };
00141
00142 #endif