7#ifndef PXR_USD_PCP_MAP_FUNCTION_H
8#define PXR_USD_PCP_MAP_FUNCTION_H
11#include "pxr/usd/pcp/api.h"
12#include "pxr/usd/sdf/path.h"
14#include "pxr/usd/sdf/pathExpression.h"
19PXR_NAMESPACE_OPEN_SCOPE
68 typedef std::map<SdfPath, SdfPath, SdfPath::FastLessThan>
PathMap;
181 std::vector<SdfPathExpression::PathPattern>
182 *unmappedPatterns =
nullptr,
183 std::vector<SdfPathExpression::ExpressionReference>
184 *unmappedRefs =
nullptr
204 std::vector<SdfPathExpression::PathPattern>
205 *unmappedPatterns =
nullptr,
206 std::vector<SdfPathExpression::ExpressionReference>
207 *unmappedRefs =
nullptr
261 std::shared_ptr<_Mappings>&& mappings,
270 _MapPathExpressionImpl(
273 std::vector<SdfPathExpression::PathPattern> *unmappedPatterns,
274 std::vector<SdfPathExpression::ExpressionReference> *unmappedRefs
291 PCP_API
size_t _GetNumMappingSets()
const;
295 friend class Pcp_MapFunctionPyAccess;
298 template <
typename HashState>
304 std::shared_ptr<_Mappings> _mappings;
315PXR_NAMESPACE_CLOSE_SCOPE
A function that maps values from one namespace (and time domain) to another.
PCP_API PcpMapFunction()
Construct a null function.
std::map< SdfPath, SdfPath, SdfPath::FastLessThan > PathMap
A mapping from path to path.
static PCP_API PcpMapFunction Create(const PathMap &sourceToTargetMap, const SdfLayerOffset &offset)
Constructs a map function with the given arguments.
PCP_API void Swap(PcpMapFunction &map)
Swap the contents of this map function with map.
PCP_API SdfPathExpression MapTargetToSource(const SdfPathExpression &pathExpr, std::vector< SdfPathExpression::PathPattern > *unmappedPatterns=nullptr, std::vector< SdfPathExpression::ExpressionReference > *unmappedRefs=nullptr) const
Map all path pattern prefix paths and expression reference paths in the target namespace to the sourc...
PCP_API SdfPath MapSourceToTarget(const SdfPath &path) const
Map a path in the source namespace to the target.
static PCP_API PcpMapFunction ImpliedClass(const PcpMapFunction &transferFunc, const PcpMapFunction &classArc)
Constructs a map function that is equivalent to.
PCP_API bool IsIdentity() const
Return true if the map function is the identity function.
PCP_API bool HasRootIdentity() const
Return true if the map function maps the absolute root path to the absolute root path,...
PCP_API size_t Hash() const
Return a size_t hash for this map function.
PCP_API SdfPathExpression MapSourceToTarget(const SdfPathExpression &pathExpr, std::vector< SdfPathExpression::PathPattern > *unmappedPatterns=nullptr, std::vector< SdfPathExpression::ExpressionReference > *unmappedRefs=nullptr) const
Map all path pattern prefix paths and expression reference paths in the source namespace to the targe...
PCP_API std::string GetString() const
Returns a string representation of this mapping for debugging purposes.
static PCP_API const PathMap & IdentityPathMap()
Returns an identity path mapping.
PCP_API SdfPath MapTargetToSource(const SdfPath &path) const
Map a path in the target namespace to the source.
PCP_API bool operator!=(const PcpMapFunction &map) const
Inequality.
const SdfLayerOffset & GetTimeOffset() const
The time offset of the mapping.
static PCP_API const PcpMapFunction & Identity()
Construct an identity map function.
PCP_API bool IsDeferredComposition() const
Return true if the map function is a defered-composition function.
PCP_API PcpMapFunction ComposeOffset(const SdfLayerOffset &newOffset) const
Compose this map function over a hypothetical map function that has an identity path mapping and offs...
PCP_API PcpMapFunction GetInverse() const
Return the inverse of this map function.
PCP_API PcpMapFunction Compose(const PcpMapFunction &f) const
Compose this map over the given map function.
PCP_API bool IsIdentityPathMapping() const
Return true if the map function uses the identity path mapping.
PCP_API bool operator==(const PcpMapFunction &map) const
Equality.
PCP_API bool IsNull() const
Return true if this map function is the null function.
PCP_API PathMap GetSourceToTargetMap() const
The set of path mappings, from source to target.
static PCP_API PcpMapFunction DeferredComposition(const PcpMapFunction &mapFn)
Constructs a "deferred-composition" map function from the given source mapFn.
Represents a time offset and scale between layers.
Objects of this class represent a logical expression syntax tree consisting of SdfPathPattern s,...
A path value used to locate objects in layers or scenegraphs.
A user-extensible hashing mechanism for use with runtime hash tables.
size_t hash_value(const TfToken &x)
Overload hash_value for TfToken.