25 #ifndef PXR_USD_USD_STAGE_LOAD_RULES_H
26 #define PXR_USD_USD_STAGE_LOAD_RULES_H
31 #include "pxr/usd/usd/api.h"
33 #include "pxr/usd/sdf/path.h"
38 PXR_NAMESPACE_OPEN_SCOPE
141 void SetRules(std::vector<std::pair<SdfPath, Rule>>
const &rules);
144 inline void SetRules(std::vector<std::pair<SdfPath, Rule>> &&rules) {
145 _rules = std::move(rules);
179 inline std::vector<std::pair<SdfPath, Rule>>
const &
GetRules()
const {
193 return !(*
this == other);
198 _rules.swap(other._rules);
202 friend USD_API std::ostream &
203 operator<<(std::ostream &, std::pair<SdfPath, Rule>
const &);
205 friend USD_API std::ostream &
212 std::vector<std::pair<SdfPath, Rule> >::const_iterator
213 _LowerBound(
SdfPath const &path)
const;
216 std::vector<std::pair<SdfPath, Rule> >::iterator
217 _LowerBound(
SdfPath const &path);
219 std::vector<std::pair<SdfPath, Rule>> _rules;
237 std::pair<SdfPath, UsdStageLoadRules::Rule>
const &);
244 PXR_NAMESPACE_CLOSE_SCOPE
246 #endif // PXR_USD_USD_STAGE_LOAD_RULES_H
void swap(ArAssetInfo &lhs, ArAssetInfo &rhs)
USD_API void SetRules(std::vector< std::pair< SdfPath, Rule >> const &rules)
Set literal rules, must be sorted by SdfPath::operator<.
void SetRules(std::vector< std::pair< SdfPath, Rule >> &&rules)
Set literal rules, must be sorted by SdfPath::operator<.
Rule
These values are paired with paths to govern payload inclusion on UsdStages.
USD_API void LoadWithDescendants(SdfPath const &path)
Add a rule indicating that path, all its ancestors, and all its descendants shall be loaded...
USD_API void Unload(SdfPath const &path)
Add a rule indicating that path and all its descendants shall be unloaded.
std::vector< std::pair< SdfPath, Rule > > const & GetRules() const
Return all the rules as a vector.
USD_API bool IsLoadedWithNoDescendants(SdfPath const &path) const
Return true if the given path and is considered loaded, but none of its descendants are considered lo...
UsdStageLoadRules()=default
Construct rules that load all payloads.
friend USD_API std::ostream & operator<<(std::ostream &, std::pair< SdfPath, Rule > const &)
Stream a text representation of a pair of SdfPath and UsdStageLoadRules::Rule.
friend USD_API size_t hash_value(UsdStageLoadRules const &)
Return the hash code for a UsdStageLoadRules object.
Include payloads on the specified prim and all descendants.
Exclude payloads on the specified prim and all descendants.
This class represents rules that govern payload inclusion on UsdStages.
A path value used to locate objects in layers or scenegraphs.
USD_API bool operator==(UsdStageLoadRules const &other) const
Return true if other has exactly the same set of rules as this.
static UsdStageLoadRules LoadAll()
Return rules that load all payloads.
void swap(UsdStageLoadRules &other)
Swap the contents of these rules with other.
USD_API void 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 LoadWit...
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
UsdLoadPolicy
Controls UsdStage::Load() and UsdPrim::Load() behavior regarding whether or not descendant prims are ...
USD_API bool IsLoaded(SdfPath const &path) const
Return true if the given path is considered loaded by these rules, or false if it is considered unloa...
bool operator!=(UsdStageLoadRules const &other) const
Return false if other has exactly the same set of rules as this.
USD_API void AddRule(SdfPath const &path, Rule rule)
Add a literal rule. If there's already a rule for path, replace it.
Include payloads on the specified prim but no descendants.
USD_API void LoadWithoutDescendants(SdfPath const &path)
Add a rule indicating that path and all its ancestors but none of its descendants shall be loaded...
USD_API Rule GetEffectiveRuleForPath(SdfPath const &path) const
Return the "effective" rule for the given path.
USD_API void Minimize()
Remove any redundant rules to make the set of rules as small as possible without changing behavior...
USD_API bool IsLoadedWithAllDescendants(SdfPath const &path) const
Return true if the given path and all descendants are considered loaded by these rules; false otherwi...
static USD_API UsdStageLoadRules LoadNone()
Return rules that load no payloads.