36 #ifndef Alembic_Util_Dimensions_h
37 #define Alembic_Util_Dimensions_h
51 typedef std::vector<T> SizeVec;
67 : m_vector( copy.m_vector )
73 m_vector.resize( copy.
rank() );
74 for (
size_t i = 0; i < copy.
rank(); ++i )
77 m_vector[i] =
static_cast<T>(
val );
83 m_vector = copy.m_vector;
90 m_vector.resize( copy.
rank() );
91 for (
size_t i = 0; i < copy.
rank(); ++i )
94 m_vector[i] =
static_cast<T>(
val );
99 size_t rank()
const {
return m_vector.size(); }
102 size_t oldSize = m_vector.size();
103 m_vector.resize( r );
104 for (
size_t s = oldSize;
s <
r; ++
s )
106 m_vector[
s] = (
T )0;
111 {
return m_vector[i]; }
114 {
return m_vector[i]; }
116 T *
rootPtr() {
return (
T * )( &( m_vector.front() ) ); }
118 {
return (
const T * )( &( m_vector.front() ) ); }
122 if ( m_vector.size() == 0 ) {
return 0; }
126 for (
size_t i = 0 ; i < m_vector.size() ; i++ )
128 npoints *= (size_t)m_vector[i];
136 template <
class T,
class Y>
139 size_t aRank = a.
rank();
140 size_t bRank = b.
rank();
141 if ( aRank != bRank ) {
return false; }
143 if (
sizeof(
Y ) >
sizeof(
T ) )
145 for (
size_t d = 0; d < aRank; ++d )
147 if ( static_cast<Y>( a[d] ) !=
148 static_cast<Y>( b[d] ) ) {
return false; }
153 for (
size_t d = 0; d < aRank; ++d )
155 if ( static_cast<T>( a[d] ) !=
156 static_cast<T>( b[d] ) ) {
return false; }
164 template <
class T,
class Y>
173 std::ostream &operator<<( std::ostream &ostr, const BaseDimensions<T> &
a )
176 for (
size_t i = 0; i <
a.rank(); ++i )
179 if ( i != a.rank()-1 )
const T * rootPtr() const
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
GLboolean GLboolean GLboolean GLboolean a
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
BaseDimensions(const BaseDimensions ©)
BaseDimensions & operator=(const BaseDimensions< Y > ©)
GLboolean GLboolean GLboolean b
BaseDimensions(const BaseDimensions< Y > ©)
BaseDimensions< Alembic::Util::uint64_t > Dimensions
const T & operator[](size_t i) const
BaseDimensions & operator=(const BaseDimensions ©)
bool operator!=(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
BaseDimensions(const T &t)
#define ALEMBIC_VERSION_NS