Loading...
Searching...
No Matches
relationshipSpec.h
Go to the documentation of this file.
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_SDF_RELATIONSHIP_SPEC_H
8#define PXR_USD_SDF_RELATIONSHIP_SPEC_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/sdf/api.h"
14#include "pxr/usd/sdf/declareSpec.h"
16#include "pxr/usd/sdf/types.h"
17
18PXR_NAMESPACE_OPEN_SCOPE
19
35{
36 SDF_DECLARE_SPEC(SdfRelationshipSpec, SdfPropertySpec);
37
38public:
40 typedef SdfPropertySpec Parent;
41
45
50 SDF_API
51 static SdfRelationshipSpecHandle
52 New(const SdfPrimSpecHandle& owner,
53 const std::string& name,
54 bool custom = true,
55 SdfVariability variability = SdfVariabilityUniform);
56
58
61
66 SDF_API
68
70 SDF_API
71 bool HasTargetPathList() const;
72
74 SDF_API
75 void ClearTargetPathList() const;
76
81 SDF_API
82 void ReplaceTargetPath(const SdfPath& oldPath, const SdfPath& newPath);
83
90 SDF_API
91 void RemoveTargetPath(const SdfPath& path, bool preserveTargetOrder = false);
92
94
97 SDF_API
98 bool GetNoLoadHint(void) const;
99
102 SDF_API
103 void SetNoLoadHint(bool noload);
104
105private:
106 SdfPath _CanonicalizeTargetPath(const SdfPath& path) const;
107
108 SdfPath _MakeCompleteTargetSpecPath(const SdfPath& srcPath) const;
109
110 SdfSpecHandle _GetTargetSpec(const SdfPath& path) const;
111
112 // Allow access to _GetTarget() for the relational attribute c'tor
113 friend class SdfAttributeSpec;
114
115 // Allow access to retrieve relationship spec for this API object.
116 friend class Sdf_PyRelationshipAccess;
117};
118
130SDF_API
131SdfRelationshipSpecHandle
133 const SdfLayerHandle &layer,
134 const SdfPath &relPath,
135 SdfVariability variability = SdfVariabilityVarying,
136 bool isCustom = false);
137
152SDF_API
153bool
155 const SdfLayerHandle &layer,
156 const SdfPath &relPath,
157 SdfVariability variability = SdfVariabilityVarying,
158 bool isCustom = false);
159
160PXR_NAMESPACE_CLOSE_SCOPE
161
162#endif // PXR_USD_SDF_RELATIONSHIP_SPEC_H
A subclass of SdfPropertySpec that holds typed data.
Definition: attributeSpec.h:42
Represents a set of list editing operations.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
Base class for SdfAttributeSpec and SdfRelationshipSpec.
Definition: propertySpec.h:47
A property that contains a reference to one or more SdfPrimSpec instances.
SDF_API bool GetNoLoadHint(void) const
Get whether loading the target of this relationship is necessary to load the prim we're attached to.
SDF_API void ClearTargetPathList() const
Clears the list of target paths on this relationship.
SDF_API void ReplaceTargetPath(const SdfPath &oldPath, const SdfPath &newPath)
Updates the specified target path.
SDF_API SdfTargetsProxy GetTargetPathList() const
Returns the relationship's target path list editor.
static SDF_API SdfRelationshipSpecHandle New(const SdfPrimSpecHandle &owner, const std::string &name, bool custom=true, SdfVariability variability=SdfVariabilityUniform)
Creates a new prim relationship instance.
SDF_API bool HasTargetPathList() const
Returns true if the relationship has any target paths.
SDF_API void SetNoLoadHint(bool noload)
Set whether loading the target of this relationship is necessary to load the prim we're attached to.
SDF_API void RemoveTargetPath(const SdfPath &path, bool preserveTargetOrder=false)
Removes the specified target path.
SDF_API SdfRelationshipSpecHandle SdfCreateRelationshipInLayer(const SdfLayerHandle &layer, const SdfPath &relPath, SdfVariability variability=SdfVariabilityVarying, bool isCustom=false)
Convenience function to create a relationshipSpec on a primSpec at the given path,...
SDF_API bool SdfJustCreateRelationshipInLayer(const SdfLayerHandle &layer, const SdfPath &relPath, SdfVariability variability=SdfVariabilityVarying, bool isCustom=false)
Convenience function to create a relationshipSpec on a primSpec at the given path,...
Basic Sdf data types.
SdfVariability
An enum that identifies variability types for attributes.
Definition: types.h:156