예제 #1
0
파일: AbcLs.cpp 프로젝트: alembic/alembic
//-*****************************************************************************
void  printTimeSampling( AbcA::TimeSamplingPtr iTime, index_t iMaxSample,
                         double fps )
{
    AbcA::TimeSamplingType timeType = iTime->getTimeSamplingType();
    if ( timeType.isUniform() ) {
        std::cout  << "Uniform Sampling. Start time: " <<
            iTime->getStoredTimes()[0] * fps << " Time per cycle: " <<
            timeType.getTimePerCycle() * fps << std::endl;
    }
    else if ( timeType.isCyclic() ) {
        std::cout << "Cyclic Sampling. Time per cycle:" <<
            timeType.getTimePerCycle() * fps << std::endl;

        const std::vector < double > & storedTimes = iTime->getStoredTimes();
        std::size_t numTimes = iTime->getNumStoredTimes();
        std::cout << "Start cycle times: ";
        for (std::size_t i = 0; i < numTimes; ++i ) {
            if (i != 0) {
                std::cout << ", ";
            }
            std::cout << storedTimes[i] * fps;
        }
        std:: cout << std::endl;
    }
    else {
        std::cout << "Acyclic Sampling." << std::endl;
        const std::vector < double > & storedTimes = iTime->getStoredTimes();
        std::size_t numTimes = iTime->getNumStoredTimes();

        for (std::size_t i = 0; i < numTimes; ++i ) {
            if (i != 0) {
                std::cout << ", ";
            }
            std::cout << storedTimes[i] * fps;
        }
        std:: cout << std::endl;
    }

    std::cout << "Max Num Samples: " << iMaxSample << std::endl;
}