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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 { | 50 { |
51 public: | 51 public: |
52 //-************************************************************************* | 52 //-************************************************************************* |
53 // POLY MESH SCHEMA SAMPLE TYPE | 53 // POLY MESH SCHEMA SAMPLE TYPE |
54 //-************************************************************************* | 54 //-************************************************************************* |
55 class Sample | 55 class Sample |
56 { | 56 { |
57 public: | 57 public: |
58 //! Creates a default sample with no data in it. | 58 //! Creates a default sample with no data in it. |
59 //! ... | 59 //! ... |
60 Sample() {} | 60 Sample() { reset(); } |
61 | 61 |
62 //! Creates a sample with position data but no index | 62 //! Creates a sample with position data but no index |
63 //! or count data. For specifying samples after the first one | 63 //! or count data. For specifying samples after the first one |
64 Sample( const Abc::V3fArraySample &iPos ) | 64 Sample( const Abc::V3fArraySample &iPos ) |
65 : m_positions( iPos ) {} | 65 : m_positions( iPos ) {} |
66 | 66 |
67 | 67 |
68 //! Creates a sample with position data, index data, count data, | 68 //! Creates a sample with position data, index data, count data, |
69 //! and optional UV and Normals data. | 69 //! and optional UV and Normals data. |
70 //! For specifying samples with an explicit topology. The first | 70 //! For specifying samples with an explicit topology. The first |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 OPolyMeshSchema() {} | 152 OPolyMeshSchema() {} |
153 | 153 |
154 //! This templated, primary constructor creates a new poly mesh writer. | 154 //! This templated, primary constructor creates a new poly mesh writer. |
155 //! The first argument is any Abc (or AbcCoreAbstract) object | 155 //! The first argument is any Abc (or AbcCoreAbstract) object |
156 //! which can intrusively be converted to an CompoundPropertyWriterPtr | 156 //! which can intrusively be converted to an CompoundPropertyWriterPtr |
157 //! to use as a parent, from which the error handler policy for | 157 //! to use as a parent, from which the error handler policy for |
158 //! inheritance is also derived. The remaining optional arguments | 158 //! inheritance is also derived. The remaining optional arguments |
159 //! can be used to override the ErrorHandlerPolicy, to specify | 159 //! can be used to override the ErrorHandlerPolicy, to specify |
160 //! MetaData, and to set TimeSamplingType. | 160 //! MetaData, and to set TimeSamplingType. |
161 template <class CPROP_PTR> | 161 template <class CPROP_PTR> |
162 OPolyMeshSchema( CPROP_PTR iParentObject, | 162 OPolyMeshSchema( CPROP_PTR iParent, |
163 const std::string &iName, | 163 const std::string &iName, |
164 | 164 |
165 const Abc::Argument &iArg0 = Abc::Argument(), | 165 const Abc::Argument &iArg0 = Abc::Argument(), |
166 const Abc::Argument &iArg1 = Abc::Argument(), | 166 const Abc::Argument &iArg1 = Abc::Argument(), |
167 const Abc::Argument &iArg2 = Abc::Argument() ) | 167 const Abc::Argument &iArg2 = Abc::Argument() ) |
168 : Abc::OSchema<PolyMeshSchemaInfo>( iParentObject, iName, | 168 : Abc::OSchema<PolyMeshSchemaInfo>( iParent, iName, |
169 iArg0, iArg1, iArg2 ) | 169 iArg0, iArg1, iArg2 ) |
170 { | 170 { |
171 | 171 |
172 AbcA::TimeSamplingPtr tsPtr = | 172 AbcA::TimeSamplingPtr tsPtr = |
173 Abc::GetTimeSampling( iArg0, iArg1, iArg2 ); | 173 Abc::GetTimeSampling( iArg0, iArg1, iArg2 ); |
174 uint32_t tsIndex = | 174 uint32_t tsIndex = |
175 Abc::GetTimeSamplingIndex( iArg0, iArg1, iArg2 ); | 175 Abc::GetTimeSamplingIndex( iArg0, iArg1, iArg2 ); |
176 | 176 |
177 // if we specified a valid TimeSamplingPtr, use it to determine the | 177 // if we specified a valid TimeSamplingPtr, use it to determine the |
178 // index otherwise we'll use the index, which defaults to the intrinsic | 178 // index otherwise we'll use the index, which defaults to the intrinsic |
179 // 0 index | 179 // 0 index |
180 if (tsPtr) | 180 if (tsPtr) |
181 { | 181 { |
182 tsIndex = iParentObject->getObject()->getArchive( | 182 tsIndex = iParent->getObject()->getArchive( |
183 )->addTimeSampling(*tsPtr); | 183 )->addTimeSampling(*tsPtr); |
184 } | 184 } |
185 | 185 |
186 // Meta data and error handling are eaten up by | 186 // Meta data and error handling are eaten up by |
187 // the super type, so all that's left is time sampling. | 187 // the super type, so all that's left is time sampling. |
188 init( tsIndex ); | 188 init( tsIndex ); |
189 } | 189 } |
190 | 190 |
191 template <class CPROP_PTR> | 191 template <class CPROP_PTR> |
192 explicit OPolyMeshSchema( CPROP_PTR iParentObject, | 192 explicit OPolyMeshSchema( CPROP_PTR iParent, |
193 const Abc::Argument &iArg0 = Abc::Argument(), | 193 const Abc::Argument &iArg0 = Abc::Argument(), |
194 const Abc::Argument &iArg1 = Abc::Argument(), | 194 const Abc::Argument &iArg1 = Abc::Argument(), |
195 const Abc::Argument &iArg2 = Abc::Argument() ) | 195 const Abc::Argument &iArg2 = Abc::Argument() ) |
196 : Abc::OSchema<PolyMeshSchemaInfo>( iParentObject, | 196 : Abc::OSchema<PolyMeshSchemaInfo>( iParent, |
197 iArg0, iArg1, iArg2 ) | 197 iArg0, iArg1, iArg2 ) |
198 { | 198 { |
199 | 199 |
200 AbcA::TimeSamplingPtr tsPtr = | 200 AbcA::TimeSamplingPtr tsPtr = |
201 Abc::GetTimeSampling( iArg0, iArg1, iArg2 ); | 201 Abc::GetTimeSampling( iArg0, iArg1, iArg2 ); |
202 uint32_t tsIndex = | 202 uint32_t tsIndex = |
203 Abc::GetTimeSamplingIndex( iArg0, iArg1, iArg2 ); | 203 Abc::GetTimeSamplingIndex( iArg0, iArg1, iArg2 ); |
204 | 204 |
205 // if we specified a valid TimeSamplingPtr, use it to determine the | 205 // if we specified a valid TimeSamplingPtr, use it to determine the |
206 // index otherwise we'll use the index, which defaults to the intrinsic | 206 // index otherwise we'll use the index, which defaults to the intrinsic |
207 // 0 index | 207 // 0 index |
208 if (tsPtr) | 208 if (tsPtr) |
209 { | 209 { |
210 tsIndex = iParentObject->getObject()->getArchive( | 210 tsIndex = iParent->getObject()->getArchive( |
211 )->addTimeSampling(*tsPtr); | 211 )->addTimeSampling(*tsPtr); |
212 } | 212 } |
213 | 213 |
214 // Meta data and error handling are eaten up by | 214 // Meta data and error handling are eaten up by |
215 // the super type, so all that's left is time sampling. | 215 // the super type, so all that's left is time sampling. |
216 init( tsIndex ); | 216 init( tsIndex ); |
217 } | 217 } |
218 | 218 |
219 //! Copy constructor. | 219 //! Copy constructor. |
220 OPolyMeshSchema( const OPolyMeshSchema& iCopy ) | 220 OPolyMeshSchema( const OPolyMeshSchema& iCopy ) |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 | 321 |
322 //-***************************************************************************** | 322 //-***************************************************************************** |
323 // SCHEMA OBJECT | 323 // SCHEMA OBJECT |
324 //-***************************************************************************** | 324 //-***************************************************************************** |
325 typedef Abc::OSchemaObject<OPolyMeshSchema> OPolyMesh; | 325 typedef Abc::OSchemaObject<OPolyMeshSchema> OPolyMesh; |
326 | 326 |
327 } // End namespace AbcGeom | 327 } // End namespace AbcGeom |
328 } // End namespace Alembic | 328 } // End namespace Alembic |
329 | 329 |
330 #endif | 330 #endif |
OLD | NEW |