iXrefMaterial.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 xref materials
00012 // AUTHOR: Daniel Levesque - created Feb.24.2005
00013 //***************************************************************************/
00014 
00015 #pragma once
00016 
00017 #include "..\imtl.h"
00018 
00020 #define IID_XREF_MATERIAL Interface_ID(0x2edc624a, 0x3de347b)
00021 
00022 //==============================================================================
00023 // Class IXRefMaterial
00024 //
00026 
00035 class IXRefMaterial : public Mtl, public FPMixinInterface {
00036 public:
00037 
00039 
00044     virtual Mtl* GetSourceMaterial(bool resolveNestedXRef = false) const = 0;
00045 
00047 
00050     static bool Is_IXRefMaterial(Animatable& animatable);
00051 
00052     using FPMixinInterface::GetInterface;
00054 
00057     static IXRefMaterial* GetInterface(InterfaceServer& is);
00058 
00060 
00063     virtual FPInterfaceDesc* GetIXRefMaterialDesc() = 0;
00064 
00065     // -- from FPMixinInterface
00066     virtual Interface_ID GetID();
00067     virtual FPInterfaceDesc* GetDesc();
00068 
00069     // --- Function publishing
00070     enum {
00071         kfpGetSourceMaterial,
00072     };
00073 
00074     BEGIN_FUNCTION_MAP
00075         FN_1(kfpGetSourceMaterial, TYPE_MTL, GetSourceMaterial, TYPE_bool);
00076     END_FUNCTION_MAP
00077 };
00078 
00079 //==============================================================================
00080 // Class IXRefMaterial inlined methods
00081 //==============================================================================
00082 
00083 inline bool IXRefMaterial::Is_IXRefMaterial(Animatable& animatable) {
00084 
00085     return ((animatable.SuperClassID() == MATERIAL_CLASS_ID) 
00086         && (animatable.ClassID() == XREFMATERIAL_CLASS_ID));
00087 }
00088 
00089 inline IXRefMaterial* IXRefMaterial::GetInterface(InterfaceServer& is) {
00090 
00091     return static_cast<IXRefMaterial*>(is.GetInterface(IID_XREF_MATERIAL));
00092 };
00093 
00094 inline Interface_ID IXRefMaterial::GetID() { 
00095     
00096     return IID_XREF_MATERIAL; 
00097 }
00098 
00099 inline FPInterfaceDesc* IXRefMaterial::GetDesc() {
00100 
00101     return GetIXRefMaterialDesc();
00102 }
00103