IContainerObject.h

Go to the documentation of this file.
00001 //*****************************************************************************
00002 // Copyright 2010 Autodesk, Inc.  All rights reserved.
00003 //
00004 // Use of this software is subject to the terms of the Autodesk license agreement
00005 // provided at the time of installation or download, or which otherwise accompanies 
00006 // this software in either electronic or hard copy form.   
00007 //
00008 //*****************************************************************************
00009 //
00010 //  FILE: IContainerObject.h
00011 //  DESCRIPTION: Describes the container object interface 
00012 //  CREATED BY: Nicolas Leonard
00013 //
00014 //  HISTORY:    July 9th, 2008  Creation
00015 //*****************************************************************************
00016 
00017 #pragma once
00018 
00019 #include "iFnPub.h"
00020 #include "AssetManagement\iassetmanager.h"
00021 #include "Animatable.h"
00022 // forward declarations
00023 class INodeTab;
00024 
00025 
00027 //  Container ClassIDs and Interface IDs   
00029 
00030 #define CONTAINER_CLASS_ID  Class_ID(0x6E34B493, 0xE3C48E41)
00031 
00032 #define IID_CONTAINER Interface_ID(0xB314E0F8, 0x4B104959)
00033 #define IID_CONTAINER13 Interface_ID(0x6f9826aa, 0x75a12aa6)
00034 
00040 
00079 
00080 
00081 class IContainerObject: public FPMixinInterface
00082 {
00083 public:
00084 
00085 
00086 
00087     FPInterfaceDesc* GetDesc(); 
00088 
00090 
00091     virtual INode*      GetContainerNode() const = 0;
00093 
00094 
00095 
00096 
00097     virtual void        GetContentNodes(bool nestedContainerNodes, INodeTab& contentNodes) const = 0;
00102     virtual bool        IsNodeInContent(INode* in_node, bool nestedContainerNodes) const = 0;
00106     virtual bool        IsNodeInInheritedContent(INode* in_node, bool nestedContainerNodes) const = 0;
00108 
00113 
00114 
00115 
00116     virtual bool        AddNodeToContent(INode* in_node) = 0;           
00121     virtual bool        AddNodesToContent(INodeTab& in_nodeTab) = 0;
00123 
00126 
00127 
00128 
00129 
00130     virtual bool        RemoveNodeFromContent(INode* in_node, bool detach = true) = 0;
00132 
00139 
00140 
00141     virtual MaxSDK::AssetManagement::AssetUser  GetLocalDefinitionFileName() const = 0;
00143     virtual bool        SetLocalDefinitionFileName(const MaxSDK::AssetManagement::AssetUser &val) = 0;
00144 
00146     virtual MaxSDK::AssetManagement::AssetUser  GetSourceDefinitionFileName() const = 0;
00148     virtual bool        SetSourceDefinitionFileName(const MaxSDK::AssetManagement::AssetUser &val) = 0;
00150 
00152 
00153 
00154 
00155 
00156     virtual bool        SaveContainer(bool newFileName = false) = 0;
00158     virtual bool        UpdateContainer() = 0;
00160     virtual bool        UnloadContainer() = 0;
00162     virtual bool        LoadContainer() = 0;
00165     virtual bool        ReloadContainer() = 0;
00167     virtual bool        MergeSource() = 0;
00169     virtual bool        MakeUnique() = 0;
00171 
00173 
00174 
00175     virtual bool        IsInherited() const = 0;
00176 
00178     virtual bool        IsOpen() const = 0;
00180 
00181     virtual bool        SetOpen(bool isOpen) = 0;
00182 
00184     virtual bool        IsContainerOpenableOrClosable() const = 0;
00185 
00187     virtual bool        IsUnloaded() const = 0;
00188 
00190     virtual bool        IsUnique() const = 0;
00191 
00193 
00196 
00197     virtual void        AllowInPlaceEdit(bool allowEdit) = 0;
00199     virtual bool        GetAllowInPlaceEdit() const = 0;
00200 
00202     virtual void        SetEditInPlace(bool edit) = 0;
00204     virtual bool        IsInPlaceEditing() const = 0;
00205 
00207     virtual bool        CanEditInPlace() const = 0;
00208 
00210 
00211     virtual void        SetAutoUpdateClosed(bool setAutoUpdate) = 0;
00213     virtual bool        AutoUpdateClosed() const = 0;
00215 
00217 
00218 
00219     virtual void        SetLabelDisplay(bool display) = 0;
00221     virtual bool        GetLabelDisplay() const = 0;
00222 
00224     virtual void        UseContentBoundingBox(bool useContent) = 0;
00226     virtual bool        IsUsingContentBoundingBox() const = 0;
00227 
00229     virtual void        SetOverrideNodeProperties(bool setOverride) = 0;
00231     virtual bool        OverrideNodeProperties() const = 0;
00232 
00234     virtual void        SetSize(float size, TimeValue t = 0) = 0;
00236     virtual float       GetSize(TimeValue t = 0) const = 0;
00238 
00239 
00243     static inline IContainerObject* GetInterface(Animatable* anim) { 
00244         return anim? static_cast<IContainerObject*>(anim->GetInterface(IID_CONTAINER)): NULL;}
00245 };
00246 
00247 
00254 
00261 class IContainerObject13  : public IContainerObject
00262 {
00263 public:
00264 
00266     enum 
00267         AccessType{ 
00269             eNoAccess = 0x0, 
00271             eOnlyEditInPlace , 
00273             eOnlyAddNewObjects,  
00275             eAnythingUnlocked};
00276     
00278     enum LockedContents {
00280         eLockAllMaterials =0x1, 
00282         eLockAllModifiers = 0x2 , 
00284         eLockAllTransforms =0x4, 
00286         eLockAllObjects= 0x8};
00287 
00288     enum ProxyType {
00290         PROXYTYPE_NONE,
00292         PROXYTYPE_ALTERNATE
00293     };
00294 
00296 
00297 
00298 
00299 
00300     virtual void SetAccessType(AccessType accessType) =0;
00301 
00304     virtual AccessType GetAccessType() const = 0;
00305 
00309     virtual AccessType InheritedAccessType() const = 0;
00311 
00313 
00314 
00315 
00316 
00317 
00318     virtual void SetLockedContents(LockedContents content, bool clear) =0;
00319 
00321     virtual void ClearLockedContents() =0;
00322 
00326     virtual bool IsLockedContents(LockedContents content)const =0;
00328 
00335     virtual bool SaveContainerAsVersion(bool newFileName, unsigned long saveAsVersion) = 0;
00336 
00338     virtual MCHAR*      GetStatusString() = 0;
00339 
00341     virtual void        SetStatusDisplay(bool status) = 0;
00343     virtual bool        GetStatusDisplay() const = 0;
00344 
00346     virtual const MCHAR* GetEditingUser() const = 0;
00347 
00349     virtual bool        IsUpdateNeeded() const = 0;
00350 
00360 
00361 
00362     virtual ProxyType   GetProxyType() const = 0;
00364     virtual void        SetProxyType(ProxyType type) = 0;
00365 
00367     virtual int         GetAlternateDefinitionCount() const = 0;
00370     virtual MaxSDK::AssetManagement::AssetUser  GetAlternateDefinition(int defIndex) const = 0;
00376     virtual bool        SetAlternateDefinition(int defIndex, const MaxSDK::AssetManagement::AssetUser &val) = 0;
00378     // Appending an alternate definition does not set the current alternate to the added asset
00381     virtual bool        AppendAlternateDefinition(const MaxSDK::AssetManagement::AssetUser &val) = 0;
00385     virtual bool        RemoveAlternateDefinition(int defIndex) = 0;
00386 
00388     virtual int         GetCurrentAlternateDefinitionIndex() const = 0;
00392     virtual void        SetCurrentAlternateDefinitionIndex(int defIndex) = 0;
00394     virtual MaxSDK::AssetManagement::AssetUser  GetCurrentAlternateDefinition() const = 0;
00396 
00398     virtual bool        IsInheritedClosed() const = 0;
00399 
00403     static inline IContainerObject13* GetInterface(Animatable* anim) { 
00404         return anim? static_cast<IContainerObject13*>(anim->GetInterface(IID_CONTAINER13)): NULL;}
00405 };
00406