//-***************************************************************************** AbcA::CompoundPropertyWriterPtr CpwData::createCompoundProperty( AbcA::CompoundPropertyWriterPtr iParent, const std::string & iName, const AbcA::MetaData & iMetaData ) { if ( m_madeProperties.count( iName ) ) { ABCA_THROW( "Already have a property named: " << iName ); } PropertyHeaderPtr headerPtr( new PropertyHeaderAndFriends( iName, iMetaData ) ); Alembic::Util::shared_ptr<CpwImpl> ret( new CpwImpl( iParent, m_group->addGroup(), headerPtr, m_propertyHeaders.size() ) ); m_propertyHeaders.push_back( headerPtr ); m_madeProperties[iName] = WeakBpwPtr( ret ); m_hashes.push_back(0); m_hashes.push_back(0); return ret; }
//-***************************************************************************** AbcA::CompoundPropertyWriterPtr BaseCpwImpl::createCompoundProperty( const std::string & iName, const AbcA::MetaData & iMetaData ) { if ( m_madeProperties.count( iName ) ) { ABCA_THROW( "Already have a property named: " << iName ); } hid_t myGroup = getGroup(); AbcA::CompoundPropertyWriterPtr ret( new CpwImpl( this->asCompoundPtr(), myGroup, iName, iMetaData ) ); PropertyHeaderPtr headerPtr( new AbcA::PropertyHeader( ret->getHeader() ) ); m_propertyHeaders.push_back( headerPtr ); m_madeProperties[iName] = WeakBpwPtr( ret ); return ret; }
//-***************************************************************************** AbcA::ScalarPropertyWriterPtr BaseCpwImpl::createScalarProperty( const std::string & iName, const AbcA::MetaData & iMetaData, const AbcA::DataType & iDataType, uint32_t iTimeSamplingIndex ) { if ( m_madeProperties.count( iName ) ) { ABCA_THROW( "Already have a property named: " << iName ); } hid_t myGroup = getGroup(); AbcA::ScalarPropertyWriterPtr ret( new SpwImpl( asCompoundPtr(), myGroup, iName, iMetaData, iDataType, iTimeSamplingIndex ) ); PropertyHeaderPtr headerPtr( new AbcA::PropertyHeader( ret->getHeader() ) ); m_propertyHeaders.push_back( headerPtr ); m_madeProperties[iName] = WeakBpwPtr( ret ); return ret; }
//-***************************************************************************** AbcA::ArrayPropertyWriterPtr CpwData::createArrayProperty( AbcA::CompoundPropertyWriterPtr iParent, const std::string & iName, const AbcA::MetaData & iMetaData, const AbcA::DataType & iDataType, Util::uint32_t iTimeSamplingIndex ) { if ( m_madeProperties.count( iName ) ) { ABCA_THROW( "Already have a property named: " << iName ); } ABCA_ASSERT( iDataType.getExtent() != 0 && iDataType.getPod() != Alembic::Util::kNumPlainOldDataTypes && iDataType.getPod() != Alembic::Util::kUnknownPOD, "createArrayProperty, illegal DataType provided."); // will assert if TimeSamplingPtr not found AbcA::TimeSamplingPtr ts = iParent->getObject()->getArchive()->getTimeSampling( iTimeSamplingIndex ); PropertyHeaderPtr headerPtr( new PropertyHeaderAndFriends( iName, AbcA::kArrayProperty, iMetaData, iDataType, ts, iTimeSamplingIndex ) ); Alembic::Util::shared_ptr<ApwImpl> ret( new ApwImpl( iParent, m_group->addGroup(), headerPtr, m_propertyHeaders.size() ) ); m_propertyHeaders.push_back( headerPtr ); m_madeProperties[iName] = WeakBpwPtr( ret ); m_hashes.push_back(0); m_hashes.push_back(0); return ret; }