本文整理汇总了C++中ConstIndexedIOPtr::entryIds方法的典型用法代码示例。如果您正苦于以下问题:C++ ConstIndexedIOPtr::entryIds方法的具体用法?C++ ConstIndexedIOPtr::entryIds怎么用?C++ ConstIndexedIOPtr::entryIds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConstIndexedIOPtr
的用法示例。
在下文中一共展示了ConstIndexedIOPtr::entryIds方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load
void load( IECore::Object::LoadContextPtr context )
{
unsigned int v = g_ioVersion;
ConstIndexedIOPtr container = context->container( staticTypeName(), v );
ConstIndexedIOPtr shaders = container->subdirectory( "shaders" );
IndexedIO::EntryIDList handles;
shaders->entryIds( handles, IndexedIO::Directory );
for( const auto &handle : handles )
{
ShaderPtr shader = context->load<Shader>( shaders.get(), handle );
setShader( handle, shader.get() );
}
ConstIndexedIOPtr connections = container->subdirectory( "connections" );
IndexedIO::EntryIDList connectionIndices;
for( const auto &connectionIndex : connectionIndices )
{
InternedString c[4];
InternedString *cp = c;
connections->read( connectionIndex, cp, 4 );
addConnection(
Connection( Parameter( cp[0], cp[1] ), Parameter( cp[2], cp[3] ) )
);
}
InternedString o[2];
InternedString *op = o;
container->read( "output", op, 2 );
m_output = Parameter( op[0], op[1] );
}
示例2: load
void Primitive::load( IECore::Object::LoadContextPtr context )
{
unsigned int v = m_ioVersion;
ConstIndexedIOPtr container = context->container( staticTypeName(), v );
// we changed the inheritance hierarchy at io version 1
if( v==0 )
{
Renderable::load( context );
}
else
{
VisibleRenderable::load( context );
}
ConstIndexedIOPtr ioVariables = container->subdirectory( g_variablesEntry );
variables.clear();
IndexedIO::EntryIDList names;
ioVariables->entryIds( names, IndexedIO::Directory );
IndexedIO::EntryIDList::const_iterator it;
for( it=names.begin(); it!=names.end(); it++ )
{
ConstIndexedIOPtr ioPrimVar = ioVariables->subdirectory( *it );
int i;
ioPrimVar->read( g_interpolationEntry, i );
variables.insert(
PrimitiveVariableMap::value_type( *it, PrimitiveVariable( (PrimitiveVariable::Interpolation)i, context->load<Data>( ioPrimVar.get(), g_dataEntry ) ) )
);
}
}
示例3: load
void CompoundDataBase::load( LoadContextPtr context )
{
Data::load( context );
unsigned int v = 0;
ConstIndexedIOPtr container = nullptr;
try
{
container = context->container( staticTypeName(), v );
}
catch( const IOException &e )
{
// probably a file with CORTEX_MAJOR_VERSION < 5, get the
// data from CompoundData container instead.
container = context->container( "CompoundData", v );
}
CompoundDataMap &m = writable();
m.clear();
container = container->subdirectory( g_membersEntry );
IndexedIO::EntryIDList memberNames;
container->entryIds( memberNames );
IndexedIO::EntryIDList::const_iterator it;
for( it=memberNames.begin(); it!=memberNames.end(); it++ )
{
m[*it] = context->load<Data>( container.get(), *it );
}
}
示例4: load
void MotionPrimitive::load( IECore::Object::LoadContextPtr context )
{
VisibleRenderable::load( context );
unsigned int v = m_ioVersion;
ConstIndexedIOPtr container = context->container( staticTypeName(), v );
ConstIndexedIOPtr snapshots = container->subdirectory( g_snapshotsEntry );
m_snapshots.clear();
IndexedIO::EntryIDList names;
snapshots->entryIds( names, IndexedIO::Directory );
IndexedIO::EntryIDList::const_iterator it;
for( it=names.begin(); it!=names.end(); it++ )
{
ConstIndexedIOPtr snapshot = snapshots->subdirectory( *it );
float t;
snapshot->read( g_timeEntry, t );
m_snapshots[t] = context->load<Primitive>( snapshot, g_primitiveEntry );
}
}
示例5: load
void MatrixMotionTransform::load( LoadContextPtr context )
{
Transform::load( context );
unsigned int v = m_ioVersion;
ConstIndexedIOPtr container = context->container( staticTypeName(), v );
container = container->subdirectory( g_snapshotsEntry );
m_snapshots.clear();
IndexedIO::EntryIDList names;
container->entryIds( names, IndexedIO::Directory );
IndexedIO::EntryIDList::const_iterator it;
for( it=names.begin(); it!=names.end(); it++ )
{
ConstIndexedIOPtr snapshotContainer = container->subdirectory( *it );
float t; snapshotContainer->read( g_timeEntry, t );
M44f m;
float *f = m.getValue();
snapshotContainer->read( g_matrixEntry, f, 16 );
m_snapshots[t] = m;
}
}
示例6: load
void ObjectVector::load( LoadContextPtr context )
{
Object::load( context );
unsigned int v = m_ioVersion;
ConstIndexedIOPtr container = context->container( staticTypeName(), v );
unsigned int size = 0;
container->read( g_sizeEntry, size );
m_members.resize( size );
std::fill( m_members.begin(), m_members.end(), (IECore::Object*)0 );
ConstIndexedIOPtr ioMembers = container->subdirectory( g_membersEntry );
IndexedIO::EntryIDList l;
ioMembers->entryIds(l);
for( IndexedIO::EntryIDList::const_iterator it=l.begin(); it!=l.end(); it++ )
{
MemberContainer::size_type i = boost::lexical_cast<MemberContainer::size_type>( (*it).value() );
m_members[i] = context->load<Object>( ioMembers, *it );
}
}