HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SdfReference Class Reference

#include <reference.h>

+ Inheritance diagram for SdfReference:

Classes

struct  IdentityEqual
 
struct  IdentityLessThan
 

Public Member Functions

SDF_API SdfReference (const std::string &assetPath=std::string(), const SdfPath &primPath=SdfPath(), const SdfLayerOffset &layerOffset=SdfLayerOffset(), const VtDictionary &customData=VtDictionary())
 
const std::stringGetAssetPath () const
 
void SetAssetPath (const std::string &assetPath)
 
const SdfPathGetPrimPath () const
 
void SetPrimPath (const SdfPath &primPath)
 
const SdfLayerOffsetGetLayerOffset () const
 
void SetLayerOffset (const SdfLayerOffset &layerOffset)
 
const VtDictionaryGetCustomData () const
 
void SetCustomData (const VtDictionary &customData)
 
SDF_API void SetCustomData (const std::string &name, const VtValue &value)
 
void SwapCustomData (VtDictionary &customData)
 Swaps the custom data dictionary for this reference. More...
 
SDF_API bool IsInternal () const
 
SDF_API bool operator== (const SdfReference &rhs) const
 Returns whether this reference equals rhs. More...
 
SDF_API bool operator< (const SdfReference &rhs) const
 

Friends

size_t hash_value (const SdfReference &r)
 

Detailed Description

Represents a reference and all its meta data.

A reference is expressed on a prim in a given layer and it identifies a prim in a layer stack. All opinions in the namespace hierarchy under the referenced prim will be composed with the opinions in the namespace hierarchy under the referencing prim.

The asset path specifies the layer stack being referenced. If this asset path is non-empty, this reference is considered an 'external' reference to the layer stack rooted at the specified layer. If this is empty, this reference is considered an 'internal' reference to the layer stack containing (but not necessarily rooted at) the layer where the reference is authored.

The prim path specifies the prim in the referenced layer stack from which opinions will be composed. If this prim path is empty, it will be considered a reference to the default prim specified in the root layer of the referenced layer stack – see SdfLayer::GetDefaultPrim.

The meta data for a reference is its layer offset and custom data. The layer offset is an affine transformation applied to all anim splines in the referenced prim's namespace hierarchy, see SdfLayerOffset for details. Custom data is for use by plugins or other non-tools supplied extensions that need to be able to store data associated with references.

Definition at line 76 of file reference.h.

Constructor & Destructor Documentation

SDF_API SdfReference::SdfReference ( const std::string assetPath = std::string(),
const SdfPath primPath = SdfPath(),
const SdfLayerOffset layerOffset = SdfLayerOffset(),
const VtDictionary customData = VtDictionary() 
)

Creates a reference with all its meta data. The default reference is an internal reference to the default prim. See SdfAssetPath for what characters are valid in assetPath. If assetPath contains invalid characters, issue an error and set this reference's asset path to the empty asset path.

Member Function Documentation

const std::string& SdfReference::GetAssetPath ( ) const
inline

Returns the asset path to the root layer of the referenced layer stack. This will be empty in the case of an internal reference.

Definition at line 93 of file reference.h.

const VtDictionary& SdfReference::GetCustomData ( ) const
inline

Returns the custom data associated with the reference.

Definition at line 138 of file reference.h.

const SdfLayerOffset& SdfReference::GetLayerOffset ( ) const
inline

Returns the layer offset associated with the reference.

Definition at line 126 of file reference.h.

const SdfPath& SdfReference::GetPrimPath ( ) const
inline

Returns the path of the referenced prim. This will be empty if the referenced prim is the default prim specified in the referenced layer stack.

Definition at line 112 of file reference.h.

SDF_API bool SdfReference::IsInternal ( ) const

Returns true in the case of an internal reference.

An internal reference is a reference with an empty asset path.

SDF_API bool SdfReference::operator< ( const SdfReference rhs) const

Returns whether this reference is less than rhs. The meaning of less than is somewhat arbitrary.

SDF_API bool SdfReference::operator== ( const SdfReference rhs) const

Returns whether this reference equals rhs.

void SdfReference::SetAssetPath ( const std::string assetPath)
inline

Sets the asset path for the root layer of the referenced layer stack. This may be set to an empty string to specify an internal reference. See SdfAssetPath for what characters are valid in assetPath. If assetPath contains invalid characters, issue an error and set this reference's asset path to the empty asset path.

Definition at line 102 of file reference.h.

void SdfReference::SetCustomData ( const VtDictionary customData)
inline

Sets the custom data associated with the reference.

Definition at line 144 of file reference.h.

SDF_API void SdfReference::SetCustomData ( const std::string name,
const VtValue value 
)

Sets a custom data entry for the reference.

If value is empty, then this removes the given custom data entry.

void SdfReference::SetLayerOffset ( const SdfLayerOffset layerOffset)
inline

Sets a new layer offset.

Definition at line 132 of file reference.h.

void SdfReference::SetPrimPath ( const SdfPath primPath)
inline

Sets the path of the referenced prim. This may be set to an empty path to specify a reference to the default prim in the referenced layer stack.

Definition at line 120 of file reference.h.

void SdfReference::SwapCustomData ( VtDictionary customData)
inline

Swaps the custom data dictionary for this reference.

Definition at line 155 of file reference.h.

Friends And Related Function Documentation

size_t hash_value ( const SdfReference r)
friend

Definition at line 165 of file reference.h.


The documentation for this class was generated from the following file: