HDK
|
#include <mapExpression.h>
Classes | |
class | Variable |
Public Types | |
typedef PcpMapFunction | Value |
The value type of PcpMapExpression is a PcpMapFunction. More... | |
Public Member Functions | |
PCP_API const Value & | Evaluate () const |
PcpMapExpression () noexcept=default | |
Default-construct a NULL expression. More... | |
void | Swap (PcpMapExpression &other) noexcept |
Swap this expression with the other. More... | |
bool | IsNull () const noexcept |
Return true if this is a null expression. More... | |
Convenience API | |
The following API just forwards through to the underlying evaluated mapfunction value. | |
bool | IsIdentity () const |
SdfPath | MapSourceToTarget (const SdfPath &path) const |
SdfPath | MapTargetToSource (const SdfPath &path) const |
const SdfLayerOffset & | GetTimeOffset () const |
The time offset of the mapping. More... | |
std::string | GetString () const |
Friends | |
class | Pcp_Statistics |
struct | Pcp_VariableImpl |
PCP_API void | intrusive_ptr_add_ref (_Node *) |
PCP_API void | intrusive_ptr_release (_Node *) |
Creating expressions | |
typedef std::unique_ptr< Variable > | VariableUniquePtr |
Variables are held by reference. More... | |
PCP_API PcpMapExpression | Compose (const PcpMapExpression &f) const |
PCP_API PcpMapExpression | Inverse () const |
Create a new PcpMapExpression representing the inverse of f. More... | |
PCP_API PcpMapExpression | AddRootIdentity () const |
bool | IsConstantIdentity () const |
Return true if the map function is the constant identity function. More... | |
static PCP_API PcpMapExpression | Identity () |
Return an expression representing PcpMapFunction::Identity(). More... | |
static PCP_API PcpMapExpression | Constant (const Value &constValue) |
Create a new constant. More... | |
static PCP_API VariableUniquePtr | NewVariable (Value &&initialValue) |
An expression that yields a PcpMapFunction value.
Expressions comprise constant values, variables, and operators applied to sub-expressions. Expressions cache their computed values internally. Assigning a new value to a variable automatically invalidates the cached values of dependent expressions. Common (sub-)expressions are automatically detected and shared.
PcpMapExpression exists solely to support efficient incremental handling of relocates edits. It represents a tree of the namespace mapping operations and their inputs, so we can narrowly redo the computation when one of the inputs changes.
Definition at line 56 of file mapExpression.h.
The value type of PcpMapExpression is a PcpMapFunction.
Definition at line 60 of file mapExpression.h.
typedef std::unique_ptr<Variable> PcpMapExpression::VariableUniquePtr |
Variables are held by reference.
Definition at line 113 of file mapExpression.h.
|
defaultnoexcept |
Default-construct a NULL expression.
PCP_API PcpMapExpression PcpMapExpression::AddRootIdentity | ( | ) | const |
Return a new expression representing this expression with an added (if necessary) mapping from </> to </>.
PCP_API PcpMapExpression PcpMapExpression::Compose | ( | const PcpMapExpression & | f | ) | const |
Create a new PcpMapExpression representing the application of f's value, followed by the application of this expression's value.
|
static |
Create a new constant.
Evaluate this expression, yielding a PcpMapFunction value. The computed result is cached. The return value is a reference to the internal cached value. The cache is automatically invalidated as needed.
|
inline |
Returns a string representation of this mapping for debugging purposes.
Definition at line 176 of file mapExpression.h.
|
inline |
The time offset of the mapping.
Definition at line 170 of file mapExpression.h.
|
static |
Return an expression representing PcpMapFunction::Identity().
PCP_API PcpMapExpression PcpMapExpression::Inverse | ( | ) | const |
Create a new PcpMapExpression representing the inverse of f.
|
inline |
Return true if the map function is the constant identity function.
Definition at line 139 of file mapExpression.h.
|
inline |
Return true if the evaluated map function is the identity function. For identity, MapSourceToTarget() always returns the path unchanged.
Definition at line 153 of file mapExpression.h.
|
inlinenoexcept |
Return true if this is a null expression.
Definition at line 78 of file mapExpression.h.
Map a path in the source namespace to the target. If the path is not in the domain, returns an empty path.
Definition at line 159 of file mapExpression.h.
Map a path in the target namespace to the source. If the path is not in the co-domain, returns an empty path.
Definition at line 165 of file mapExpression.h.
|
static |
Create a new variable. The client is expected to retain the reference for as long as it wishes to continue being able to set the value of the variable. After the reference is dropped, expressions using the variable will continue to be valid, but there will be no way to further change the value of the variable.
|
inlinenoexcept |
Swap this expression with the other.
Definition at line 73 of file mapExpression.h.
|
friend |
Definition at line 184 of file mapExpression.h.
|
friend |
Definition at line 185 of file mapExpression.h.