Ejemplo n.º 1
0
IDataPtr IGroup::getData(Alembic::Util::uint64_t iIndex,
                         std::size_t iThreadIndex)
{
    IDataPtr child;
    if (isLight())
    {
        if (iIndex < mData->numChildren)
        {
            Alembic::Util::uint64_t childPos = 0;
            mData->streams->read(iThreadIndex, mData->pos + 8 * iIndex + 8, 8,
                                 &childPos);

            // top bit should be set for data
            if ((childPos & EMPTY_DATA) != 0)
            {
                child.reset(new IData(mData->streams, childPos, iThreadIndex));
            }
        }
    }
    else if (isChildData(iIndex))
    {
        child.reset(new IData(mData->streams, mData->childVec[iIndex],
                              iThreadIndex));
    }
    return child;
}
Ejemplo n.º 2
0
int HBase::numDatas()
{
	int res = 0;
	hsize_t nobj;
	H5Gget_num_objs(fObjectId, &nobj);
	hsize_t i;
	for(i = 0; i < nobj; i++) {
		if(isChildData(i))
            res++;
	}
	return res;
}
Ejemplo n.º 3
0
void OGroup::replaceData(Alembic::Util::uint64_t iIndex, ODataPtr iData)
{
    if (!isChildData(iIndex))
    {
        return;
    }

    Alembic::Util::uint64_t pos = iData->getPos() | 0x8000000000000000ULL;
    if (isFrozen())
    {
        mData->stream->seek(mData->pos + (iIndex + 1) * 8);
        mData->stream->write(&pos, 8);
    }
    mData->childVec[iIndex] = pos;
}
Ejemplo n.º 4
0
char HBase::hasNamedData(const char * dataName)
{
	hsize_t nobj;
	H5Gget_num_objs(fObjectId, &nobj);
	//std::cout<<"\n"<<fObjectPath<<" has "<<nobj<<"objs\n";
	hsize_t i;
	for(i = 0; i < nobj; i++) {
		//std::cout<<getChildName(i)<<"\n";
		if(isChildData(i)) {
            if(getChildName(i) == dataName) {
                //std::cout<<"found "<<dataName<<"\n";;
                return 1;
            }
        }
	}
	return 0;
}