HDK
|
#include <stageLoadRules.h>
Public Types | |
enum | Rule { AllRule, OnlyRule, NoneRule } |
Public Member Functions | |
UsdStageLoadRules ()=default | |
Construct rules that load all payloads. More... | |
UsdStageLoadRules (UsdStageLoadRules const &)=default | |
UsdStageLoadRules (UsdStageLoadRules &&)=default | |
UsdStageLoadRules & | operator= (UsdStageLoadRules const &)=default |
UsdStageLoadRules & | operator= (UsdStageLoadRules &&)=default |
USD_API void | LoadWithDescendants (SdfPath const &path) |
USD_API void | LoadWithoutDescendants (SdfPath const &path) |
USD_API void | Unload (SdfPath const &path) |
USD_API void | LoadAndUnload (const SdfPathSet &loadSet, const SdfPathSet &unloadSet, UsdLoadPolicy policy) |
USD_API void | AddRule (SdfPath const &path, Rule rule) |
Add a literal rule. If there's already a rule for path , replace it. More... | |
USD_API void | SetRules (std::vector< std::pair< SdfPath, Rule >> const &rules) |
Set literal rules, must be sorted by SdfPath::operator<. More... | |
void | SetRules (std::vector< std::pair< SdfPath, Rule >> &&rules) |
Set literal rules, must be sorted by SdfPath::operator<. More... | |
USD_API void | Minimize () |
USD_API bool | IsLoaded (SdfPath const &path) const |
USD_API bool | IsLoadedWithAllDescendants (SdfPath const &path) const |
USD_API bool | IsLoadedWithNoDescendants (SdfPath const &path) const |
USD_API Rule | GetEffectiveRuleForPath (SdfPath const &path) const |
std::vector< std::pair < SdfPath, Rule > > const & | GetRules () const |
Return all the rules as a vector. More... | |
USD_API bool | operator== (UsdStageLoadRules const &other) const |
bool | operator!= (UsdStageLoadRules const &other) const |
void | swap (UsdStageLoadRules &other) |
Swap the contents of these rules with other . More... | |
Static Public Member Functions | |
static UsdStageLoadRules | LoadAll () |
static USD_API UsdStageLoadRules | LoadNone () |
Return rules that load no payloads. More... | |
Friends | |
USD_API std::ostream & | operator<< (std::ostream &, std::pair< SdfPath, Rule > const &) |
USD_API std::ostream & | operator<< (std::ostream &, UsdStageLoadRules const &) |
Stream a text representation of a UsdStageLoadRules object. More... | |
USD_API size_t | hash_value (UsdStageLoadRules const &) |
Return the hash code for a UsdStageLoadRules object. More... | |
This class represents rules that govern payload inclusion on UsdStages.
Rules are represented as pairs of SdfPath and a Rule enum value, one of AllRule, OnlyRule, and NoneRule. To understand how rules apply to particular paths, see UsdStageLoadRules::GetEffectiveRuleForPath().
Convenience methods for manipulating rules by typical 'Load' and 'Unload' operations are provided in UsdStageLoadRules::LoadWithoutDescendants(), UsdStageLoadRules::LoadWithDescendants(), UsdStageLoadRules::Unload().
For finer-grained rule crafting, see AddRule().
Remove redundant rules that do not change the effective load state with UsdStageLoadRules::Minimize().
Definition at line 56 of file stageLoadRules.h.
These values are paired with paths to govern payload inclusion on UsdStages.
Definition at line 63 of file stageLoadRules.h.
|
default |
Construct rules that load all payloads.
|
default |
|
default |
Add a literal rule. If there's already a rule for path
, replace it.
Return the "effective" rule for the given path
. For example, if the closest ancestral rule of path
is an AllRule
, return AllRule
. If the closest ancestral rule of path
is for path
itself and it is an OnlyRule
, return OnlyRule
. Otherwise if there is a closest descendant rule to path
this is an OnlyRule
or an AllRule
, return OnlyRule
. Otherwise return NoneRule
.
Return all the rules as a vector.
Definition at line 179 of file stageLoadRules.h.
Return true if the given path
is considered loaded by these rules, or false if it is considered unloaded. This is equivalent to GetEffectiveRuleForPath(path) != NoneRule.
Return true if the given path
and all descendants are considered loaded by these rules; false otherwise.
Return true if the given path
and is considered loaded, but none of its descendants are considered loaded by these rules; false otherwise.
|
inlinestatic |
Return rules that load all payloads. This is equivalent to default-constructed UsdStageLoadRules.
Definition at line 77 of file stageLoadRules.h.
USD_API void UsdStageLoadRules::LoadAndUnload | ( | const SdfPathSet & | loadSet, |
const SdfPathSet & | unloadSet, | ||
UsdLoadPolicy | policy | ||
) |
Add rules as if Unload() was called for each element of unloadSet
followed by calls to either LoadWithDescendants() (if policy
is UsdLoadPolicy::LoadWithDescendants) or LoadWithoutDescendants() (if policy
is UsdLoadPolicy::LoadWithoutDescendants) for each element of loadSet
.
|
static |
Return rules that load no payloads.
Add a rule indicating that path
, all its ancestors, and all its descendants shall be loaded.
Any previous rules created by calling LoadWithoutDescendants() or Unload() on this path or descendant paths are replaced by this rule. For example, calling LoadWithoutDescendants('/World/sets/kitchen') followed by LoadWithDescendants('/World/sets') will effectively remove the rule created in the first call. See AddRule() for more direct manipulation.
Add a rule indicating that path
and all its ancestors but none of its descendants shall be loaded.
Any previous rules created by calling LoadWithDescendants() or Unload() on this path or descendant paths are replaced or restricted by this rule. For example, calling LoadWithDescendants('/World/sets') followed by LoadWithoutDescendants('/World/sets/kitchen') will cause everything under '/World/sets' to load except for those things under '/World/sets/kitchen'. See AddRule() for more direct manipulation.
Remove any redundant rules to make the set of rules as small as possible without changing behavior.
|
inline |
Return false if other
has exactly the same set of rules as this. See operator==().
Definition at line 192 of file stageLoadRules.h.
|
default |
|
default |
USD_API bool UsdStageLoadRules::operator== | ( | UsdStageLoadRules const & | other | ) | const |
Return true if other
has exactly the same set of rules as this. Note that this means rules that are functionally equivalent may compare inequal. If this is not desired, ensure both sets of rules are reduced by Minimize() first.
Set literal rules, must be sorted by SdfPath::operator<.
Set literal rules, must be sorted by SdfPath::operator<.
Definition at line 144 of file stageLoadRules.h.
|
inline |
Swap the contents of these rules with other
.
Definition at line 197 of file stageLoadRules.h.
Add a rule indicating that path
and all its descendants shall be unloaded.
Any previous rules created by calling LoadWithDescendants() or LoadWithoutDescendants() on this path or descendant paths are replaced or restricted by this rule. For example, calling LoadWithDescendants('/World/sets') followed by Unload('/World/sets/kitchen') will cause everything under '/World/sets' to load, except for '/World/sets/kitchen' and everything under it.
|
friend |
Return the hash code for a UsdStageLoadRules object.
Stream a text representation of a pair of SdfPath and UsdStageLoadRules::Rule.
|
friend |
Stream a text representation of a UsdStageLoadRules object.