本文整理汇总了C++中IndexedIOPtr::write方法的典型用法代码示例。如果您正苦于以下问题:C++ IndexedIOPtr::write方法的具体用法?C++ IndexedIOPtr::write怎么用?C++ IndexedIOPtr::write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IndexedIOPtr
的用法示例。
在下文中一共展示了IndexedIOPtr::write方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: save
void save( IECore::Object::SaveContext *context ) const
{
IndexedIOPtr container = context->container( ShaderNetwork::staticTypeName(), g_ioVersion );
IndexedIOPtr shaders = container->subdirectory( "shaders", IndexedIO::CreateIfMissing );
IndexedIOPtr connections = container->subdirectory( "connections", IndexedIO::CreateIfMissing );
int connectionIndex = 0;
for( const Node &node : m_nodes )
{
context->save( node.shader.get(), shaders.get(), node.handle );
for( const Connection &connection : node.inputConnections )
{
InternedString c[4] = {
connection.source.shader,
connection.source.name,
connection.destination.shader,
connection.destination.name
};
connections->write(
std::to_string( connectionIndex ),
c, 4
);
connectionIndex++;
}
}
InternedString o[2] = { m_output.shader, m_output.name };
container->write( "output", o, 2 );
}
示例2: staticTypeName
void TypedData< TimePeriod >::save( SaveContext *context ) const
{
Data::save( context );
IndexedIOPtr container = context->container( staticTypeName(), 0 );
container->write( g_beginEntry, boost::posix_time::to_iso_string( readable().begin() ) );
container->write( g_endEntry, boost::posix_time::to_iso_string( readable().end() ) );
}
示例3: save
void Display::save( SaveContext *context ) const
{
PreWorldRenderable::save( context );
IndexedIOPtr container = context->container( staticTypeName(), m_ioVersion );
container->write( g_nameEntry, m_name );
container->write( g_typeEntry, m_type );
container->write( g_dataEntry, m_data );
context->save( m_parameters.get(), container.get(), g_parametersEntry );
}
示例4: save
void MatrixMotionTransform::save( SaveContext *context ) const
{
Transform::save( context );
IndexedIOPtr container = context->container( staticTypeName(), m_ioVersion );
container = container->subdirectory( g_snapshotsEntry, IndexedIO::CreateIfMissing );
int i = 0;
for( SnapshotMap::const_iterator it=m_snapshots.begin(); it!=m_snapshots.end(); it++ )
{
string is = str( boost::format( "%d" ) % i );
IndexedIOPtr snapshotContainer = container->subdirectory( is, IndexedIO::CreateIfMissing );
snapshotContainer->write( g_timeEntry, it->first );
snapshotContainer->write( g_matrixEntry, it->second.getValue(), 16 );
i++;
}
}
示例5: save
void CurvesPrimitive::save( IECore::Object::SaveContext *context ) const
{
Primitive::save(context);
IndexedIOPtr container = context->container( staticTypeName(), m_ioVersion );
container->write( g_basisMatrixEntry, m_basis.matrix.getValue(), 16 );
container->write( g_basisStepEntry, m_basis.step );
int p = m_periodic;
container->write( g_periodicEntry, p );
context->save( m_vertsPerCurve.get(), container.get(), g_verticesPerCurveEntry );
// we could recompute these on loading, but it'd take a while and the overhead
// of storing them isn't great.
container->write( g_numVertsEntry, m_numVerts );
container->write( g_numFaceVaryingEntry, m_numFaceVarying );
}
示例6: save
void NURBSPrimitive::save( IECore::Object::SaveContext *context ) const
{
Primitive::save(context);
IndexedIOPtr container = context->container( staticTypeName(), m_ioVersion );
container->write( g_uOrderEntry, m_uOrder );
context->save( m_uKnot.get(), container.get(), g_uKnotEntry );
container->write( g_uMinEntry, m_uMin );
container->write( g_uMaxEntry, m_uMax );
container->write( g_vOrderEntry, m_vOrder );
context->save( m_vKnot.get(), container.get(), g_vKnotEntry );
container->write( g_vMinEntry, m_vMin );
container->write( g_vMaxEntry, m_vMax );
}
示例7: save
void ImagePrimitive::save(IECore::Object::SaveContext *context) const
{
assert( context );
Primitive::save(context);
IndexedIOPtr container = context->container(staticTypeName(), m_ioVersion);
container->write(g_displayWindowMinXEntry, m_displayWindow.min.x);
container->write(g_displayWindowMinYEntry, m_displayWindow.min.y);
container->write(g_displayWindowMaxXEntry, m_displayWindow.max.x);
container->write(g_displayWindowMaxYEntry, m_displayWindow.max.y);
container->write(g_dataWindowMinXEntry, m_dataWindow.min.x);
container->write(g_dataWindowMinYEntry, m_dataWindow.min.y);
container->write(g_dataWindowMaxXEntry, m_dataWindow.max.x);
container->write(g_dataWindowMaxYEntry, m_dataWindow.max.y);
}
示例8: save
void Shader::save( SaveContext *context ) const
{
StateRenderable::save( context );
IndexedIOPtr container = context->container( staticTypeName(), m_ioVersion );
container->write( g_nameEntry, m_name );
container->write( g_typeEntry, m_type );
context->save( m_parameters.get(), container.get(), g_parametersEntry );
}
示例9:
IndexedIOPtr Object::SaveContext::container( const std::string &typeName, unsigned int ioVersion )
{
IndexedIOPtr typeIO = m_ioInterface->subdirectory( typeName, IndexedIO::CreateIfMissing );
typeIO->write( g_ioVersionEntry, ioVersion );
IndexedIOPtr dataIO = typeIO->subdirectory( g_dataEntry, IndexedIO::CreateIfMissing );
dataIO->removeAll();
return dataIO;
}
示例10: save
void Primitive::save( IECore::Object::SaveContext *context ) const
{
VisibleRenderable::save( context );
IndexedIOPtr container = context->container( staticTypeName(), m_ioVersion );
IndexedIOPtr ioVariables = container->subdirectory( g_variablesEntry, IndexedIO::CreateIfMissing );
for( PrimitiveVariableMap::const_iterator it=variables.begin(); it!=variables.end(); it++ )
{
IndexedIOPtr ioPrimVar = ioVariables->subdirectory( it->first, IndexedIO::CreateIfMissing );
const int i = it->second.interpolation;
ioPrimVar->write( g_interpolationEntry, i );
context->save( it->second.data.get(), ioPrimVar.get(), g_dataEntry );
}
}
示例11: save
void PathMatcherData::save( SaveContext *context ) const
{
Data::save( context );
IndexedIOPtr container = context->container( staticTypeName(), g_ioVersion );
std::vector<InternedString> strings;
std::vector<unsigned int> pathLengths;
std::vector<unsigned char> exactMatches;
for( PathMatcher::RawIterator it = readable().begin(), eIt = readable().end(); it != eIt; ++it )
{
pathLengths.push_back( it->size() );
if( it->size() )
{
strings.push_back( it->back() );
}
exactMatches.push_back( it.exactMatch() );
}
container->write( "strings", strings.data(), strings.size() );
container->write( "pathLengths", pathLengths.data(), pathLengths.size() );
container->write( "exactMatches", exactMatches.data(), exactMatches.size() );
}
示例12: save
void MotionPrimitive::save( IECore::Object::SaveContext *context ) const
{
VisibleRenderable::save( context );
IndexedIOPtr container = context->container( staticTypeName(), m_ioVersion );
IndexedIOPtr snapshots = container->subdirectory( g_snapshotsEntry, IndexedIO::CreateIfMissing );
int i = 0;
for( SnapshotMap::const_iterator it=m_snapshots.begin(); it!=m_snapshots.end(); it++ )
{
string is = str( boost::format( "%d" ) % i );
IndexedIOPtr snapshot = snapshots->subdirectory( is, IndexedIO::CreateIfMissing );
snapshot->write( g_timeEntry, it->first );
context->save( it->second, snapshot, g_primitiveEntry );
i++;
}
}
示例13: Exception
void Object::SaveContext::save( const Object *toSave, IndexedIO *container, const IndexedIO::EntryID &name )
{
if ( !toSave )
{
throw Exception( "Error trying to save NULL pointer object!" );
}
SavedObjectMap::const_iterator it = m_savedObjects->find( toSave );
if( it!=m_savedObjects->end() )
{
container->write( name, &(it->second[0]), it->second.size() );
}
else
{
bool rootObject = ( m_savedObjects->size() == 0 );
if ( rootObject )
{
if ( container->hasEntry( name ) )
{
container->remove( name );
}
}
IndexedIOPtr nameIO = container->createSubdirectory( name );
IndexedIO::EntryIDList pathParts;
nameIO->path( pathParts );
(*m_savedObjects)[toSave] = pathParts;
nameIO->write( g_typeEntry, toSave->typeName() );
IndexedIOPtr dataIO = nameIO->createSubdirectory( g_dataEntry );
dataIO->removeAll();
SaveContext context( dataIO, m_savedObjects );
toSave->save( &context );
// Objects saved on a file can be committed to disk to free memory.
if ( rootObject )
{
nameIO->commit();
}
}
}
示例14: save
void ObjectVector::save( SaveContext *context ) const
{
Object::save( context );
IndexedIOPtr container = context->container( staticTypeName(), m_ioVersion );
unsigned int size = m_members.size();
container->write( g_sizeEntry, size );
IndexedIOPtr ioMembers = container->subdirectory( g_membersEntry, IndexedIO::CreateIfMissing );
unsigned i=0;
for( MemberContainer::const_iterator it=m_members.begin(); it!=m_members.end(); it++ )
{
if( *it )
{
std::string name = str( boost::format( "%d" ) % i );
context->save( *it, ioMembers, name );
}
i++;
}
}
示例15: save
void MatrixTransform::save( SaveContext *context ) const
{
Transform::save( context );
IndexedIOPtr container = context->container( staticTypeName(), m_ioVersion );
container->write( g_matrixEntry, matrix.getValue(), 16 );
}