37 #ifndef Alembic_AbcCoreAbstract_TimeSamplingType_h
38 #define Alembic_AbcCoreAbstract_TimeSamplingType_h
44 namespace AbcCoreAbstract {
71 static uint32_t AcyclicNumSamples();
72 static chrono_t AcyclicTimePerCycle();
78 : m_numSamplesPerCycle( 1 ),
79 m_timePerCycle( 1.0 ) {}
84 : m_numSamplesPerCycle( 1 )
85 , m_timePerCycle( iTimePerCycle )
88 m_timePerCycle < AcyclicTimePerCycle(),
89 "Time per cycle must be greater than 0 " <<
90 "and can not be ACYCLIC_TIME_PER_CYCLE." );
97 : m_numSamplesPerCycle( iNumSamplesPerCycle )
98 , m_timePerCycle( iTimePerCycle )
103 ( m_timePerCycle == AcyclicTimePerCycle() &&
104 m_numSamplesPerCycle == AcyclicNumSamples() ) ||
107 ( m_timePerCycle > 0.0 &&
108 m_timePerCycle < AcyclicTimePerCycle() &&
111 m_numSamplesPerCycle > 0 &&
112 m_numSamplesPerCycle < AcyclicNumSamples() ),
113 "Invalid Time Sampling Type, time per cycle: "
114 << m_timePerCycle <<
" samples per cycle: "
115 << m_numSamplesPerCycle );
126 m_numSamplesPerCycle = AcyclicNumSamples();
127 m_timePerCycle = AcyclicTimePerCycle();
139 bool isUniform()
const {
return m_numSamplesPerCycle == 1; }
142 return ( ( m_numSamplesPerCycle > 1 ) &&
143 ( m_numSamplesPerCycle < AcyclicNumSamples() ) );
146 {
return m_numSamplesPerCycle == AcyclicNumSamples(); }
153 uint32_t m_numSamplesPerCycle;
std::ostream & operator<<(std::ostream &ostr, const DataType &a)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
TimeSamplingType(chrono_t iTimePerCycle)
TimeSamplingType(AcyclicFlag)
uint32_t getNumSamplesPerCycle() const
TimeSamplingType()
Uniform default.
chrono_t getTimePerCycle() const
#define ABCA_ASSERT(COND, TEXT)
#define ALEMBIC_VERSION_NS
TimeSamplingType(uint32_t iNumSamplesPerCycle, chrono_t iTimePerCycle)