ILayerControl.h

Go to the documentation of this file.
00001 /*==============================================================================
00002 // Copyright (c) 1998-2006 Autodesk, Inc.
00003 // All rights reserved.
00004 // 
00005 // These coded instructions, statements, and computer programs contain
00006 // unpublished proprietary information written by Autodesk, Inc., and are
00007 // protected by Federal copyright law. They may not be disclosed to third
00008 // parties or copied or duplicated in any form, in whole or in part, without
00009 // the prior written consent of Autodesk, Inc.
00010 //**************************************************************************/
00011 // DESCRIPTION: Interface to Animation Layer Interfaces
00012 // AUTHOR: Michael Zyracki created 2006
00013 //***************************************************************************/
00014 
00015 #pragma once
00016 
00017 #include "ifnpub.h"
00018 #include "iparamb2.h"
00019 #include "XMLAnimTreeEntry.h"
00020 
00021 
00023 #define ANIMLAYERMGR_COMBOBOX_ID   50612
00024 #define ANIMLAYERMGR_EDIT_ID   50613
00025 #define ANIMLAYERMGR_SPINNER_ID   50614
00026 
00028 #define MASTERLAYERCONTROLMANAGER_CLASS_ID  Class_ID(0xf4871a5, 0x781f1430)
00029 
00032 #define IANIMLAYERCONTROLMANAGER_INTERFACE Interface_ID(0xe343ef5, 0x62944bc2)
00033 
00034 
00036 
00039 class IAnimLayerControlManager  : public FPStaticInterface {
00040 
00041 public:
00042 
00044 
00045 
00047     
00054     enum Filter{ePos= 0x1, eRot = 0x2, eScale = 0x4,eIK = 0x8, eObject = 0x10,
00055     eCA = 0x20, eMod = 0x40, eMat = 0x80, eOther = 0x100};
00056 
00058 
00063     enum ControllerType {eBezier=0x0, eLinear, eDefault};
00065 
00067 
00068 
00070     
00073     virtual void ShowAnimLayersManagerToolbar(bool show) =0;
00074 
00076     virtual void RefreshAnimLayersManagerToolbar() =0;
00077 
00079 
00083     virtual int  EnableAnimLayersDlg(Tab<INode *> &nodeTab) =0;
00085 
00087 
00088 
00090 
00094 
00097 
00098     virtual int  EnableAnimLayers(Tab<INode *> &nodeTab,DWORD filter) =0;
00099     
00100 
00106     virtual BOOL CanEnableAnimLayer(ReferenceTarget *anim, ReferenceTarget *client,int subNum) =0;
00107 
00116     virtual BOOL EnableAnimLayer(ReferenceTarget *anim, ReferenceTarget *client, int subnum) =0;
00117 
00120     virtual int  GetLayerCount()=0;
00121 
00126     virtual void GetNodesLayers(Tab<INode *> &nodeTab,Tab<int> &layers)=0;
00127 
00130     virtual void SetLayerActive(int index)=0;
00131 
00136     virtual void SetLayerActiveNodes(int index,Tab<INode *> &nodeTab)=0;
00137 
00145     virtual void AddLayer(MSTR &name, Tab<INode *> &nodeTab, bool useActiveControllerType)=0;
00146 
00150     virtual void AddLayerDlg(Tab<INode *> &nodeTab)=0;
00151 
00152 
00156     virtual void     GetActiveLayersNodes(Tab<INode *> &nodeTab,Tab<int> &layers)=0;
00157 
00158 
00162     virtual void     GetNodesActiveLayer(Tab<INode *> &nodeTab)=0;
00163 
00166     virtual void DeleteLayer(int index)=0;
00167 
00171     virtual void DeleteLayerNodes(int index,Tab<INode *> &nodeTab)=0;
00172 
00176     virtual void CopyLayerNodes(int index,Tab<INode *> &nodeTab)=0;
00177 
00181     virtual void PasteLayerNodes(int index,Tab<INode *> &nodeTab)=0;
00182 
00186     virtual void SetLayerName(int index, MSTR name)=0;
00187 
00191     virtual MSTR GetLayerName(int index)=0;
00192 
00197     virtual float GetLayerWeight(int index,TimeValue t)=0;
00198 
00203     virtual void SetLayerWeight(int index, TimeValue t, float weight)=0;
00204 
00208     virtual Control * GetLayerWeightControl(int index)=0;
00209 
00214     virtual bool SetLayerWeightControl(int index, Control *c)=0;
00215 
00216 
00220     virtual bool GetLayerMute(int index)=0;
00221 
00225     virtual void SetLayerMute(int index, bool mute)=0;
00226 
00230     virtual bool GetLayerOutputMute(int index)=0;
00231 
00235     virtual void SetLayerOutputMute(int index, bool mute)=0;
00236 
00241     virtual bool GetLayerLocked(int index)=0;
00242 
00248     virtual void SetLayerLocked(int index, bool locked)=0;
00249 
00250 
00254     virtual void CollapseLayerNodes(int index,Tab<INode*> &nodeTab)=0;
00255 
00256 
00260     virtual void DisableLayerNodes(Tab<INode*> &nodeTab)=0;
00261 
00262 
00265     virtual void AnimLayerPropertiesDlg() = 0;
00266 
00269     virtual void SetFilterActiveOnlyTrackView(bool val)=0;
00270 
00271         
00274     virtual bool GetFilterActiveOnlyTrackView()=0;
00275 
00278     virtual void SetJustUpToActive(bool v)=0;
00279 
00282     virtual  bool GetJustUpToActive()=0;
00283 
00286     virtual  void SetCollapseControllerType(IAnimLayerControlManager::ControllerType type)=0;
00287 
00290     virtual IAnimLayerControlManager::ControllerType GetCollapseControllerType() = 0;
00291 
00295     virtual void SetCollapsePerFrame(bool v) =0;
00296 
00300     virtual bool GetCollapsePerFrame() =0;
00301 
00304     virtual void SetCollapsePerFrameActiveRange(bool v) =0;
00305 
00308     virtual bool GetCollapsePerFrameActiveRange() =0;
00309 
00312     virtual void SetCollapseRange(Interval range) =0;
00313 
00316     virtual Interval GetCollapseRange() =0;
00318 
00320     virtual void SetUpCustUI(ICustToolbar *toolbar,int id,HWND hWnd, HWND hParent)=0;
00321 
00323     virtual MCHAR *GetComboToolTip() =0;
00324 
00325 };
00326 
00327 
00329 #define FLOATLAYER_CONTROL_CLASS_ID     Class_ID(0xba900de, 0x64230ed4)
00330 #define POINT3LAYER_CONTROL_CLASS_ID    Class_ID(0x602b0ddf, 0x455b1b11)
00331 #define POSLAYER_CONTROL_CLASS_ID       Class_ID(0x29b938ee, 0x7fe83f9c)
00332 #define ROTLAYER_CONTROL_CLASS_ID       Class_ID(0x6d7f1859, 0x3f3f0f5e)
00333 #define SCALELAYER_CONTROL_CLASS_ID     Class_ID(0x300e6319, 0x194e7d61)
00334 #define POINT4LAYER_CONTROL_CLASS_ID    Class_ID(0x753822fd, 0xedf52d8)
00335 #define LAYEROUTPUT_CONTROL_CLASS_ID    Class_ID(0x5b6e7ba7, 0x692e4477)
00336 
00338 
00341 
00342 
00345 #define LAYER_CONTROLLER_INTERFACE Interface_ID(0x434d7627, 0xa25e6e26)
00346 
00349 #define GetILayerControlInterface(cd) \
00350         static_cast<ILayerControl*> ((cd)->GetInterface(LAYER_CONTROLLER_INTERFACE))
00351 
00352 
00354 
00356 class ILayerControl :  public FPMixinInterface {
00357     public:
00358         
00359         enum{ getNumLayers, setLayerActive, getLayerActive,  copyLayer,pasteLayer,
00360               deleteLayer, count, setLayerActive_prop, getLayerActive_prop,getLayerName, setLayerName,
00361               getSubCtrl, getLayerWeight,setLayerWeight,getLayerMute, setLayerMute,collapseLayer,
00362               disableLayer, getLayerLocked, setLayerLocked};
00363         // FUNCTION_PUBLISHING      
00364         // Function Map for Function Publish System 
00365         //***********************************
00366 #pragma warning(push)
00367 #pragma warning(disable:4238)
00368         BEGIN_FUNCTION_MAP
00369             FN_0        (getNumLayers,  TYPE_INT,   GetLayerCount               );
00370             VFN_1       (setLayerActive,                SetLayerActive,     TYPE_INDEX  );
00371             FN_0        (getLayerActive,    TYPE_INDEX, GetLayerActive                  );
00372             VFN_1       (copyLayer,                 CopyLayer,      TYPE_INDEX  );
00373             VFN_1       (pasteLayer,                PasteLayer,     TYPE_INDEX  );
00374             VFN_1       (deleteLayer,               DeleteLayer,        TYPE_INDEX  );
00375             FN_1        (getLayerName,    TYPE_TSTR_BV, GetLayerName,       TYPE_INDEX  );
00376             VFN_2       (setLayerName,                  SetLayerName,       TYPE_INDEX, TYPE_STRING );
00377             RO_PROP_FN  (count,                 GetLayerCount,  TYPE_INT    ); 
00378             PROP_FNS    (getLayerActive_prop, GetLayerActive, setLayerActive_prop, SetLayerActive, TYPE_INDEX   ); 
00379             FN_1        (getSubCtrl,    TYPE_CONTROL,   GetSubCtrl, TYPE_INDEX  );
00380             FN_2        (getLayerWeight,TYPE_FLOAT, GetLayerWeight,TYPE_INDEX,TYPE_TIMEVALUE );
00381             VFN_3       (setLayerWeight,SetLayerWeight, TYPE_INDEX,TYPE_TIMEVALUE,TYPE_FLOAT );
00382             FN_1        (getLayerMute,TYPE_bool, GetLayerMute,TYPE_INDEX );
00383             VFN_2       (setLayerMute,SetLayerMute, TYPE_INDEX,TYPE_bool );
00384             VFN_1       (collapseLayer,             CollapseLayer,      TYPE_INDEX  );
00385             VFN_0       (disableLayer, DisableLayer);
00386             FN_1        (getLayerLocked,TYPE_bool, GetLayerLocked,TYPE_INDEX );
00387             VFN_2       (setLayerLocked,SetLayerLocked, TYPE_INDEX,TYPE_bool );
00388     END_FUNCTION_MAP
00389 #pragma warning(pop)
00390         FPInterfaceDesc* GetDesc();    // <-- must implement 
00391         //End of Function Publishing system code 
00392         //***********************************
00393 
00396         virtual int  GetLayerCount()=0;
00397 
00401         virtual void SetLayerActive(int index)=0;
00402 
00405         virtual int  GetLayerActive()=0;
00406 
00409         virtual void DeleteLayer(int index)=0;
00410 
00413         virtual void CopyLayer(int index)=0;
00414             
00418         virtual void PasteLayer(int index)=0;
00419 
00423         virtual void SetLayerName(int index, MSTR name)=0;
00424 
00428         virtual MSTR GetLayerName(int index)=0;
00429     
00430 
00435         virtual float GetLayerWeight(int index,TimeValue t)=0;
00436 
00441         virtual void SetLayerWeight(int index, TimeValue t, float weight)=0;
00442 
00446         virtual bool GetLayerMute(int index)=0;
00447 
00451         virtual void SetLayerMute(int index, bool mute)=0;
00452 
00456         virtual Control*    GetSubCtrl(int in_index) const =0;
00457 
00460         virtual void CollapseLayer(int index)=0;
00461 
00465         virtual void DisableLayer()=0;
00466 
00471         virtual bool GetLayerLocked(int index)=0;
00472 
00478         virtual void SetLayerLocked(int index,bool locked)=0;
00479 
00480 
00481 };
00482 
00483