This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
references.h
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_USD_USD_REFERENCES_H
8#define PXR_USD_USD_REFERENCES_H
9
10#include "pxr/pxr.h"
11#include "pxr/usd/usd/api.h"
12#include "pxr/usd/usd/common.h"
13#include "pxr/usd/usd/prim.h"
14
16#include "pxr/usd/sdf/path.h"
18
19PXR_NAMESPACE_OPEN_SCOPE
20
198 friend class UsdPrim;
199
200 explicit UsdReferences(const UsdPrim& prim) : _prim(prim) {}
201
202public:
209 USD_API
210 bool AddReference(const SdfReference& ref,
212
214 USD_API
215 bool AddReference(const std::string &identifier,
216 const SdfPath &primPath,
217 const SdfLayerOffset &layerOffset = SdfLayerOffset(),
219
222 USD_API
223 bool AddReference(const std::string &identifier,
224 const SdfLayerOffset &layerOffset = SdfLayerOffset(),
226
229 USD_API
230 bool AddInternalReference(const SdfPath &primPath,
231 const SdfLayerOffset &layerOffset = SdfLayerOffset(),
233
239 USD_API
241
247 USD_API
249
256 USD_API
257 bool SetReferences(const SdfReferenceVector& items);
258
260 const UsdPrim &GetPrim() const { return _prim; }
261
263 UsdPrim GetPrim() { return _prim; }
264
265 explicit operator bool() { return bool(_prim); }
266
267private:
268 UsdPrim _prim;
269};
270
271PXR_NAMESPACE_CLOSE_SCOPE
272
273#endif // PXR_USD_USD_REFERENCES_H
Represents a time offset and scale between layers.
Definition: layerOffset.h:44
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
Represents a reference and all its meta data.
Definition: reference.h:58
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117
UsdReferences provides an interface to authoring and introspecting references in Usd.
Definition: references.h:197
USD_API bool AddInternalReference(const SdfPath &primPath, const SdfLayerOffset &layerOffset=SdfLayerOffset(), UsdListPosition position=UsdListPositionBackOfPrependList)
Add an internal reference to the specified prim.
USD_API bool ClearReferences()
Removes the authored reference listOp edits at the current EditTarget.
USD_API bool AddReference(const std::string &identifier, const SdfPath &primPath, const SdfLayerOffset &layerOffset=SdfLayerOffset(), UsdListPosition position=UsdListPositionBackOfPrependList)
This is an overloaded member function, provided for convenience. It differs from the above function o...
USD_API bool RemoveReference(const SdfReference &ref)
Removes the specified reference from the references listOp at the current EditTarget.
USD_API bool AddReference(const SdfReference &ref, UsdListPosition position=UsdListPositionBackOfPrependList)
Adds a reference to the reference listOp at the current EditTarget, in the position specified by posi...
USD_API bool AddReference(const std::string &identifier, const SdfLayerOffset &layerOffset=SdfLayerOffset(), UsdListPosition position=UsdListPositionBackOfPrependList)
This is an overloaded member function, provided for convenience. It differs from the above function o...
USD_API bool SetReferences(const SdfReferenceVector &items)
Explicitly set the references, potentially blocking weaker opinions that add or remove items.
const UsdPrim & GetPrim() const
Return the prim this object is bound to.
Definition: references.h:260
UsdPrim GetPrim()
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: references.h:263
UsdListPosition
Specifies a position to add items to lists.
Definition: common.h:71
@ UsdListPositionBackOfPrependList
The position at the back of the prepend list.
Definition: common.h:81