00001
00002
00003
00004
00005 #ifndef COM_M4NKIND_EquationList_H
00006 #define COM_M4NKIND_EquationList_H
00007
00008 #include "VirtualEquation.h"
00009 #include "PackFloat.h"
00010 #include "PackStruct.h"
00011 #include "PackULong_Enums.h"
00012 #include "PackULong_Flags.h"
00013 #include "PackDynamicFloat.h"
00014 #include "PackList.h"
00015
00016
00017
00018
00019
00020
00021 class EquationList : public VirtualEquation
00022 {
00023
00024
00025
00026 public:
00027
00028
00029
00030 EquationList(void);
00031
00032
00033
00034
00035 BASEOBJECT_DEFINE_CLASS(EquationList);
00036
00037
00038
00039
00040
00041
00042 virtual void Compute( float _OutgoingParameterTable[4] , const float _IncomingParameterTable[4] );
00043
00044
00045
00046
00047 protected:
00048
00049
00050 PackList mSer_EquationList;
00051
00052
00053
00054
00055
00056
00057
00058
00059 typedef enum {
00060 eEqu_Var_Input=0,
00061 eEqu_Var_Result,
00062 eEqu_Var_A,
00063 eEqu_Var_B,
00064 eEqu_Var_C,
00065 eEqu_Var_D,
00066 eEqu_Var_E,
00067 eEqu_Var_F,
00068 eEqu_Var_G,
00069 eEqu_Var_H,
00070 eEqu_Var_NumberOfVar
00071 };
00072
00073
00074
00075 typedef enum {
00076 eEquOp_Equal=0,
00077 eEquOp_Add,
00078 eEquOp_Sub,
00079 eEquOp_Mul,
00080 eEquOp_Div,
00081 eEquOp_Ceiling,
00082 eEquOp_Floor,
00083 eEquOp_Sin,
00084 eEquOp_Cos,
00085 eEquOp_MulSin,
00086 eEquOp_MulCos,
00087 eEquOp_AddSin,
00088 eEquOp_AddCos,
00089 eEquOp_Sqrt
00090 };
00091
00092
00093
00094 class OperandType : public PackDynamicType
00095 { public:
00096
00097 OperandType();
00098 PackULong_Enums mSer_Variables;
00099 PackDynamicFloat mSer_Vector;
00100 };
00101
00102
00103
00104 class EquationLine : public PackStruct
00105 {
00106 public:
00107
00108 EquationLine(void);
00109
00110 PackULong_Enums mSer_AffectedVarEnum;
00111
00112 PackULong_Enums mSer_AffectedDimension;
00113
00114
00115
00116 PackULong_Enums mSer_OperatorEnum;
00117
00118 PackULong_Enums mSer_OperandDimension;
00119
00120 OperandType mSer_Operand;
00121
00122
00123 };
00124
00125
00126
00127
00128
00129 static BaseType *NewEquationLine();
00130
00131 static void Op_Equal(float *_pAffect,unsigned int _nbAffect,float *_pOperand,unsigned int _nbOp);
00132 static void Op_Add(float *_pAffect,unsigned int _nbAffect,float *_pOperand,unsigned int _nbOp);
00133 static void Op_Sub(float *_pAffect,unsigned int _nbAffect,float *_pOperand,unsigned int _nbOp);
00134 static void Op_Mul(float *_pAffect,unsigned int _nbAffect,float *_pOperand,unsigned int _nbOp);
00135 static void Op_Div(float *_pAffect,unsigned int _nbAffect,float *_pOperand,unsigned int _nbOp);
00136 static void Op_Ceiling(float *_pAffect,unsigned int _nbAffect,float *_pOperand,unsigned int _nbOp);
00137 static void Op_Floor(float *_pAffect,unsigned int _nbAffect,float *_pOperand,unsigned int _nbOp);
00138 static void Op_CosSin(float *_pAffect,unsigned int _nbAffect,float *_pOperand,unsigned int _nbOp);
00139 static void Op_AddCosSin(float *_pAffect,unsigned int _nbAffect,float *_pOperand,unsigned int _nbOp);
00140 static void Op_MulCosSin(float *_pAffect,unsigned int _nbAffect,float *_pOperand,unsigned int _nbOp);
00141 static void Op_Random(float *_pAffect,unsigned int _nbAffect,float *_pOperand,unsigned int _nbOp);
00142 static void Op_Norm(float *_pAffect,unsigned int _nbAffect,float *_pOperand,unsigned int _nbOp);
00143
00144
00145
00146
00147 static void (*m_Op_FunctionTable[])(float *_pAffect,unsigned int _nbAffect,float *_pOperand,unsigned int _nbOp);
00148
00149
00150 };
00151 #endif