Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes

IXRefItem Class Reference

This reference page is linked to from the following overview topics: XRef Scenes and Objects.


Search for all occurrences

Detailed Description

Generic interface that represents an xrefed scene entity.

This interface exposes services common to all xref scene entities. 3rd party plugins do not need to derive from this interface. Support for xrefing different plugin categories is provided by the system (3ds Max). Each plugin category that supports xrefing is modeled as a class that implements this interface.

Xref items can be created and modified via the Object XRef Manager (IObjXRefManager8), and live in xref records (IObjXRefRecord). An xref item can live in one and only one xref record.

Sub-object animation of a scene entity is maintained when the scene entity is xrefed. Transform animation of a scene entity such as a node is brought into the master file, but is not updated when the xref record is updated.

In order to retrieve this interface from a scene entity, one must call either IXRefItem::GetInterface with a reference to a scene entity (Object, Atmospherics, etc.),

See also:
IObjXRefManager8, IObjXRefRecord

#include <iXrefItem.h>

Inheritance diagram for IXRefItem:
Inheritance graph
[legend]

List of all members.

Public Types

enum   XRefItemType {
  kType_Object = 1<<0, kType_Material = 1<<1, kType_Controller = 1<<2, kType_Atmospheric = 1<<3,
  kType_All, kType_All_No_Atmospherics
}
 

List of xref item types or categories of xref-able scene entities.

More...
enum   {
  kfpGetSrcFileName, kfpSetSrcFileName, kfpGetSrcItemName, kfpSetSrcItemName,
  kfpGetSrcItem, kfpGetParentItems, kfpGetChildItems, kfpGetRootItems,
  kfpGetXRefRecord, kfpIsUnresolved, kfpIsNested, kfpGetNodes,
  kfpLastID
}

Public Member Functions

virtual Interface_ID  GetID ()
BEGIN_FUNCTION_MAP  PROP_FNS (kfpGetSrcFileName, FPGetSrcFileName, kfpSetSrcFileName, FPSetSrcFileName, TYPE_FILENAME)
  PROP_FNS (kfpGetSrcItemName, GetSrcItemName, kfpSetSrcItemName, FPSetSrcItemName, TYPE_STRING)
  RO_PROP_FN (kfpGetXRefRecord, GetXRefRecord, TYPE_INTERFACE)
  RO_PROP_FN (kfpIsUnresolved, IsUnresolved, TYPE_bool)
  RO_PROP_FN (kfpIsNested, IsNested, TYPE_bool)
  FN_1 (kfpGetSrcItem, TYPE_REFTARG, GetSrcItem, TYPE_bool)
  FN_1 (kfpGetParentItems, TYPE_DWORD, GetParentItems, TYPE_REFTARG_TAB_BR)
  FN_1 (kfpGetRootItems, TYPE_DWORD, GetRootItems, TYPE_REFTARG_TAB_BR)
  FN_1 (kfpGetChildItems, TYPE_DWORD, GetChildItems, TYPE_REFTARG_TAB_BR)
  VFN_1 (kfpGetNodes, FPGetNodes, TYPE_INODE_TAB_BR)
virtual END_FUNCTION_MAP
FPInterfaceDesc
GetDesc ()
XRef Item Property Access

The following methods give access to the properties of xref items.

These properties are allowed to be modified only via methods of IObjXRefManager8 in order to ensure the integrity of xref items and records where they are stored.

virtual const
MaxSDK::AssetManagement::AssetUser
GetSrcFile () const =0
  Retrieves the file asset that the source scene entity comes from.
virtual const MCHAR *  GetSrcItemName () const =0
  Retrieves the name of the source scene entity.
virtual ReferenceTarget GetSrcItem (bool resolveNested=false) const =0
  Retrieves the source scene entity xrefed by this xref item.
virtual bool  IsUnresolved () const =0
  Allows to verify whether the xref item is unresolved.
virtual IObjXRefRecord GetXRefRecord () const =0
  Retrieves the xref record this xref item belongs to.
virtual void  GetNodes (INodeTab &xrefNodes) const =0
  Retrieves the nodes associated with this xref item.
Nested XRef Item Management

When xrefing scene entities that are themselves xrefs, nested xref items are created.

The following methods allow working with nested xref items.

virtual unsigned int  GetParentItems (Tab< ReferenceTarget * > &parentItems) const =0
  Retrieves the xref items under which this xref item is nested.
virtual unsigned int  GetChildItems (Tab< ReferenceTarget * > &childItems) const =0
  Returns the list of every xref item for which GetParentItem() would return 'this'.
virtual unsigned int  GetRootItems (Tab< ReferenceTarget * > &rootItems) const =0
  Retrieves the root (top-level) xref items of this xref item.
virtual bool  IsNested () const =0
  Checks whether this xref item is a nested one.

Static Public Member Functions

static bool  IsIXRefItem (InterfaceServer &is)
  Allows to determine whether a scene entity implements this interface.
static IXRefItem GetInterface (InterfaceServer &is)
  Retrieves the IXRefItem interface from a scene entity.

Static Public Attributes

static FPInterfaceDesc  mFPInterfaceDesc

Protected Member Functions

Function Publishing methods
virtual void  FPSetSrcFileName (const MCHAR *fileName)=0
  Sets file name of xref. Implemented by the system.
virtual const MCHAR *  FPGetSrcFileName ()=0
  Gets file name of xref. Implemented by the system.
virtual void  FPSetSrcItemName (const MCHAR *itemName)=0
  Sets item name of xref. Implemented by the system.

Member Enumeration Documentation

List of xref item types or categories of xref-able scene entities.

Use the following values when retrieving xref items from xref records.

Enumerator:
kType_Object 

Xref object type.

kType_Material 

Xref material type.

kType_Controller 
kType_Atmospheric 

Xref atmospheric type.

kType_All 

All xref item types.

kType_All_No_Atmospherics 

All xref item types, except atmospherics.

anonymous enum

Member Function Documentation

virtual const MaxSDK::AssetManagement::AssetUser& GetSrcFile ( ) const [pure virtual]

Retrieves the file asset that the source scene entity comes from.

Returns:
- The file asset that the source scene entity comes from.
See also:
IObjXRefManager8::SetSrcFile
virtual const MCHAR* GetSrcItemName ( ) const [pure virtual]

Retrieves the name of the source scene entity.

Returns:
- Pointer to the name of the source scene entity or NULL if there's no source item name specified.
See also:
IObjXRefManager8::SetXRefItemSrcName
virtual ReferenceTarget* GetSrcItem ( bool  resolveNested = false ) const [pure virtual]

Retrieves the source scene entity xrefed by this xref item.

Parameters:
[in] resolveNested - If true, the method looks for the first non-xref source item. This could be a direct or indirect source item.
Returns:
- Pointer to the source scene entity xrefed by this xref item. The source entity can be itself an xref item or a derived object if the supplied parameter is false. If the source scene entity is NULL, the xref item is unresolved.
See also:
virtual bool IsUnresolved ( ) const [pure virtual]

Allows to verify whether the xref item is unresolved.

An xref item is unresolved if the source scene entity is invalid. This can happen for example if the source scene entity does not exist in the source file or the xref item has been pointed to a source file that does not exist. Unresolved xref items will not render, but have a default viewport representation. Unresolved xref items may get re-resolved on a subsequent reload of the xref item's record.

Returns:
- true if this is an unresolved xref item
See also:
IObjXRefRecord::Update
virtual IObjXRefRecord* GetXRefRecord ( ) const [pure virtual]

Retrieves the xref record this xref item belongs to.

Returns:
The xref record this xref item belongs to. An xref item can belong to one and only one xref record at any one time. A return value of NULL, indicates that the xref item is not part of an xref record yet.
virtual void GetNodes ( INodeTab xrefNodes ) const [pure virtual]

Retrieves the nodes associated with this xref item.

This method retrieves all the nodes that reference this xref item. If this xref item is an xref atmospheric, no nodes will be reported. If this xref item is nested, this method retrieves the nodes that reference it indirectly. Note that nodes that are not in the scene could also be returned by this method.

Parameters:
[in,out] xrefNodes - The tab of nodes that reference this xref item. The tab is not cleared by this method. The tab is guaranteed to not contain duplicated nodes.
virtual unsigned int GetParentItems ( Tab< ReferenceTarget * > &  parentItems ) const [pure virtual]

Retrieves the xref items under which this xref item is nested.

A nested xref item can have multiple parent items (when for example a nested xref item is cloned), and all of them have the same type as their child item.

Parameters:
[out] parentItems - Array where the parent xref items of this item are returned. The parent xref items are added to the array without clearing it out first.
Returns:
- The number of parent xref items returned.
virtual unsigned int GetChildItems ( Tab< ReferenceTarget * > &  childItems ) const [pure virtual]

Returns the list of every xref item for which GetParentItem() would return 'this'.

A child xref item is a xref item encountered when walking down any given path in the reference hierarchy of this xref item. An xref item may have several child xref items.

Parameters:
[out] childItems - Array where the child xref items of this item are returned. The child xref items are added to the array without clearing it out first.
Returns:
- The number of child xref items returned.
virtual unsigned int GetRootItems ( Tab< ReferenceTarget * > &  rootItems ) const [pure virtual]

Retrieves the root (top-level) xref items of this xref item.

This method retrieves all top-level parent xref items of this item. A top-level xref item is an item that does not have an ancestor. The top-level xref item of an item that doesn't have ancestors is itself.

Parameters:
rootItems - Array where the top-level (root) xref items of this item are returned. This array is guaranteed to contain at least this xref item.
Returns:
- The number of top-level (root) xref items returned.
virtual bool IsNested ( ) const [pure virtual]

Checks whether this xref item is a nested one.

This method offers a more efficient way of finding out if this xref item is nested than calling GetParentItems.

Returns:
- true if this xref item is a nested one.
static bool IsIXRefItem ( InterfaceServer is ) [inline, static]

Allows to determine whether a scene entity implements this interface.

Parameters:
[in] is - Reference to scene entity
Returns:
- true if the scene entity implements the IXRefItem interface, false otherwise
                                                 {
        return (is.GetInterface(IID_XREF_ITEM) != NULL);
    };
static IXRefItem* GetInterface ( InterfaceServer is ) [inline, static]

Retrieves the IXRefItem interface from a scene entity.

Parameters:
[in] is - Reference to scene entity
Returns:
- Pointer to the IXRefItem interface of the scene entity or NULL if it's not an xref item
                                                        {
        return static_cast<IXRefItem*>(is.GetInterface(IID_XREF_ITEM));
    };
virtual 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_ITEM; }
BEGIN_FUNCTION_MAP PROP_FNS ( kfpGetSrcFileName  ,
FPGetSrcFileName  ,
kfpSetSrcFileName  ,
FPSetSrcFileName  ,
TYPE_FILENAME   
)
PROP_FNS ( kfpGetSrcItemName  ,
GetSrcItemName  ,
kfpSetSrcItemName  ,
FPSetSrcItemName  ,
TYPE_STRING   
)
RO_PROP_FN ( kfpGetXRefRecord  ,
GetXRefRecord  ,
TYPE_INTERFACE   
)
RO_PROP_FN ( kfpIsUnresolved  ,
IsUnresolved  ,
TYPE_bool   
)
RO_PROP_FN ( kfpIsNested  ,
IsNested  ,
TYPE_bool   
)
FN_1 ( kfpGetSrcItem  ,
TYPE_REFTARG  ,
GetSrcItem  ,
TYPE_bool   
)
FN_1 ( kfpGetParentItems  ,
TYPE_DWORD  ,
GetParentItems  ,
TYPE_REFTARG_TAB_BR   
)
FN_1 ( kfpGetRootItems  ,
TYPE_DWORD  ,
GetRootItems  ,
TYPE_REFTARG_TAB_BR   
)
FN_1 ( kfpGetChildItems  ,
TYPE_DWORD  ,
GetChildItems  ,
TYPE_REFTARG_TAB_BR   
)
VFN_1 ( kfpGetNodes  ,
FPGetNodes  ,
TYPE_INODE_TAB_BR   
)
virtual END_FUNCTION_MAP FPInterfaceDesc* GetDesc ( ) [inline, virtual]
Remarks:
Returns a pointer to the class which contains the interface metadata.

Implements FPInterface.

{ return &mFPInterfaceDesc; }
virtual void FPSetSrcFileName ( const MCHAR *  fileName ) [protected, pure virtual]

Sets file name of xref. Implemented by the system.

virtual const MCHAR* FPGetSrcFileName ( ) [protected, pure virtual]

Gets file name of xref. Implemented by the system.

virtual void FPSetSrcItemName ( const MCHAR *  itemName ) [protected, pure virtual]

Sets item name of xref. Implemented by the system.


Member Data Documentation


IXRefItem IXRefItem IXRefItem IXRefItem IXRefItem IXRefItem IXRefItem IXRefItem IXRefItem IXRefItem
IXRefItem IXRefItem IXRefItem IXRefItem IXRefItem IXRefItem IXRefItem IXRefItem IXRefItem IXRefItem