Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(724)

Unified Diff: lib/Alembic/AbcCoreHDF5/AprImpl.cpp

Issue 4662068: Alembic 1.0rc1, changes since 0.9.3
Patch Set: Created 12 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/Alembic/AbcCoreHDF5/AprImpl.h ('k') | lib/Alembic/AbcCoreHDF5/BaseCprImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Alembic/AbcCoreHDF5/AprImpl.cpp
===================================================================
--- a/lib/Alembic/AbcCoreHDF5/AprImpl.cpp
+++ b/lib/Alembic/AbcCoreHDF5/AprImpl.cpp
@@ -42,15 +42,15 @@
//-*****************************************************************************
AprImpl::AprImpl( AbcA::CompoundPropertyReaderPtr iParent,
- hid_t iParentGroup,
- PropertyHeaderPtr iHeader,
- bool iIsScalarLike,
- uint32_t iNumSamples,
- uint32_t iFirstChangedIndex,
- uint32_t iLastChangedIndex )
- : SimplePrImpl<AbcA::ArrayPropertyReader, AprImpl, AbcA::ArraySamplePtr&>
- ( iParent, iParentGroup, iHeader, iNumSamples, iFirstChangedIndex,
- iLastChangedIndex )
+ hid_t iParentGroup,
+ PropertyHeaderPtr iHeader,
+ bool iIsScalarLike,
+ uint32_t iNumSamples,
+ uint32_t iFirstChangedIndex,
+ uint32_t iLastChangedIndex )
+ : SimplePrImpl<AbcA::ArrayPropertyReader, AprImpl, AbcA::ArraySamplePtr&>
+ ( iParent, iParentGroup, iHeader, iNumSamples, iFirstChangedIndex,
+ iLastChangedIndex )
{
if ( m_header->getPropertyType() != AbcA::kArrayProperty )
{
@@ -74,6 +74,50 @@
}
//-*****************************************************************************
+void AprImpl::getDimensions( index_t iSampleIndex, Dimensions & oDim )
+{
+ iSampleIndex = verifySampleIndex( iSampleIndex );
+
+ std::string sampleName = getSampleName( m_header->getName(), iSampleIndex );
+ hid_t parent = -1;
+
+ if ( iSampleIndex == 0 )
+ {
+ parent = m_parentGroup;
+ }
+ else
+ {
+ // Create the subsequent samples group.
+ if ( m_samplesIGroup < 0 )
+ {
+ std::string samplesIName = m_header->getName() + ".smpi";
+ ABCA_ASSERT( GroupExists( m_parentGroup, samplesIName ),
+ "Invalid property: " << m_header->getName()
+ << ", missing smpi" );
+
+ m_samplesIGroup = H5Gopen2( m_parentGroup,
+ samplesIName.c_str(),
+ H5P_DEFAULT );
+ ABCA_ASSERT( m_samplesIGroup >= 0,
+ "Invalid property: " << m_header->getName()
+ << ", invalid smpi group" );
+ }
+ parent = m_samplesIGroup;
+ }
+
+ std::string dimName = sampleName + ".dims";
+ if ( H5Aexists( parent, dimName.c_str() ) )
+ {
+ ReadDimensions( parent, dimName, oDim );
+ }
+ else
+ {
+ ReadDataSetDimensions( parent, sampleName,
+ m_header->getDataType().getExtent(), oDim );
+ }
+}
+
+//-*****************************************************************************
void AprImpl::readSample( hid_t iGroup,
const std::string &iSampleName,
index_t iSampleIndex,
@@ -95,8 +139,8 @@
//-*****************************************************************************
bool AprImpl::readKey( hid_t iGroup,
- const std::string &iSampleName,
- AbcA::ArraySampleKey& oKey )
+ const std::string &iSampleName,
+ AbcA::ArraySampleKey& oKey )
{
assert( iGroup >= 0 );
@@ -110,7 +154,7 @@
{
hid_t dspaceId = H5Dget_space( dsetId );
ABCA_ASSERT( dspaceId >= 0, "Could not get dataspace for dataSet: "
- << iSampleName );
+ << iSampleName );
DspaceCloser dspaceCloser( dspaceId );
oKey.readPOD = m_header->getDataType().getPod();
« no previous file with comments | « lib/Alembic/AbcCoreHDF5/AprImpl.h ('k') | lib/Alembic/AbcCoreHDF5/BaseCprImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b