Loading...
Searching...
No Matches
UsdSemanticsLabelsQuery Class Reference

The UsdSemanticsLabelsQuery can be used to query a prim's labels for a specified taxonomy and time from the UsdSemanticsLabelsAPI. More...

#include <labelsQuery.h>

Public Member Functions

 UsdSemanticsLabelsQuery (const UsdSemanticsLabelsQuery &)=delete
 
UsdSemanticsLabelsQueryoperator= (const UsdSemanticsLabelsQuery &)=delete
 
USDSEMANTICS_API UsdSemanticsLabelsQuery (const TfToken &taxonomy, UsdTimeCode timeCode)
 Constructs a query for a taxonomy at a single timeCode.
 
USDSEMANTICS_API UsdSemanticsLabelsQuery (const TfToken &taxonomy, const GfInterval &interval)
 Construct a query for a taxonomy over an interval.
 
USDSEMANTICS_API VtTokenArray ComputeUniqueDirectLabels (const UsdPrim &prim) const
 Computes the values for semantics:labels:<taxonomy> directly applied to this prim.
 
USDSEMANTICS_API VtTokenArray ComputeUniqueInheritedLabels (const UsdPrim &prim) const
 Computes the values for semantics:labels:<taxonomy> including any labels inherited from ancestors.
 
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 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 time.
 
const std::variant< GfInterval, UsdTimeCode > & GetTime () const &
 Returns the time used by this query when computing a prim's labels.
 
std::variant< GfInterval, UsdTimeCodeGetTime () &&
 Returns the time used by this query when computing a prim's labels.
 
const TfTokenGetTaxonomy () const &
 Returns the taxonomy used by this query when computing a prim's labels.
 
TfToken GetTaxonomy () &&
 Returns the taxonomy used by this query when computing a prim's labels.
 

Detailed Description

The UsdSemanticsLabelsQuery can be used to query a prim's labels for a specified taxonomy and time from the UsdSemanticsLabelsAPI.

Time may be an individual time code or an interval.

This utility requires that all prims are on the same stage.

The query caches certain reads and computations and should be discarded when the state of the stage changes. Queries are thread safe.

Definition at line 33 of file labelsQuery.h.

Constructor & Destructor Documentation

◆ UsdSemanticsLabelsQuery() [1/2]

USDSEMANTICS_API UsdSemanticsLabelsQuery ( const TfToken taxonomy,
UsdTimeCode  timeCode 
)

Constructs a query for a taxonomy at a single timeCode.

Requires that the taxonomy must not be empty.

◆ UsdSemanticsLabelsQuery() [2/2]

USDSEMANTICS_API UsdSemanticsLabelsQuery ( const TfToken taxonomy,
const GfInterval interval 
)

Construct a query for a taxonomy over an interval.

Requires that neither the interval nor taxonomy to be empty.

Warning
Finite minimum values of the interval will return the same result regardless of closed or open state due to held interpolation semantics and Zeno's paradox.

Member Function Documentation

◆ ComputeUniqueDirectLabels()

USDSEMANTICS_API VtTokenArray ComputeUniqueDirectLabels ( const UsdPrim prim) const

Computes the values for semantics:labels:<taxonomy> directly applied to this prim.

If this query's specified time is a time code, returns the values at that time, otherwise, computes the union of values for the interval.

The results are sorted as if by std::sort

If no time samples are authored, the default and fallback values will be queried.

See also
UsdSemanticsLabelsQuery::ComputeUniqueInheritedLabels

◆ ComputeUniqueInheritedLabels()

USDSEMANTICS_API VtTokenArray ComputeUniqueInheritedLabels ( const UsdPrim prim) const

Computes the values for semantics:labels:<taxonomy> including any labels inherited from ancestors.

If this query's specified time is a time code, returns the values at that time, otherwise, computes the union of values for the interval.

The results are sorted as if by std::sort

If no time samples are authored, the default and fallback values of the prim and every ancestor will be queried.

See also
UsdSemanticsLabelsQuery::ComputeUniqueDirectLabels

◆ GetTaxonomy() [1/2]

TfToken GetTaxonomy ( ) &&
inline

Returns the taxonomy used by this query when computing a prim's labels.

Definition at line 110 of file labelsQuery.h.

◆ GetTaxonomy() [2/2]

const TfToken & GetTaxonomy ( ) const &
inline

Returns the taxonomy used by this query when computing a prim's labels.

Definition at line 107 of file labelsQuery.h.

◆ GetTime() [1/2]

std::variant< GfInterval, UsdTimeCode > GetTime ( ) &&
inline

Returns the time used by this query when computing a prim's labels.

Definition at line 103 of file labelsQuery.h.

◆ GetTime() [2/2]

const std::variant< GfInterval, UsdTimeCode > & GetTime ( ) const &
inline

Returns the time used by this query when computing a prim's labels.

Definition at line 99 of file labelsQuery.h.

◆ HasDirectLabel()

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.

See also
UsdSemanticsLabelsQuery::HasInheritedLabel

◆ HasInheritedLabel()

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 time.

See also
UsdSemanticsLabelsQuery::HasDirectLabel

The documentation for this class was generated from the following file: