HDK
|
#include <collectionCache.h>
Public Types | |
typedef UsdCollectionAPI::MembershipQuery | Query |
Query is the MembershipQuery computed from a collection's state. More... | |
Public Member Functions | |
UsdImaging_CollectionCache ()=default | |
UsdImaging_CollectionCache (const UsdImaging_CollectionCache &)=delete | |
UsdImaging_CollectionCache & | operator= (const UsdImaging_CollectionCache &)=delete |
USDIMAGING_API bool | UpdateCollection (UsdCollectionAPI const &collection) |
USDIMAGING_API size_t | RemoveCollection (UsdStageWeakPtr const &stage, SdfPath const &path) |
Returns the hash of the removed collection, or 0 if no collection existed. More... | |
USDIMAGING_API TfToken | GetIdForCollection (UsdCollectionAPI const &collection) |
Return the cached entry for the given collection. More... | |
USDIMAGING_API VtArray< TfToken > | ComputeCollectionsContainingPath (SdfPath const &path) const |
Return a list of identifiers of all collections that contain. More... | |
USDIMAGING_API SdfPathSet const & | GetDirtyPaths () const |
USDIMAGING_API void | ClearDirtyPaths () |
Clears the internal dirty flags. More... | |
UsdImaging_CollectionCache provides a cache of Usd collections discovered in the scene. It associates the collection paths (UsdCollectionAPI::GetCollectionPath) with the computed membership query (UsdCollectionAPI::ComputeMembershipQuery).
For efficiency, it groups collections into equivalence classes based on the computed query. Collections that yield equivalent queries are merged. Each unique query is assigned an identifier token.
This cache is used to track the collections used for linking UsdLux lights/shadows/filters to geometry.
As an optimization, the query that includes everything is treated as a special case and given the empty id, TfToken().
Definition at line 41 of file collectionCache.h.
Query is the MembershipQuery computed from a collection's state.
Definition at line 48 of file collectionCache.h.
|
default |
|
delete |
USDIMAGING_API void UsdImaging_CollectionCache::ClearDirtyPaths | ( | ) |
Clears the internal dirty flags.
USDIMAGING_API VtArray<TfToken> UsdImaging_CollectionCache::ComputeCollectionsContainingPath | ( | SdfPath const & | path | ) | const |
Return a list of identifiers of all collections that contain.
USDIMAGING_API SdfPathSet const& UsdImaging_CollectionCache::GetDirtyPaths | ( | ) | const |
Returns a set of dirty paths Should only be used if AreAllPathsDirty returned false
USDIMAGING_API TfToken UsdImaging_CollectionCache::GetIdForCollection | ( | UsdCollectionAPI const & | collection | ) |
Return the cached entry for the given collection.
|
delete |
USDIMAGING_API size_t UsdImaging_CollectionCache::RemoveCollection | ( | UsdStageWeakPtr const & | stage, |
SdfPath const & | path | ||
) |
Returns the hash of the removed collection, or 0 if no collection existed.
USDIMAGING_API bool UsdImaging_CollectionCache::UpdateCollection | ( | UsdCollectionAPI const & | collection | ) |
Computes the membership query from the current state of the given collection, and establishes a cache entry. If a prior entry existed for the collection at this path, it is removed first. Returns true for newly created collection or if the hash of the collection is different from the previous collection