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

#include <layerOffset.h>

+ Inheritance diagram for SdfLayerOffset:

Classes

struct  Hash
 Hash functor for hash maps and sets. More...
 

Public Member Functions

Constructors
SDF_API SdfLayerOffset (double offset=0.0, double scale=1.0)
 Constructs a new SdfLayerOffset instance. More...
 
Accessors
double GetOffset () const
 Returns the time offset. More...
 
double GetScale () const
 Returns the time scale factor. More...
 
void SetOffset (double newOffset)
 Sets the time offset. More...
 
void SetScale (double newScale)
 Sets the time scale factor. More...
 
SDF_API bool IsIdentity () const
 
SDF_API bool IsValid () const
 
SDF_API SdfLayerOffset GetInverse () const
 Gets the inverse offset, which performs the opposite transformation. More...
 
Operators
SDF_API bool operator== (const SdfLayerOffset &rhs) const
 Returns whether the offsets are equal. More...
 
SDF_API bool operator< (const SdfLayerOffset &rhs) const
 
SDF_API SdfLayerOffset operator* (const SdfLayerOffset &rhs) const
 
SDF_API double operator* (double rhs) const
 Applies the offset to the given value. More...
 
SDF_API SdfTimeCode operator* (const SdfTimeCode &rhs) const
 Applies the offset to the given value. More...
 

Hashing

SDF_API size_t GetHash () const
 Returns hash for this offset. More...
 
size_t hash_value (const SdfLayerOffset &offset)
 Returns hash for this offset. More...
 

Detailed Description

Represents a time offset and scale between layers.

The SdfLayerOffset class is an affine transform, providing both a scale and a translate. It supports vector algebra semantics for composing SdfLayerOffsets together via multiplication. The SdfLayerOffset class is unitless: it does not refer to seconds or frames.

For example, suppose layer A uses layer B, with an offset of X: when bringing animation from B into A, you first apply the scale of X, and then the offset. Suppose you have a scale of 2 and an offset of 24: first multiply B's frame numbers by 2, and then add 24. The animation from B as seen in A will take twice as long and start 24 frames later.

Offsets are typically used in either sublayers or prim references. For more information, see the SetSubLayerOffset() method of the SdfLayer class (the subLayerOffsets property in Python), as well as the SetReference() and GetReferenceLayerOffset() methods (the latter is the referenceLayerOffset property in Python) of the SdfPrimSpec class.

Definition at line 61 of file layerOffset.h.

Constructor & Destructor Documentation

SDF_API SdfLayerOffset::SdfLayerOffset ( double  offset = 0.0,
double  scale = 1.0 
)
explicit

Constructs a new SdfLayerOffset instance.

Member Function Documentation

SDF_API size_t SdfLayerOffset::GetHash ( ) const

Returns hash for this offset.

SDF_API SdfLayerOffset SdfLayerOffset::GetInverse ( ) const

Gets the inverse offset, which performs the opposite transformation.

double SdfLayerOffset::GetOffset ( ) const
inline

Returns the time offset.

Definition at line 77 of file layerOffset.h.

double SdfLayerOffset::GetScale ( ) const
inline

Returns the time scale factor.

Definition at line 80 of file layerOffset.h.

SDF_API bool SdfLayerOffset::IsIdentity ( ) const

Returns true if this is an identity transformation, with an offset of 0.0 and a scale of 1.0.

SDF_API bool SdfLayerOffset::IsValid ( ) const

Returns true if this offset is valid, i.e. both the offset and scale are finite (not infinite or NaN). Note that a valid layer offset's inverse may be invalid.

SDF_API SdfLayerOffset SdfLayerOffset::operator* ( const SdfLayerOffset rhs) const

Composes this with the offset rhs, such that the resulting offset is equivalent to first applying rhs and then *this.

SDF_API double SdfLayerOffset::operator* ( double  rhs) const

Applies the offset to the given value.

SDF_API SdfTimeCode SdfLayerOffset::operator* ( const SdfTimeCode rhs) const

Applies the offset to the given value.

SDF_API bool SdfLayerOffset::operator< ( const SdfLayerOffset rhs) const

Returns whether this offset is less than another. The meaning of less than is somewhat arbitrary.

SDF_API bool SdfLayerOffset::operator== ( const SdfLayerOffset rhs) const

Returns whether the offsets are equal.

void SdfLayerOffset::SetOffset ( double  newOffset)
inline

Sets the time offset.

Definition at line 83 of file layerOffset.h.

void SdfLayerOffset::SetScale ( double  newScale)
inline

Sets the time scale factor.

Definition at line 86 of file layerOffset.h.

Friends And Related Function Documentation

size_t hash_value ( const SdfLayerOffset offset)
friend

Returns hash for this offset.

Definition at line 117 of file layerOffset.h.


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