iXrefItem.h

Go to the documentation of this file.
00001 //**************************************************************************/
00002 // Copyright (c) 1998-2005 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 any xref scene entity
00012 // AUTHOR: Attila Szabo - created Feb.09.2005
00013 //***************************************************************************/
00014 
00015 #pragma once
00016 
00017 #include "..\iFnPub.h"
00018 #include "..\tab.h"
00019 #include "..\assetmanagement\AssetUser.h"
00020 
00021 // Foreward declarations
00022 class IObjXRefRecord;
00023 class ReferenceMaker;
00024 class ReferenceTarget;
00025 class INodeTab;
00026 
00028 #define IID_XREF_ITEM Interface_ID(0x5fa551f4, 0x442f057c)
00029 
00031 
00047 class IXRefItem : public FPMixinInterface
00048 {
00049 public:
00051 
00053     enum XRefItemType
00054     {
00056         kType_Object            = 1<<0, 
00058         kType_Material      = 1<<1, 
00059         // Xref controller type - Unsupported
00060         kType_Controller    = 1<<2, 
00062         kType_Atmospheric   = 1<<3, 
00064         kType_All                   = (kType_Object | 
00065                                                 kType_Material | 
00066                                                 kType_Controller | 
00067                                                 kType_Atmospheric),
00069         kType_All_No_Atmospherics   = (kType_Object | 
00070                                                 kType_Material | 
00071                                                 kType_Controller),
00072     };
00073 
00080 
00081 
00084     virtual const MaxSDK::AssetManagement::AssetUser& GetSrcFile() const = 0;
00085 
00087 
00091     virtual const MCHAR* GetSrcItemName() const = 0;
00092     
00094 
00101     virtual ReferenceTarget* GetSrcItem(bool resolveNested = false) const = 0;
00102 
00104 
00113     virtual bool IsUnresolved() const = 0;
00114 
00116 
00120     virtual IObjXRefRecord* GetXRefRecord() const = 0;
00121 
00123 
00130     virtual void GetNodes(INodeTab& xrefNodes) const = 0;
00132 
00138 
00139 
00145     virtual unsigned int GetParentItems(Tab<ReferenceTarget*>& parentItems) const = 0;
00147 
00153     virtual unsigned int GetChildItems(Tab<ReferenceTarget*>& childItems) const = 0;
00155 
00162     virtual unsigned int GetRootItems(Tab<ReferenceTarget*>& rootItems) const = 0;
00164 
00168     virtual bool IsNested() const = 0;
00170 
00171 
00173 
00176     static bool IsIXRefItem(InterfaceServer& is) {
00177         return (is.GetInterface(IID_XREF_ITEM) != NULL);
00178     };
00179 
00180     using FPMixinInterface::GetInterface;
00182 
00185     static IXRefItem* GetInterface(InterfaceServer& is) {
00186         return static_cast<IXRefItem*>(is.GetInterface(IID_XREF_ITEM));
00187     };
00188 
00189     // --- Function publishing
00190     virtual Interface_ID GetID() { return IID_XREF_ITEM; }
00191 
00192     enum {
00193         kfpGetSrcFileName, kfpSetSrcFileName,
00194         kfpGetSrcItemName, kfpSetSrcItemName,
00195         kfpGetSrcItem,
00196         kfpGetParentItems,
00197         kfpGetChildItems,
00198         kfpGetRootItems,
00199         kfpGetXRefRecord,
00200         kfpIsUnresolved,
00201         kfpIsNested,
00202         kfpGetNodes,
00203         kfpLastID,
00204     };
00205 
00206     BEGIN_FUNCTION_MAP
00207         PROP_FNS(kfpGetSrcFileName, FPGetSrcFileName, kfpSetSrcFileName, FPSetSrcFileName, TYPE_FILENAME);
00208         PROP_FNS(kfpGetSrcItemName, GetSrcItemName, kfpSetSrcItemName, FPSetSrcItemName, TYPE_STRING);
00209         RO_PROP_FN(kfpGetXRefRecord, GetXRefRecord, TYPE_INTERFACE);
00210         RO_PROP_FN(kfpIsUnresolved, IsUnresolved, TYPE_bool);
00211         RO_PROP_FN(kfpIsNested, IsNested, TYPE_bool);
00212         FN_1(kfpGetSrcItem, TYPE_REFTARG, GetSrcItem, TYPE_bool);
00213         FN_1(kfpGetParentItems, TYPE_DWORD, GetParentItems, TYPE_REFTARG_TAB_BR);
00214         FN_1(kfpGetRootItems, TYPE_DWORD, GetRootItems, TYPE_REFTARG_TAB_BR);
00215         FN_1(kfpGetChildItems, TYPE_DWORD, GetChildItems, TYPE_REFTARG_TAB_BR);
00216         VFN_1(kfpGetNodes, FPGetNodes, TYPE_INODE_TAB_BR);
00217     END_FUNCTION_MAP
00218 
00219     // From FPMixinInterface
00220     virtual FPInterfaceDesc* GetDesc() { return &mFPInterfaceDesc; }
00221     static FPInterfaceDesc mFPInterfaceDesc;
00222 
00223     protected:
00225 
00226 
00227         virtual void FPSetSrcFileName(const MCHAR* fileName) = 0;
00229         virtual const MCHAR* FPGetSrcFileName() = 0;
00231         virtual void FPSetSrcItemName(const MCHAR* itemName) = 0;
00233 
00234     private:
00235         void FPGetNodes(Tab<INode*>& xrefNodes);
00236 };
00237 
00238