7#ifndef PXR_USDSEMANTICS_LABELSQUERY_H
8#define PXR_USDSEMANTICS_LABELSQUERY_H
13#include "pxr/usd/usd/timeCode.h"
17#include <shared_mutex>
19#include <unordered_map>
23PXR_NAMESPACE_OPEN_SCOPE
99 const std::variant<GfInterval, UsdTimeCode>&
GetTime() const & {
103 std::variant<GfInterval, UsdTimeCode>
GetTime() && {
104 return std::move(_time); }
114 bool _PopulateLabels(
const UsdPrim& prim)
const;
117 bool _PopulateInheritedLabels(
const UsdPrim& prim)
const;
120 std::variant<GfInterval, UsdTimeCode> _time;
122 mutable std::shared_mutex _cachedLabelsMutex;
123 using _UnorderedTokenSet = std::unordered_set<TfToken, TfHash>;
124 mutable std::unordered_map<SdfPath, _UnorderedTokenSet, TfHash> _cachedLabels;
127PXR_NAMESPACE_CLOSE_SCOPE
A basic mathematical interval class.
Token for efficient comparison, assignment, and hashing of known strings.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
The UsdSemanticsLabelsQuery can be used to query a prim's labels for a specified taxonomy and time fr...
TfToken GetTaxonomy() &&
Returns the taxonomy used by this query when computing a prim's labels.
USDSEMANTICS_API VtTokenArray ComputeUniqueInheritedLabels(const UsdPrim &prim) const
Computes the values for semantics:labels:<taxonomy> including any labels inherited from ancestors.
USDSEMANTICS_API UsdSemanticsLabelsQuery(const TfToken &taxonomy, const GfInterval &interval)
Construct a query for a taxonomy over an interval.
const std::variant< GfInterval, UsdTimeCode > & GetTime() const &
Returns the time used by this query when computing a prim's labels.
USDSEMANTICS_API bool HasDirectLabel(const UsdPrim &prim, const TfToken &label) const
Return true if a label has been specified directly on this prim for this query's taxonomy and time.
USDSEMANTICS_API UsdSemanticsLabelsQuery(const TfToken &taxonomy, UsdTimeCode timeCode)
Constructs a query for a taxonomy at a single timeCode.
std::variant< GfInterval, UsdTimeCode > GetTime() &&
Returns the time used by this query when computing a prim's labels.
USDSEMANTICS_API bool HasInheritedLabel(const UsdPrim &prim, const TfToken &label) const
Return true if a label has been specified for a prim or its ancestors for this query's taxonomy and t...
USDSEMANTICS_API VtTokenArray ComputeUniqueDirectLabels(const UsdPrim &prim) const
Computes the values for semantics:labels:<taxonomy> directly applied to this prim.
const TfToken & GetTaxonomy() const &
Returns the taxonomy used by this query when computing a prim's labels.
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...