All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
inherits.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_INHERITS_H
8#define PXR_USD_USD_INHERITS_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"
17
18PXR_NAMESPACE_OPEN_SCOPE
19
20SDF_DECLARE_HANDLES(SdfPrimSpec);
21
35 friend class UsdPrim;
36
37 explicit UsdInherits(const UsdPrim& prim) : _prim(prim) {}
38
39public:
42 USD_API
43 bool AddInherit(const SdfPath &primPath,
45
48 USD_API
49 bool RemoveInherit(const SdfPath &primPath);
50
53 USD_API
55
59 USD_API
60 bool SetInherits(const SdfPathVector& items);
61
70 USD_API
71 SdfPathVector GetAllDirectInherits() const;
72
74 const UsdPrim &GetPrim() const { return _prim; }
75 UsdPrim GetPrim() { return _prim; }
76
77 explicit operator bool() { return bool(_prim); }
78
79 // ---------------------------------------------------------------------- //
80 // Private Methods and Members
81 // ---------------------------------------------------------------------- //
82private:
83
84 UsdPrim _prim;
85};
86
87PXR_NAMESPACE_CLOSE_SCOPE
88
89#endif // PXR_USD_USD_INHERITS_H
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
Represents a prim description in an SdfLayer object.
Definition: primSpec.h:58
A proxy class for applying listOp edits to the inherit paths list for a prim.
Definition: inherits.h:34
USD_API bool RemoveInherit(const SdfPath &primPath)
Removes the specified path from the inheritPaths listOp at the current EditTarget.
USD_API bool SetInherits(const SdfPathVector &items)
Explicitly set the inherited paths, potentially blocking weaker opinions that add or remove items,...
USD_API bool ClearInherits()
Removes the authored inheritPaths listOp edits at the current edit target.
USD_API SdfPathVector GetAllDirectInherits() const
Return all the paths in this prim's stage's local layer stack that would compose into this prim via d...
USD_API bool AddInherit(const SdfPath &primPath, UsdListPosition position=UsdListPositionBackOfPrependList)
Adds a path to the inheritPaths listOp at the current EditTarget, in the position specified by positi...
const UsdPrim & GetPrim() const
Return the prim this object is bound to.
Definition: inherits.h:74
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117
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