All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
specializes.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_SPECIALIZES_H
8#define PXR_USD_USD_SPECIALIZES_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 UsdSpecializes(const UsdPrim& prim) : _prim(prim) {}
38
39public:
40
43 USD_API
44 bool AddSpecialize(const SdfPath &primPath,
46
49 USD_API
50 bool RemoveSpecialize(const SdfPath &primPath);
51
54 USD_API
56
60 USD_API
61 bool SetSpecializes(const SdfPathVector& items);
62
64 const UsdPrim &GetPrim() const { return _prim; }
65 UsdPrim GetPrim() { return _prim; }
66
67 explicit operator bool() { return bool(_prim); }
68
69 // ---------------------------------------------------------------------- //
70 // Private Methods and Members
71 // ---------------------------------------------------------------------- //
72private:
73
74 UsdPrim _prim;
75};
76
77PXR_NAMESPACE_CLOSE_SCOPE
78
79#endif //PXR_USD_USD_SPECIALIZES_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
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117
A proxy class for applying listOp edits to the specializes list for a prim.
Definition: specializes.h:34
USD_API bool SetSpecializes(const SdfPathVector &items)
Explicitly set specializes paths, potentially blocking weaker opinions that add or remove items,...
USD_API bool ClearSpecializes()
Removes the authored specializes listOp edits at the current edit target.
USD_API bool RemoveSpecialize(const SdfPath &primPath)
Removes the specified path from the specializes listOp at the current EditTarget.
const UsdPrim & GetPrim() const
Return the prim this object is bound to.
Definition: specializes.h:64
USD_API bool AddSpecialize(const SdfPath &primPath, UsdListPosition position=UsdListPositionBackOfPrependList)
Adds a path to the specializes listOp at the current EditTarget, in the position specified by positio...
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