Loading...
Searching...
No Matches
composeSite.h
Go to the documentation of this file.
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_PCP_COMPOSE_SITE_H
25#define PXR_USD_PCP_COMPOSE_SITE_H
26
52
53#include "pxr/pxr.h"
54#include "pxr/usd/pcp/api.h"
55#include "pxr/usd/pcp/errors.h"
56#include "pxr/usd/pcp/node.h"
58#include "pxr/usd/sdf/path.h"
59#include "pxr/usd/sdf/payload.h"
61#include "pxr/usd/sdf/types.h"
62#include "pxr/usd/sdf/site.h"
63
64#include <set>
65#include <string>
66#include <unordered_set>
67#include <vector>
68
69PXR_NAMESPACE_OPEN_SCOPE
70
72
74
82 SdfLayerHandle layer;
83 SdfLayerOffset layerStackOffset;
84 std::string authoredAssetPath;
85};
86
88typedef std::vector<PcpSourceArcInfo> PcpSourceArcInfoVector;
89
91PCP_API
92void
94 PcpLayerStackRefPtr const &layerStack,
95 SdfPath const &path,
96 SdfReferenceVector *result,
98 std::unordered_set<std::string> *exprVarDependencies,
99 PcpErrorVector *errors);
100
101inline void
103 PcpLayerStackRefPtr const &layerStack,
104 SdfPath const &path,
105 SdfReferenceVector *result,
107{
109 layerStack, path, result, info, nullptr , nullptr);
110}
111
112inline void
114 PcpNodeRef const &node,
115 SdfReferenceVector *result,
117 std::unordered_set<std::string> *exprVarDependencies,
118 PcpErrorVector *errors)
119{
121 node.GetLayerStack(), node.GetPath(),
122 result, info, exprVarDependencies, errors);
123}
124
125inline void
127 PcpNodeRef const &node,
128 SdfReferenceVector *result,
130{
132 node.GetLayerStack(), node.GetPath(), result, info, nullptr, nullptr);
133}
134
136PCP_API
137void
139 PcpLayerStackRefPtr const &layerStack,
140 SdfPath const &path,
141 SdfPayloadVector *result,
143 std::unordered_set<std::string> *exprVarDependencies,
144 PcpErrorVector *errors);
145
146inline void
148 PcpLayerStackRefPtr const &layerStack,
149 SdfPath const &path,
150 SdfPayloadVector *result,
152{
154 layerStack, path, result, info, nullptr, nullptr);
155}
156
157inline void
159 PcpNodeRef const &node,
160 SdfPayloadVector *result,
162 std::unordered_set<std::string> *exprVarDependencies,
163 PcpErrorVector *errors)
164{
166 node.GetLayerStack(), node.GetPath(),
167 result, info, exprVarDependencies, errors);
168}
169
170inline void
172 PcpNodeRef const &node,
173 SdfPayloadVector *result,
175{
177 node.GetLayerStack(), node.GetPath(), result, info, nullptr, nullptr);
178}
179
181PCP_API
183PcpComposeSitePermission(PcpLayerStackRefPtr const &layerStack,
184 SdfPath const &path);
185
186inline SdfPermission
188{
189 return PcpComposeSitePermission(node.GetLayerStack(), node.GetPath());
190}
191
193PCP_API
194void
195PcpComposeSitePrimSites(PcpLayerStackRefPtr const &layerStack,
196 SdfPath const &path,
197 SdfSiteVector *result);
198
199inline void
200PcpComposeSitePrimSites(PcpNodeRef const &node, SdfSiteVector *result)
201{
203 node.GetLayerStack(), node.GetPath(), result);
204}
205
207PCP_API
208void
209PcpComposeSiteRelocates(PcpLayerStackRefPtr const &layerStack,
210 SdfPath const &path,
211 SdfRelocatesMap *result);
212
213inline void
215{
217 node.GetLayerStack(), node.GetPath(), result);
218}
219
221PCP_API
222bool
223PcpComposeSiteHasPrimSpecs(PcpLayerStackRefPtr const &layerStack,
224 SdfPath const &path);
225inline bool
227{
228 return PcpComposeSiteHasPrimSpecs(node.GetLayerStack(), node.GetPath());
229}
230
232PCP_API
233bool
234PcpComposeSiteHasSymmetry(PcpLayerStackRefPtr const &layerStack,
235 SdfPath const &path);
236inline bool
238{
239 return PcpComposeSiteHasSymmetry(node.GetLayerStack(), node.GetPath());
240}
241
243PCP_API
244void
245PcpComposeSiteInherits(PcpLayerStackRefPtr const &layerStack,
246 SdfPath const &path, SdfPathVector *result,
248
249PCP_API
250void
251PcpComposeSiteInherits(PcpLayerStackRefPtr const &layerStack,
252 SdfPath const &path, SdfPathVector *result);
253
254inline void
255PcpComposeSiteInherits(PcpNodeRef const &node, SdfPathVector *result)
256{
257 return PcpComposeSiteInherits(node.GetLayerStack(), node.GetPath(), result);
258}
259
261PCP_API
262void
263PcpComposeSiteSpecializes(PcpLayerStackRefPtr const &layerStack,
264 SdfPath const &path, SdfPathVector *result,
266
267PCP_API
268void
269PcpComposeSiteSpecializes(PcpLayerStackRefPtr const &layerStack,
270 SdfPath const &path, SdfPathVector *result);
271
272inline void
273PcpComposeSiteSpecializes(PcpNodeRef const &node, SdfPathVector *result)
274{
276 node.GetLayerStack(), node.GetPath(), result);
277}
278
280PCP_API
281void
282PcpComposeSiteVariantSets(PcpLayerStackRefPtr const &layerStack,
283 SdfPath const &path,
284 std::vector<std::string> *result,
286
287PCP_API
288void
289PcpComposeSiteVariantSets(PcpLayerStackRefPtr const &layerStack,
290 SdfPath const &path,
291 std::vector<std::string> *result);
292inline void
294 std::vector<std::string> *result) {
296 node.GetLayerStack(), node.GetPath(), result);
297}
298
300PCP_API
301void
302PcpComposeSiteVariantSetOptions(PcpLayerStackRefPtr const &layerStack,
303 SdfPath const &path,
304 std::string const &vsetName,
305 std::set<std::string> *result);
306inline void
308 std::string const &vsetName,
309 std::set<std::string> *result)
310{
312 node.GetLayerStack(), node.GetPath(), vsetName, result);
313}
314
316PCP_API
317bool
319 PcpLayerStackRefPtr const &layerStack,
320 SdfPath const &path,
321 std::string const &vsetName,
322 std::string *result,
323 std::unordered_set<std::string> *exprVarDependencies,
324 PcpErrorVector *errors);
325
326inline bool
328 PcpLayerStackRefPtr const &layerStack,
329 SdfPath const &path,
330 std::string const &vsetName,
331 std::string *result)
332{
334 layerStack, path, vsetName, result, nullptr, nullptr);
335}
336
337inline bool
339 std::string const &vsetName,
340 std::string *result)
341{
343 node.GetLayerStack(), node.GetPath(), vsetName, result);
344}
345
347PCP_API
348void
350 PcpLayerStackRefPtr const &layerStack,
351 SdfPath const &path,
353 std::unordered_set<std::string> *exprVarDependencies,
354 PcpErrorVector *errors);
355
356inline void
358 PcpLayerStackRefPtr const &layerStack,
359 SdfPath const &path,
361{
363 layerStack, path, result, nullptr, nullptr);
364}
365
366inline void
369{
371 node.GetLayerStack(), node.GetPath(), result);
372}
373
374PCP_API
375bool
376PcpComposeSiteHasVariantSelections(
377 PcpLayerStackRefPtr const &layerStack,
378 SdfPath const &path);
379
382PCP_API
383void
384PcpComposeSiteChildNames(SdfLayerRefPtrVector const &layers,
385 SdfPath const &path,
386 const TfToken & namesField,
387 TfTokenVector *nameOrder,
388 PcpTokenSet *nameSet,
389 const TfToken *orderField = nullptr);
390
391PXR_NAMESPACE_CLOSE_SCOPE
392
393#endif // PXR_USD_PCP_COMPOSE_SITE_H
Represents a stack of layers that contribute opinions to composition.
Definition: layerStack.h:67
A site specifies a path in a layer stack of scene description.
Definition: site.h:96
PcpNode represents a node in an expression tree for compositing scene description.
Definition: node.h:64
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:61
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:290
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:88
Implementation of a hash set using open-addressing and the robin hood hashing algorithm with backward...
Definition: robin_set.h:95
PCP_API void PcpComposeSiteReferences(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, SdfReferenceVector *result, PcpSourceArcInfoVector *info, std::unordered_set< std::string > *exprVarDependencies, PcpErrorVector *errors)
References.
PCP_API void PcpComposeSitePrimSites(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, SdfSiteVector *result)
Prim sites.
PCP_API bool PcpComposeSiteHasPrimSpecs(PcpLayerStackRefPtr const &layerStack, SdfPath const &path)
Has prim specs.
PCP_API void PcpComposeSiteVariantSetOptions(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, std::string const &vsetName, std::set< std::string > *result)
VariantSetOptions.
PCP_API void PcpComposeSiteSpecializes(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, SdfPathVector *result, PcpSourceArcInfoVector *info)
Specializes.
PCP_API void PcpComposeSiteVariantSelections(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, SdfVariantSelectionMap *result, std::unordered_set< std::string > *exprVarDependencies, PcpErrorVector *errors)
VariantSelections.
PCP_API void PcpComposeSitePayloads(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, SdfPayloadVector *result, PcpSourceArcInfoVector *info, std::unordered_set< std::string > *exprVarDependencies, PcpErrorVector *errors)
Payloads.
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 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 SdfPermission PcpComposeSitePermission(PcpLayerStackRefPtr const &layerStack, SdfPath const &path)
Permission.
PCP_API void PcpComposeSiteInherits(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, SdfPathVector *result, PcpSourceArcInfoVector *info)
Inherits.
std::vector< PcpSourceArcInfo > PcpSourceArcInfoVector
A vector of reference or payload arc information.
Definition: composeSite.h:88
PCP_API void PcpComposeSiteRelocates(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, SdfRelocatesMap *result)
Relocates.
PCP_API bool PcpComposeSiteHasSymmetry(PcpLayerStackRefPtr const &layerStack, SdfPath const &path)
Symmetry.
PCP_API void PcpComposeSiteVariantSets(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, std::vector< std::string > *result, PcpSourceArcInfoVector *info)
VariantSets.
Information about the source of the target of an arc.
Definition: composeSite.h:81
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Definition: declarePtrs.h:89
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:457
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:275
SdfPermission
An enum that defines permission levels.
Definition: types.h:149
std::map< SdfPath, SdfPath > SdfRelocatesMap
A map of source SdfPaths to target SdfPaths for relocation.
Definition: types.h:284