37 #ifndef Alembic_AbcGeom_OSubD_h
38 #define Alembic_AbcGeom_OSubD_h
55 int32_t ABC_GEOM_SUBD_NULL_INT_VALUE( -1073741824 );
94 : m_positions( iPositions )
95 , m_faceIndices( iFaceIndices )
96 , m_faceCounts( iFaceCounts )
97 , m_faceVaryingInterpolateBoundary( ABC_GEOM_SUBD_NULL_INT_VALUE )
98 , m_faceVaryingPropagateCorners( ABC_GEOM_SUBD_NULL_INT_VALUE )
99 , m_interpolateBoundary( ABC_GEOM_SUBD_NULL_INT_VALUE )
100 , m_creaseIndices ( iCreaseIndices )
101 , m_creaseLengths ( iCreaseLengths )
102 , m_creaseSharpnesses ( iCreaseSharpnesses )
103 , m_cornerIndices ( iCornerIndices )
104 , m_cornerSharpnesses ( iCornerSharpnesses )
106 , m_subdScheme (
"catmull-clark" )
112 { m_positions = iSmp; }
116 { m_faceIndices = iSmp; }
120 { m_faceCounts = iCnt; }
125 {
return m_faceVaryingInterpolateBoundary; }
127 { m_faceVaryingInterpolateBoundary = i; }
130 {
return m_faceVaryingPropagateCorners; }
132 { m_faceVaryingPropagateCorners = i; }
135 {
return m_interpolateBoundary; }
137 { m_interpolateBoundary = i; }
141 {
return m_creaseIndices; }
143 { m_creaseIndices = iCreaseIndices; }
146 {
return m_creaseLengths; }
148 { m_creaseLengths = iCreaseLengths; }
151 {
return m_creaseSharpnesses; }
153 &iCreaseSharpnesses )
154 { m_creaseSharpnesses = iCreaseSharpnesses; }
159 m_creaseIndices = iCreaseIndices;
160 m_creaseLengths = iCreaseLengths;
167 m_creaseIndices = iCreaseIndices;
168 m_creaseLengths = iCreaseLengths;
169 m_creaseSharpnesses = iCreaseSharpnesses;
174 {
return m_cornerIndices; }
176 { m_cornerIndices = iCornerIndices; }
179 {
return m_cornerSharpnesses; }
181 &iCornerSharpnesses )
182 { m_cornerSharpnesses = iCornerSharpnesses; }
187 m_cornerIndices = iCornerIndices;
188 m_cornerSharpnesses = iCornerSharpnesses;
195 { m_holes = iHoles; }
199 {
return m_subdScheme; }
201 { m_subdScheme = iScheme; }
206 { m_selfBounds = iBnds; }
211 { m_velocities = iVelocities; }
214 const OV2fGeomParam::Sample &
getUVs()
const {
return m_uvs; }
215 void setUVs(
const OV2fGeomParam::Sample &iUVs )
221 m_faceIndices.reset();
222 m_faceCounts.reset();
224 m_faceVaryingInterpolateBoundary = ABC_GEOM_SUBD_NULL_INT_VALUE;
225 m_faceVaryingPropagateCorners = ABC_GEOM_SUBD_NULL_INT_VALUE;
226 m_interpolateBoundary = ABC_GEOM_SUBD_NULL_INT_VALUE;
228 m_creaseIndices.reset();
229 m_creaseLengths.reset();
230 m_creaseSharpnesses.reset();
232 m_cornerIndices.reset();
233 m_cornerSharpnesses.reset();
237 m_subdScheme =
"catmull-clark";
239 m_velocities.reset();
241 m_selfBounds.makeEmpty();
248 if( !m_positions.getData() && !m_faceIndices.getData() && !m_faceCounts.getData() )
250 if( m_uvs.getVals() || m_velocities.getData() ||
251 (m_faceVaryingInterpolateBoundary != ABC_GEOM_SUBD_NULL_INT_VALUE) ||
252 (m_faceVaryingPropagateCorners != ABC_GEOM_SUBD_NULL_INT_VALUE) ||
253 (m_interpolateBoundary != ABC_GEOM_SUBD_NULL_INT_VALUE) ||
254 m_creaseIndices.getData() ||
255 m_creaseLengths.getData() || m_creaseSharpnesses.getData() ||
256 m_cornerIndices.getData() || m_cornerSharpnesses.getData() ||
318 m_selectiveExport =
false;
320 m_timeSamplingIndex = 0;
365 if( m_positionsProperty.valid() )
367 return m_positionsProperty.getTimeSampling();
371 return getObject().getArchive().getTimeSampling( 0 );
382 {
return m_numSamples; }
386 void set(
const Sample &iSamp );
390 void setFromPrevious( );
392 void setTimeSampling( uint32_t iIndex );
405 m_positionsProperty.reset();
406 m_faceIndicesProperty.reset();
407 m_faceCountsProperty.reset();
409 m_faceVaryingInterpolateBoundaryProperty.reset();
410 m_faceVaryingPropagateCornersProperty.reset();
411 m_interpolateBoundaryProperty.reset();
413 m_creaseIndicesProperty.reset();
414 m_creaseLengthsProperty.reset();
415 m_creaseSharpnessesProperty.reset();
417 m_cornerIndicesProperty.reset();
418 m_cornerSharpnessesProperty.reset();
420 m_holesProperty.reset();
422 m_subdSchemeProperty.reset();
424 m_velocitiesProperty.reset();
438 m_positionsProperty.
valid() &&
439 m_faceIndicesProperty.valid() &&
440 m_faceCountsProperty.valid() ) ||
447 void getFaceSetNames( std::vector <std::string> & oFaceSetNames );
449 bool hasFaceSet(
const std::string &iFaceSetName );
461 void init( uint32_t iTsIdx,
bool isSparse );
466 void selectiveSet(
const Sample &iSamp );
502 void initCreases(uint32_t iNumSamples);
503 void initCorners(uint32_t iNumSamples);
504 void initHoles(uint32_t iNumSamples);
507 std::map <std::string, OFaceSet> m_faceSets;
511 bool m_selectiveExport;
516 uint32_t m_timeSamplingIndex;
518 void createSubDSchemeProperty();
520 void createFaceVaryingInterpolateBoundaryProperty();
522 void createFaceVaryingPropagateCornersProperty();
524 void createInterpolateBoundaryProperty();
526 void createVelocitiesProperty();
528 void createUVsProperty(
const Sample &iSamp );
530 void createPositionsProperty();
void setFaceCounts(const Abc::Int32ArraySample &iCnt)
void setSelfBounds(const Abc::Box3d &iBnds)
const Abc::Box3d & getSelfBounds() const
virtual bool valid() const
std::string m_uvSourceName
bool isPartialSample() const
void setHoles(const Abc::Int32ArraySample &iHoles)
int32_t getFaceVaryingPropagateCorners() const
GLsizei const GLchar *const * string
Abc::OV3fArrayProperty m_velocitiesProperty
int32_t m_faceVaryingPropagateCorners
Util::shared_ptr< OSubD > OSubDPtr
Abc::OInt32Property m_faceVaryingPropagateCornersProperty
const Abc::FloatArraySample & getCornerSharpnesses() const
Abc::OFloatArrayProperty m_creaseSharpnessesProperty
const Abc::V3fArraySample & getVelocities() const
Sample(const Abc::P3fArraySample &iPositions, const Abc::Int32ArraySample &iFaceIndices, const Abc::Int32ArraySample &iFaceCounts, const Abc::Int32ArraySample &iCreaseIndices=Abc::Int32ArraySample(), const Abc::Int32ArraySample &iCreaseLengths=Abc::Int32ArraySample(), const Abc::FloatArraySample &iCreaseSharpnesses=Abc::FloatArraySample(), const Abc::Int32ArraySample &iCornerIndices=Abc::Int32ArraySample(), const Abc::FloatArraySample &iCornerSharpnesses=Abc::FloatArraySample(), const Abc::Int32ArraySample &iHoles=Abc::Int32ArraySample())
Abc::OInt32ArrayProperty m_creaseIndicesProperty
Abc::OInt32ArrayProperty m_faceCountsProperty
Abc::P3fArraySample m_positions
int32_t m_interpolateBoundary
void setFaceVaryingInterpolateBoundary(int32_t i)
int32_t getFaceVaryingInterpolateBoundary() const
const Abc::Int32ArraySample & getCreaseIndices() const
Abc::Int32ArraySample m_creaseIndices
void setUVs(const OV2fGeomParam::Sample &iUVs)
const Abc::P3fArraySample & getPositions() const
Abc::Int32ArraySample m_faceIndices
Abc::OStringProperty m_subdSchemeProperty
const Abc::Int32ArraySample & getHoles() const
const Abc::Int32ArraySample & getCornerIndices() const
Alembic::Util::shared_ptr< TimeSampling > TimeSamplingPtr
void setFaceIndices(const Abc::Int32ArraySample &iSmp)
Abc::OInt32ArrayProperty m_faceIndicesProperty
Abc::OFloatArrayProperty m_cornerSharpnessesProperty
void setCreases(const Abc::Int32ArraySample &iCreaseIndices, const Abc::Int32ArraySample &iCreaseLengths)
Abc::OP3fArrayProperty m_positionsProperty
std::string getSubdivisionScheme() const
void setCorners(const Abc::Int32ArraySample &iCornerIndices, const Abc::FloatArraySample &iCornerSharpnesses)
void setCornerIndices(const Abc::Int32ArraySample &iCornerIndices)
#define ALEMBIC_EXPORT_CONST
#define ALEMBIC_OVERRIDE_OPERATOR_BOOL(PASS_COND)
int32_t getInterpolateBoundary() const
void setSubdivisionScheme(const std::string &iScheme)
AbcA::TimeSamplingPtr getTimeSampling() const
Default assignment operator used.
void setCreaseIndices(const Abc::Int32ArraySample &iCreaseIndices)
Abc::V3fArraySample m_velocities
const Abc::Int32ArraySample & getCreaseLengths() const
Box< V3d > Box3d
3D box of base type double.
void setVelocities(const Abc::V3fArraySample &iVelocities)
Abc::OInt32ArrayProperty m_creaseLengthsProperty
void setCreases(const Abc::Int32ArraySample &iCreaseIndices, const Abc::Int32ArraySample &iCreaseLengths, const Abc::FloatArraySample &iCreaseSharpnesses)
void setInterpolateBoundary(int32_t i)
int32_t m_faceVaryingInterpolateBoundary
const Abc::Int32ArraySample & getFaceCounts() const
size_t getNumSamples() const
void setCreaseSharpnesses(const Abc::FloatArraySample &iCreaseSharpnesses)
OV2fGeomParam::Sample m_uvs
Abc::OInt32Property m_interpolateBoundaryProperty
Abc::Int32ArraySample m_faceCounts
Abc::Int32ArraySample m_cornerIndices
Abc::OInt32Property m_faceVaryingInterpolateBoundaryProperty
Abc::Int32ArraySample m_creaseLengths
const Abc::FloatArraySample & getCreaseSharpnesses() const
Abc::OSchemaObject< OSubDSchema > OSubD
void setPositions(const Abc::P3fArraySample &iSmp)
void setCornerSharpnesses(const Abc::FloatArraySample &iCornerSharpnesses)
Abc::FloatArraySample m_cornerSharpnesses
void setCreaseLengths(const Abc::Int32ArraySample &iCreaseLengths)
OSubDSchema(const OSubDSchema &iCopy)
Copy constructor.
Abc::Int32ArraySample m_holes
Abc::OInt32ArrayProperty m_cornerIndicesProperty
const Abc::Int32ArraySample & getFaceIndices() const
Abc::OInt32ArrayProperty m_holesProperty
const OV2fGeomParam::Sample & getUVs() const
#define ALEMBIC_VERSION_NS
void setFaceVaryingPropagateCorners(int32_t i)
Alembic::Util::shared_ptr< CompoundPropertyWriter > CompoundPropertyWriterPtr
Abc::FloatArraySample m_creaseSharpnesses