Loading...
Searching...
No Matches
HdRetainedTypedSampledDataSource< T > Class Template Reference

Similar to HdRetainedSampledDataSource but provides strongly typed semantics. More...

#include <retainedDataSource.h>

+ Inheritance diagram for HdRetainedTypedSampledDataSource< T >:

Public Member Functions

 HD_DECLARE_DATASOURCE_ABSTRACT (HdRetainedTypedSampledDataSource< T >)
 
 HdRetainedTypedSampledDataSource (const T &value)
 
bool GetContributingSampleTimesForInterval (HdSampledDataSource::Time startTime, HdSampledDataSource::Time endTime, std::vector< HdSampledDataSource::Time > *outSampleTimes) override
 Given a shutter window of interest (startTime and endTime relative to the current frame), return a list of sample times for the caller to query with GetValue such that the caller can reconstruct the signal over the shutter window.
 
VtValue GetValue (HdSampledDataSource::Time shutterOffset) override
 Returns the value of this data source at frame-relative time shutterOffset.
 
GetTypedValue (HdSampledDataSource::Time shutterOffset) override
 Returns the value of this data source at frame-relative time shutterOffset, as type T.
 
HdRetainedTypedSampledDataSource< bool >::Handle New (const bool &value)
 
- Public Member Functions inherited from HdTypedSampledDataSource< T >
 HD_DECLARE_DATASOURCE_ABSTRACT (HdTypedSampledDataSource< T >)
 
virtual T GetTypedValue (Time shutterOffset)=0
 Returns the value of this data source at frame-relative time shutterOffset, as type T.
 
- Public Member Functions inherited from HdSampledDataSource
 HD_DECLARE_DATASOURCE_ABSTRACT (HdSampledDataSource)
 
virtual VtValue GetValue (Time shutterOffset)=0
 Returns the value of this data source at frame-relative time shutterOffset.
 
virtual bool GetContributingSampleTimesForInterval (Time startTime, Time endTime, std::vector< Time > *outSampleTimes)=0
 Given a shutter window of interest (startTime and endTime relative to the current frame), return a list of sample times for the caller to query with GetValue such that the caller can reconstruct the signal over the shutter window.
 

Static Public Member Functions

static HdRetainedTypedSampledDataSource< T >::Handle New (const T &value)
 

Protected Attributes

_value
 

Additional Inherited Members

- Public Types inherited from HdTypedSampledDataSource< T >
using Type = T
 
- Public Types inherited from HdSampledDataSource
using Time = float
 

Detailed Description

template<typename T>
class HdRetainedTypedSampledDataSource< T >

Similar to HdRetainedSampledDataSource but provides strongly typed semantics.

Definition at line 164 of file retainedDataSource.h.

Constructor & Destructor Documentation

◆ HdRetainedTypedSampledDataSource()

HdRetainedTypedSampledDataSource ( const T &  value)
inline

Definition at line 170 of file retainedDataSource.h.

Member Function Documentation

◆ GetContributingSampleTimesForInterval()

bool GetContributingSampleTimesForInterval ( HdSampledDataSource::Time  startTime,
HdSampledDataSource::Time  endTime,
std::vector< HdSampledDataSource::Time > *  outSampleTimes 
)
inlineoverridevirtual

Given a shutter window of interest (startTime and endTime relative to the current frame), return a list of sample times for the caller to query with GetValue such that the caller can reconstruct the signal over the shutter window.

For a sample-based attribute, this might be a list of times when samples are defined. For a procedural scene, this might be a generated distribution. Note that the returned samples don't need to be within startTime and endTime; if a boundary sample is outside of the window, implementers can return it, and callers should expect it and interpolate to startTime or endTime accordingly. If this call returns true, the caller is expected to pass the list of outSampleTimes to GetValue. If this call returns false, this value is uniform across the shutter window and the caller should call GetValue(0) to get that uniform value.

Implements HdSampledDataSource.

Definition at line 173 of file retainedDataSource.h.

◆ GetTypedValue()

T GetTypedValue ( HdSampledDataSource::Time  shutterOffset)
inlineoverridevirtual

Returns the value of this data source at frame-relative time shutterOffset, as type T.

Implements HdTypedSampledDataSource< T >.

Definition at line 186 of file retainedDataSource.h.

◆ GetValue()

VtValue GetValue ( HdSampledDataSource::Time  shutterOffset)
inlineoverridevirtual

Returns the value of this data source at frame-relative time shutterOffset.

The caller does not track the frame; the scene index producing this datasource is responsible for that, if applicable. Note that, although this call returns a VtValue for each shutter offset, the type of the held value is expected to be the same across all shutter offsets. This call is expected to be threadsafe.

Implements HdSampledDataSource.

Definition at line 181 of file retainedDataSource.h.

◆ New()

HdRetainedTypedSampledDataSource< T >::Handle New ( const T &  value)
static

Definition at line 201 of file retainedDataSource.h.

Member Data Documentation

◆ _value

T _value
protected

Definition at line 195 of file retainedDataSource.h.


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