00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #pragma once
00012
00013 #include "maxheap.h"
00014 #include "iFnPub.h"
00015 #include "ref.h"
00016 #include "coreexp.h"
00017 #include "InodeTransformModes.h"
00018 #include "GetCOREInterface.h"
00019 #include "quat.h"
00020
00021
00022 class Material;
00023 class ObjectState;
00024 class Object;
00025 class Control;
00026 class ScaleValue;
00027 class Mtl;
00028 class RenderData;
00029 class View;
00030 class IDerivedObject;
00031 namespace MaxSDK
00032 {
00033 namespace AssetManagement
00034 {
00035 class AssetUser;
00036 }
00037 }
00038
00039 #define INODE_INTERFACE Interface_ID(0x67b113ca, 0x34204b2b)
00040
00041
00042
00043 enum nodeVertexColorType
00044 { nvct_color, nvct_illumination, nvct_alpha, nvct_color_plus_illum, nvct_soft_select, nvct_map_channel, nvct_num_types };
00045
00046
00056 #pragma warning(push)
00057 #pragma warning(disable:4100)
00058
00059 class INode: public ReferenceTarget, public FPMixinInterface {
00060 public:
00062 static const ULONG kNullHandle = 0;
00063
00064
00065
00066
00067 using ReferenceTarget::GetInterface;
00068
00069
00073 virtual void DisposeTemporary() {}
00074
00075
00079 virtual INode *GetActualINode() {return this;}
00080
00082 virtual MCHAR* GetName()=0;
00083
00086 virtual void SetName(MCHAR *s)=0;
00087
00088
00110 virtual Matrix3 GetNodeTM(TimeValue t, Interval* valid=NULL)=0;
00121 virtual void SetNodeTM(TimeValue t, Matrix3& tm)=0;
00122
00123
00127 virtual void InvalidateTreeTM()=0;
00130 virtual void InvalidateTM()=0;
00133 virtual void InvalidateWS()=0;
00134
00135
00149 virtual void InvalidateRect( TimeValue t, bool oldRect = false) = 0;
00150
00151
00152
00153
00189 virtual Matrix3 GetObjectTM(TimeValue time, Interval* valid=NULL)=0;
00190
00191
00201 virtual Matrix3 GetObjTMBeforeWSM(TimeValue time, Interval* valid=NULL)=0;
00202
00203
00218 virtual Matrix3 GetObjTMAfterWSM(TimeValue time, Interval* valid=NULL)=0;
00219
00220
00221
00222
00286 virtual const ObjectState& EvalWorldState(TimeValue time,BOOL evalHidden=TRUE)=0;
00287
00288
00292 virtual INode* GetParentNode()=0;
00293
00300 virtual void AttachChild(INode* node, int keepTM=1)=0;
00301
00309 virtual void Detach(TimeValue t, int keepTM=1)=0;
00310
00312 virtual int NumberOfChildren()=0;
00313
00316 virtual INode* GetChildNode(int i)=0;
00317
00318
00323 virtual void Delete(TimeValue t, int keepChildPosition) {}
00324
00325
00327
00328 virtual void Hide(BOOL onOff)=0;
00329
00331
00332 virtual void UnhideObjectAndLayer(bool dolayer = true) {Hide(FALSE);}
00333
00335
00336 virtual int IsObjectHidden() {return 0;}
00337
00339
00357 virtual int IsHidden(DWORD hflags=0,BOOL forRenderer=FALSE) {return 0;}
00358
00360
00363 virtual int IsNodeHidden(BOOL forRenderer=FALSE) {return 0;}
00364
00366
00368 virtual void Freeze(BOOL onOff)=0;
00369
00372 virtual void UnfreezeObjectAndLayer(bool dolayer = true) {Freeze(FALSE);}
00373
00376 virtual int IsObjectFrozen() {return 0;};
00377
00379
00381 virtual int IsFrozen()=0;
00382
00387 virtual void SetShowFrozenWithMtl(BOOL onOff)=0;
00388
00391 virtual int ShowFrozenWithMtl()=0;
00392
00394
00397 virtual void XRayMtl(BOOL onOff)=0;
00398
00400
00403 virtual int HasObjectXRayMtl() {return 0;};
00404
00407 virtual int HasXRayMtl()=0;
00408
00411 virtual void IgnoreExtents(BOOL onOff)=0;
00412
00415 virtual int GetIgnoreExtents()=0;
00416
00419 virtual void BoxMode(BOOL onOff)=0;
00420
00423 virtual int GetBoxMode()=0;
00424
00427 virtual void AllEdges(BOOL onOff)=0;
00428
00431 virtual int GetAllEdges()=0;
00432
00435 virtual void VertTicks(int onOff)=0;
00436
00439 virtual int GetVertTicks()=0;
00440
00445 virtual void BackCull(BOOL onOff)=0;
00446
00449 virtual int GetBackCull()=0;
00450
00453 virtual void SetCastShadows(BOOL onOff)=0;
00454
00458 virtual int CastShadows()=0;
00459
00462 virtual void SetRcvShadows(BOOL onOff)=0;
00463
00466 virtual int RcvShadows()=0;
00467
00468 virtual void SetGenerateCaustics(BOOL onOff) {}
00469 virtual int GenerateCaustics() {return 0;}
00470 virtual void SetRcvCaustics(BOOL onOff) {}
00471 virtual int RcvCaustics() {return 0;}
00472
00473
00476 virtual void SetApplyAtmospherics(BOOL onOff)=0;
00477
00479 virtual int ApplyAtmospherics()=0;
00480
00481 virtual void SetGenerateGlobalIllum(BOOL onOff) {}
00482 virtual int GenerateGlobalIllum() {return 0;}
00483 virtual void SetRcvGlobalIllum(BOOL onOff) {}
00484 virtual int RcvGlobalIllum() {return 0;}
00485
00491 virtual void SetMotBlur(int kind)=0;
00492
00498 virtual int MotBlur()=0;
00501 virtual float GetImageBlurMultiplier(TimeValue t) { return 1.0f;}
00502
00507 virtual void SetImageBlurMultiplier(TimeValue t, float m){};
00508
00511 virtual void SetImageBlurMultController(Control *cont){}
00512
00514 virtual Control *GetImageBlurMultController() {return NULL; }
00515
00516
00522 virtual BOOL GetMotBlurOnOff(TimeValue t) { return 1; }
00523
00529 virtual void SetMotBlurOnOff(TimeValue t, BOOL m) { }
00530
00534 virtual Control *GetMotBlurOnOffController() { return NULL;}
00535
00540 virtual void SetMotBlurOnOffController(Control *cont) { }
00541
00545 virtual void SetRenderable(BOOL onOff)=0;
00546
00548 virtual int Renderable()=0;
00549
00553 virtual void SetPrimaryVisibility(BOOL onOff) = 0;
00554
00557 virtual int GetPrimaryVisibility() = 0;
00558
00562 virtual void SetSecondaryVisibility(BOOL onOff) = 0;
00563
00567 virtual int GetSecondaryVisibility() = 0;
00568
00575 virtual void SetCVertMode(int onOff) {}
00576
00578 virtual int GetCVertMode() {return 0;}
00579
00586 virtual void SetShadeCVerts(int onOff) {}
00587
00589 virtual int GetShadeCVerts() {return 0;}
00590
00593 virtual int GetVertexColorType () { return 0; }
00594
00597 virtual void SetVertexColorType (int nvct) { }
00598
00600 virtual int GetVertexColorMapChannel () { return 1; }
00602 virtual void SetVertexColorMapChannel (int vcmc) { }
00603
00605 virtual int GetTrajectoryON() {return 0;}
00606
00609 virtual void SetTrajectoryON(BOOL onOff) {}
00610
00611
00621 virtual void ShowBone(int boneVis)=0;
00622
00625 virtual void BoneAsLine(int onOff)=0;
00626
00628 virtual BOOL IsBoneShowing()=0;
00629
00632 virtual BOOL IsBoneOnly() { return 0; }
00633
00634
00652 virtual void SetTargetNodePair(int onOff) {}
00653
00658 virtual int GetTargetNodePair() { return 0; }
00659
00660
00663 virtual DWORD GetWireColor()=0;
00664
00671 virtual void SetWireColor(DWORD newcol)=0;
00672
00673
00677 virtual int IsRootNode()=0;
00678
00681 virtual int Selected()=0;
00682
00690 virtual int Dependent()=0;
00691
00694 virtual int IsTarget()=0;
00695
00700 virtual void SetIsTarget(BOOL b)=0;
00701
00702
00709 virtual BOOL GetTransformLock(int type, int axis)=0;
00710
00717 virtual void SetTransformLock(int type, int axis, BOOL onOff)=0;
00718
00719
00722 virtual INode* GetTarget()=0;
00723
00727 virtual INode* GetLookatNode()=0;
00728
00729
00735 virtual Matrix3 GetParentTM(TimeValue t)=0;
00736
00737
00745 virtual int GetTargetTM(TimeValue t, Matrix3& m)=0;
00746
00756 virtual Object* GetObjectRef()=0;
00757
00762 virtual void SetObjectRef(Object *o)=0;
00763
00768 virtual Object* GetObjOrWSMRef()=0;
00769
00786 virtual Control* GetTMController()=0;
00787
00793 virtual BOOL SetTMController(Control *m3cont)=0;
00794
00795
00797 virtual Control *GetVisController()=0;
00798
00801 virtual void SetVisController(Control *cont)=0;
00802
00810 virtual float GetVisibility(TimeValue t,Interval *valid=NULL)=0;
00811
00821 virtual float GetVisibility(TimeValue t,View &view,Interval *valid=NULL) {return GetVisibility(t,valid);}
00822
00827 virtual void SetVisibility(TimeValue t,float vis)=0;
00828
00838 virtual float GetLocalVisibility(TimeValue t,Interval *valid=NULL)=0;
00839
00842 virtual BOOL GetInheritVisibility()=0;
00843
00848 virtual void SetInheritVisibility(BOOL onOff)=0;
00849
00850
00853 virtual void SetRenderOccluded(BOOL onOff)=0;
00854
00856 virtual BOOL GetRenderOccluded()=0;
00857
00858
00863 virtual Mtl *GetMtl()=0;
00864
00871 virtual void SetMtl(Mtl* matl)=0;
00872
00873
00876 virtual Material* Mtls()=0;
00877
00880 virtual int NumMtls()=0;
00881
00882
00888 virtual void SetObjOffsetPos(Point3 p)=0;
00889
00894 virtual Point3 GetObjOffsetPos()=0;
00895
00901 virtual void SetObjOffsetRot(Quat q)=0;
00902
00907 virtual Quat GetObjOffsetRot()=0;
00908
00914 virtual void SetObjOffsetScale(ScaleValue sv)=0;
00915
00920 virtual ScaleValue GetObjOffsetScale()=0;
00921
00922
00923
00929 virtual void CenterPivot(TimeValue t, BOOL moveObject)=0;
00930
00936 virtual void AlignPivot(TimeValue t, BOOL moveObject)=0;
00937
00943 virtual void WorldAlignPivot(TimeValue t, BOOL moveObject)=0;
00944
00947 virtual void AlignToParent(TimeValue t)=0;
00948
00951 virtual void AlignToWorld(TimeValue t)=0;
00952
00957 virtual void ResetTransform(TimeValue t,BOOL scaleOnly)=0;
00958
00962 virtual void ResetPivot(TimeValue t)=0;
00963
00967 virtual bool MayResetTransform ()=0;
00968
00969
00977 virtual void FlagForeground(TimeValue t,BOOL notify=TRUE)=0;
00978
00981 virtual int IsActiveGrid()=0;
00982
00983
00987 virtual void SetNodeLong(LONG_PTR l)=0;
00988
00990 virtual LONG_PTR GetNodeLong()=0;
00991
00992
00994 virtual RenderData *GetRenderData()=0;
00995
01000 virtual void SetRenderData(RenderData *rd)=0;
01001
01002
01003
01004
01005
01008 virtual void GetUserPropBuffer(MSTR &buf)=0;
01009
01012 virtual void SetUserPropBuffer(const MSTR &buf)=0;
01013
01014
01019 virtual BOOL GetUserPropString(const MSTR &key,MSTR &string)=0;
01020
01025 virtual BOOL GetUserPropInt(const MSTR &key,int &val)=0;
01026
01031 virtual BOOL GetUserPropFloat(const MSTR &key,float &val)=0;
01032
01037 virtual BOOL GetUserPropBool(const MSTR &key,BOOL &b)=0;
01038
01039
01044 virtual void SetUserPropString(const MSTR &key,const MSTR &string)=0;
01045
01050 virtual void SetUserPropInt(const MSTR &key,int val)=0;
01051
01056 virtual void SetUserPropFloat(const MSTR &key,float val)=0;
01057
01062 virtual void SetUserPropBool(const MSTR &key,BOOL b)=0;
01063
01064
01068 virtual BOOL UserPropExists(const MSTR &key)=0;
01069
01070
01075 virtual ULONG GetGBufID()=0;
01076
01082 virtual void SetGBufID(ULONG id)=0;
01083
01084
01087 virtual UWORD GetRenderID() { return 0xffff; }
01088
01092 virtual void SetRenderID(UWORD id) {}
01093
01094
01100 virtual ULONG GetHandle() { return kNullHandle; }
01101
01102
01103
01104
01127 virtual void Move(TimeValue t, const Matrix3& tmAxis, const Point3& val, BOOL localOrigin=FALSE, BOOL affectKids=TRUE, int pivMode=PIV_NONE, BOOL ignoreLocks=FALSE)=0;
01128
01150 virtual void Rotate(TimeValue t, const Matrix3& tmAxis, const AngAxis& val, BOOL localOrigin=FALSE, BOOL affectKids=TRUE, int pivMode=PIV_NONE, BOOL ignoreLocks=FALSE)=0;
01151
01173 virtual void Rotate(TimeValue t, const Matrix3& tmAxis, const Quat& val, BOOL localOrigin=FALSE, BOOL affectKids=TRUE, int pivMode=PIV_NONE, BOOL ignoreLocks=FALSE)=0;
01174
01196 virtual void Scale(TimeValue t, const Matrix3& tmAxis, const Point3& val, BOOL localOrigin=FALSE, BOOL affectKids=TRUE, int pivMode=PIV_NONE, BOOL ignoreLocks=FALSE)=0;
01197
01199 virtual BOOL IsGroupMember()=0;
01200
01202 virtual BOOL IsGroupHead()=0;
01203
01207 virtual BOOL IsOpenGroupMember() {return 0; }
01208
01212 virtual BOOL IsOpenGroupHead() {return 0; }
01213
01216 virtual void SetGroupMember(BOOL b) {}
01217
01220 virtual void SetGroupHead(BOOL b) {}
01221
01224 virtual void SetGroupMemberOpen(BOOL b) {}
01225
01229 virtual void SetGroupHeadOpen(BOOL b) {}
01230
01231
01233 virtual float GetPosTaskWeight() {return 1.0f;}
01234
01236 virtual float GetRotTaskWeight() {return 1.0f;}
01237
01240 virtual void SetPosTaskWeight(float w) {}
01241
01244 virtual void SetRotTaskWeight(float w) {}
01245
01254 virtual BOOL GetTaskAxisState(int which,int axis) {return TRUE;}
01255
01265 virtual void SetTaskAxisState(int which,int axis,BOOL onOff) {}
01266
01270 virtual DWORD GetTaskAxisStateBits() {return 127;}
01271
01272
01273
01274
01275
01280 virtual void CreateWSMDerivedObject() {}
01281
01286 virtual IDerivedObject *GetWSMDerivedObject() {return NULL;}
01287
01288
01289
01290
01291
01295 CoreExport virtual MaxSDK::AssetManagement::AssetUser GetXRefFile(int i);
01296
01303 virtual void SetXRefFile(int i,const MaxSDK::AssetManagement::AssetUser& file,BOOL reload) {}
01304
01308 virtual int GetXRefFileCount() {return 0;}
01309
01319 virtual BOOL AddNewXRefFile(const MaxSDK::AssetManagement::AssetUser &file, BOOL loadNow=TRUE, BOOL hideInManagerUI=FALSE) {return FALSE;}
01320
01326 virtual BOOL DeleteXRefFile(int i) {return FALSE;}
01333 virtual BOOL BindXRefFile(int i) {return FALSE;}
01334
01339 virtual void DeleteAllXRefs() {}
01340
01346 virtual BOOL ReloadXRef(int i) {return FALSE;}
01347
01352 virtual void FlagXrefChanged(int i) {}
01353
01359 virtual BOOL UpdateChangedXRefs(BOOL redraw=TRUE) {return FALSE;}
01360
01371 virtual INode *GetXRefTree(int i) {return NULL;}
01372
01379 virtual INode *GetXRefParent(int i) {return NULL;}
01380
01387 virtual void SetXRefParent(int i, INode *par, BOOL autoOffset = TRUE) {}
01388
01394 virtual BOOL FindUnresolvedXRefs(Tab<MSTR*> &fnames) {return FALSE;}
01395
01399 virtual void AttemptToResolveUnresolvedXRefs() {}
01400
01406 virtual DWORD GetXRefFlags(int i) {return 0;}
01407
01414 virtual void SetXRefFlags(int i,DWORD flag,BOOL onOff) {}
01415
01416
01422 virtual void SetBoneNodeOnOff(BOOL onOff, TimeValue t) {}
01423
01428 virtual void SetBoneAutoAlign(BOOL onOff) {}
01429
01434 virtual void SetBoneFreezeLen(BOOL onOff) {}
01435
01443 virtual void SetBoneScaleType(int which) {}
01444
01452 virtual void SetBoneAxis(int which) {}
01453
01458 virtual void SetBoneAxisFlip(BOOL onOff) {}
01459
01463 virtual BOOL GetBoneNodeOnOff() {return FALSE;}
01464
01465 virtual BOOL GetBoneNodeOnOff_T (TimeValue t) { return GetBoneNodeOnOff(); }
01466
01470 virtual BOOL GetBoneAutoAlign() {return FALSE;}
01471
01475 virtual BOOL GetBoneFreezeLen() {return FALSE;}
01476
01484 virtual int GetBoneScaleType() {return 0;}
01485
01493 virtual int GetBoneAxis() {return 0;}
01494
01498 virtual BOOL GetBoneAxisFlip() {return FALSE;}
01499
01504 virtual void RealignBoneToChild(TimeValue t) {}
01505
01512 virtual void ResetBoneStretch(TimeValue t) {}
01513
01527 virtual Matrix3 GetStretchTM(TimeValue t, Interval *valid=NULL) {return Matrix3(1);}
01528
01529
01530 BaseInterface* GetInterface(Interface_ID id) { return (id == INODE_INTERFACE) ? this : FPMixinInterface::GetInterface(id); }
01531 FPInterfaceDesc* GetDesc() { return (FPInterfaceDesc*)GetCOREInterface(INODE_INTERFACE); }
01532
01533
01534 enum { getPosTaskWeight, getRotTaskWeight, setPosTaskWeight, setRotTaskWeight,
01535
01536 setBoneNodeOnOff, setBoneNodeOnOffM, setBoneAutoAlign, setBoneFreezeLen, setBoneScaleType, getBoneNodeOnOff,
01537 getBoneAutoAlign, getBoneFreezeLen, getBoneScaleType, realignBoneToChild, resetBoneStretch, getStretchTM,
01538 getBoneAxis, getBoneAxisFlip, setBoneAxis, setBoneAxisFlip,
01539
01540 setPrimaryVisibility, getPrimaryVisibility, setSecondaryVisibility, getSecondaryVisibility, setApplyAtmospherics, getApplyAtmospherics,
01541
01542 getVertexColorType, setVertexColorType, getCVertMode, setCVertMode, getShadeCVerts, setShadeCVerts,
01543 getNodeHandle,
01544
01545 getVertexColorMapChannel, setVertexColorMapChannel,
01546
01547
01548
01549 kLastFPFuncID
01550 };
01551
01552 enum { boneScaleTypeEnum, boneAxisEnum,
01553 vertexColorTypeEnum,
01554 };
01555
01556 #pragma warning(push)
01557 #pragma warning(disable:4238)
01558
01559 BEGIN_FUNCTION_MAP
01560 PROP_FNS(getPosTaskWeight, GetPosTaskWeight, setPosTaskWeight, SetPosTaskWeight, TYPE_FLOAT);
01561 PROP_FNS(getRotTaskWeight, GetRotTaskWeight, setRotTaskWeight, SetRotTaskWeight, TYPE_FLOAT);
01562
01563 PROP_FNS(getBoneAutoAlign, GetBoneAutoAlign, setBoneAutoAlign, SetBoneAutoAlign, TYPE_BOOL);
01564 PROP_FNS(getBoneFreezeLen, GetBoneFreezeLen, setBoneFreezeLen, SetBoneFreezeLen, TYPE_BOOL);
01565 PROP_FNS(getBoneScaleType, GetBoneScaleType, setBoneScaleType, SetBoneScaleType, TYPE_ENUM);
01566 PROP_FNS(getBoneAxis, GetBoneAxis, setBoneAxis, SetBoneAxis, TYPE_ENUM);
01567 PROP_FNS(getBoneAxisFlip, GetBoneAxisFlip, setBoneAxisFlip, SetBoneAxisFlip, TYPE_BOOL);
01568 RO_PROP_TFN(getStretchTM, GetStretchTM, TYPE_MATRIX3_BV);
01569 PROP_TFNS(getBoneNodeOnOff, GetBoneNodeOnOff_T, setBoneNodeOnOff, SetBoneNodeOnOff, TYPE_BOOL);
01570 VFNT_1(setBoneNodeOnOffM, SetBoneNodeOnOff, TYPE_BOOL);
01571 VFNT_0(realignBoneToChild, RealignBoneToChild);
01572 VFNT_0(resetBoneStretch, ResetBoneStretch);
01573
01574 PROP_FNS(getPrimaryVisibility, GetPrimaryVisibility, setPrimaryVisibility, SetPrimaryVisibility, TYPE_BOOL);
01575 PROP_FNS(getSecondaryVisibility, GetSecondaryVisibility, setSecondaryVisibility, SetSecondaryVisibility, TYPE_BOOL);
01576 PROP_FNS(getApplyAtmospherics, ApplyAtmospherics, setApplyAtmospherics, SetApplyAtmospherics, TYPE_BOOL);
01577 PROP_FNS(getCVertMode, GetCVertMode, setCVertMode, SetCVertMode, TYPE_INT);
01578 PROP_FNS(getShadeCVerts, GetShadeCVerts, setShadeCVerts, SetShadeCVerts, TYPE_INT);
01579 PROP_FNS(getVertexColorType, GetVertexColorType, setVertexColorType, SetVertexColorType, TYPE_ENUM);
01580
01581 PROP_FNS(getVertexColorMapChannel, GetVertexColorMapChannel, setVertexColorMapChannel, SetVertexColorMapChannel, TYPE_INT);
01582 RO_PROP_FN(getNodeHandle, GetHandle, TYPE_DWORD);
01583 END_FUNCTION_MAP
01584 #pragma warning(pop)
01585
01592 CoreExport void CopyProperties(INode *from);
01593 };
01594
01599 #define XREF_UPDATE_AUTO (1<<0) //!< Automatic XRef file updating is ON.
01600 #define XREF_BOX_DISP (1<<1) //!< The Box display option is set.
01601 #define XREF_HIDDEN (1<<2) //!< The XRef is hidden.
01602 #define XREF_DISABLED (1<<3) //!< The XRef is disabled.
01603 #define XREF_IGNORE_LIGHTS (1<<4) //!< The XRef ignores lights in the file.
01604 #define XREF_IGNORE_CAMERAS (1<<5) //!< The XRef ignores cameras in the file.
01605 #define XREF_IGNORE_SHAPES (1<<6) //!< The XRef ignores shapes in the file.
01606 #define XREF_IGNORE_HELPERS (1<<7) //!< The XRef ignores helpers in the file.
01607 #define XREF_IGNORE_ANIM (1<<8) //!< The XRef ignores the animation in the file.
01608
01609 #define XREF_FILE_CHANGE (1<<10) //!< Is set when a change notification is sent indicating that the file may have changed.
01610 #define XREF_LOAD_ERROR (1<<11) //!< Is set when an XRef can not be resolved.
01611
01612 #define XREF_SCENE_OVERLAY (1<<12) //!< Is set when a scene XRef is set to overlay.
01613 #define XREF_SCENE_HIDEINMANAGERUI (1<<13) //!< Is set when a scene XRef is not displayed in scene XREF manager UI. Is set at creation.
01614
01615
01616
01617 #define BONE_SCALETYPE_SCALE 1
01618 #define BONE_SCALETYPE_SQUASH 2
01619 #define BONE_SCALETYPE_NONE 0
01620
01621
01622 #define BONE_AXIS_X 0
01623 #define BONE_AXIS_Y 1
01624 #define BONE_AXIS_Z 2
01625
01626
01630 #define INODE_LOCKPOS 0 //!< Position locked
01631 #define INODE_LOCKROT 1 //!< Rotate locked
01632 #define INODE_LOCKSCL 2 //!< Scale locked.
01633
01634
01638 #define INODE_LOCK_X 0 //!< The X-axis is locked.
01639 #define INODE_LOCK_Y 1 //!< The Y-axis is locked.
01640 #define INODE_LOCK_Z 2 //!< The Z-axis is locked.
01641
01642
01643
01648 class ITreeEnumProc: public MaxHeapOperators {
01649 public:
01650 virtual ~ITreeEnumProc() { }
01664 virtual int callback( INode *node )=0;
01665 };
01666
01667
01668 #define TREE_CONTINUE 0 // Continue enumerating
01669 #define TREE_IGNORECHILDREN 1 // Don't enumerate children, but continue
01670 #define TREE_ABORT 2 // Stop enumerating
01671
01672
01673 #define PROPID_PINNODE PROPID_USER+1 // Returns a pointer to the node this node is pinned to
01674 #define PROPID_PRECEDENCE PROPID_USER+2 // Returns an integer representing this node's precedence
01675 #define PROPID_RELPOS PROPID_USER+3 // Returns a pointer to the relative vector between the node and its pin
01676 #define PROPID_RELROT PROPID_USER+4 // Returns a pointer to the relative quaternion between the node and its pin
01677
01678
01679
01680 class INodeTransformed;
01681
01682
01683
01688 CoreExport void DeleteINodeTransformed(INodeTransformed* n);
01698 CoreExport INodeTransformed* CreateINodeTransformed(INode* n, Matrix3 tm, BOOL dm = TRUE);
01699
01700
01701
01702
01703
01704
01705
01725 class INodeTransformed : public INode {
01726 public:
01727 INode *node;
01728 Matrix3 tm;
01729 BOOL deleteMe;
01730
01731 INodeTransformed(INode *n,Matrix3 tm,BOOL dm=TRUE) {node = n;this->tm = tm;deleteMe = dm;}
01732
01734 void DisposeTemporary() {node->DisposeTemporary(); if (deleteMe) DeleteINodeTransformed(this);}
01741 INode *GetActualINode() {return node->GetActualINode();}
01742
01743 MCHAR* GetName() {return node->GetName();}
01744 void SetName(MCHAR *s) {node->SetName(s);}
01745 Matrix3 GetNodeTM(TimeValue t, Interval* valid=NULL) {return node->GetNodeTM(t,valid);}
01746 void SetNodeTM(TimeValue t, Matrix3& tm) {node->SetNodeTM(t,tm);}
01747 void InvalidateTreeTM() {node->InvalidateTreeTM();}
01748 void InvalidateTM() {node->InvalidateTM();}
01749 void InvalidateWS() {node->InvalidateWS();}
01750 void InvalidateRect( TimeValue t, bool oldRect) { node->InvalidateRect(t,oldRect); }
01751 Matrix3 GetObjectTM(TimeValue time, Interval* valid=NULL) {return tm*node->GetObjectTM(time,valid);}
01752 Matrix3 GetObjTMBeforeWSM(TimeValue time, Interval* valid=NULL) {return tm*node->GetObjTMBeforeWSM(time,valid);}
01753 Matrix3 GetObjTMAfterWSM(TimeValue time, Interval* valid=NULL) {return tm*node->GetObjTMAfterWSM(time,valid);}
01754 const ObjectState& EvalWorldState(TimeValue time,BOOL evalHidden=TRUE) {return node->EvalWorldState(time,evalHidden);}
01755 INode* GetParentNode() {return node->GetParentNode();}
01756 void AttachChild(INode* node, int keepTM=1) {node->AttachChild(node,keepTM);}
01757 void Detach(TimeValue t, int keepTM=1) {node->Detach(t,keepTM);}
01758 int NumberOfChildren() {return node->NumberOfChildren();}
01759 INode* GetChildNode(int i) {return node->GetChildNode(i);}
01760 void Delete(TimeValue t, int keepChildPosition) { node->Delete(t,keepChildPosition); }
01761 void Hide(BOOL onOff) {node->Hide(onOff);}
01762 int IsHidden(DWORD hflags=0,BOOL forRenderer=FALSE) {return node->IsHidden(hflags,forRenderer);}
01763 int IsNodeHidden(BOOL forRenderer=FALSE) { return node->IsNodeHidden(forRenderer); }
01764 void Freeze(BOOL onOff) {node->Freeze(onOff);}
01765 int IsFrozen() {return node->IsFrozen();}
01766 void SetShowFrozenWithMtl(BOOL onOff) {node->SetShowFrozenWithMtl(onOff);}
01767 int ShowFrozenWithMtl() {return node->ShowFrozenWithMtl();}
01768 void XRayMtl(BOOL onOff) {node->XRayMtl(onOff);}
01769 int HasXRayMtl() {return node->HasXRayMtl();}
01770 void IgnoreExtents(BOOL onOff) {node->IgnoreExtents(onOff);}
01771 int GetIgnoreExtents() {return node->GetIgnoreExtents();}
01772 void BoxMode(BOOL onOff) {node->BoxMode(onOff);}
01773 int GetBoxMode() {return node->GetBoxMode();}
01774 void AllEdges(BOOL onOff) {node->AllEdges(onOff);}
01775 int GetAllEdges() {return node->GetAllEdges();}
01776 void VertTicks(int onOff) {node->VertTicks(onOff);}
01777 int GetVertTicks() {return node->GetVertTicks();}
01778 void BackCull(BOOL onOff) {node->BackCull(onOff);}
01779 int GetBackCull() {return node->GetBackCull();}
01780 void SetCastShadows(BOOL onOff) { node->SetCastShadows(onOff); }
01781 int CastShadows() { return node->CastShadows(); }
01782 void SetRcvShadows(BOOL onOff) { node->SetRcvShadows(onOff); }
01783 int RcvShadows() { return node->RcvShadows(); }
01784 void SetGenerateCaustics(BOOL onOff) { node->SetGenerateCaustics(onOff); }
01785 int GenerateCaustics() { return node->GenerateCaustics(); }
01786 void SetRcvCaustics(BOOL onOff) { node->SetRcvCaustics(onOff); }
01787 int RcvCaustics() { return node->RcvCaustics(); }
01788 void SetApplyAtmospherics(BOOL onOff) { node->SetApplyAtmospherics(onOff); }
01789 int ApplyAtmospherics() { return node->ApplyAtmospherics(); }
01790 void SetGenerateGlobalIllum(BOOL onOff) { node->SetGenerateGlobalIllum(onOff); }
01791 int GenerateGlobalIllum() { return node->GenerateGlobalIllum(); }
01792 void SetRcvGlobalIllum(BOOL onOff) { node->SetRcvGlobalIllum(onOff); }
01793 int RcvGlobalIllum() { return node->RcvGlobalIllum(); }
01794
01795 void SetMotBlur(BOOL onOff) { node->SetMotBlur(onOff); }
01796 int MotBlur() { return node->MotBlur(); }
01797
01798 float GetImageBlurMultiplier(TimeValue t) { return node->GetImageBlurMultiplier(t);}
01799 void SetImageBlurMultiplier(TimeValue t, float m) {node->SetImageBlurMultiplier(t,m); };
01800 void SetImageBlurMultController(Control *cont){ node->SetImageBlurMultController(cont); }
01801 Control *GetImageBlurMultController() {return node->GetImageBlurMultController(); }
01802
01803
01804 BOOL GetMotBlurOnOff(TimeValue t) { return node->GetMotBlurOnOff(t); }
01805 void SetMotBlurOnOff(TimeValue t, BOOL m) { node->SetMotBlurOnOff(t,m); }
01806 Control *GetMotBlurOnOffController() { return node->GetMotBlurOnOffController();}
01807 void SetMotBlurOnOffController(Control *cont) { node->SetMotBlurOnOffController(cont);}
01808
01809 void SetRenderable(BOOL onOff) { node->SetRenderable(onOff); }
01810 int Renderable() { return node->Renderable(); }
01811
01812 void SetPrimaryVisibility(BOOL onOff) { node->SetPrimaryVisibility(onOff); }
01813 int GetPrimaryVisibility() { return node->GetPrimaryVisibility(); }
01814 void SetSecondaryVisibility(BOOL onOff) { node->SetSecondaryVisibility(onOff); }
01815 int GetSecondaryVisibility() { return node->GetSecondaryVisibility(); }
01816
01817 void ShowBone(int boneVis) {node->ShowBone(boneVis);}
01818 void BoneAsLine(int onOff) {node->BoneAsLine(onOff);}
01819 BOOL IsBoneShowing() {return node->IsBoneShowing();}
01820 BOOL IsBoneOnly() { return node->IsBoneOnly(); }
01821 DWORD GetWireColor() {return node->GetWireColor();}
01822 void SetWireColor(DWORD newcol) {node->SetWireColor(newcol);}
01823 int IsRootNode() {return node->IsRootNode();}
01824 int Selected() {return node->Selected();}
01825 int Dependent() {return node->Dependent();}
01826 int IsTarget() {return node->IsTarget();}
01827 void SetIsTarget(BOOL b) { node->SetIsTarget(b);}
01828 BOOL GetTransformLock(int type, int axis) {return node->GetTransformLock(type,axis);}
01829 void SetTransformLock(int type, int axis, BOOL onOff) {node->SetTransformLock(type,axis,onOff);}
01830 INode* GetTarget() {return node->GetTarget();}
01831 INode* GetLookatNode() {return node->GetLookatNode();}
01832 Matrix3 GetParentTM(TimeValue t) {return node->GetParentTM(t);}
01833 int GetTargetTM(TimeValue t, Matrix3& m) {return node->GetTargetTM(t,m);}
01834 Object* GetObjectRef() {return node->GetObjectRef();}
01835 void SetObjectRef(Object *o) {node->SetObjectRef(o);}
01836 Object* GetObjOrWSMRef() { return node->GetObjOrWSMRef();}
01837 Control* GetTMController() {return node->GetTMController();}
01838 BOOL SetTMController(Control *m3cont) { return node->SetTMController(m3cont);}
01839 Control *GetVisController() {return node->GetVisController();}
01840 void SetVisController(Control *cont) {node->SetVisController(cont);}
01841 float GetVisibility(TimeValue t,Interval *valid=NULL) {return node->GetVisibility(t,valid);}
01842 void SetVisibility(TimeValue t,float vis) { node->SetVisibility(t,vis); }
01843 float GetLocalVisibility(TimeValue t,Interval *valid) { return node->GetLocalVisibility(t,valid); }
01844 BOOL GetInheritVisibility() { return node->GetInheritVisibility(); }
01845 void SetInheritVisibility(BOOL onOff) { node->SetInheritVisibility(onOff); }
01846
01847 virtual void SetRenderOccluded(BOOL onOff) { node->SetRenderOccluded(onOff); }
01848 virtual BOOL GetRenderOccluded(){ return node->GetRenderOccluded(); }
01849
01850 Mtl *GetMtl() { return node->GetMtl(); }
01851 void SetMtl(Mtl* matl) { node->SetMtl(matl); }
01852
01853 Material* Mtls() { return node->Mtls(); }
01854 int NumMtls() { return node->NumMtls(); }
01855
01856 RenderData *GetRenderData() {return node->GetRenderData();}
01857 void SetRenderData(RenderData *rd) {node->SetRenderData(rd);}
01858
01859 void SetObjOffsetPos(Point3 p) {node->SetObjOffsetPos(p);}
01860 Point3 GetObjOffsetPos() {return node->GetObjOffsetPos();}
01861 void SetObjOffsetRot(Quat q) {node->SetObjOffsetRot(q);}
01862 Quat GetObjOffsetRot() {return node->GetObjOffsetRot();}
01863 void FlagForeground(TimeValue t,BOOL notify=TRUE) {node->FlagForeground(t,notify);}
01864 int IsActiveGrid() {return node->IsActiveGrid();}
01865 void SetNodeLong(LONG_PTR l) {node->SetNodeLong(l);}
01866 LONG_PTR GetNodeLong() {return node->GetNodeLong();}
01867
01868 void GetUserPropBuffer(MSTR &buf) {node->GetUserPropBuffer(buf);}
01869 void SetUserPropBuffer(const MSTR &buf) {node->SetUserPropBuffer(buf);}
01870 BOOL GetUserPropString(const MSTR &key,MSTR &string) {return node->GetUserPropString(key,string);}
01871 BOOL GetUserPropInt(const MSTR &key,int &val) {return node->GetUserPropInt(key,val);}
01872 BOOL GetUserPropFloat(const MSTR &key,float &val) {return node->GetUserPropFloat(key,val);}
01873 BOOL GetUserPropBool(const MSTR &key,BOOL &b) {return node->GetUserPropBool(key,b);}
01874 void SetUserPropString(const MSTR &key,const MSTR &string) {node->SetUserPropString(key,string);}
01875 void SetUserPropInt(const MSTR &key,int val) {node->SetUserPropInt(key,val);}
01876 void SetUserPropFloat(const MSTR &key,float val) {node->SetUserPropFloat(key,val);}
01877 void SetUserPropBool(const MSTR &key,BOOL b) {node->SetUserPropBool(key,b);}
01878 BOOL UserPropExists(const MSTR &key) {return node->UserPropExists(key);}
01879 ULONG GetGBufID() { return node->GetGBufID(); }
01880 void SetGBufID(ULONG id) { node->SetGBufID(id); }
01881
01882 UWORD GetRenderID() { return node->GetRenderID(); }
01883 void SetRenderID(UWORD id) { node->SetRenderID(id); }
01884
01885 CoreExport void SetObjOffsetScale(ScaleValue sv);
01886 CoreExport ScaleValue GetObjOffsetScale();
01887
01888 void CenterPivot(TimeValue t, BOOL moveObject) { node->CenterPivot(t,moveObject); }
01889 void AlignPivot(TimeValue t, BOOL moveObject) { node->AlignPivot(t,moveObject); }
01890 void WorldAlignPivot(TimeValue t, BOOL moveObject) { node->WorldAlignPivot(t,moveObject); }
01891 void AlignToParent(TimeValue t) { node->AlignToParent(t); }
01892 void AlignToWorld(TimeValue t) { node->AlignToWorld(t); }
01893 void ResetTransform(TimeValue t,BOOL scaleOnly) { node->ResetTransform(t,scaleOnly); }
01894 void ResetPivot(TimeValue t) { node->ResetPivot(t); }
01895 bool MayResetTransform () { return node->MayResetTransform(); }
01896
01897 void Move(TimeValue t, const Matrix3& tmAxis, const Point3& val, BOOL localOrigin=FALSE, BOOL affectKids=TRUE, int pivMode=PIV_NONE, BOOL ignoreLocks=FALSE) {node->Move(t,tmAxis,val,localOrigin,pivMode,ignoreLocks);}
01898 void Rotate(TimeValue t, const Matrix3& tmAxis, const AngAxis& val, BOOL localOrigin=FALSE, BOOL affectKids=TRUE, int pivMode=PIV_NONE, BOOL ignoreLocks=FALSE) {node->Rotate(t,tmAxis,val,localOrigin,pivMode,ignoreLocks);}
01899 void Rotate(TimeValue t, const Matrix3& tmAxis, const Quat& val, BOOL localOrigin=FALSE, BOOL affectKids=TRUE, int pivMode=PIV_NONE, BOOL ignoreLocks=FALSE) {node->Rotate(t,tmAxis,val,localOrigin,pivMode,ignoreLocks);}
01900 void Scale(TimeValue t, const Matrix3& tmAxis, const Point3& val, BOOL localOrigin=FALSE, BOOL affectKids=TRUE, int pivMode=PIV_NONE, BOOL ignoreLocks=FALSE) {node->Scale(t,tmAxis,val,localOrigin,pivMode,ignoreLocks);}
01901
01902 BOOL IsGroupMember() {return node->IsGroupMember();}
01903 BOOL IsGroupHead() { return node->IsGroupHead();}
01904 BOOL IsOpenGroupMember(){return node->IsOpenGroupMember();}
01905 BOOL IsOpenGroupHead(){return node->IsOpenGroupHead();}
01906
01907 void SetGroupMember(BOOL b) { node->SetGroupMember(b); }
01908 void SetGroupHead(BOOL b) { node->SetGroupHead(b); }
01909 void SetGroupMemberOpen(BOOL b) { node->SetGroupMemberOpen(b); }
01910 void SetGroupHeadOpen(BOOL b) { node->SetGroupHeadOpen(b); }
01911
01912 RefResult NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget,
01913 PartID& partID, RefMessage message) {return REF_SUCCEED;}
01914 void CopyProperties(INode *from) {node->CopyProperties(from);}
01915 };
01916
01917 #pragma warning(pop)
01918