24#ifndef PXR_USD_SDF_REFERENCE_H
25#define PXR_USD_SDF_REFERENCE_H
30#include "pxr/usd/sdf/api.h"
33#include "pxr/usd/sdf/path.h"
36#include "pxr/base/vt/value.h"
42PXR_NAMESPACE_OPEN_SCOPE
46typedef std::vector<SdfReference> SdfReferenceVector;
84 const std::string &assetPath = std::string(),
120 _primPath = primPath;
132 _layerOffset = layerOffset;
144 _customData = customData;
155 _customData.
swap(customData);
164 friend inline size_t hash_value(
const SdfReference &r) {
178 return !(*
this == rhs);
192 return !(rhs < *
this);
197 return !(*
this < rhs);
205 return lhs._assetPath == rhs._assetPath &&
206 lhs._primPath == rhs._primPath;
215 return lhs._assetPath < rhs._assetPath ||
216 (lhs._assetPath == rhs._assetPath &&
217 lhs._primPath < rhs._primPath);
223 std::string _assetPath;
246 const SdfReferenceVector &references,
253PXR_NAMESPACE_CLOSE_SCOPE
Contains an asset path and an optional resolved path.
const std::string & GetAssetPath() const &
Return the asset path.
Represents a time offset and scale between layers.
A path value used to locate objects in layers or scenegraphs.
Represents a reference and all its meta data.
const VtDictionary & GetCustomData() const
Returns the custom data associated with the reference.
SDF_API 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.
SDF_API bool operator<(const SdfReference &rhs) const
Returns whether this reference is less than rhs.
const SdfLayerOffset & GetLayerOffset() const
Returns the layer offset associated with the reference.
void SwapCustomData(VtDictionary &customData)
Swaps the custom data dictionary for this reference.
void SetPrimPath(const SdfPath &primPath)
Sets the path of the referenced prim.
void SetLayerOffset(const SdfLayerOffset &layerOffset)
Sets a new layer offset.
void SetAssetPath(const std::string &assetPath)
Sets the asset path for the root layer of the referenced layer stack.
const std::string & GetAssetPath() const
Returns the asset path to the root layer of the referenced layer stack.
bool operator>(const SdfReference &rhs) const
void SetCustomData(const VtDictionary &customData)
Sets the custom data associated with the reference.
bool operator!=(const SdfReference &rhs) const
SDF_API void SetCustomData(const std::string &name, const VtValue &value)
Sets a custom data entry for the reference.
const SdfPath & GetPrimPath() const
Returns the path of the referenced prim.
bool operator>=(const SdfReference &rhs) const
SDF_API bool IsInternal() const
Returns true in the case of an internal reference.
bool operator<=(const SdfReference &rhs) const
SDF_API bool operator==(const SdfReference &rhs) const
Returns whether this reference equals rhs.
static size_t Combine(Args &&... args)
Produce a hash code by combining the hash codes of several objects.
A map with string keys and VtValue values.
VT_API void swap(VtDictionary &dict)
Swaps the contents of two VtDictionaries.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
SDF_API int SdfFindReferenceByIdentity(const SdfReferenceVector &references, const SdfReference &referenceId)
Convenience function to find the index of the reference in references that has the same identity as t...
Struct that defines equality of SdfReferences based on their identity (the asset path and prim path).
Struct that defines a strict weak ordering of SdfReferences based on their identity (the asset path a...