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


C++ InputStream::readSize方法代码示例

本文整理汇总了C++中osgdb::InputStream::readSize方法的典型用法代码示例。如果您正苦于以下问题:C++ InputStream::readSize方法的具体用法?C++ InputStream::readSize怎么用?C++ InputStream::readSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在osgdb::InputStream的用法示例。


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

示例1: readInfluenceMap

static bool readInfluenceMap( osgDB::InputStream& is, osgAnimation::RigGeometry& geom )
{
    osg::ref_ptr<osgAnimation::VertexInfluenceMap> map = new osgAnimation::VertexInfluenceMap;
    unsigned int size = is.readSize(); is >> is.BEGIN_BRACKET;
    for ( unsigned int i=0; i<size; ++i )
    {
        std::string name;
        unsigned int viSize = 0;
        is >> is.PROPERTY("VertexInfluence");
        is.readWrappedString(name);
        viSize = is.readSize(); is >> is.BEGIN_BRACKET;

        osgAnimation::VertexInfluence vi;
        vi.setName( name );
        vi.reserve( viSize );
        for ( unsigned int j=0; j<viSize; ++j )
        {
            int index = 0;
            float weight = 0.0f;
            is >> index >> weight;
            vi.push_back( osgAnimation::VertexIndexWeight(index, weight) );
        }
        (*map)[name] = vi;
        is >> is.END_BRACKET;
    }
    is >> is.END_BRACKET;

    if ( !map->empty() ) geom.setInfluenceMap( map.get() );
    return true;
}
开发者ID:AlexBobkov,项目名称:OpenSceneGraph,代码行数:30,代码来源:RigGeometry.cpp

示例2: readTextureWeights

static bool readTextureWeights( osgDB::InputStream& is, osgFX::MultiTextureControl& ctrl )
{
    unsigned int size = is.readSize(); is >> is.BEGIN_BRACKET;
    for ( unsigned int i=0; i<size; ++i )
    {
        float weight = 0.0f; is >> weight;
        ctrl.setTextureWeight( i, weight );
    }
    is >> is.END_BRACKET;
    return true;
}
开发者ID:AdriCS,项目名称:osg,代码行数:11,代码来源:MultiTextureControl.cpp

示例3: readImages

static bool readImages( osgDB::InputStream& is, osg::ImageSequence& image )
{
    unsigned int images = is.readSize(); is >> is.BEGIN_BRACKET;
    for ( unsigned int i=0; i<images; ++i )
    {
        osg::Image* img = dynamic_cast<osg::Image*>( is.readObject() );
        if ( img ) image.addImage( img );
    }
    is >> is.END_BRACKET;
    return true;
}
开发者ID:3dcl,项目名称:osg,代码行数:11,代码来源:ImageSequence.cpp

示例4: readShaders

static bool readShaders( osgDB::InputStream& is, osg::Program& attr )
{
    unsigned int size = is.readSize(); is >> is.BEGIN_BRACKET;
    for ( unsigned int i=0; i<size; ++i )
    {
        osg::Shader* shader = dynamic_cast<osg::Shader*>( is.readObject() );
        if ( shader ) attr.addShader( shader );
    }
    is >> is.END_BRACKET;
    return true;
}
开发者ID:BodyViz,项目名称:osg,代码行数:11,代码来源:Program.cpp

示例5: readAnimations

static bool readAnimations( osgDB::InputStream& is, osgAnimation::AnimationManagerBase& manager )
{
    unsigned int size = is.readSize(); is >> osgDB::BEGIN_BRACKET;
    for ( unsigned int i=0; i<size; ++i )
    {
        osgAnimation::Animation* ani = dynamic_cast<osgAnimation::Animation*>( is.readObject() );
        if ( ani ) manager.registerAnimation( ani );
    }
    is >> osgDB::END_BRACKET;
    return true;
}
开发者ID:aalex,项目名称:osg,代码行数:11,代码来源:AnimationManagerBase.cpp

示例6: readValues

static bool readValues( osgDB::InputStream& is, osgSim::MultiSwitch& node )
{
    unsigned int size = is.readSize(); is >> is.BEGIN_BRACKET;
    for ( unsigned int i=0; i<size; ++i )
    {
        is >> is.PROPERTY("SwitchSet");
        unsigned int valueSize = is.readSize(); is >> is.BEGIN_BRACKET;

        osgSim::MultiSwitch::ValueList values;
        for ( unsigned int j=0; j<valueSize; ++j )
        {
            bool value; is >> value;
            values.push_back( value );
        }
        node.setValueList( i, values );
        is >> is.END_BRACKET;
    }
    is >> is.END_BRACKET;
    return true;
}
开发者ID:151706061,项目名称:OpenSceneGraph,代码行数:20,代码来源:MultiSwitch.cpp

示例7: readImages

static bool readImages( osgDB::InputStream& is, osg::ImageSequence& image )
{
    unsigned int images = is.readSize(); is >> is.BEGIN_BRACKET;
    for ( unsigned int i=0; i<images; ++i )
    {
        osg::ref_ptr<osg::Image> img = is.readImage();
        if ( img ) image.addImage( img );
    }
    is >> is.END_BRACKET;
    return true;
}
开发者ID:151706061,项目名称:OpenSceneGraph,代码行数:11,代码来源:ImageSequence.cpp

示例8: readShaders

static bool readShaders( osgDB::InputStream& is, osg::Program& attr )
{
    unsigned int size = is.readSize(); is >> is.BEGIN_BRACKET;
    for ( unsigned int i=0; i<size; ++i )
    {
        osg::ref_ptr<osg::Shader> shader = is.readObjectOfType<osg::Shader>();
        if ( shader ) attr.addShader( shader );
    }
    is >> is.END_BRACKET;
    return true;
}
开发者ID:yueying,项目名称:osg,代码行数:11,代码来源:Program.cpp

示例9: readPositionList

static bool readPositionList( osgDB::InputStream& is, osg::Billboard& node )
{
    unsigned int size = is.readSize();
    is >> is.BEGIN_BRACKET;
    for ( unsigned int i=0; i<size; ++i )
    {
        osg::Vec3d pos; is >> pos;
        node.setPosition( i, pos );
    }
    is >> is.END_BRACKET;
    return true;
}
开发者ID:yueying,项目名称:osg,代码行数:12,代码来源:Billboard.cpp

示例10: readRangeList

static bool readRangeList( osgDB::InputStream& is, osg::LOD& node )
{
    unsigned int size = is.readSize(); is >> is.BEGIN_BRACKET;
    for ( unsigned int i=0; i<size; ++i )
    {
        float min, max;
        is >> min >> max;
        node.setRange( i, min, max );
    }
    is >> is.END_BRACKET;
    return true;
}
开发者ID:151706061,项目名称:OpenSceneGraph,代码行数:12,代码来源:LOD.cpp

示例11: readMatrices

static bool readMatrices( osgDB::InputStream& is, osg::VertexProgram& vp )
{
    unsigned int size = is.readSize(); is >> is.BEGIN_BRACKET;
    for ( unsigned int i=0; i<size; ++i )
    {
        unsigned int key; osg::Matrixd value;
        is >> key >> value;
        vp.setMatrix( key, value );
    }
    is >> is.END_BRACKET;
    return true;
}
开发者ID:yueying,项目名称:osg,代码行数:12,代码来源:VertexProgram.cpp

示例12: readLocalParameters

static bool readLocalParameters( osgDB::InputStream& is, osg::VertexProgram& vp )
{
    unsigned int size = is.readSize(); is >> is.BEGIN_BRACKET;
    for ( unsigned int i=0; i<size; ++i )
    {
        GLuint key; osg::Vec4d value;
        is >> key >> value;
        vp.setProgramLocalParameter( key, value );
    }
    is >> is.END_BRACKET;
    return true;
}
开发者ID:yueying,项目名称:osg,代码行数:12,代码来源:VertexProgram.cpp

示例13: readLocatorCallbacks

static bool readLocatorCallbacks( osgDB::InputStream& is, osgVolume::Locator& locator )
{
    unsigned int size = is.readSize(); is >> is.BEGIN_BRACKET;
    for ( unsigned int i=0; i<size; ++i )
    {
        osgVolume::Locator::LocatorCallback* cb =
            dynamic_cast<osgVolume::Locator::LocatorCallback*>( is.readObject() );
        if ( cb ) locator.addCallback( cb );
    }
    is >> is.END_BRACKET;
    return true;
}
开发者ID:3dcl,项目名称:osg,代码行数:12,代码来源:Locator.cpp

示例14: readFeedBackVaryingsName

static bool readFeedBackVaryingsName( osgDB::InputStream& is, osg::Program& attr )
{
	unsigned int size = is.readSize(); is >> is.BEGIN_BRACKET;
	for ( unsigned int i=0; i<size; ++i )
	{
		std::string str;
		is>> str;
		attr.addTransformFeedBackVarying(str);
	}
	is >> is.END_BRACKET;
	return true;
}
开发者ID:yueying,项目名称:osg,代码行数:12,代码来源:Program.cpp

示例15: readStackedTransforms

static bool readStackedTransforms( osgDB::InputStream& is, osgAnimation::UpdateMatrixTransform& obj )
{
    osgAnimation::StackedTransform& transform = obj.getStackedTransforms();
    unsigned int size = is.readSize(); is >> is.BEGIN_BRACKET;
    for ( unsigned int i=0; i<size; ++i )
    {
        osgAnimation::StackedTransformElement* element =
            dynamic_cast<osgAnimation::StackedTransformElement*>( is.readObject() );
        if ( element ) transform.push_back( element );
    }
    is >> is.END_BRACKET;
    return true;
}
开发者ID:,项目名称:,代码行数:13,代码来源:


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