Public Types | Public Member Functions | Static Public Member Functions

IXRefMaterial Class Reference

Search for all occurrences

Detailed Description

Class representing xref materials.

This interface groups functionality specific to xref materials. In order to access functionality common to all xref scene entities, use the IXRefItem interface. An xref material acts as a wrapper around the xrefed material (also referred to as the "source material"). For example, all shading methods on the XRef Material are automatically forwarded to the source material, requests for interfaces are also forwarded to the source material. Client or plugin code working with materials should not be required to write xref material specific code, unless the desired functionality is xref specific.

#include <iXrefMaterial.h>

Inheritance diagram for IXRefMaterial:
Inheritance graph
[legend]

List of all members.

Public Types

enum   { kfpGetSourceMaterial }

Public Member Functions

virtual Mtl GetSourceMaterial (bool resolveNestedXRef=false) const =0
  Retrieves the source material, the actual material behind the XRef.
virtual FPInterfaceDesc GetIXRefMaterialDesc ()=0
  Returns the function publishing descriptor for the XRef Material.
virtual Interface_ID  GetID ()
virtual FPInterfaceDesc GetDesc ()
BEGIN_FUNCTION_MAP  FN_1 (kfpGetSourceMaterial, TYPE_MTL, GetSourceMaterial, TYPE_bool)

Static Public Member Functions

static bool  Is_IXRefMaterial (Animatable &animatable)
  Determines whether it is safe to cast an Animatable to an IXRefMaterial.
static IXRefMaterial GetInterface (InterfaceServer &is)
  Retrieves the IXRefMaterial interface from a scene entity.

Member Enumeration Documentation

anonymous enum

Member Function Documentation

virtual Mtl* GetSourceMaterial ( bool  resolveNestedXRef = false ) const [pure virtual]

Retrieves the source material, the actual material behind the XRef.

Parameters:
[in] resolveNestedXRef - When set to true, the method will recursively resolve any nested XRef materials, guaranteeing that the material being returned is NOT an XRef material. When set to false, the source is returned directly without attempting to resolve nesting.
Returns:
The source material, or NULL if the XRef is unresoled.
bool Is_IXRefMaterial ( Animatable animatable ) [inline, static]

Determines whether it is safe to cast an Animatable to an IXRefMaterial.

Parameters:
[in] animatable - The animatable to test.
Returns:
true if the specified animatable can be safely cast to IXRefMaterial, false otherwise.
                                                                  {

    return ((animatable.SuperClassID() == MATERIAL_CLASS_ID) 
        && (animatable.ClassID() == XREFMATERIAL_CLASS_ID));
}
IXRefMaterial * GetInterface ( InterfaceServer is ) [inline, static]

Retrieves the IXRefMaterial interface from a scene entity.

Parameters:
[in] is - Reference to scene entity
Returns:
Pointer to the IXRefMaterial interface of the scene entity or NULL if it's not an xref material
                                                                     {

    return static_cast<IXRefMaterial*>(is.GetInterface(IID_XREF_MATERIAL));
};
virtual FPInterfaceDesc* GetIXRefMaterialDesc ( ) [pure virtual]

Returns the function publishing descriptor for the XRef Material.

This method is need in order to avoid problems inherant to multiple inheritance.

Returns:
The function publishing descriptor for the XRef Material.
Interface_ID GetID ( ) [inline, virtual]
Remarks:
This method overrides GetID() in those interfaces that do not publish metadata but instead have a unique Interface_ID for quick internal identification in implementation code that might be shared by a bunch of mixin interfaces.
Returns:
The Interface_ID.
Default Implementation:
{ return GetDesc()->ID; }

Reimplemented from FPMixinInterface.

                                         { 
    
    return IID_XREF_MATERIAL; 
}
FPInterfaceDesc * GetDesc ( ) [inline, virtual]
Remarks:
Returns a pointer to the class which contains the interface metadata.

Implements FPInterface.

                                               {

    return GetIXRefMaterialDesc();
}
BEGIN_FUNCTION_MAP FN_1 ( kfpGetSourceMaterial  ,
TYPE_MTL  ,
GetSourceMaterial  ,
TYPE_bool   
)

IXRefMaterial IXRefMaterial IXRefMaterial IXRefMaterial IXRefMaterial IXRefMaterial IXRefMaterial IXRefMaterial IXRefMaterial IXRefMaterial
IXRefMaterial IXRefMaterial IXRefMaterial IXRefMaterial IXRefMaterial IXRefMaterial IXRefMaterial IXRefMaterial IXRefMaterial IXRefMaterial