Loading...
Searching...
No Matches
composeSite.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_PCP_COMPOSE_SITE_H
8#define PXR_USD_PCP_COMPOSE_SITE_H
9
35
36#include "pxr/pxr.h"
37#include "pxr/usd/pcp/api.h"
38#include "pxr/usd/pcp/errors.h"
39#include "pxr/usd/pcp/node.h"
41#include "pxr/usd/sdf/path.h"
42#include "pxr/usd/sdf/payload.h"
44#include "pxr/usd/sdf/types.h"
45#include "pxr/usd/sdf/site.h"
46
47#include <set>
48#include <string>
49#include <unordered_set>
50#include <vector>
51
52PXR_NAMESPACE_OPEN_SCOPE
53
55
57
64struct PcpArcInfo {
65 SdfLayerHandle sourceLayer;
66 SdfLayerOffset sourceLayerStackOffset;
67 std::string authoredAssetPath;
68 int arcNum;
69};
70
72typedef std::vector<PcpArcInfo> PcpArcInfoVector;
73
75PCP_API
76void
78 PcpLayerStackRefPtr const &layerStack,
79 SdfPath const &path,
80 SdfReferenceVector *result,
81 PcpArcInfoVector *info,
82 std::unordered_set<std::string> *exprVarDependencies,
83 PcpErrorVector *errors);
84
85inline void
87 PcpLayerStackRefPtr const &layerStack,
88 SdfPath const &path,
89 SdfReferenceVector *result,
90 PcpArcInfoVector *info)
91{
93 layerStack, path, result, info, nullptr , nullptr);
94}
95
96inline void
98 PcpNodeRef const &node,
99 SdfReferenceVector *result,
100 PcpArcInfoVector *info,
101 std::unordered_set<std::string> *exprVarDependencies,
102 PcpErrorVector *errors)
103{
105 node.GetLayerStack(), node.GetPath(),
106 result, info, exprVarDependencies, errors);
107}
108
109inline void
111 PcpNodeRef const &node,
112 SdfReferenceVector *result,
113 PcpArcInfoVector *info)
114{
116 node.GetLayerStack(), node.GetPath(), result, info, nullptr, nullptr);
117}
118
120PCP_API
121void
123 PcpLayerStackRefPtr const &layerStack,
124 SdfPath const &path,
125 SdfPayloadVector *result,
126 PcpArcInfoVector *info,
127 std::unordered_set<std::string> *exprVarDependencies,
128 PcpErrorVector *errors);
129
130inline void
132 PcpLayerStackRefPtr const &layerStack,
133 SdfPath const &path,
134 SdfPayloadVector *result,
135 PcpArcInfoVector *info)
136{
138 layerStack, path, result, info, nullptr, nullptr);
139}
140
141inline void
143 PcpNodeRef const &node,
144 SdfPayloadVector *result,
145 PcpArcInfoVector *info,
146 std::unordered_set<std::string> *exprVarDependencies,
147 PcpErrorVector *errors)
148{
150 node.GetLayerStack(), node.GetPath(),
151 result, info, exprVarDependencies, errors);
152}
153
154inline void
156 PcpNodeRef const &node,
157 SdfPayloadVector *result,
158 PcpArcInfoVector *info)
159{
161 node.GetLayerStack(), node.GetPath(), result, info, nullptr, nullptr);
162}
163
165PCP_API
167PcpComposeSitePermission(PcpLayerStackRefPtr const &layerStack,
168 SdfPath const &path);
169
170inline SdfPermission
172{
173 return PcpComposeSitePermission(node.GetLayerStack(), node.GetPath());
174}
175
177PCP_API
178void
179PcpComposeSitePrimSites(PcpLayerStackRefPtr const &layerStack,
180 SdfPath const &path,
181 SdfSiteVector *result);
182
183inline void
184PcpComposeSitePrimSites(PcpNodeRef const &node, SdfSiteVector *result)
185{
187 node.GetLayerStack(), node.GetPath(), result);
188}
189
191PCP_API
192void
193PcpComposeSiteRelocates(PcpLayerStackRefPtr const &layerStack,
194 SdfPath const &path,
195 SdfRelocatesMap *result);
196
197inline void
199{
201 node.GetLayerStack(), node.GetPath(), result);
202}
203
205PCP_API
206bool
207PcpComposeSiteHasPrimSpecs(PcpLayerStackRefPtr const &layerStack,
208 SdfPath const &path,
209 const std::unordered_set<SdfLayerHandle, TfHash>&
210 layersToIgnore);
211
212PCP_API
213bool
214PcpComposeSiteHasPrimSpecs(PcpLayerStackRefPtr const &layerStack,
215 SdfPath const &path);
216
217inline bool
219{
220 return PcpComposeSiteHasPrimSpecs(node.GetLayerStack(), node.GetPath());
221}
222
224PCP_API
225bool
226PcpComposeSiteHasSymmetry(PcpLayerStackRefPtr const &layerStack,
227 SdfPath const &path);
228inline bool
230{
231 return PcpComposeSiteHasSymmetry(node.GetLayerStack(), node.GetPath());
232}
233
235PCP_API
236bool
237PcpComposeSiteHasValueClips(PcpLayerStackRefPtr const &layerStack,
238 SdfPath const &path);
239PCP_API
240inline bool
242{
244}
245
247PCP_API
248void
249PcpComposeSiteInherits(PcpLayerStackRefPtr const &layerStack,
250 SdfPath const &path, SdfPathVector *result,
251 PcpArcInfoVector *info);
252
253PCP_API
254void
255PcpComposeSiteInherits(PcpLayerStackRefPtr const &layerStack,
256 SdfPath const &path, SdfPathVector *result);
257
258inline void
259PcpComposeSiteInherits(PcpNodeRef const &node, SdfPathVector *result)
260{
261 return PcpComposeSiteInherits(node.GetLayerStack(), node.GetPath(), result);
262}
263
265PCP_API
266void
267PcpComposeSiteSpecializes(PcpLayerStackRefPtr const &layerStack,
268 SdfPath const &path, SdfPathVector *result,
269 PcpArcInfoVector *info);
270
271PCP_API
272void
273PcpComposeSiteSpecializes(PcpLayerStackRefPtr const &layerStack,
274 SdfPath const &path, SdfPathVector *result);
275
276inline void
277PcpComposeSiteSpecializes(PcpNodeRef const &node, SdfPathVector *result)
278{
280 node.GetLayerStack(), node.GetPath(), result);
281}
282
284PCP_API
285void
286PcpComposeSiteVariantSets(PcpLayerStackRefPtr const &layerStack,
287 SdfPath const &path,
288 std::vector<std::string> *result,
289 PcpArcInfoVector *info);
290
291PCP_API
292void
293PcpComposeSiteVariantSets(PcpLayerStackRefPtr const &layerStack,
294 SdfPath const &path,
295 std::vector<std::string> *result);
296inline void
298 std::vector<std::string> *result) {
300 node.GetLayerStack(), node.GetPath(), result);
301}
302
304PCP_API
305void
306PcpComposeSiteVariantSetOptions(PcpLayerStackRefPtr const &layerStack,
307 SdfPath const &path,
308 std::string const &vsetName,
309 std::set<std::string> *result);
310inline void
312 std::string const &vsetName,
313 std::set<std::string> *result)
314{
316 node.GetLayerStack(), node.GetPath(), vsetName, result);
317}
318
320PCP_API
321bool
323 PcpLayerStackRefPtr const &layerStack,
324 SdfPath const &path,
325 std::string const &vsetName,
326 std::string *result,
327 std::unordered_set<std::string> *exprVarDependencies,
328 PcpErrorVector *errors);
329
330inline bool
332 PcpLayerStackRefPtr const &layerStack,
333 SdfPath const &path,
334 std::string const &vsetName,
335 std::string *result)
336{
338 layerStack, path, vsetName, result, nullptr, nullptr);
339}
340
341inline bool
343 std::string const &vsetName,
344 std::string *result)
345{
347 node.GetLayerStack(), node.GetPath(), vsetName, result);
348}
349
351PCP_API
352void
354 PcpLayerStackRefPtr const &layerStack,
355 SdfPath const &path,
357 std::unordered_set<std::string> *exprVarDependencies,
358 PcpErrorVector *errors);
359
360inline void
362 PcpLayerStackRefPtr const &layerStack,
363 SdfPath const &path,
365{
367 layerStack, path, result, nullptr, nullptr);
368}
369
370inline void
373{
375 node.GetLayerStack(), node.GetPath(), result);
376}
377
378PCP_API
379bool
380PcpComposeSiteHasVariantSelections(
381 PcpLayerStackRefPtr const &layerStack,
382 SdfPath const &path);
383
386PCP_API
387void
388PcpComposeSiteChildNames(SdfLayerRefPtrVector const &layers,
389 SdfPath const &path,
390 const TfToken & namesField,
391 TfTokenVector *nameOrder,
392 PcpTokenSet *nameSet,
393 const TfToken *orderField = nullptr);
394
395PXR_NAMESPACE_CLOSE_SCOPE
396
397#endif // PXR_USD_PCP_COMPOSE_SITE_H
Represents a stack of layers that contribute opinions to composition.
Definition: layerStack.h:50
A site specifies a path in a layer stack of scene description.
Definition: site.h:79
PcpNode represents a node in an expression tree for compositing scene description.
Definition: node.h:47
PCP_API const SdfPath & GetPath() const
Returns the path for the site this node represents.
PCP_API const PcpLayerStackRefPtr & GetLayerStack() const
Returns the layer stack for the site this node represents.
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
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
Implementation of a hash set using open-addressing and the robin hood hashing algorithm with backward...
Definition: robin_set.h:95
PCP_API void PcpComposeSitePrimSites(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, SdfSiteVector *result)
Prim sites.
PCP_API bool PcpComposeSiteHasValueClips(PcpLayerStackRefPtr const &layerStack, SdfPath const &path)
Value clips.
PCP_API void PcpComposeSiteVariantSetOptions(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, std::string const &vsetName, std::set< std::string > *result)
VariantSetOptions.
std::vector< PcpArcInfo > PcpArcInfoVector
A vector of reference or payload arc information.
Definition: composeSite.h:72
PCP_API void PcpComposeSiteVariantSelections(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, SdfVariantSelectionMap *result, std::unordered_set< std::string > *exprVarDependencies, PcpErrorVector *errors)
VariantSelections.
PCP_API void PcpComposeSiteReferences(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, SdfReferenceVector *result, PcpArcInfoVector *info, std::unordered_set< std::string > *exprVarDependencies, PcpErrorVector *errors)
References.
PCP_API void PcpComposeSiteChildNames(SdfLayerRefPtrVector const &layers, SdfPath const &path, const TfToken &namesField, TfTokenVector *nameOrder, PcpTokenSet *nameSet, const TfToken *orderField=nullptr)
Compose child names.
PCP_API bool PcpComposeSiteHasPrimSpecs(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, const std::unordered_set< SdfLayerHandle, TfHash > &layersToIgnore)
Has prim specs.
PCP_API bool PcpComposeSiteVariantSelection(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, std::string const &vsetName, std::string *result, std::unordered_set< std::string > *exprVarDependencies, PcpErrorVector *errors)
VariantSelection.
PCP_API void PcpComposeSitePayloads(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, SdfPayloadVector *result, PcpArcInfoVector *info, std::unordered_set< std::string > *exprVarDependencies, PcpErrorVector *errors)
Payloads.
PCP_API void PcpComposeSiteVariantSets(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, std::vector< std::string > *result, PcpArcInfoVector *info)
VariantSets.
PCP_API SdfPermission PcpComposeSitePermission(PcpLayerStackRefPtr const &layerStack, SdfPath const &path)
Permission.
PCP_API void PcpComposeSiteRelocates(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, SdfRelocatesMap *result)
Relocates.
PCP_API void PcpComposeSiteInherits(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, SdfPathVector *result, PcpArcInfoVector *info)
Inherits.
PCP_API void PcpComposeSiteSpecializes(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, SdfPathVector *result, PcpArcInfoVector *info)
Specializes.
PCP_API bool PcpComposeSiteHasSymmetry(PcpLayerStackRefPtr const &layerStack, SdfPath const &path)
Symmetry.
Helper information about an arc.
Definition: composeSite.h:64
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Definition: declarePtrs.h:72
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
Basic Sdf data types.
std::map< std::string, std::string > SdfVariantSelectionMap
A map of reference variant set names to variants in those sets.
Definition: types.h:258
SdfPermission
An enum that defines permission levels.
Definition: types.h:132
std::map< SdfPath, SdfPath > SdfRelocatesMap
A map of source SdfPaths to target SdfPaths for relocation.
Definition: types.h:267