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 |
bool | UpdateCollection (UsdCollectionAPI const &collection) |
size_t | RemoveCollection (UsdStageWeakPtr const &stage, SdfPath const &path) |
Returns the hash of the removed collection, or 0 if no collection existed. More... | |
TfToken | GetIdForCollection (UsdCollectionAPI const &collection) |
Return the cached entry for the given collection. More... | |
VtArray< TfToken > | ComputeCollectionsContainingPath (SdfPath const &path) const |
Return a list of identifiers of all collections that contain. More... | |
SdfPathSet const & | GetDirtyPaths () const |
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 58 of file collectionCache.h.
Query is the MembershipQuery computed from a collection's state.
Definition at line 65 of file collectionCache.h.
|
default |
|
delete |
void UsdImaging_CollectionCache::ClearDirtyPaths | ( | ) |
Clears the internal dirty flags.
VtArray<TfToken> UsdImaging_CollectionCache::ComputeCollectionsContainingPath | ( | SdfPath const & | path | ) | const |
Return a list of identifiers of all collections that contain.
SdfPathSet const& UsdImaging_CollectionCache::GetDirtyPaths | ( | ) | const |
Returns a set of dirty paths Should only be used if AreAllPathsDirty returned false
TfToken UsdImaging_CollectionCache::GetIdForCollection | ( | UsdCollectionAPI const & | collection | ) |
Return the cached entry for the given collection.
|
delete |
size_t UsdImaging_CollectionCache::RemoveCollection | ( | UsdStageWeakPtr const & | stage, |
SdfPath const & | path | ||
) |
Returns the hash of the removed collection, or 0 if no collection existed.
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