OLD | NEW |
1 //-***************************************************************************** | 1 //-***************************************************************************** |
2 // | 2 // |
3 // Copyright (c) 2009-2011, | 3 // Copyright (c) 2009-2011, |
4 // Sony Pictures Imageworks, Inc. and | 4 // Sony Pictures Imageworks, Inc. and |
5 // Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd. | 5 // Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd. |
6 // | 6 // |
7 // All rights reserved. | 7 // All rights reserved. |
8 // | 8 // |
9 // Redistribution and use in source and binary forms, with or without | 9 // Redistribution and use in source and binary forms, with or without |
10 // modification, are permitted provided that the following conditions are | 10 // modification, are permitted provided that the following conditions are |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 IXformSchema() {} | 68 IXformSchema() {} |
69 | 69 |
70 //! This templated, primary constructor creates a new xform writer. | 70 //! This templated, primary constructor creates a new xform writer. |
71 //! The first argument is any Abc (or AbcCoreAbstract) object | 71 //! The first argument is any Abc (or AbcCoreAbstract) object |
72 //! which can intrusively be converted to an CompoundPropertyWriterPtr | 72 //! which can intrusively be converted to an CompoundPropertyWriterPtr |
73 //! to use as a parent, from which the error handler policy for | 73 //! to use as a parent, from which the error handler policy for |
74 //! inheritance is also derived. The remaining optional arguments | 74 //! inheritance is also derived. The remaining optional arguments |
75 //! can be used to override the ErrorHandlerPolicy, to specify | 75 //! can be used to override the ErrorHandlerPolicy, to specify |
76 //! MetaData, and to set TimeSamplingType. | 76 //! MetaData, and to set TimeSamplingType. |
77 template <class CPROP_PTR> | 77 template <class CPROP_PTR> |
78 IXformSchema( CPROP_PTR iParentObject, | 78 IXformSchema( CPROP_PTR iParent, |
79 const std::string &iName, | 79 const std::string &iName, |
80 const Abc::Argument &iArg0 = Abc::Argument(), | 80 const Abc::Argument &iArg0 = Abc::Argument(), |
81 const Abc::Argument &iArg1 = Abc::Argument() ) | 81 const Abc::Argument &iArg1 = Abc::Argument() ) |
82 : Abc::ISchema<XformSchemaInfo>( iParentObject, iName, | 82 : Abc::ISchema<XformSchemaInfo>( iParent, iName, |
83 iArg0, iArg1 ) | 83 iArg0, iArg1 ) |
84 { | 84 { |
85 // Meta data and error handling are eaten up by | 85 // Meta data and error handling are eaten up by |
86 // the super type, so all that's left is SchemaInterpMatching. | 86 // the super type, so all that's left is SchemaInterpMatching. |
87 init( Abc::GetSchemaInterpMatching( iArg0, iArg1 ) ); | 87 init( Abc::GetSchemaInterpMatching( iArg0, iArg1 ) ); |
88 } | 88 } |
89 | 89 |
90 //! This constructor does the same as the above, but uses the default | 90 //! This constructor does the same as the above, but uses the default |
91 //! name from the XformSchemaInfo struct. | 91 //! name from the XformSchemaInfo struct. |
92 template <class CPROP_PTR> | 92 template <class CPROP_PTR> |
93 explicit IXformSchema( CPROP_PTR iParentObject, | 93 explicit IXformSchema( CPROP_PTR iParent, |
94 | 94 |
95 const Abc::Argument &iArg0 = Abc::Argument(), | 95 const Abc::Argument &iArg0 = Abc::Argument(), |
96 const Abc::Argument &iArg1 = Abc::Argument() ) | 96 const Abc::Argument &iArg1 = Abc::Argument() ) |
97 : Abc::ISchema<XformSchemaInfo>( iParentObject, iArg0, iArg1 ) | 97 : Abc::ISchema<XformSchemaInfo>( iParent, iArg0, iArg1 ) |
98 { | 98 { |
99 init( Abc::GetSchemaInterpMatching( iArg0, iArg1 ) ); | 99 init( Abc::GetSchemaInterpMatching( iArg0, iArg1 ) ); |
100 } | 100 } |
101 | 101 |
102 //! Wrap an existing IXform object | 102 //! Wrap an existing IXform object |
103 template <class CPROP_PTR> | 103 template <class CPROP_PTR> |
104 explicit IXformSchema( CPROP_PTR iThis, | 104 explicit IXformSchema( CPROP_PTR iThis, |
105 Abc::WrapExistingFlag iFlag, | 105 Abc::WrapExistingFlag iFlag, |
106 | 106 |
107 const Abc::Argument &iArg0 = Abc::Argument(), | 107 const Abc::Argument &iArg0 = Abc::Argument(), |
(...skipping 18 matching lines...) Expand all Loading... |
126 | 126 |
127 size_t getNumSamples(); | 127 size_t getNumSamples(); |
128 | 128 |
129 //! fill the supplied sample reference with values | 129 //! fill the supplied sample reference with values |
130 void get( XformSample &oSamp, | 130 void get( XformSample &oSamp, |
131 const Abc::ISampleSelector &iSS = Abc::ISampleSelector() ); | 131 const Abc::ISampleSelector &iSS = Abc::ISampleSelector() ); |
132 | 132 |
133 XformSample getValue( const Abc::ISampleSelector &iSS = | 133 XformSample getValue( const Abc::ISampleSelector &iSS = |
134 Abc::ISampleSelector() ); | 134 Abc::ISampleSelector() ); |
135 | 135 |
| 136 Abc::IBox3dProperty getChildBounds() { return m_childBounds; } |
| 137 |
136 // lightweight get to avoid constructing a sample | 138 // lightweight get to avoid constructing a sample |
137 // see XformSample.h for explanation of this property | 139 // see XformSample.h for explanation of this property |
138 bool getInheritsXforms( const Abc::ISampleSelector &iSS = | 140 bool getInheritsXforms( const Abc::ISampleSelector &iSS = |
139 Abc::ISampleSelector() ); | 141 Abc::ISampleSelector() ); |
140 | 142 |
141 size_t getNumOps() const { return m_numOps; } | 143 size_t getNumOps() const { return m_sample.getNumOps(); } |
142 | 144 |
143 //! Reset returns this function set to an empty, default | 145 //! Reset returns this function set to an empty, default |
144 //! state. | 146 //! state. |
145 void reset() | 147 void reset() |
146 { | 148 { |
147 m_childBounds.reset(); | 149 m_childBounds.reset(); |
148 m_ops.reset(); | 150 m_sample = XformSample(); |
149 m_inherits.reset(); | 151 m_inherits.reset(); |
150 m_isConstant = true; | 152 m_isConstant = true; |
151 m_isConstantIdentity = true; | 153 m_isConstantIdentity = true; |
152 | 154 |
153 super_type::reset(); | 155 super_type::reset(); |
154 } | 156 } |
155 | 157 |
156 //! Valid returns whether this function set is valid. | 158 //! Valid returns whether this function set is valid. |
157 bool valid() const | 159 bool valid() const |
158 { | 160 { |
159 return ( m_ops && super_type::valid() ); | 161 return ( super_type::valid() ); |
160 } | 162 } |
161 | 163 |
| 164 ICompoundProperty getArbGeomParams() { return m_arbGeomParams; } |
| 165 |
162 //! unspecified-bool-type operator overload. | 166 //! unspecified-bool-type operator overload. |
163 //! ... | 167 //! ... |
164 ALEMBIC_OVERRIDE_OPERATOR_BOOL( this_type::valid() ); | 168 ALEMBIC_OVERRIDE_OPERATOR_BOOL( this_type::valid() ); |
165 | 169 |
166 | 170 |
167 protected: | 171 protected: |
168 Abc::IBox3dProperty m_childBounds; | 172 Abc::IBox3dProperty m_childBounds; |
169 | 173 |
170 AbcA::ScalarPropertyReaderPtr m_ops; | |
171 | |
172 AbcA::BasePropertyReaderPtr m_vals; | 174 AbcA::BasePropertyReaderPtr m_vals; |
173 | 175 |
174 Abc::UInt32ArraySamplePtr m_animChannels; | 176 Abc::IBoolProperty m_inherits; |
175 | 177 |
176 Abc::IBoolProperty m_inherits; | 178 Abc::ICompoundProperty m_arbGeomParams; |
177 | 179 |
178 bool m_isConstant; | 180 bool m_isConstant; |
179 | 181 |
180 bool m_isConstantIdentity; | 182 bool m_isConstantIdentity; |
181 | 183 |
182 std::size_t m_numOps; | 184 XformSample m_sample; |
183 std::size_t m_numChannels; | |
184 | |
185 std::vector<Alembic::Util::uint8_t> m_opVec; | |
186 std::vector<Alembic::Util::float64_t> m_valVec; | |
187 | 185 |
188 private: | 186 private: |
189 void init( Abc::SchemaInterpMatching iMatching ); | 187 void init( Abc::SchemaInterpMatching iMatching ); |
190 | 188 |
191 // is m_vals an ArrayProperty, or a ScalarProperty? | 189 // is m_vals an ArrayProperty, or a ScalarProperty? |
192 bool m_useArrayProp; | 190 bool m_useArrayProp; |
193 | 191 |
194 // fills m_valVec with data | 192 // fills m_valVec with data |
195 void getChannelValues( const AbcA::index_t iSampleIndex ); | 193 void getChannelValues( const AbcA::index_t iSampleIndex, |
| 194 XformSample & oSamp ); |
196 }; | 195 }; |
197 | 196 |
198 //-***************************************************************************** | 197 //-***************************************************************************** |
199 // SCHEMA OBJECT | 198 // SCHEMA OBJECT |
200 //-***************************************************************************** | 199 //-***************************************************************************** |
201 typedef Abc::ISchemaObject<IXformSchema> IXform; | 200 typedef Abc::ISchemaObject<IXformSchema> IXform; |
202 | 201 |
203 } // End namespace AbcGeom | 202 } // End namespace AbcGeom |
204 } // End namespace Alembic | 203 } // End namespace Alembic |
205 | 204 |
206 #endif | 205 #endif |
OLD | NEW |