Loading...
Searching...
No Matches
references.h
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
5// with the following modification; you may not use this file except in
6// compliance with the Apache License and the following modification to it:
7// Section 6. Trademarks. is deleted and replaced with:
8//
9// 6. Trademarks. This License does not grant permission to use the trade
10// names, trademarks, service marks, or product names of the Licensor
11// and its affiliates, except as required to comply with Section 4(c) of
12// the License and to reproduce the content of the NOTICE file.
13//
14// You may obtain a copy of the Apache License at
15//
16// http://www.apache.org/licenses/LICENSE-2.0
17//
18// Unless required by applicable law or agreed to in writing, software
19// distributed under the Apache License with the above modification is
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21// KIND, either express or implied. See the Apache License for the specific
22// language governing permissions and limitations under the Apache License.
23//
24#ifndef PXR_USD_USD_REFERENCES_H
25#define PXR_USD_USD_REFERENCES_H
26
27#include "pxr/pxr.h"
28#include "pxr/usd/usd/api.h"
29#include "pxr/usd/usd/common.h"
30#include "pxr/usd/usd/prim.h"
31
33#include "pxr/usd/sdf/path.h"
35
36PXR_NAMESPACE_OPEN_SCOPE
37
215 friend class UsdPrim;
216
217 explicit UsdReferences(const UsdPrim& prim) : _prim(prim) {}
218
219public:
226 USD_API
227 bool AddReference(const SdfReference& ref,
229
231 USD_API
232 bool AddReference(const std::string &identifier,
233 const SdfPath &primPath,
234 const SdfLayerOffset &layerOffset = SdfLayerOffset(),
236
239 USD_API
240 bool AddReference(const std::string &identifier,
241 const SdfLayerOffset &layerOffset = SdfLayerOffset(),
243
246 USD_API
247 bool AddInternalReference(const SdfPath &primPath,
248 const SdfLayerOffset &layerOffset = SdfLayerOffset(),
250
256 USD_API
258
264 USD_API
266
273 USD_API
274 bool SetReferences(const SdfReferenceVector& items);
275
277 const UsdPrim &GetPrim() const { return _prim; }
278
280 UsdPrim GetPrim() { return _prim; }
281
282 explicit operator bool() { return bool(_prim); }
283
284private:
285 UsdPrim _prim;
286};
287
288PXR_NAMESPACE_CLOSE_SCOPE
289
290#endif // PXR_USD_USD_REFERENCES_H
Represents a time offset and scale between layers.
Definition: layerOffset.h:61
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:291
Represents a reference and all its meta data.
Definition: reference.h:75
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:134
UsdReferences provides an interface to authoring and introspecting references in Usd.
Definition: references.h:214
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:277
UsdPrim GetPrim()
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: references.h:280
UsdListPosition
Specifies a position to add items to lists.
Definition: common.h:88
@ UsdListPositionBackOfPrependList
The position at the back of the prepend list.
Definition: common.h:98