All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling Class Reference

#include <TimeSampling.h>

Public Member Functions

 TimeSampling (const TimeSamplingType &iTimeSamplingType, const std::vector< chrono_t > &iSampleTimes)
 TimeSampling (chrono_t iTimePerCycle, chrono_t iStartTime)
 TimeSampling (const TimeSampling &copy)
 TimeSampling ()
bool operator== (const TimeSampling &iRhs) const
size_t getNumStoredTimes () const
const std::vector< chrono_t > & getStoredTimes () const
TimeSamplingType getTimeSamplingType () const
chrono_t getSampleTime (index_t iIndex) const
std::pair< index_t, chrono_tgetFloorIndex (chrono_t iTime, index_t iNumSamples) const
std::pair< index_t, chrono_tgetCeilIndex (chrono_t iTime, index_t iNumSamples) const
std::pair< index_t, chrono_tgetNearIndex (chrono_t iTime, index_t iNumSamples) const

Protected Attributes

TimeSamplingType m_timeSamplingType
std::vector< chrono_tm_sampleTimes

Detailed Description

The TimeSampling class's whole job is to report information about the time values that are associated with the samples that were written to a property. Most of the time, the sampling will be uniform or cyclic, in which case this is mostly an algorithmic interface to the small sample times buffer. In the case where the sampling is truly acyclic, this class acts as an accessor to that array of times.

Definition at line 57 of file TimeSampling.h.

Constructor & Destructor Documentation

Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::TimeSampling ( const TimeSamplingType iTimeSamplingType,
const std::vector< chrono_t > &  iSampleTimes 

The TimeSampling class is really a portable interface, usable via aggregation, that the SimplePropertyReaders and Writers (and their derived classes) can use to provide consistent time-sampling introspection to clients.

iSampleTimesThe number of time samples per cycle
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::TimeSampling ( chrono_t  iTimePerCycle,
chrono_t  iStartTime 

Convenience constructor which creates uniform time sampling with the specified time per cycle and the specified start time.

Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::TimeSampling ( const TimeSampling copy)
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::TimeSampling ( )

Member Function Documentation

std::pair<index_t, chrono_t> Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::getCeilIndex ( chrono_t  iTime,
index_t  iNumSamples 
) const

Find the smallest valid index that has a time greater than the given time. Invalid to call this with zero samples. If the maximum sample time is less than iTime, index numSamples-1 will be returned.

std::pair<index_t, chrono_t> Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::getFloorIndex ( chrono_t  iTime,
index_t  iNumSamples 
) const

Find the largest valid index that has a time less than or equal to the given time. Invalid to call this with zero samples. If the minimum sample time is greater than iTime, index 0 will be returned.

std::pair<index_t, chrono_t> Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::getNearIndex ( chrono_t  iTime,
index_t  iNumSamples 
) const

Find the valid index with the closest time to the given time. Invalid to call this with zero samples.

size_t Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::getNumStoredTimes ( ) const

Get the number of stored times. This is same as the samples per cycle in the time sampling type except for acyclic time sampling. There will always be at least one sample because a start time is always needed.

Definition at line 87 of file TimeSampling.h.

chrono_t Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::getSampleTime ( index_t  iIndex) const

Get the time of any sample it is invalid to call this for out-of-range indices.

const std::vector< chrono_t >& Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::getStoredTimes ( ) const

Definition at line 92 of file TimeSampling.h.

TimeSamplingType Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::getTimeSamplingType ( ) const

Definition at line 97 of file TimeSampling.h.

bool Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::operator== ( const TimeSampling iRhs) const

Definition at line 77 of file TimeSampling.h.

Member Data Documentation

std::vector< chrono_t > Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::m_sampleTimes

Definition at line 130 of file TimeSampling.h.

TimeSamplingType Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::m_timeSamplingType

A TimeSamplingType This is "Uniform", "Cyclic", or "Acyclic".

Definition at line 128 of file TimeSampling.h.

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