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
110 void SetGraph(
const PcpPrimIndex_GraphRefPtr& graph) {
114 const PcpPrimIndex_GraphRefPtr &GetGraph()
const {
161 PcpNodeRange
GetNodeRange(PcpRangeType rangeType = PcpRangeTypeAll)
const;
173 PcpPrimRange
GetPrimRange(PcpRangeType rangeType = PcpRangeTypeAll)
const;
195 const SdfLayerHandle& layer,
const SdfPath& path)
const;
204 return _localErrors ? *_localErrors.get() : PcpErrorVector();
219 bool includeInheritOriginInfo =
true,
220 bool includeMaps =
true)
const;
226 const std::string& filename,
227 bool includeInheritOriginInfo =
true,
228 bool includeMaps =
false)
const;
264 const std::string &variantSet)
const;
270 friend struct Pcp_PrimIndexer;
272 bool updateHasSpecs);
275 PcpPrimIndex_GraphRefPtr _graph;
279 Pcp_CompressedSdSiteVector _primStack;
283 std::unique_ptr<PcpErrorVector> _localErrors;
301 IncludedByIncludeSet, ExcludedByIncludeSet,
302 IncludedByPredicate, ExcludedByPredicate };
331 const PcpArc& arcToParent,
332 PcpErrorBasePtr *error);
343 , variantFallbacks(
nullptr)
344 , includedPayloads(
nullptr)
345 , includedPayloadsMutex(
nullptr)
346 , parentIndex(
nullptr)
358 { cache = cache_;
return *
this; }
363 { variantFallbacks = map;
return *
this; }
367 using PayloadSet = std::unordered_set<SdfPath, SdfPath::Hash>;
369 { includedPayloads = payloadSet;
return *
this; }
373 { includedPayloadsMutex = mutex;
return *
this; }
380 std::function<
bool (
const SdfPath &)> predicate)
381 { includePayloadPredicate = predicate;
return *
this; }
386 { cull = doCulling;
return *
this; }
392 { usd = doUSD;
return *
this; }
397 { fileFormatTarget = target;
return *
this; }
403 tbb::spin_rw_mutex *includedPayloadsMutex;
404 std::function<bool (
const SdfPath &)> includePayloadPredicate;
406 std::string fileFormatTarget;
417 const PcpLayerStackPtr& layerStack,
425 PcpIsNewDefaultStandinBehaviorEnabled();
437 Pcp_NeedToRecomputeDueToAssetPathChange(
const PcpPrimIndex& index);
439 PXR_NAMESPACE_CLOSE_SCOPE
441 #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.
PCP_API PcpNodeIterator GetNodeIteratorAtNode(const PcpNodeRef &node) const
Returns the node iterator that points to the given node if the node is in the prim index graph.
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...
Object used to iterate over nodes in the prim index graph in strong-to-weak order.
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.
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.
Implementation of a hash set using open-addressing and the robin hood hashing algorithm with backward...
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.