00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #pragma once
00015
00016 #include "maxheap.h"
00017 #include "ref.h"
00018 #include "ioapi.h"
00019
00020 class Control;
00021 class Point3;
00022 class Color;
00023
00024 class UserType : public ReferenceTarget {
00025 public:
00026 virtual ~UserType() {};
00027 virtual Control* CreateController()=0;
00028 virtual BOOL operator==( const UserType& t )=0;
00029 virtual UserType& operator=( const UserType& t )=0;
00030 };
00031
00032
00033
00034 #include "paramtype.h"
00035
00036
00037 #define PB_COUNT_CHUNK 0x0001
00038 #define PB_PARAM_CHUNK 0x0002
00039 #define PB_INDEX_CHUNK 0x0003
00040 #define PB_ANIMATABLE_CHUNK 0x0004
00041 #define PB_VERSION_CHUNK 0x0005
00042 #define PB_LOCKED_CHUNK 0x0006
00043 #define PB_FLOAT_CHUNK (TYPE_FLOAT + 0x100)
00044 #define PB_INT_CHUNK (TYPE_INT + 0x100)
00045 #define PB_RGBA_CHUNK (TYPE_RGBA + 0x100)
00046 #define PB_POINT3_CHUNK (TYPE_POINT3 + 0x100)
00047 #define PB_BOOL_CHUNK (TYPE_BOOL + 0x100)
00048
00049 #define PB_TYPE_CHUNK 0x0200
00050 #define PB_TYPE_FLOAT_CHUNK (PB_TYPE_CHUNK + TYPE_FLOAT)
00051 #define PB_TYPE_INT_CHUNK (PB_TYPE_CHUNK + TYPE_INT)
00052 #define PB_TYPE_RGBA_CHUNK (PB_TYPE_CHUNK + TYPE_RGBA)
00053 #define PB_TYPE_POINT3_CHUNK (PB_TYPE_CHUNK + TYPE_POINT3)
00054 #define PB_TYPE_BOOL_CHUNK (PB_TYPE_CHUNK + TYPE_BOOL)
00055 #define PB_TYPE_USER_CHUNK (PB_TYPE_CHUNK + TYPE_USER)
00056
00057
00058
00059
00060
00071 class GetParamName: public MaxHeapOperators {
00072 public:
00073 MSTR name;
00074 int index;
00076 GetParamName(MSTR n,int i) { name=n;index=i; }
00077 };
00078
00079
00080
00081
00093 class GetParamDim: public MaxHeapOperators {
00094 public:
00095 ParamDimension *dim;
00096 int index;
00098 GetParamDim(int i) {index=i;dim=NULL;}
00099 };
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00128 class ParamBlockDesc {
00129 public:
00130 ParamType type;
00131 UserType *user;
00132 BOOL animatable;
00133 };
00134
00135
00165 class ParamBlockDescID {
00166 public:
00167 ParamType type;
00168 UserType *user;
00169 BOOL animatable;
00170 DWORD id;
00171 };
00172
00173 class IParamBlock;
00174
00175
00176
00177
00178
00179
00180
00181
00182
00195 #pragma warning(push)
00196 #pragma warning(disable:4100)
00197 class IParamArray : public MaxHeapOperators {
00198 public:
00211 virtual BOOL SetValue( int i, TimeValue t, float v ) {return FALSE;}
00213 virtual BOOL SetValue( int i, TimeValue t, int v ) {return FALSE;}
00215 virtual BOOL SetValue( int i, TimeValue t, Point3& v ) {return FALSE;}
00216
00232 virtual BOOL GetValue( int i, TimeValue t, float &v, Interval &ivalid ) {return FALSE;}
00234 virtual BOOL GetValue( int i, TimeValue t, int &v, Interval &ivalid ) {return FALSE;}
00236 virtual BOOL GetValue( int i, TimeValue t, Point3 &v, Interval &ivalid ) {return FALSE;}
00237
00238
00239
00245 virtual IParamBlock *GetParamBlock() {return NULL;}
00246
00247
00260 virtual BOOL KeyFrameAtTime(int i, TimeValue t) {return FALSE;}
00261 };
00262 #pragma warning(pop)
00263
00270 class IParamBlock :
00271 public ReferenceTarget,
00272 public IParamArray {
00273 public:
00274
00279 virtual SClass_ID GetAnimParamControlType(int anim)=0;
00280
00281
00287 virtual ParamType GetParameterType(int i)=0;
00288
00289
00305 virtual BOOL SetValue( int i, TimeValue t, float v )=0;
00307 virtual BOOL SetValue( int i, TimeValue t, int v )=0;
00309 virtual BOOL SetValue( int i, TimeValue t, Point3& v )=0;
00311 virtual BOOL SetValue( int i, TimeValue t, Color& v )=0;
00312
00313
00366 virtual BOOL GetValue( int i, TimeValue t, float &v, Interval &ivalid )=0;
00368 virtual BOOL GetValue( int i, TimeValue t, int &v, Interval &ivalid )=0;
00370 virtual BOOL GetValue( int i, TimeValue t, Point3 &v, Interval &ivalid )=0;
00372 virtual BOOL GetValue( int i, TimeValue t, Color &v, Interval &ivalid )=0;
00373
00374 virtual Color GetColor(int i, TimeValue t=0)=0;
00375 virtual Point3 GetPoint3(int i, TimeValue t=0)=0;
00376 virtual int GetInt(int i, TimeValue t=0)=0;
00377 virtual float GetFloat(int i, TimeValue t=0)=0;
00378
00381 virtual DWORD GetVersion()=0;
00382 virtual int NumParams()=0;
00383
00389 virtual void RemoveController(int i)=0;
00395 virtual Control* GetController(int i)=0;
00405 virtual void SetController(int i, Control *c, BOOL preserveFrame0Value=TRUE)=0;
00411 virtual void SwapControllers(int j, int k )=0;
00412
00413
00420 virtual int GetRefNum(int paramNum)=0;
00421
00422
00428 virtual int GetAnimNum(int paramNum)=0;
00429
00430
00436 virtual int AnimNumToParamNum(int animNum)=0;
00437
00438
00439 IParamBlock *GetParamBlock() {return this;}
00440
00441
00442
00443
00444
00457 virtual void RescaleParam(int paramNum, float f)=0;
00458
00459
00460
00481 virtual int LastNotifyParamNum()=0;
00482 };
00483
00484
00494 CoreExport IParamBlock *CreateParameterBlock(ParamBlockDesc *pdesc, int count);
00495
00496
00515 CoreExport IParamBlock *CreateParameterBlock(ParamBlockDescID *pdesc, int count, DWORD version);
00516
00517
00518
00519
00538 CoreExport IParamBlock *UpdateParameterBlock(
00539 ParamBlockDescID *pdescOld, int oldCount, IParamBlock *oldPB,
00540 ParamBlockDescID *pdescNew, int newCount, DWORD newVersion);
00541
00542
00543
00544
00545
00546
00557 class ParamVersionDesc: public MaxHeapOperators {
00558 public:
00559 ParamBlockDescID *desc;
00560 int count;
00561 DWORD version;
00570 ParamVersionDesc(ParamBlockDescID *d,int c,int v) {desc=d;count=c;version=v;}
00571 };
00572
00573
00574
00575
00583 class ParamBlockPLCB : public PostLoadCallback {
00584 public:
00585 ParamVersionDesc *versions;
00586 int count;
00587 ParamVersionDesc *cur;
00588 ReferenceTarget *targ;
00589 int pbRefNum;
00590
00607 ParamBlockPLCB(
00608 ParamVersionDesc *v,int cnt,ParamVersionDesc *c,
00609 ReferenceTarget *t,int refNum)
00610 {versions=v;count=cnt;cur=c;targ=t;pbRefNum=refNum;}
00611 CoreExport void proc(ILoad *iload);
00612 int Priority() { return 0; }
00613 CoreExport INT_PTR Execute(int cmd, ULONG_PTR arg1=0, ULONG_PTR arg2=0, ULONG_PTR arg3=0);
00614 };
00615
00616
00617
00618