37#ifndef Alembic_AbcGeom_IGeomParam_h
38#define Alembic_AbcGeom_IGeomParam_h
48template <
class TRAITS>
59 typedef Alembic::Util::shared_ptr< Abc::TypedArraySample<TRAITS> >
samp_ptr_type;
95 return TRAITS::interpretation();
108 TRAITS::dataType().getExtent() ) ) &&
121 template <
class CPROP>
123 const std::string &iName,
127 template <
class PROP>
162 if ( e ==
"" ) {
return 1; }
163 else {
return atoi( e.c_str() ); }
220template <
class TRAITS>
221template <
class CPROP>
223 const std::string &iName,
238 "NULL CompoundPropertyReader passed into "
239 <<
"ITypedGeomParam ctor" );
242 parent->getPropertyHeader( iName );
244 "Nonexistent GeomParam: " << iName );
266 ABCA_ASSERT(
false,
"Invalid ITypedGeomParam: " << iName );
273template <
class TRAITS>
292 "Property " << ph.
getName() <<
" is not an "
293 <<
"ITypedGeomParam" );
296 <<
" cannot be an ITypedGeomParam" );
320template <
class TRAITS>
325 m_valProp.get( oSamp.
m_vals, iSS );
326 if ( m_indicesProperty ) { m_indicesProperty.get( oSamp.
m_indices, iSS ); }
329 uint32_t size =
static_cast< uint32_t
> ( oSamp.
m_vals->size() );
331 uint32_t *v =
new uint32_t[size];
333 for ( uint32_t i = 0 ; i < size ; ++i )
344 oSamp.
m_scope = this->getScope();
350template <
class TRAITS>
355 oSamp.
m_scope = this->getScope();
358 if ( ! m_indicesProperty )
360 m_valProp.get( oSamp.
m_vals, iSS );
366 size_t size = idxPtr->size();
371 m_valProp.get( oSamp.
m_vals, iSS );
375 Alembic::Util::shared_ptr< Abc::TypedArraySample<TRAITS> > valPtr = \
376 m_valProp.getValue( iSS );
378 typename TRAITS::value_type *v =
new typename TRAITS::value_type[size];
380 for (
size_t i = 0 ; i < size ; ++i )
382 v[i] = (*valPtr)[ (*idxPtr)[i] ];
401template <
class TRAITS>
408 return std::max( m_indicesProperty.getNumSamples(),
409 m_valProp.getNumSamples() );
413 if ( m_valProp ) {
return m_valProp.getNumSamples(); }
423template <
class TRAITS>
430 return m_valProp.isConstant() && m_indicesProperty.isConstant();
434 return m_valProp.isConstant();
443 const std::string g_emptyStr;
446template <
class TRAITS>
451 if ( m_isIndexed ) {
return m_cprop.getName(); }
452 else {
return m_valProp.getName(); }
460template <
class TRAITS>
463 if ( m_isIndexed ) {
return m_cprop.
getParent(); }
468template <
class TRAITS>
471 if ( m_isIndexed ) {
return m_cprop.
getHeader(); }
472 else {
return m_valProp.getHeader(); }
476template <
class TRAITS>
479 if ( m_isIndexed ) {
return m_cprop.
getMetaData(); }
480 else {
return m_valProp.getMetaData(); }
484template <
class TRAITS>
491 else if ( m_indicesProperty )
493 return m_indicesProperty.getTimeSampling();
#define ABCA_ASSERT(COND, TEXT)
#define ALEMBIC_ABC_SAFE_CALL_END()
#define ALEMBIC_ABC_SAFE_CALL_BEGIN(CONTEXT)
#define ALEMBIC_ABC_SAFE_CALL_END_RESET()
#define ALEMBIC_VERSION_NS
ALEMBIC_OPERATOR_BOOL(valid())
Alembic::Util::shared_ptr< Abc::TypedArraySample< TRAITS > > samp_ptr_type
samp_ptr_type getVals() const
Abc::UInt32ArraySamplePtr getIndices() const
Abc::UInt32ArraySamplePtr m_indices
GeometryScope getScope() const
sample_type getExpandedValue(const Abc::ISampleSelector &iSS=Abc::ISampleSelector()) const
Abc::IUInt32ArrayProperty getIndexProperty()
size_t getNumSamples() const
static bool matches(const AbcA::PropertyHeader &iHeader, SchemaInterpMatching iMatching=kStrictMatching)
ALEMBIC_OPERATOR_BOOL(this_type::valid())
ITypedGeomParam(CPROP iParent, const std::string &iName, const Abc::Argument &iArg0=Abc::Argument(), const Abc::Argument &iArg1=Abc::Argument())
GeometryScope getScope() const
sample_type getIndexedValue(const Abc::ISampleSelector &iSS=Abc::ISampleSelector()) const
Abc::ICompoundProperty getParent() const
Abc::IUInt32ArrayProperty m_indicesProperty
void getIndexed(sample_type &oSamp, const Abc::ISampleSelector &iSS=Abc::ISampleSelector()) const
prop_type getValueProperty()
AbcA::TimeSamplingPtr getTimeSampling() const
ITypedGeomParam< TRAITS > this_type
ITypedGeomParam(PROP iThis, WrapExistingFlag iWrapFlag, const Abc::Argument &iArg0=Abc::Argument(), const Abc::Argument &iArg1=Abc::Argument())
TRAITS::value_type value_type
Abc::ITypedArrayProperty< TRAITS > prop_type
size_t getArrayExtent() const
Abc::ICompoundProperty m_cprop
static const char * getInterpretation()
const std::string & getName() const
void getExpanded(sample_type &oSamp, const Abc::ISampleSelector &iSS=Abc::ISampleSelector()) const
AbcA::DataType getDataType() const
this_type::Sample sample_type
const AbcA::PropertyHeader & getHeader() const
const AbcA::MetaData & getMetaData() const
void setInto(Arguments &iArgs) const
ErrorHandler::Policy getErrorHandlerPolicy() const
ErrorHandler & getErrorHandler() const
const AbcA::MetaData & getMetaData() const
ICompoundProperty getParent() const
static bool matches(const AbcA::MetaData &iMetaData, SchemaInterpMatching iMatching=kStrictMatching)
Alembic::Util::shared_ptr< TimeSampling > TimeSamplingPtr
Alembic::Util::shared_ptr< CompoundPropertyReader > CompoundPropertyReaderPtr
ITypedGeomParam< BooleanTPTraits > IBoolGeomParam
GeometryScope GetGeometryScope(const AbcA::MetaData &iMetaData)
ITypedGeomParam< C3hTPTraits > IC3hGeomParam
ITypedGeomParam< C4cTPTraits > IC4cGeomParam
ITypedGeomParam< P3sTPTraits > IP3sGeomParam
ITypedGeomParam< P3iTPTraits > IP3iGeomParam
ITypedGeomParam< Box3iTPTraits > IBox3iGeomParam
ITypedGeomParam< P3fTPTraits > IP3fGeomParam
ITypedGeomParam< Box2sTPTraits > IBox2sGeomParam
ITypedGeomParam< M44dTPTraits > IM44dGeomParam
ITypedGeomParam< QuatfTPTraits > IQuatfGeomParam
ITypedGeomParam< Uint8TPTraits > IUcharGeomParam
ITypedGeomParam< M44fTPTraits > IM44fGeomParam
ITypedGeomParam< StringTPTraits > IStringGeomParam
ITypedGeomParam< Int16TPTraits > IInt16GeomParam
ITypedGeomParam< V3fTPTraits > IV3fGeomParam
ITypedGeomParam< N2dTPTraits > IN2dGeomParam
ITypedGeomParam< Box2dTPTraits > IBox2dGeomParam
ITypedGeomParam< Int64TPTraits > IInt64GeomParam
ITypedGeomParam< V2iTPTraits > IV2iGeomParam
ITypedGeomParam< P2iTPTraits > IP2iGeomParam
ITypedGeomParam< Box2iTPTraits > IBox2iGeomParam
ITypedGeomParam< Box3fTPTraits > IBox3fGeomParam
ITypedGeomParam< V3sTPTraits > IV3sGeomParam
ITypedGeomParam< V2dTPTraits > IV2dGeomParam
ITypedGeomParam< C4fTPTraits > IC4fGeomParam
ITypedGeomParam< P3dTPTraits > IP3dGeomParam
ITypedGeomParam< WstringTPTraits > IWstringGeomParam
ITypedGeomParam< Uint32TPTraits > IUInt32GeomParam
ITypedGeomParam< N2fTPTraits > IN2fGeomParam
ITypedGeomParam< P2sTPTraits > IP2sGeomParam
ITypedGeomParam< C3fTPTraits > IC3fGeomParam
ITypedGeomParam< P2dTPTraits > IP2dGeomParam
ITypedGeomParam< V2sTPTraits > IV2sGeomParam
ITypedGeomParam< P2fTPTraits > IP2fGeomParam
ITypedGeomParam< Int8TPTraits > ICharGeomParam
ITypedGeomParam< QuatdTPTraits > IQuatdGeomParam
ITypedGeomParam< Float64TPTraits > IDoubleGeomParam
ITypedGeomParam< V3iTPTraits > IV3iGeomParam
ITypedGeomParam< N3dTPTraits > IN3dGeomParam
ITypedGeomParam< Int32TPTraits > IInt32GeomParam
ITypedGeomParam< Box2fTPTraits > IBox2fGeomParam
ITypedGeomParam< C3cTPTraits > IC3cGeomParam
ITypedGeomParam< Box3dTPTraits > IBox3dGeomParam
ITypedGeomParam< V3dTPTraits > IV3dGeomParam
ITypedGeomParam< M33dTPTraits > IM33dGeomParam
ITypedGeomParam< Box3sTPTraits > IBox3sGeomParam
ITypedGeomParam< Float16TPTraits > IHalfGeomParam
ITypedGeomParam< Uint16TPTraits > IUInt16GeomParam
ITypedGeomParam< C4hTPTraits > IC4hGeomParam
ITypedGeomParam< Uint64TPTraits > IUInt64GeomParam
ITypedGeomParam< M33fTPTraits > IM33fGeomParam
ErrorHandler::Policy GetErrorHandlerPolicy(SOMETHING iSomething, const Argument &iArg0, const Argument &iArg1=Argument(), const Argument &iArg2=Argument(), const Argument &iArg3=Argument())
AbcA::CompoundPropertyReaderPtr GetCompoundPropertyReaderPtr(AbcA::CompoundPropertyReaderPtr iPtr)
ITypedArrayProperty< Uint32TPTraits > IUInt32ArrayProperty
SchemaInterpMatching GetSchemaInterpMatching(const Argument &iArg0, const Argument &iArg1=Argument(), const Argument &iArg2=Argument(), const Argument &iArg3=Argument())
Alembic::Util::shared_ptr< UInt32ArraySample > UInt32ArraySamplePtr
const char * PODName(PlainOldDataType pod)