本文整理汇总了C++中osgdb::InputStream::readObject方法的典型用法代码示例。如果您正苦于以下问题:C++ InputStream::readObject方法的具体用法?C++ InputStream::readObject怎么用?C++ InputStream::readObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osgdb::InputStream
的用法示例。
在下文中一共展示了InputStream::readObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readResources
//------------------------------------------------------------------------------
static bool readResources( osgDB::InputStream& is, osgCuda::Computation& computation )
{
unsigned int numRes = 0;
is >> numRes >> osgDB::BEGIN_BRACKET;
for( unsigned int i=0; i<numRes; ++i )
{
osg::Object* newRes = is.readObject();
if( newRes != NULL )
{
osgCompute::GLMemoryAdapter* ioo = dynamic_cast<osgCompute::GLMemoryAdapter*>( newRes );
if( ioo != NULL )
{
computation.addResource( *ioo->getMemory() );
}
else
{
osgCompute::Resource* curRes = dynamic_cast<osgCompute::Resource*>( newRes );
if( curRes != NULL ) computation.addResource( *curRes );
}
}
}
is >> osgDB::END_BRACKET;
return true;
}
示例2: 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;
}
示例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;
}
示例4: 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;
}
示例5: readOperators
static bool readOperators( osgDB::InputStream& is, osgParticle::ModularProgram& prog )
{
unsigned int size = 0; is >> size >> is.BEGIN_BRACKET;
for ( unsigned int i=0; i<size; ++i )
{
osgParticle::Operator* op = dynamic_cast<osgParticle::Operator*>( is.readObject() );
if ( op ) prog.addOperator( op );
}
is >> is.END_BRACKET;
return true;
}
示例6: readLayers
static bool readLayers( osgDB::InputStream& is, osgVolume::CompositeLayer& layer )
{
unsigned int size = 0; is >> size >> is.BEGIN_BRACKET;
for ( unsigned int i=0; i<size; ++i )
{
osgVolume::Layer* child = dynamic_cast<osgVolume::Layer*>( is.readObject() );
if ( child ) layer.addLayer( child );
}
is >> is.END_BRACKET;
return true;
}
示例7: readChildren
static bool readChildren( osgDB::InputStream& is, osg::Group& node )
{
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET;
for ( unsigned int i=0; i<size; ++i )
{
osg::Node* child = dynamic_cast<osg::Node*>( is.readObject() );
if ( child ) node.addChild( child );
}
is >> osgDB::END_BRACKET;
return true;
}
示例8: readChildren
static bool readChildren( osgDB::InputStream& is, osg::CompositeShape& shape )
{
unsigned int size = 0; is >> size >> is.BEGIN_BRACKET;
for ( unsigned int i=0; i<size; ++i )
{
osg::Shape* child = dynamic_cast<osg::Shape*>( is.readObject() );
if ( child ) shape.addChild( child );
}
is >> is.END_BRACKET;
return true;
}
示例9: readDraggers
static bool readDraggers( osgDB::InputStream& is, osgManipulator::CompositeDragger& dragger )
{
unsigned int size = 0; is >> size >> is.BEGIN_BRACKET;
for ( unsigned int i=0; i<size; ++i )
{
osgManipulator::Dragger* child = dynamic_cast<osgManipulator::Dragger*>( is.readObject() );
if ( child ) dragger.addDragger( child );
}
is >> is.END_BRACKET;
return true;
}
示例10: readPlacers
static bool readPlacers( osgDB::InputStream& is, osgParticle::CompositePlacer& cp )
{
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET;
for ( unsigned int i=0; i<size; ++i )
{
osgParticle::Placer* p = dynamic_cast<osgParticle::Placer*>( is.readObject() );
if ( p ) cp.addPlacer( p );
}
is >> osgDB::END_BRACKET;
return true;
}
示例11: readProperties
static bool readProperties( osgDB::InputStream& is, osgVolume::CompositeProperty& prop )
{
unsigned int size = 0; is >> size >> is.BEGIN_BRACKET;
for ( unsigned int i=0; i<size; ++i )
{
osgVolume::Property* child = dynamic_cast<osgVolume::Property*>( is.readObject() );
if ( child ) prop.addProperty( child );
}
is >> is.END_BRACKET;
return true;
}
示例12: 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;
}
示例13: 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;
}
示例14: readDrawables
static bool readDrawables( osgDB::InputStream& is, osg::Geode& node )
{
unsigned int size = 0; is >> size >> is.BEGIN_BRACKET;
for ( unsigned int i=0; i<size; ++i )
{
osg::Drawable* drawable = dynamic_cast<osg::Drawable*>( is.readObject() );
if ( drawable )
{
node.addDrawable( drawable );
}
}
is >> is.END_BRACKET;
return true;
}
示例15: readEventHandlers
static bool readEventHandlers(osgDB::InputStream &is, gsc::CaptureSettings &cs)
{
unsigned int size = 0; is >> size >> is.BEGIN_BRACKET;
for (unsigned int i = 0; i < size; ++i)
{
osg::ref_ptr<osg::Object> obj = is.readObject();
gsc::UpdateProperty *up = dynamic_cast<gsc::UpdateProperty*>(obj.get());
if (up)
cs.addUpdateProperty(up);
}
is >> is.END_BRACKET;
return true;
}