Loading...
Searching...
No Matches
TimeSampling.h
Go to the documentation of this file.
//-*****************************************************************************
//
// Copyright (c) 2009-2012,
// Sony Pictures Imageworks, Inc. and
// Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Sony Pictures Imageworks, nor
// Industrial Light & Magic nor the names of their contributors may be used
// to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//-*****************************************************************************
#ifndef Alembic_AbcCoreAbstract_TimeSampling_h
#define Alembic_AbcCoreAbstract_TimeSampling_h
#include <Alembic/Util/Export.h>
#include <Alembic/AbcCoreAbstract/Foundation.h>
#include <Alembic/AbcCoreAbstract/TimeSamplingType.h>
#include <Alembic/AbcCoreAbstract/ArraySample.h>
namespace Alembic {
namespace AbcCoreAbstract {
namespace ALEMBIC_VERSION_NS {
//-*****************************************************************************
class ALEMBIC_EXPORT TimeSampling
{
public:
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
{
return (m_timeSamplingType == iRhs.m_timeSamplingType &&
m_sampleTimes == iRhs.m_sampleTimes);
}
size_t getNumStoredTimes() const
{
return m_sampleTimes.size();
}
const std::vector < chrono_t > & getStoredTimes() const
{
return m_sampleTimes;
}
TimeSamplingType getTimeSamplingType() const
{
return m_timeSamplingType;
}
chrono_t getSampleTime( index_t iIndex ) const;
std::pair<index_t, chrono_t> getFloorIndex( chrono_t iTime,
index_t iNumSamples ) const;
std::pair<index_t, chrono_t> getCeilIndex( chrono_t iTime,
index_t iNumSamples ) const;
std::pair<index_t, chrono_t> getNearIndex( chrono_t iTime,
index_t iNumSamples ) const;
protected:
TimeSamplingType m_timeSamplingType;
std::vector < chrono_t > m_sampleTimes;
private:
// sanity checks the data coming in
void init();
};
typedef Alembic::Util::shared_ptr<TimeSampling> TimeSamplingPtr;
} // End namespace ALEMBIC_VERSION_NS
using namespace ALEMBIC_VERSION_NS;
} // End namespace AbcCoreAbstract
} // End namespace Alembic
#endif
Foundation.h
ArraySample.h
Export.h
ALEMBIC_EXPORT
#define ALEMBIC_EXPORT
Definition Export.h:51
TimeSamplingType.h
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSamplingType
Definition TimeSamplingType.h:69
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::getFloorIndex
std::pair< index_t, chrono_t > getFloorIndex(chrono_t iTime, index_t iNumSamples) const
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::TimeSampling
TimeSampling(chrono_t iTimePerCycle, chrono_t iStartTime)
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::getNearIndex
std::pair< index_t, chrono_t > getNearIndex(chrono_t iTime, index_t iNumSamples) const
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::TimeSampling
TimeSampling(const TimeSamplingType &iTimeSamplingType, const std::vector< chrono_t > &iSampleTimes)
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::getStoredTimes
const std::vector< chrono_t > & getStoredTimes() const
Definition TimeSampling.h:92
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::operator==
bool operator==(const TimeSampling &iRhs) const
Definition TimeSampling.h:77
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::m_timeSamplingType
TimeSamplingType m_timeSamplingType
Definition TimeSampling.h:128
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::TimeSampling
TimeSampling(const TimeSampling &copy)
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::m_sampleTimes
std::vector< chrono_t > m_sampleTimes
Definition TimeSampling.h:130
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::getSampleTime
chrono_t getSampleTime(index_t iIndex) const
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::getNumStoredTimes
size_t getNumStoredTimes() const
Definition TimeSampling.h:87
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::getTimeSamplingType
TimeSamplingType getTimeSamplingType() const
Definition TimeSampling.h:97
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::TimeSampling
TimeSampling()
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSampling::getCeilIndex
std::pair< index_t, chrono_t > getCeilIndex(chrono_t iTime, index_t iNumSamples) const
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS
Definition ArchiveReader.h:47
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::index_t
int64_t index_t
Definition Foundation.h:62
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::chrono_t
float64_t chrono_t
Definition Foundation.h:71
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSamplingPtr
Alembic::Util::shared_ptr< TimeSampling > TimeSamplingPtr
Definition TimeSampling.h:137
Alembic::AbcCoreAbstract
Definition ArchiveReader.h:46
Alembic
Alembic namespace ...
Definition ArchiveInfo.h:46