Alembic Version 1.1
Loading...
Searching...
No Matches
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling Class Reference

#include <TimeSampling.h>

Collaboration diagram for Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling:

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

◆ TimeSampling() [1/4]

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.

Parameters
iSampleTimesThe number of time samples per cycle

Referenced by TimeSampling(), and operator==().

Here is the caller graph for this function:

◆ TimeSampling() [2/4]

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.

◆ TimeSampling() [3/4]

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

References TimeSampling().

Here is the call graph for this function:

◆ TimeSampling() [4/4]

Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::TimeSampling ( )

Member Function Documentation

◆ getCeilIndex()

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.

◆ getFloorIndex()

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.

◆ getNearIndex()

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.

◆ getNumStoredTimes()

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

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.

References m_sampleTimes.

◆ getSampleTime()

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.

◆ getStoredTimes()

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

Definition at line 92 of file TimeSampling.h.

References m_sampleTimes.

◆ getTimeSamplingType()

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

Definition at line 97 of file TimeSampling.h.

References m_timeSamplingType.

◆ operator==()

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

Definition at line 77 of file TimeSampling.h.

References TimeSampling(), m_sampleTimes, and m_timeSamplingType.

Here is the call graph for this function:

Member Data Documentation

◆ m_sampleTimes

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

Definition at line 130 of file TimeSampling.h.

Referenced by getNumStoredTimes(), getStoredTimes(), and operator==().

◆ m_timeSamplingType

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

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

Definition at line 128 of file TimeSampling.h.

Referenced by getTimeSamplingType(), and operator==().


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