00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #pragma once
00017
00018 #include "object.h"
00019
00020 class MoveModBoxCMode;
00021 class RotateModBoxCMode;
00022 class UScaleModBoxCMode;
00023 class NUScaleModBoxCMode;
00024 class SquashModBoxCMode;
00025
00026
00027
00082 class SimpleMod: public Modifier {
00083 protected:
00085 CoreExport virtual ~SimpleMod();
00086
00087 public:
00088 Control *tmControl;
00089 Control *posControl;
00090 IParamBlock *pblock;
00091
00092 CoreExport static IObjParam *ip;
00093 static MoveModBoxCMode *moveMode;
00094 static RotateModBoxCMode *rotMode;
00095 static UScaleModBoxCMode *uscaleMode;
00096 static NUScaleModBoxCMode *nuscaleMode;
00097 static SquashModBoxCMode *squashMode;
00098 static SimpleMod *editMod;
00099
00100 CoreExport SimpleMod();
00101
00102
00103 ChannelMask ChannelsUsed() { return PART_GEOM|PART_TOPO|SELECT_CHANNEL|SUBSEL_TYPE_CHANNEL; }
00104 ChannelMask ChannelsChanged() { return PART_GEOM; }
00105 CoreExport void ModifyObject(TimeValue t, ModContext &mc, ObjectState *os, INode *node);
00106 Class_ID InputType() {return defObjectClassID;}
00107 CoreExport Interval LocalValidity(TimeValue t);
00108 CoreExport Matrix3 CompMatrix(TimeValue t, ModContext& mc, Matrix3& ntm,
00109 Interval& valid, BOOL needOffset);
00110 CoreExport void CompOffset( TimeValue t, Matrix3& offset, Matrix3& invoffset);
00111
00112
00113 CoreExport int HitTest(TimeValue t, INode* inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt, ModContext* mc);
00114 CoreExport int Display(TimeValue t, INode* inode, ViewExp *vpt, int flagst, ModContext *mc);
00115 CoreExport void GetWorldBoundBox(TimeValue t,INode* inode, ViewExp *vpt, Box3& box, ModContext *mc);
00116
00117 CoreExport void GetSubObjectCenters(SubObjAxisCallback *cb,TimeValue t,INode *node,ModContext *mc);
00118 CoreExport void GetSubObjectTMs(SubObjAxisCallback *cb,TimeValue t,INode *node,ModContext *mc);
00119 BOOL ChangeTopology() {return FALSE;}
00120
00121 CoreExport IParamArray *GetParamBlock();
00122 CoreExport int GetParamBlockIndex(int id);
00123
00124
00125 CoreExport void Move( TimeValue t, Matrix3& partm, Matrix3& tmAxis, Point3& val, BOOL localOrigin=FALSE );
00126 CoreExport void Rotate( TimeValue t, Matrix3& partm, Matrix3& tmAxis, Quat& val, BOOL localOrigin=FALSE );
00127 CoreExport void Scale( TimeValue t, Matrix3& partm, Matrix3& tmAxis, Point3& val, BOOL localOrigin=FALSE );
00128
00129 int NumRefs() {return 3;}
00130 CoreExport RefTargetHandle GetReference(int i);
00131 protected:
00132 CoreExport virtual void SetReference(int i, RefTargetHandle rtarg);
00133 public:
00134
00135 int NumSubs() {return 3;}
00136 CoreExport Animatable* SubAnim(int i);
00137 CoreExport MSTR SubAnimName(int i);
00138 CoreExport int SubNumToRefNum(int subNum);
00139 CoreExport BOOL AssignController(Animatable *control,int subAnim);
00140
00141 CoreExport RefResult NotifyRefChanged( Interval changeInt,RefTargetHandle hTarget,
00142 PartID& partID, RefMessage message);
00143
00144 CreateMouseCallBack* GetCreateMouseCallBack() {return NULL;}
00145 CoreExport void ActivateSubobjSel(int level, XFormModes& modes);
00146
00147
00148
00149
00150 CoreExport void SimpleModClone(SimpleMod *smodSource);
00151
00152
00153
00154 CoreExport void SimpleModClone(SimpleMod *smodSource, RemapDir& remap );
00155
00156
00157
00158 CoreExport void BeginEditParams(IObjParam *ip, ULONG flags,Animatable *prev);
00159 CoreExport void EndEditParams(IObjParam *ip, ULONG flags,Animatable *next);
00160
00161
00182 virtual Deformer& GetDeformer(TimeValue t,ModContext &mc,Matrix3& mat,Matrix3& invmat)=0;
00206 virtual void InvalidateUI() {}
00207 #pragma warning(push)
00208 #pragma warning(disable:4100)
00209
00222 virtual Interval GetValidity(TimeValue t) {return FOREVER;}
00231 virtual ParamDimension *GetParameterDim(int pbIndex) {return defaultDim;}
00239 virtual MSTR GetParameterName(int pbIndex) {return MSTR(_M("Parameter"));}
00257 virtual BOOL GetModLimits(TimeValue t,float &zmin, float &zmax, int &axis) {return FALSE;}
00258
00259 CoreExport int NumSubObjTypes();
00260 CoreExport ISubObjType *GetSubObjType(int i);
00261 };
00262
00263
00264
00265 #define SIMPMOD_PBLOCKREF 2
00266
00267
00268 class IParamBlock2;
00278 class SimpleMod2 : public SimpleMod {
00279 protected:
00280
00281 CoreExport virtual ~SimpleMod2();
00282
00283 public:
00284 IParamBlock2* pblock2;
00285
00286 SimpleMod2() { pblock2 = NULL; }
00287
00288 CoreExport RefTargetHandle GetReference(int i);
00289 protected:
00290 CoreExport virtual void SetReference(int i, RefTargetHandle rtarg);
00291 public:
00292 CoreExport Animatable* SubAnim(int i);
00293 };
00294
00295
00296
00335 class SimpleWSMMod: public Modifier {
00336 public:
00337 WSMObject *obRef;
00338 INode *nodeRef;
00339 IParamBlock *pblock;
00340
00341 CoreExport static IObjParam *ip;
00342 static SimpleWSMMod *editMod;
00343
00344 CoreExport SimpleWSMMod();
00345 CoreExport virtual ~SimpleWSMMod();
00346
00347 ChannelMask ChannelsUsed() { return PART_GEOM|PART_TOPO; }
00348 ChannelMask ChannelsChanged() { return PART_GEOM; }
00349 CoreExport void ModifyObject(TimeValue t, ModContext &mc, ObjectState *os, INode *node);
00350 Class_ID InputType() {return defObjectClassID;}
00351 CoreExport Interval LocalValidity(TimeValue t);
00352 BOOL ChangeTopology() {return FALSE;}
00353 CreateMouseCallBack* GetCreateMouseCallBack() {return NULL;}
00354
00355 int NumRefs() {return 3;}
00356 CoreExport RefTargetHandle GetReference(int i);
00357 protected:
00358 CoreExport virtual void SetReference(int i, RefTargetHandle rtarg);
00359 public:
00360
00361 int NumSubs() {return 1;}
00362 CoreExport Animatable* SubAnim(int i);
00363 CoreExport MSTR SubAnimName(int i);
00364
00365 CoreExport RefResult NotifyRefChanged( Interval changeInt,RefTargetHandle hTarget,
00366 PartID& partID, RefMessage message);
00367
00368 CoreExport IParamArray *GetParamBlock();
00369 CoreExport int GetParamBlockIndex(int id);
00370
00371
00388 CoreExport WSMObject *GetWSMObject(TimeValue t);
00389
00390
00391
00392
00393 CoreExport void SimpleWSMModClone(SimpleWSMMod *smodSource);
00394
00395
00396
00397 CoreExport void SimpleWSMModClone(SimpleWSMMod *smodSource, RemapDir& remap);
00398
00399
00400
00401 CoreExport void BeginEditParams(IObjParam *ip, ULONG flags,Animatable *prev);
00402 CoreExport void EndEditParams(IObjParam *ip, ULONG flags,Animatable *next);
00403
00404
00428 virtual Deformer& GetDeformer(TimeValue t,ModContext &mc,Matrix3& mat,Matrix3& invmat)=0;
00452 virtual void InvalidateUI() {}
00466 virtual Interval GetValidity(TimeValue t) {return FOREVER;}
00475 virtual ParamDimension *GetParameterDim(int pbIndex) {return defaultDim;}
00483 virtual MSTR GetParameterName(int pbIndex) {return MSTR(_M("Parameter"));}
00484 #pragma warning(pop)
00485 virtual void InvalidateParamMap() {}
00486
00487
00488 CoreExport SvGraphNodeReference SvTraverseAnimGraph(IGraphObjectManager *gom, Animatable *owner, int id, DWORD flags);
00489 };
00490
00491
00492 class SimpleWSMMod2 : public SimpleWSMMod {
00493 public:
00494 IParamBlock2* pblock2;
00495
00496 SimpleWSMMod2() { pblock2 = NULL; }
00497
00498
00499 Animatable* SubAnim(int i);
00500
00501
00502 RefTargetHandle GetReference(int i);
00503 protected:
00504 virtual void SetReference(int i, RefTargetHandle rtarg);
00505 public:
00506
00507
00508
00509
00510
00511
00512
00513 void SimpleWSMModClone(SimpleWSMMod2 *smodSource);
00514
00515
00516 void SimpleWSMModClone(SimpleWSMMod2 *smodSource, RemapDir& remap);
00517 };
00518
00519
00520 #define SIMPWSMMOD_OBREF 0
00521 #define SIMPWSMMOD_NODEREF 1
00522 #define SIMPWSMMOD_PBLOCKREF 2
00523
00524 #define SIMPLEOSMTOWSM_CLASSID Class_ID(0x3fa72be3,0xa5ee1bf9)
00525
00526 #pragma warning(push)
00527 #pragma warning(disable:4239)
00528
00529
00568 class SimpleOSMToWSMMod : public SimpleWSMMod {
00569 public:
00570 CoreExport SimpleOSMToWSMMod();
00571 CoreExport SimpleOSMToWSMMod(INode *node);
00572
00573 void GetClassName(MSTR& s) {s=GetObjectName();}
00574 SClass_ID SuperClassID() {return WSM_CLASS_ID;}
00575 Class_ID ClassID() {return SIMPLEOSMTOWSM_CLASSID;}
00576 CoreExport void DeleteThis();
00577
00578 CoreExport RefTargetHandle Clone(RemapDir& remap);
00579 CoreExport MCHAR *GetObjectName();
00580
00581 CoreExport Deformer& GetDeformer(TimeValue t,ModContext &mc,Matrix3& mat,Matrix3& invmat);
00582 CoreExport Interval GetValidity(TimeValue t);
00583 };
00584
00585
00586 #define SIMPLEOSMTOWSM2_CLASSID Class_ID(0x385220f9, 0x7e7f48e9)
00587
00588 class SimpleOSMToWSMMod2 : public SimpleWSMMod2 {
00589 public:
00590 CoreExport SimpleOSMToWSMMod2();
00591 CoreExport SimpleOSMToWSMMod2(INode *node);
00592
00593 void GetClassName(MSTR& s) {s=GetObjectName();}
00594 SClass_ID SuperClassID() {return WSM_CLASS_ID;}
00595 Class_ID ClassID() {return SIMPLEOSMTOWSM2_CLASSID;}
00596 CoreExport void DeleteThis();
00597 CoreExport RefTargetHandle Clone(RemapDir& remap);
00598 CoreExport MCHAR *GetObjectName();
00599
00600 CoreExport Deformer& GetDeformer(TimeValue t,ModContext &mc,Matrix3& mat,Matrix3& invmat);
00601 CoreExport Interval GetValidity(TimeValue t);
00602 };
00603 #pragma warning(pop)
00604 CoreExport ClassDesc* GetSimpleOSMToWSMModDesc();
00605 CoreExport ClassDesc* GetSimpleOSMToWSMMod2Desc();
00606
00607