Loading...
Searching...
No Matches
userProcessingFunc.h
Go to the documentation of this file.
1//
2// Copyright 2023 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7
8#ifndef PXR_USD_USD_UTILS_USER_PROCESSING_FUNC
9#define PXR_USD_USD_UTILS_USER_PROCESSING_FUNC
10
12
13#include "pxr/usd/sdf/layer.h"
14#include "pxr/usd/usdUtils/api.h"
15
16#include <functional>
17#include <string>
18#include <vector>
19
20PXR_NAMESPACE_OPEN_SCOPE
21
29public:
30 USDUTILS_API UsdUtilsDependencyInfo() = default;
31 USDUTILS_API explicit UsdUtilsDependencyInfo(const std::string &assetPath)
32 : _assetPath(assetPath) {}
33
34 USDUTILS_API UsdUtilsDependencyInfo(
35 const std::string &assetPath,
36 const std::vector<std::string> &dependencies)
37 : _assetPath(assetPath), _dependencies(dependencies) {}
38
39private:
43 USDUTILS_API UsdUtilsDependencyInfo(
44 const std::string &assetPath,
45 const std::vector<std::string> &dependencies,
46 const std::string &rawAssetPath,
47 const VtDictionary *expressionVariables)
48 : _assetPath(assetPath), _dependencies(dependencies),
49 _rawAssetPath(rawAssetPath), _expressionVariables(expressionVariables)
50 {}
51
52 friend class UsdUtils_LocalizationClient;
53
54public:
76 USDUTILS_API const std::string& GetAssetPath() const {
77 return _assetPath;
78 }
79
83 USDUTILS_API const std::string& GetRawAssetPath() const {
84 return _rawAssetPath;
85 }
86
90 USDUTILS_API const VtDictionary &GetExpressionVariables() const {
91 return _expressionVariables ?
92 *_expressionVariables : VtGetEmptyDictionary();
93 }
94
105 USDUTILS_API const std::vector<std::string>& GetDependencies() const {
106 return _dependencies;
107 }
108
110 bool operator==(const UsdUtilsDependencyInfo &rhs) const {
111 return _assetPath == rhs._assetPath &&
112 _dependencies == rhs._dependencies;
113 }
114
117 bool operator!=(const UsdUtilsDependencyInfo& rhs) const {
118 return !(*this == rhs);
119 }
120
121private:
122 std::string _assetPath;
123 std::vector<std::string> _dependencies;
124 std::string _rawAssetPath;
125 const VtDictionary *_expressionVariables = nullptr;
126};
127
132 const SdfLayerHandle &layer,
133 const UsdUtilsDependencyInfo &dependencyInfo);
134
135PXR_NAMESPACE_CLOSE_SCOPE
136
137#endif // PXR_USD_USD_UTILS_USER_PROCESSING_FUNC
Class containing information from a processed dependency.
USDUTILS_API const std::string & GetAssetPath() const
Returns the asset value path for the dependency.
USDUTILS_API const VtDictionary & GetExpressionVariables() const
Gets the current set of variable expressions relevant to this dependency.
USDUTILS_API const std::string & GetRawAssetPath() const
Gets the raw asset path that was authored in the layer without any substitutions or evaluations.
USDUTILS_API const std::vector< std::string > & GetDependencies() const
Returns a list of dependencies related to the asset path.
bool operator==(const UsdUtilsDependencyInfo &rhs) const
Equality: Asset path and dependencies are the same.
bool operator!=(const UsdUtilsDependencyInfo &rhs) const
Inequality operator.
A map with string keys and VtValue values.
Definition dictionary.h:52
UsdUtilsDependencyInfo( const SdfLayerHandle &layer, const UsdUtilsDependencyInfo &dependencyInfo) UsdUtilsProcessingFunc
Signature for user supplied processing function.