00001 //-***************************************************************************** 00002 // 00003 // Copyright (c) 2009-2011, 00004 // Sony Pictures Imageworks, Inc. and 00005 // Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd. 00006 // 00007 // All rights reserved. 00008 // 00009 // Redistribution and use in source and binary forms, with or without 00010 // modification, are permitted provided that the following conditions are 00011 // met: 00012 // * Redistributions of source code must retain the above copyright 00013 // notice, this list of conditions and the following disclaimer. 00014 // * Redistributions in binary form must reproduce the above 00015 // copyright notice, this list of conditions and the following disclaimer 00016 // in the documentation and/or other materials provided with the 00017 // distribution. 00018 // * Neither the name of Sony Pictures Imageworks, nor 00019 // Industrial Light & Magic nor the names of their contributors may be used 00020 // to endorse or promote products derived from this software without specific 00021 // prior written permission. 00022 // 00023 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00024 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00025 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00026 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00027 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00028 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00029 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00030 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00031 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00032 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00033 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00034 // 00035 //-***************************************************************************** 00036 00037 #ifndef _Alembic_Abc_ISampleSelector_h_ 00038 #define _Alembic_Abc_ISampleSelector_h_ 00039 00040 #include <Alembic/Abc/Foundation.h> 00041 00042 namespace Alembic { 00043 namespace Abc { 00044 namespace ALEMBIC_VERSION_NS { 00045 00046 //-***************************************************************************** 00047 class ISampleSelector 00048 { 00049 public: 00050 enum TimeIndexType 00051 { 00052 kFloorIndex, 00053 kCeilIndex, 00054 kNearIndex 00055 }; 00056 00057 ISampleSelector() 00058 : m_requestedIndex( 0 ), 00059 m_requestedTime( 0.0 ), 00060 m_requestedTimeIndexType( kNearIndex ) {} 00061 00062 ISampleSelector( index_t iReqIdx ) 00063 : m_requestedIndex( iReqIdx ), 00064 m_requestedTime( 0.0 ), 00065 m_requestedTimeIndexType( kNearIndex ) {} 00066 00067 explicit ISampleSelector( chrono_t iReqTime, 00068 TimeIndexType iReqIdxType = kNearIndex ) 00069 : m_requestedIndex( -1 ), 00070 m_requestedTime( iReqTime ), 00071 m_requestedTimeIndexType( iReqIdxType ) {} 00072 00073 index_t getRequestedIndex() const { return m_requestedIndex; } 00074 chrono_t getRequestedTime() const { return m_requestedTime; } 00075 TimeIndexType getRequestedTimeIndexType() const 00076 { return m_requestedTimeIndexType; } 00077 00078 index_t getIndex( const AbcA::TimeSamplingPtr & iTsmp, index_t 00079 iNumSamples ) const; 00080 00081 private: 00082 index_t m_requestedIndex; 00083 chrono_t m_requestedTime; 00084 TimeIndexType m_requestedTimeIndexType; 00085 }; 00086 00087 } // End namespace ALEMBIC_VERSION_NS 00088 00089 using namespace ALEMBIC_VERSION_NS; 00090 00091 } // End namespace Abc 00092 } // End namespace Alembic 00093 00094 #endif
1.5.9