All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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/node.h"
57 #include "pxr/usd/sdf/path.h"
58 #include "pxr/usd/sdf/payload.h"
59 #include "pxr/usd/sdf/reference.h"
60 #include "pxr/usd/sdf/types.h"
61 #include "pxr/usd/sdf/site.h"
62 
63 #include <set>
64 #include <vector>
65 
66 PXR_NAMESPACE_OPEN_SCOPE
67 
69 
70 class PcpLayerStackSite;
71 
79  SdfLayerHandle layer;
80  SdfLayerOffset layerOffset;
81  std::string authoredAssetPath;
82 };
83 
85 typedef std::vector<PcpSourceArcInfo> PcpSourceArcInfoVector;
86 
88 PCP_API
89 void
90 PcpComposeSiteReferences(PcpLayerStackRefPtr const &layerStack,
91  SdfPath const &path,
92  SdfReferenceVector *result,
94 inline void
96  SdfReferenceVector *result,
98 {
99  return PcpComposeSiteReferences(node.GetLayerStack(), node.GetPath(),
100  result, info);
101 }
102 
104 PCP_API
105 void
106 PcpComposeSitePayloads(PcpLayerStackRefPtr const &layerStack,
107  SdfPath const &path,
108  SdfPayloadVector *result,
109  PcpSourceArcInfoVector *info);
110 inline void
112  SdfPayloadVector *result,
114 {
115  return PcpComposeSitePayloads(node.GetLayerStack(), node.GetPath(),
116  result, info);
117 }
118 
120 PCP_API
122 PcpComposeSitePermission(PcpLayerStackRefPtr const &layerStack,
123  SdfPath const &path);
124 
125 inline SdfPermission
127 {
128  return PcpComposeSitePermission(node.GetLayerStack(), node.GetPath());
129 }
130 
132 PCP_API
133 void
134 PcpComposeSitePrimSites(PcpLayerStackRefPtr const &layerStack,
135  SdfPath const &path,
136  SdfSiteVector *result);
137 
138 inline void
139 PcpComposeSitePrimSites(PcpNodeRef const &node, SdfSiteVector *result)
140 {
142  node.GetLayerStack(), node.GetPath(), result);
143 }
144 
146 PCP_API
147 void
148 PcpComposeSiteRelocates(PcpLayerStackRefPtr const &layerStack,
149  SdfPath const &path,
150  SdfRelocatesMap *result);
151 
152 inline void
154 {
156  node.GetLayerStack(), node.GetPath(), result);
157 }
158 
160 PCP_API
161 bool
162 PcpComposeSiteHasPrimSpecs(PcpLayerStackRefPtr const &layerStack,
163  SdfPath const &path);
164 inline bool
166 {
167  return PcpComposeSiteHasPrimSpecs(node.GetLayerStack(), node.GetPath());
168 }
169 
171 PCP_API
172 bool
173 PcpComposeSiteHasSymmetry(PcpLayerStackRefPtr const &layerStack,
174  SdfPath const &path);
175 inline bool
177 {
178  return PcpComposeSiteHasSymmetry(node.GetLayerStack(), node.GetPath());
179 }
180 
182 PCP_API
183 void
184 PcpComposeSiteInherits(PcpLayerStackRefPtr const &layerStack,
185  SdfPath const &path, SdfPathVector *result,
186  PcpSourceArcInfoVector *info);
187 
188 PCP_API
189 void
190 PcpComposeSiteInherits(PcpLayerStackRefPtr const &layerStack,
191  SdfPath const &path, SdfPathVector *result);
192 
193 inline void
194 PcpComposeSiteInherits(PcpNodeRef const &node, SdfPathVector *result)
195 {
196  return PcpComposeSiteInherits(node.GetLayerStack(), node.GetPath(), result);
197 }
198 
200 PCP_API
201 void
202 PcpComposeSiteSpecializes(PcpLayerStackRefPtr const &layerStack,
203  SdfPath const &path, SdfPathVector *result,
204  PcpSourceArcInfoVector *info);
205 
206 PCP_API
207 void
208 PcpComposeSiteSpecializes(PcpLayerStackRefPtr const &layerStack,
209  SdfPath const &path, SdfPathVector *result);
210 
211 inline void
212 PcpComposeSiteSpecializes(PcpNodeRef const &node, SdfPathVector *result)
213 {
215  node.GetLayerStack(), node.GetPath(), result);
216 }
217 
219 PCP_API
220 void
221 PcpComposeSiteVariantSets(PcpLayerStackRefPtr const &layerStack,
222  SdfPath const &path,
223  std::vector<std::string> *result,
224  PcpSourceArcInfoVector *info);
225 
226 PCP_API
227 void
228 PcpComposeSiteVariantSets(PcpLayerStackRefPtr const &layerStack,
229  SdfPath const &path,
230  std::vector<std::string> *result);
231 inline void
233  std::vector<std::string> *result) {
235  node.GetLayerStack(), node.GetPath(), result);
236 }
237 
239 PCP_API
240 void
241 PcpComposeSiteVariantSetOptions(PcpLayerStackRefPtr const &layerStack,
242  SdfPath const &path,
243  std::string const &vsetName,
244  std::set<std::string> *result);
245 inline void
247  std::string const &vsetName,
248  std::set<std::string> *result)
249 {
251  node.GetLayerStack(), node.GetPath(), vsetName, result);
252 }
253 
255 PCP_API
256 bool
257 PcpComposeSiteVariantSelection(PcpLayerStackRefPtr const &layerStack,
258  SdfPath const &path,
259  std::string const &vsetName,
260  std::string *result);
261 inline bool
263  std::string const &vsetName,
264  std::string *result)
265 {
267  vsetName, result);
268 }
269 
271 PCP_API
272 void
273 PcpComposeSiteVariantSelections(PcpLayerStackRefPtr const &layerStack,
274  SdfPath const &path,
275  SdfVariantSelectionMap *result);
276 inline void
278  SdfVariantSelectionMap *result)
279 {
281  result);
282 }
283 
286 PCP_API
287 void
288 PcpComposeSiteChildNames(SdfLayerRefPtrVector const &layers,
289  SdfPath const &path,
290  const TfToken & namesField,
291  TfTokenVector *nameOrder,
292  PcpTokenSet *nameSet,
293  const TfToken *orderField = nullptr);
294 
295 PXR_NAMESPACE_CLOSE_SCOPE
296 
297 #endif // PXR_USD_PCP_COMPOSE_SITE_H
PCP_API bool PcpComposeSiteVariantSelection(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, std::string const &vsetName, std::string *result)
VariantSelection.
A site specifies a path in a layer stack of scene description.
Definition: site.h:117
std::map< SdfPath, SdfPath > SdfRelocatesMap
A map of source SdfPaths to target SdfPaths for relocation.
Definition: types.h:293
Represents a stack of layers that contribute opinions to composition.
Definition: layerStack.h:65
PCP_API const PcpLayerStackRefPtr & GetLayerStack() const
Returns the layer stack for the site this node represents.
PcpNode represents a node in an expression tree for compositing scene description.
Definition: node.h:67
std::map< std::string, std::string > SdfVariantSelectionMap
A map of reference variant set names to variants in those sets.
Definition: types.h:284
PCP_API void PcpComposeSiteChildNames(SdfLayerRefPtrVector const &layers, SdfPath const &path, const TfToken &namesField, TfTokenVector *nameOrder, PcpTokenSet *nameSet, const TfToken *orderField=nullptr)
Compose child names.
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Definition: declarePtrs.h:89
PCP_API void PcpComposeSiteReferences(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, SdfReferenceVector *result, PcpSourceArcInfoVector *info)
References.
Basic Sdf data types.
PCP_API bool PcpComposeSiteHasSymmetry(PcpLayerStackRefPtr const &layerStack, SdfPath const &path)
Symmetry.
PCP_API void PcpComposeSiteInherits(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, SdfPathVector *result, PcpSourceArcInfoVector *info)
Inherits.
PCP_API void PcpComposeSiteSpecializes(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, SdfPathVector *result, PcpSourceArcInfoVector *info)
Specializes.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:87
PCP_API void PcpComposeSitePrimSites(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, SdfSiteVector *result)
Prim sites.
PCP_API void PcpComposeSiteVariantSelections(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, SdfVariantSelectionMap *result)
VariantSelections.
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:442
std::vector< PcpSourceArcInfo > PcpSourceArcInfoVector
A vector of reference or payload arc information.
Definition: composeSite.h:85
PCP_API void PcpComposeSiteVariantSetOptions(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, std::string const &vsetName, std::set< std::string > *result)
VariantSetOptions.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:288
Information about the source of the target of an arc.
Definition: composeSite.h:78
PCP_API void PcpComposeSitePayloads(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, SdfPayloadVector *result, PcpSourceArcInfoVector *info)
Payloads.
PCP_API void PcpComposeSiteVariantSets(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, std::vector< std::string > *result, PcpSourceArcInfoVector *info)
VariantSets.
PCP_API bool PcpComposeSiteHasPrimSpecs(PcpLayerStackRefPtr const &layerStack, SdfPath const &path)
Has prim specs.
PCP_API void PcpComposeSiteRelocates(PcpLayerStackRefPtr const &layerStack, SdfPath const &path, SdfRelocatesMap *result)
Relocates.
This is a space efficient container that mimics the TfHashSet API that uses a vector for storage when...
Definition: denseHashSet.h:58
Represents a time offset and scale between layers.
Definition: layerOffset.h:61
PCP_API const SdfPath & GetPath() const
Returns the path for the site this node represents.
PCP_API SdfPermission PcpComposeSitePermission(PcpLayerStackRefPtr const &layerStack, SdfPath const &path)
Permission.
SdfPermission
An enum that defines permission levels.
Definition: types.h:155