当前位置: 首页>>代码示例>>C++>>正文


C++ ConstIndexedIOPtr类代码示例

本文整理汇总了C++中ConstIndexedIOPtr的典型用法代码示例。如果您正苦于以下问题:C++ ConstIndexedIOPtr类的具体用法?C++ ConstIndexedIOPtr怎么用?C++ ConstIndexedIOPtr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ConstIndexedIOPtr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: staticTypeName

void Options::load( LoadContextPtr context )
{
	PreWorldRenderable::load( context );
	unsigned int v = m_ioVersion;
	ConstIndexedIOPtr container = context->container( staticTypeName(), v );
	m_options = context->load<CompoundData>( container.get(), g_optionsEntry );
}
开发者ID:AtomicFiction,项目名称:cortex,代码行数:7,代码来源:Options.cpp

示例2: assert

void ImagePrimitive::load(IECore::Object::LoadContextPtr context)
{
	assert( context );

	Primitive::load(context);
	unsigned int v = m_ioVersion;

	ConstIndexedIOPtr container = context->container(staticTypeName(), v);

	container->read(g_displayWindowMinXEntry, m_displayWindow.min.x);
	container->read(g_displayWindowMinYEntry, m_displayWindow.min.y);
	container->read(g_displayWindowMaxXEntry, m_displayWindow.max.x);
	container->read(g_displayWindowMaxYEntry, m_displayWindow.max.y);

	if ( v < 1 )
	{
		m_dataWindow = m_displayWindow;
	}
	else
	{
		container->read(g_dataWindowMinXEntry, m_dataWindow.min.x);
		container->read(g_dataWindowMinYEntry, m_dataWindow.min.y);
		container->read(g_dataWindowMaxXEntry, m_dataWindow.max.x);
		container->read(g_dataWindowMaxYEntry, m_dataWindow.max.y);
	}
}
开发者ID:Alwnikrotikz,项目名称:cortex-vfx,代码行数:26,代码来源:ImagePrimitive.cpp

示例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 );
	}
}
开发者ID:ImageEngine,项目名称:cortex,代码行数:29,代码来源:CompoundDataBase.cpp

示例4: staticTypeName

void MatrixTransform::load( LoadContextPtr context )
{
	Transform::load( context );
	unsigned int v = m_ioVersion;
	ConstIndexedIOPtr container = context->container( staticTypeName(), v );
	float *f = matrix.getValue();
	container->read( g_matrixEntry, f, 16 );
}
开发者ID:ImageEngine,项目名称:cortex,代码行数:8,代码来源:MatrixTransform.cpp

示例5: staticTypeName

void Shader::load( LoadContextPtr context )
{
	StateRenderable::load( context );
	unsigned int v = m_ioVersion;
	ConstIndexedIOPtr container = context->container( staticTypeName(), v );
	container->read( g_nameEntry, m_name );
	container->read( g_typeEntry, m_type );
	m_parameters = context->load<CompoundData>( container.get(), g_parametersEntry );
}
开发者ID:AtomicFiction,项目名称:cortex,代码行数:9,代码来源:Shader.cpp

示例6: 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] );
		}
开发者ID:ImageEngine,项目名称:cortex,代码行数:31,代码来源:ShaderNetwork.cpp

示例7: tokens

ObjectPtr Object::LoadContext::loadObjectOrReference( const IndexedIO *container, const IndexedIO::EntryID &name )
{
	IndexedIO::Entry e = container->entry( name );
	if( e.entryType()==IndexedIO::File )
	{
		IndexedIO::EntryIDList pathParts;
		if ( e.dataType() == IndexedIO::InternedStringArray )
		{
			pathParts.resize( e.arrayLength() );
			InternedString *p = &(pathParts[0]); 
			container->read( name, p, e.arrayLength() );
		}
		else 
		{
			// for backward compatibility...
			string path;
			container->read( name, path );
			typedef boost::tokenizer<boost::char_separator<char> > Tokenizer;
			// \todo: this would have trouble if the name of the object contains slashes...
			Tokenizer tokens(path, boost::char_separator<char>("/"));
			Tokenizer::iterator t = tokens.begin();

			for ( ; t != tokens.end(); t++ )
			{
				pathParts.push_back( *t );
			}
		}
		std::pair< LoadedObjectMap::iterator,bool > ret = m_loadedObjects->insert( std::pair<IndexedIO::EntryIDList, ObjectPtr>( pathParts, NULL ) );
		if ( ret.second )
		{
			// jump to the path..
			ConstIndexedIOPtr ioObject = m_ioInterface->directory( pathParts );
			// add the loaded object to the map.
			ret.first->second = loadObject( ioObject );
		}
		return ret.first->second;
	}
	else
	{
		ConstIndexedIOPtr ioObject = container->subdirectory( name );

		IndexedIO::EntryIDList pathParts;
		ioObject->path( pathParts );

		std::pair< LoadedObjectMap::iterator,bool > ret = m_loadedObjects->insert( std::pair<IndexedIO::EntryIDList, ObjectPtr>( pathParts, NULL ) );
		if ( ret.second )
		{
			// add the loaded object to the map.
			ret.first->second = loadObject( ioObject );
		}
		return ret.first->second;
	}
}
开发者ID:Alwnikrotikz,项目名称:cortex-vfx,代码行数:53,代码来源:Object.cpp

示例8: IOException

ConstIndexedIOPtr Object::LoadContext::container( const std::string &typeName, unsigned int &ioVersion, bool throwIfMissing )
{
	ConstIndexedIOPtr typeIO = m_ioInterface->subdirectory( typeName, throwIfMissing ? IndexedIO::ThrowIfMissing : IndexedIO::NullIfMissing );
	if ( !typeIO )
	{
		return 0;
	}
	unsigned int v;
	typeIO->read( g_ioVersionEntry, v );
	if( v > ioVersion )
	{
		throw( IOException( "File version greater than library version." ) );
	}
	ioVersion = v;
	return typeIO->subdirectory( g_dataEntry, throwIfMissing ? IndexedIO::ThrowIfMissing : IndexedIO::NullIfMissing );
}
开发者ID:Alwnikrotikz,项目名称:cortex-vfx,代码行数:16,代码来源:Object.cpp

示例9: staticTypeName

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 ) ) )
        );
    }
}
开发者ID:johnhaddon,项目名称:cortex,代码行数:31,代码来源:Primitive.cpp

示例10: Exception

PrimitiveVariableMap Primitive::loadPrimitiveVariables( const IndexedIO *ioInterface, const IndexedIO::EntryID &name, const IndexedIO::EntryIDList &primVarNames )
{
    IECore::Object::LoadContextPtr context = new Object::LoadContext( ioInterface->subdirectory( name )->subdirectory( g_dataEntry ) );

    unsigned int v = m_ioVersion;
    ConstIndexedIOPtr container = context->container( Primitive::staticTypeName(), v );
    if ( !container )
    {
        throw Exception( "Could not find Primitive entry in the file!" );
    }
    ConstIndexedIOPtr ioVariables = container->subdirectory( g_variablesEntry );

    PrimitiveVariableMap variables;
    IndexedIO::EntryIDList::const_iterator it;
    for( it=primVarNames.begin(); it!=primVarNames.end(); it++ )
    {
        ConstIndexedIOPtr ioPrimVar = ioVariables->subdirectory( *it, IndexedIO::NullIfMissing );
        if ( !ioPrimVar )
        {
            continue;
        }
        int i;
        ioPrimVar->read( g_interpolationEntry, i );
        variables.insert(
            PrimitiveVariableMap::value_type( *it, PrimitiveVariable( (PrimitiveVariable::Interpolation)i, context->load<Data>( ioPrimVar.get(), g_dataEntry ) ) )
        );
    }

    return variables;
}
开发者ID:johnhaddon,项目名称:cortex,代码行数:30,代码来源:Primitive.cpp

示例11: staticTypeName

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 );
	}
}
开发者ID:Alwnikrotikz,项目名称:cortex-vfx,代码行数:22,代码来源:ObjectVector.cpp

示例12: staticTypeName

void SmoothSkinningData::load( IECore::Object::LoadContextPtr context )
{
	Data::load(context);
	unsigned int v = m_ioVersion;

	ConstIndexedIOPtr container = context->container( staticTypeName(), v );

	m_influenceNames = context->load<StringVectorData>( container.get(), g_influenceNamesEntry );
	m_influencePose = context->load<M44fVectorData>( container.get(), g_influencePoseEntry );
	m_pointIndexOffsets = context->load<IntVectorData>( container.get(), g_pointIndexOffsetsEntry );
	m_pointInfluenceCounts = context->load<IntVectorData>( container.get(), g_pointInfluenceCountsEntry );
	m_pointInfluenceIndices = context->load<IntVectorData>( container.get(), g_pointInfluenceIndicesEntry );
	m_pointInfluenceWeights = context->load<FloatVectorData>( container.get(), g_pointInfluenceWeightsEntry );

}
开发者ID:AtomicFiction,项目名称:cortex,代码行数:15,代码来源:SmoothSkinningData.cpp

示例13: staticTypeName

void NURBSPrimitive::load( IECore::Object::LoadContextPtr context )
{
	Primitive::load(context);
	unsigned int v = m_ioVersion;

	ConstIndexedIOPtr container = context->container( staticTypeName(), v );

	container->read( g_uOrderEntry, m_uOrder );
	m_uKnot = context->load<FloatVectorData>( container.get(), g_uKnotEntry );
	container->read( g_uMinEntry, m_uMin );
	container->read( g_uMaxEntry, m_uMax );

	container->read( g_vOrderEntry, m_vOrder );
	m_vKnot = context->load<FloatVectorData>( container.get(), g_vKnotEntry );
	container->read( g_vMinEntry, m_vMin );
	container->read( g_vMaxEntry, m_vMax );
}
开发者ID:AtomicFiction,项目名称:cortex,代码行数:17,代码来源:NURBSPrimitive.cpp

示例14: staticTypeName

void CurvesPrimitive::load( IECore::Object::LoadContextPtr context )
{
	Primitive::load( context );
	unsigned int v = m_ioVersion;

	ConstIndexedIOPtr container = context->container( staticTypeName(), v );
	float *f = m_basis.matrix.getValue();
	container->read( g_basisMatrixEntry, f, 16 );
	container->read( g_basisStepEntry, m_basis.step );
	m_linear = m_basis==CubicBasisf::linear();
	int p = 0;
	container->read( g_periodicEntry, p );
	m_periodic = p;
	m_vertsPerCurve = context->load<IntVectorData>( container.get(), g_verticesPerCurveEntry );
	container->read( g_numVertsEntry, m_numVerts );
	container->read( g_numFaceVaryingEntry, m_numFaceVarying );
}
开发者ID:ImageEngine,项目名称:cortex,代码行数:17,代码来源:CurvesPrimitive.cpp

示例15: staticTypeName

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 );
	}
}
开发者ID:Alwnikrotikz,项目名称:cortex-vfx,代码行数:18,代码来源:MotionPrimitive.cpp


注:本文中的ConstIndexedIOPtr类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。