24 #ifndef PXR_USD_PCP_PRIM_INDEX_H 25 #define PXR_USD_PCP_PRIM_INDEX_H 28 #include "pxr/usd/pcp/api.h" 30 #include "pxr/usd/pcp/dependency.h" 31 #include "pxr/usd/pcp/dynamicFileFormatDependencyData.h" 32 #include "pxr/usd/pcp/errors.h" 33 #include "pxr/usd/pcp/iterator.h" 34 #include "pxr/usd/pcp/node.h" 37 #include "pxr/usd/sdf/site.h" 39 #include "pxr/base/tf/hashmap.h" 40 #include "pxr/base/tf/hashset.h" 42 #include <tbb/spin_rw_mutex.h> 47 #include <unordered_set> 49 PXR_NAMESPACE_OPEN_SCOPE
105 void SetGraph(
const PcpPrimIndex_GraphRefPtr& graph);
107 PcpPrimIndex_GraphPtr GetGraph()
const;
152 PcpNodeRange
GetNodeRange(PcpRangeType rangeType = PcpRangeTypeAll)
const;
157 PcpPrimRange
GetPrimRange(PcpRangeType rangeType = PcpRangeTypeAll)
const;
179 const SdfLayerHandle& layer,
const SdfPath& path)
const;
188 return _localErrors ? *_localErrors.get() : PcpErrorVector();
203 bool includeInheritOriginInfo =
true,
204 bool includeMaps =
true)
const;
210 const std::string& filename,
211 bool includeInheritOriginInfo =
true,
212 bool includeMaps =
false)
const;
248 const std::string &variantSet)
const;
254 friend struct Pcp_PrimIndexer;
256 bool updateHasSpecs);
259 PcpPrimIndex_GraphRefPtr _graph;
263 Pcp_CompressedSdSiteVector _primStack;
267 std::unique_ptr<PcpErrorVector> _localErrors;
285 IncludedByIncludeSet, ExcludedByIncludeSet,
286 IncludedByPredicate, ExcludedByPredicate };
324 const PcpArc& arcToParent,
325 PcpErrorBasePtr *error);
339 , variantFallbacks(
nullptr)
340 , includedPayloads(
nullptr)
341 , includedPayloadsMutex(
nullptr)
342 , parentIndex(
nullptr)
354 { cache = cache_;
return *
this; }
359 { variantFallbacks = map;
return *
this; }
363 using PayloadSet = std::unordered_set<SdfPath, SdfPath::Hash>;
365 { includedPayloads = payloadSet;
return *
this; }
369 { includedPayloadsMutex = mutex;
return *
this; }
376 std::function<
bool (
const SdfPath &)> predicate)
377 { includePayloadPredicate = predicate;
return *
this; }
382 { cull = doCulling;
return *
this; }
388 { usd = doUSD;
return *
this; }
393 { fileFormatTarget = target;
return *
this; }
399 tbb::spin_rw_mutex *includedPayloadsMutex;
400 std::function<bool (
const SdfPath &)> includePayloadPredicate;
402 std::string fileFormatTarget;
413 const PcpLayerStackPtr& layerStack,
421 PcpIsNewDefaultStandinBehaviorEnabled();
433 Pcp_NeedToRecomputeDueToAssetPathChange(
const PcpPrimIndex& index);
435 PXR_NAMESPACE_CLOSE_SCOPE
437 #endif // PXR_USD_PCP_PRIM_INDEX_H void swap(ArAssetInfo &lhs, ArAssetInfo &rhs)
Represents an arc connecting two nodes in the prim index.
PCP_API PcpNodeRef GetRootNode() const
Returns the root node of the prim index graph.
A scene description container that can combine with other such containers to form simple component as...
PCP_API void ComputePrimChildNames(TfTokenVector *nameOrder, PcpTokenSet *prohibitedNameSet) const
Compute the prim child names for the given path.
PCP_API PcpPrimRange GetPrimRangeForNode(const PcpNodeRef &node) const
Returns range of iterators that encompasses all prims from the site of node.
PCP_API void Swap(PcpPrimIndex &rhs)
Swap the contents of this prim index with index.
void swap(PcpPrimIndex &rhs)
Same as Swap(), but standard name.
Outputs of the prim indexing procedure.
PcpPrimIndex is an index of the all sites of scene description that contribute opinions to a specific...
PcpPrimIndex primIndex
Prim index describing the composition structure for the associated prim.
Standard pointer typedefs.
Represents a stack of layers that contribute opinions to composition.
PcpNode represents a node in an expression tree for compositing scene description.
PCP_API PcpPrimIndex()
Default construct an empty, invalid prim index.
PcpCache is the context required to make requests of the Pcp composition algorithm and cache the resu...
std::map< std::string, std::string > SdfVariantSelectionMap
A map of reference variant set names to variants in those sets.
std::vector< PcpCulledDependency > culledDependencies
Site dependencies from nodes in the prim index that have been culled.
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
PCP_API bool IsInstanceable() const
Returns true if this prim index is instanceable.
PcpErrorVector GetLocalErrors() const
Return the list of errors local to this prim.
PCP_API PcpNodeRange GetNodeRange(PcpRangeType rangeType=PcpRangeTypeAll) const
Returns range of iterators that encompass all children of the root node with the given arc type as we...
PcpNodeRef Append(PcpPrimIndexOutputs &&childOutputs, const PcpArc &arcToParent, PcpErrorBasePtr *error)
Appends the outputs from childOutputs to this object, using arcToParent to connect childOutputs' prim...
void swap(UsdStageLoadRules &l, UsdStageLoadRules &r)
Swap the contents of rules l and r.
PcpPrimIndex & operator=(const PcpPrimIndex &rhs)
Assignment.
PCP_API SdfVariantSelectionMap ComposeAuthoredVariantSelections() const
Compose the authored prim variant selections.
PCP_API bool IsUsd() const
Returns true if this prim index was composed in USD mode.
std::vector< TfToken > TfTokenVector
Convenience types.
PCP_API std::string GetSelectionAppliedForVariantSet(const std::string &variantSet) const
Return the variant selection applied for the named variant set.
PCP_API std::string DumpToString(bool includeInheritOriginInfo=true, bool includeMaps=true) const
Dump the prim index contents to a string.
PCP_API void PrintStatistics() const
Prints various statistics about this prim index.
A path value used to locate objects in layers or scenegraphs.
PCP_API PcpNodeRef GetNodeProvidingSpec(const SdfPrimSpecHandle &primSpec) const
Returns the node that brings opinions from primSpec into this prim index.
PCP_API void DumpToDotGraph(const std::string &filename, bool includeInheritOriginInfo=true, bool includeMaps=false) const
Dump the prim index in dot format to the file named filename.
Object used to iterate over prim specs in the prim index graph in strong-to-weak order.
PcpDynamicFileFormatDependencyData dynamicFileFormatDependency
A list of names of fields that were composed to generate dynamic file format arguments for a node in ...
PayloadState payloadState
Indicates the payload state of this index.
Represents a prim description in an SdfLayer object.
PCP_API const SdfPath & GetPath() const
Returns the path of the prim whose opinions are represented by this prim index.
PCP_API void ComputePrimPropertyNames(TfTokenVector *nameOrder) const
Compute the prim property names for the given path.
void swap(PcpPrimIndexOutputs &r)
Swap content with r.
PCP_API bool HasSpecs() const
Returns true if this prim index contains any scene description opinions.
bool IsValid() const
Return true if this index is valid.
PayloadState
Enumerator whose enumerants describe the payload state of this prim index.
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
PcpErrorVector allErrors
List of all errors encountered during indexing.
This is a space efficient container that mimics the TfHashSet API that uses a vector for storage when...
PCP_API PcpPrimRange GetPrimRange(PcpRangeType rangeType=PcpRangeTypeAll) const
Returns range of iterators that encompasses all prims, in strong-to-weak order.
std::map< std::string, std::vector< std::string > > PcpVariantFallbackMap
typedef std::map<std::string, std::vector<std::string>> PcpVariantFallbackMap
PCP_API bool HasAnyPayloads() const
Returns true if the prim has any authored payload arcs.
Interface for the asset resolution system.