ILockedTracks.h

Go to the documentation of this file.
00001 /*==============================================================================
00002 Copyright 2008 Autodesk, Inc.  All rights reserved.
00003 Use of this software is subject to the terms of the Autodesk license agreement provided at the time of installation or download,
00004 or which otherwise accompanies this software in either electronic or hard copy form.   
00005 *****************************/
00006 // DESCRIPTION: Interface to Locked Tracks
00007 // AUTHOR: Michael Zyracki created 2008
00008 //***************************************************************************/
00009 #pragma once
00010 
00011 #include "ifnpub.h"
00012 #include "control.h"
00013 #include "AnimatableInterfaceIDs.h"
00014 
00016 #define ILOCKEDTRACKSMAN_INTERFACE Interface_ID(0x30384fe4, 0x3d657ac6)
00017 
00025 class ILockedTracksMan: public FPStaticInterface
00026 {
00027 public:
00028 
00035     virtual bool IsLockable(ReferenceTarget *anim,ReferenceTarget *client, int subNum) =0;
00036 
00045     virtual bool GetLocked(ReferenceTarget *anim, ReferenceTarget *client, int subNum,bool checkOverride=true) =0;
00046 
00048 
00049 
00050 
00051 
00052 
00053 
00054 
00055 
00056 
00057 
00058     virtual void SetLocks(bool val,Tab<ReferenceTarget*> &anims, Tab<ReferenceTarget*> &clients,Tab<int> &subNums,
00059                             bool lockSubAnims)=0;
00060 
00069     virtual void ToggleLocks(Tab<ReferenceTarget*> &anims, Tab<ReferenceTarget*> &clients,Tab<int> &subNums,
00070                             bool lockSubAnims)=0;
00072     
00073 
00074 
00076 
00077 
00078 
00079 
00080     virtual void SetUnLockOverride(bool val) =0;
00081 
00085     virtual bool GetUnLockOverride() const =0;
00086     
00087 
00093     virtual void PushUberUnLockOverride()=0;
00098     virtual void PopUberUnLockOverride()=0;
00104     virtual int GetUberUnLockOverride()const =0;
00105 
00107 
00109 
00110 
00111 
00112 
00113 
00114 
00115 
00116 
00117 
00118     virtual void FindLockedAnims(bool locked,bool checkOverride, ReferenceTarget *refTarget, Tab<ReferenceTarget*> &anims, Tab<ReferenceTarget*> &clients, Tab<int> &subnums) =0;
00119 
00123     virtual bool IsAnimOverrideUnlocked(ReferenceTarget *anim) =0;
00125 
00126 };
00127 
00132 class ILockedTrack: public MaxHeapOperators 
00133 {
00134 public:
00136     virtual ~ILockedTrack(){};
00146     virtual void SetLocked(bool val, bool lockSubanims,ReferenceTarget* anim,ReferenceTarget* client, int subNum)=0;
00152     virtual bool GetLocked(bool checkOverride = true)const =0;
00153 
00159     virtual bool IsComponent(){return false;}
00160 
00161 };
00162 
00163 
00165 class ILockedTrackImpRestore;
00166 
00167 //*! \sa  Class ILockedTrack\n\n
00170 class ILockedTrackImp: public ILockedTrack
00171 {
00172     friend class ILockedTrackImpRestore;
00173 public:
00175     CoreExport ILockedTrackImp();
00177     CoreExport void SetLocked(bool val, bool effectChildren,ReferenceTarget* anim,ReferenceTarget* client, int SubNum);
00179     CoreExport bool GetLocked(bool checkOverride = true)const; 
00180 
00181 protected:
00183     bool mLocked;
00184 };
00185 
00192 class ILockedTrackClient: public MaxHeapOperators 
00193 {
00194 public:
00196     virtual ~ILockedTrackClient(){};
00208     virtual void SetLocked(bool val, bool lockSubanims, ReferenceTarget* anim, ReferenceTarget* client, int subNum)=0;
00215     virtual bool GetLocked(int subNum, bool checkOverride = true)const =0;
00216 
00220     virtual bool IsLockable(int subNum)const =0;
00221 };
00222 
00227 class LockableStdControl: public StdControl, public ILockedTrackImp
00228 {
00229 public:
00230 
00232     void* GetInterface(ULONG id)
00233     {
00234         switch (id) {
00235             case I_LOCKED:
00236                     return (ILockedTrackImp*) this;
00237             }
00238         return StdControl::GetInterface(id);
00239     }
00241     BOOL IsReplaceable() {return !GetLocked();}  
00242 
00244     BOOL CanApplyEaseMultCurves(){return !GetLocked();}
00245 };
00246 
00251 class LockableControl : public Control, public ILockedTrackImp
00252 {
00253 public:
00254     
00255 
00257     void* GetInterface(ULONG id)
00258     {
00259         switch (id) {
00260             case I_LOCKED:
00261                     return (ILockedTrackImp*) this;
00262             }
00263         return Control::GetInterface(id);
00264     }
00266     BOOL IsReplaceable() {return !GetLocked();} 
00267 
00269     BOOL CanApplyEaseMultCurves(){return !GetLocked();}
00270 };
00271 
00272