This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
primFlags.h File Reference

More...

+ Include dependency graph for primFlags.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

Usd_Term operator! (Usd_PrimFlags flag)
 
Usd_PrimFlagsConjunction operator&& (Usd_Term lhs, Usd_Term rhs)
 
Usd_PrimFlagsConjunction operator&& (const Usd_PrimFlagsConjunction &conjunction, Usd_Term rhs)
 
Usd_PrimFlagsConjunction operator&& (Usd_Term lhs, const Usd_PrimFlagsConjunction &conjunction)
 
Usd_PrimFlagsConjunction operator&& (Usd_PrimFlags lhs, Usd_PrimFlags rhs)
 
Usd_PrimFlagsDisjunction operator|| (Usd_Term lhs, Usd_Term rhs)
 
Usd_PrimFlagsDisjunction operator|| (const Usd_PrimFlagsDisjunction &disjunction, Usd_Term rhs)
 
Usd_PrimFlagsDisjunction operator|| (Usd_Term lhs, const Usd_PrimFlagsDisjunction &disjunction)
 
Usd_PrimFlagsDisjunction operator|| (Usd_PrimFlags lhs, Usd_PrimFlags rhs)
 
Usd_PrimFlagsPredicate UsdTraverseInstanceProxies (Usd_PrimFlagsPredicate predicate)
 This function is used to allow the prim traversal functions listed under Prim predicate flags to traverse beneath instance prims and return descendants that pass the specified predicate as instance proxy prims.
 
Usd_PrimFlagsPredicate UsdTraverseInstanceProxies ()
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Convenience method equivalent to calling UsdTraverseInstanceProxies with the UsdPrimDefaultPredicate that is used by default for prim traversals.
 

Variables

unspecified UsdPrimIsActive
 Tests UsdPrim::IsActive()
 
unspecified UsdPrimIsLoaded
 Tests UsdPrim::IsLoaded()
 
unspecified UsdPrimIsModel
 Tests UsdPrim::IsModel()
 
unspecified UsdPrimIsGroup
 Tests UsdPrim::IsGroup()
 
unspecified UsdPrimIsAbstract
 Tests UsdPrim::IsAbstract()
 
unspecified UsdPrimIsDefined
 Tests UsdPrim::IsDefined()
 
unspecified UsdPrimIsInstance
 Tests UsdPrim::IsInstance()
 
unspecified UsdPrimHasDefiningSpecifier
 Tests UsdPrim::HasDefiningSpecifier()
 
unspecified UsdPrimDefaultPredicate
 The default predicate used for prim traversals in methods like UsdPrim::GetChildren, UsdStage::Traverse, and by UsdPrimRange.
 
unspecified UsdPrimAllPrimsPredicate
 Predicate that includes all prims.
 

Detailed Description

Provides terms for UsdPrim flags that can be combined to form either a conjunction (via &&) or a disjunction (via ||). The result is a predicate functor object that tests those flags on the passed prim. Currently UsdPrim::GetFilteredChildren(), UsdPrim::GetNextFilteredSibling(), UsdPrim::GetFilteredDescendants(), and UsdPrimRange() accept these predicates to filter out unwanted prims.

For example:

// Get only loaded model children.
prim.GetFilteredChildren(UsdPrimIsModel && UsdPrimIsLoaded)
unspecified UsdPrimIsLoaded
Tests UsdPrim::IsLoaded()
unspecified UsdPrimIsModel
Tests UsdPrim::IsModel()

For performance, these predicates are implemented by a bitwise test, so arbitrary boolean expressions cannot be represented. The set of boolean expressions that can be represented are conjunctions with possibly negated terms (or disjunctions, by De Morgan's law). Here are some examples of valid expressions:

// simple conjunction.
// conjunction with negated term.
// disjunction with negated term.
// negated conjunction gives a disjunction.
// negated conjunction gives a disjunction, which is further extended.
// equivalent to above.
unspecified UsdPrimIsGroup
Tests UsdPrim::IsGroup()
unspecified UsdPrimIsActive
Tests UsdPrim::IsActive()
unspecified UsdPrimIsDefined
Tests UsdPrim::IsDefined()
unspecified UsdPrimIsAbstract
Tests UsdPrim::IsAbstract()

Here are some examples of invalid expressions:

// error: cannot || a term with a conjunction.
// error: cannot && disjunctions.

The following variables provide the clauses that can be combined and negated to produce predicates:

Definition in file primFlags.h.

Function Documentation

◆ operator!()

Usd_Term operator! ( Usd_PrimFlags  flag)
inline

Definition at line 114 of file primFlags.h.

◆ operator&&() [1/4]

Usd_PrimFlagsConjunction operator&& ( const Usd_PrimFlagsConjunction &  conjunction,
Usd_Term  rhs 
)
inline

Definition at line 360 of file primFlags.h.

◆ operator&&() [2/4]

Usd_PrimFlagsConjunction operator&& ( Usd_PrimFlags  lhs,
Usd_PrimFlags  rhs 
)
inline

Definition at line 370 of file primFlags.h.

◆ operator&&() [3/4]

Usd_PrimFlagsConjunction operator&& ( Usd_Term  lhs,
const Usd_PrimFlagsConjunction &  conjunction 
)
inline

Definition at line 365 of file primFlags.h.

◆ operator&&() [4/4]

Usd_PrimFlagsConjunction operator&& ( Usd_Term  lhs,
Usd_Term  rhs 
)
inline

Definition at line 352 of file primFlags.h.

◆ operator||() [1/4]

Usd_PrimFlagsDisjunction operator|| ( const Usd_PrimFlagsDisjunction &  disjunction,
Usd_Term  rhs 
)
inline

Definition at line 460 of file primFlags.h.

◆ operator||() [2/4]

Usd_PrimFlagsDisjunction operator|| ( Usd_PrimFlags  lhs,
Usd_PrimFlags  rhs 
)
inline

Definition at line 470 of file primFlags.h.

◆ operator||() [3/4]

Usd_PrimFlagsDisjunction operator|| ( Usd_Term  lhs,
const Usd_PrimFlagsDisjunction &  disjunction 
)
inline

Definition at line 465 of file primFlags.h.

◆ operator||() [4/4]

Usd_PrimFlagsDisjunction operator|| ( Usd_Term  lhs,
Usd_Term  rhs 
)
inline

Definition at line 455 of file primFlags.h.

◆ UsdTraverseInstanceProxies() [1/2]

Usd_PrimFlagsPredicate UsdTraverseInstanceProxies ( )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Convenience method equivalent to calling UsdTraverseInstanceProxies with the UsdPrimDefaultPredicate that is used by default for prim traversals.

Definition at line 570 of file primFlags.h.

◆ UsdTraverseInstanceProxies() [2/2]

Usd_PrimFlagsPredicate UsdTraverseInstanceProxies ( Usd_PrimFlagsPredicate  predicate)
inline

This function is used to allow the prim traversal functions listed under Prim predicate flags to traverse beneath instance prims and return descendants that pass the specified predicate as instance proxy prims.

For example:

// Return all children of the specified prim.
// If prim is an instance, return all children as instance proxy prims.
prim.GetFilteredChildren(
// Return children of the specified prim that pass the default predicate.
// If prim is an instance, return the children that pass this predicate
// as instance proxy prims.
prim.GetFilteredChildren(UsdTraverseInstanceProxies());
// Return all model or group children of the specified prim.
// If prim is an instance, return the children that pass this predicate
// as instance proxy prims.
Usd_PrimFlagsPredicate UsdTraverseInstanceProxies()
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: primFlags.h:570
unspecified UsdPrimAllPrimsPredicate
Predicate that includes all prims.

Users may also call Usd_PrimFlagsPredicate::TraverseInstanceProxies to enable traversal beneath instance prims. This function is equivalent to:

predicate.TraverseInstanceProxies(true);

However, this function may be more convenient, especially when calling a prim traversal function with a default-constructed tautology predicate.

Definition at line 560 of file primFlags.h.

Variable Documentation

◆ UsdPrimAllPrimsPredicate

unspecified UsdPrimAllPrimsPredicate
extern

Predicate that includes all prims.

See Prim predicate flags for more information.

◆ UsdPrimDefaultPredicate

unspecified UsdPrimDefaultPredicate
extern

The default predicate used for prim traversals in methods like UsdPrim::GetChildren, UsdStage::Traverse, and by UsdPrimRange.

This is a conjunction that includes all active, loaded, defined, non-abstract prims, equivalent to:

This represents the prims on a stage that a processor would typically consider present, meaningful, and needful of consideration.

See Prim predicate flags for more information.

◆ UsdPrimHasDefiningSpecifier

unspecified UsdPrimHasDefiningSpecifier
extern

◆ UsdPrimIsAbstract

unspecified UsdPrimIsAbstract
extern

◆ UsdPrimIsActive

unspecified UsdPrimIsActive
extern

◆ UsdPrimIsDefined

unspecified UsdPrimIsDefined
extern

◆ UsdPrimIsGroup

unspecified UsdPrimIsGroup
extern

◆ UsdPrimIsInstance

unspecified UsdPrimIsInstance
extern

◆ UsdPrimIsLoaded

unspecified UsdPrimIsLoaded
extern

◆ UsdPrimIsModel

unspecified UsdPrimIsModel
extern