This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
HdTimeSampleArray< TYPE, CAPACITY > Struct Template Reference

An array of a value sampled over time, in struct-of-arrays layout. More...

#include <timeSampleArray.h>

+ Inheritance diagram for HdTimeSampleArray< TYPE, CAPACITY >:

Public Member Functions

 HdTimeSampleArray (const HdTimeSampleArray &rhs)
 
HdTimeSampleArrayoperator= (const HdTimeSampleArray &rhs)
 
virtual void Resize (unsigned int newSize)
 Resize the internal buffers.
 
TYPE Resample (float u) const
 Convience method for invoking HdResampleRawTimeSamples on this HdTimeSampleArray.
 
bool UnboxFrom (HdTimeSampleArray< VtValue, CAPACITY > const &box)
 Unbox an HdTimeSampleArray holding boxed VtValue<VtArray<T>> samples into an array holding VtArray<T> samples.
 
bool GetContributingSampleTimesForInterval (const float startTime, const float endTime, std::vector< float > *const outSampleTimes) const
 See HdGetContributingSampleTimesForInterval.
 

Public Attributes

size_t count
 
TfSmallVector< float, CAPACITY > times
 
TfSmallVector< TYPE, CAPACITY > values
 

Detailed Description

template<typename TYPE, unsigned int CAPACITY>
struct HdTimeSampleArray< TYPE, CAPACITY >

An array of a value sampled over time, in struct-of-arrays layout.

This is provided as a convenience for time-sampling attributes. This type has static capacity but dynamic size, providing a limited ability to handle variable sampling without requiring heap allocation.

Definition at line 170 of file timeSampleArray.h.

Constructor & Destructor Documentation

◆ HdTimeSampleArray() [1/2]

HdTimeSampleArray ( )
inline

Definition at line 172 of file timeSampleArray.h.

◆ HdTimeSampleArray() [2/2]

HdTimeSampleArray ( const HdTimeSampleArray< TYPE, CAPACITY > &  rhs)
inline

Definition at line 178 of file timeSampleArray.h.

Member Function Documentation

◆ GetContributingSampleTimesForInterval()

bool GetContributingSampleTimesForInterval ( const float  startTime,
const float  endTime,
std::vector< float > *const  outSampleTimes 
) const
inline

See HdGetContributingSampleTimesForInterval.

Definition at line 225 of file timeSampleArray.h.

◆ operator=()

HdTimeSampleArray & operator= ( const HdTimeSampleArray< TYPE, CAPACITY > &  rhs)
inline

Definition at line 184 of file timeSampleArray.h.

◆ Resample()

TYPE Resample ( float  u) const
inline

Convience method for invoking HdResampleRawTimeSamples on this HdTimeSampleArray.

Definition at line 200 of file timeSampleArray.h.

◆ Resize()

virtual void Resize ( unsigned int  newSize)
inlinevirtual

Resize the internal buffers.

Reimplemented in HdIndexedTimeSampleArray< TYPE, CAPACITY >.

Definition at line 192 of file timeSampleArray.h.

◆ UnboxFrom()

bool UnboxFrom ( HdTimeSampleArray< VtValue, CAPACITY > const &  box)
inline

Unbox an HdTimeSampleArray holding boxed VtValue<VtArray<T>> samples into an array holding VtArray<T> samples.

If any of the values contain the wrong type, their data is discarded. The function returns true if all samples have the correct type.

Definition at line 208 of file timeSampleArray.h.

Member Data Documentation

◆ count

size_t count

Definition at line 233 of file timeSampleArray.h.

◆ times

TfSmallVector<float, CAPACITY> times

Definition at line 234 of file timeSampleArray.h.

◆ values

TfSmallVector<TYPE, CAPACITY> values

Definition at line 235 of file timeSampleArray.h.


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