HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PcpMapExpression Class Reference

#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 ValueEvaluate () const
 
PCP_API PcpMapExpression ()
 Default-construct a NULL expression. More...
 
PCP_API void Swap (PcpMapExpression &other)
 Swap this expression with the other. More...
 
PCP_API bool IsNull () const
 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 SdfLayerOffsetGetTimeOffset () 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< VariableVariableUniquePtr
 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)
 

Detailed Description

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.

Member Typedef Documentation

The value type of PcpMapExpression is a PcpMapFunction.

Definition at line 60 of file mapExpression.h.

Variables are held by reference.

Definition at line 112 of file mapExpression.h.

Constructor & Destructor Documentation

PCP_API PcpMapExpression::PcpMapExpression ( )

Default-construct a NULL expression.

Member Function Documentation

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 PCP_API PcpMapExpression PcpMapExpression::Constant ( const Value constValue)
static

Create a new constant.

PCP_API const Value& PcpMapExpression::Evaluate ( ) const

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.

std::string PcpMapExpression::GetString ( ) const
inline

Returns a string representation of this mapping for debugging purposes.

Definition at line 175 of file mapExpression.h.

const SdfLayerOffset& PcpMapExpression::GetTimeOffset ( ) const
inline

The time offset of the mapping.

Definition at line 169 of file mapExpression.h.

static PCP_API PcpMapExpression PcpMapExpression::Identity ( )
static

Return an expression representing PcpMapFunction::Identity().

PCP_API PcpMapExpression PcpMapExpression::Inverse ( ) const

Create a new PcpMapExpression representing the inverse of f.

bool PcpMapExpression::IsConstantIdentity ( ) const
inline

Return true if the map function is the constant identity function.

Definition at line 138 of file mapExpression.h.

bool PcpMapExpression::IsIdentity ( ) const
inline

Return true if the evaluated map function is the identity function. For identity, MapSourceToTarget() always returns the path unchanged.

Definition at line 152 of file mapExpression.h.

PCP_API bool PcpMapExpression::IsNull ( ) const

Return true if this is a null expression.

SdfPath PcpMapExpression::MapSourceToTarget ( const SdfPath path) const
inline

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 158 of file mapExpression.h.

SdfPath PcpMapExpression::MapTargetToSource ( const SdfPath path) const
inline

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 164 of file mapExpression.h.

static PCP_API VariableUniquePtr PcpMapExpression::NewVariable ( Value &&  initialValue)
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.

PCP_API void PcpMapExpression::Swap ( PcpMapExpression other)

Swap this expression with the other.

Friends And Related Function Documentation

PCP_API void intrusive_ptr_add_ref ( _Node *  )
friend
PCP_API void intrusive_ptr_release ( _Node *  )
friend
friend class Pcp_Statistics
friend

Definition at line 183 of file mapExpression.h.

friend struct Pcp_VariableImpl
friend

Definition at line 184 of file mapExpression.h.


The documentation for this class was generated from the following file: