本文整理汇总了C++中osg::ProxyNode类的典型用法代码示例。如果您正苦于以下问题:C++ ProxyNode类的具体用法?C++ ProxyNode怎么用?C++ ProxyNode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ProxyNode类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Stringify
void
ShaderGenerator::apply(osg::ProxyNode& node)
{
if ( !_active )
return;
if ( ignore(&node) )
return;
if ( node.getLoadingExternalReferenceMode() != osg::ProxyNode::LOAD_IMMEDIATELY )
{
// rewrite the filenames to include the shadergen pseudo-loader extension so
// that dynamically loaded children will have the same shadergen applied.
for( unsigned i=0; i<node.getNumFileNames(); ++i )
{
const std::string& filename = node.getFileName( i );
if (!filename.empty() &&
osgDB::getLowerCaseFileExtension(filename).compare(SHADERGEN_PL_EXTENSION) != 0 )
{
node.setFileName( i, Stringify() << filename << "." << SHADERGEN_PL_EXTENSION );
}
}
}
apply( static_cast<osg::Group&>(node) );
}
示例2: readUserCenter
static bool readUserCenter( osgDB::InputStream& is, osg::ProxyNode& node )
{
osg::Vec3d center; double radius;
is >> center >> radius;
node.setCenter( center ); node.setRadius( radius );
return true;
}
示例3: apply
virtual void apply( osg::ProxyNode& proxy )
{
proxy.setDatabasePath( archive_name );
std::string name = proxy.getFileName( 0 );
std::string simple = osgDB::getSimpleFileName( name );
proxy.setFileName( 0, simple );
osgGIS::notify( osg::INFO ) << " Rewrote " << name << " as " << simple << std::endl;
osg::NodeVisitor::apply( proxy );
}
示例4: guard
void
FltExportVisitor::apply( osg::ProxyNode& node )
{
_firstNode = false;
ScopedStatePushPop guard( this, node.getStateSet() );
writeExternalReference( node );
writeMatrix( node.getUserData() );
writeComment( node );
}
示例5: writeFileNames
static bool writeFileNames( osgDB::OutputStream& os, const osg::ProxyNode& node )
{
os << node.getNumFileNames() << os.BEGIN_BRACKET << std::endl;
for ( unsigned int i=0; i<node.getNumFileNames(); ++i )
{
os.writeWrappedString( node.getFileName(i) );
os << std::endl;
}
os << os.END_BRACKET << std::endl;
return true;
}
示例6: readChildren
static bool readChildren( osgDB::InputStream& is, osg::ProxyNode& node )
{
unsigned int size = 0; is >> size >> is.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 >> is.END_BRACKET;
return true;
}
示例7: length
void
FltExportVisitor::writeExternalReference(const osg::ProxyNode &proxy)
{
uint16 length(216);
// Set sane defaults for the override flags
unsigned long flags = COLOR_PALETTE_OVERRIDE |
MATERIAL_PALETTE_OVERRIDE |
TEXTURE_PALETTE_OVERRIDE |
LIGHT_POINT_PALETTE_OVERRIDE |
SHADER_PALETTE_OVERRIDE;
// Selectively turn off overrides for resources we don't need
const ParentPools *pp = dynamic_cast<const ParentPools*>(proxy.getUserData());
if (pp && pp->getColorPool())
flags &= ~COLOR_PALETTE_OVERRIDE;
if (pp && pp->getMaterialPool())
flags &= ~MATERIAL_PALETTE_OVERRIDE;
if (pp && pp->getTexturePool())
flags &= ~TEXTURE_PALETTE_OVERRIDE;
if (pp && pp->getLightSourcePool())
flags &= ~LIGHT_SOURCE_PALETTE_OVERRIDE;
if (pp && pp->getLPAppearancePool())
flags &= ~LIGHT_POINT_PALETTE_OVERRIDE;
if (pp && pp->getShaderPool())
flags &= ~SHADER_PALETTE_OVERRIDE;
_records->writeInt16((int16) EXTERNAL_REFERENCE_OP);
_records->writeInt16(length);
_records->writeString(proxy.getFileName(0), 200);
_records->writeInt32(0); // Reserved
_records->writeInt32(flags);
_records->writeInt16(0); // ViewAsBoundingBox flag
_records->writeInt16(0); // Reserved
}
示例8: readFileNames
static bool readFileNames( osgDB::InputStream& is, osg::ProxyNode& node )
{
unsigned int size = 0; is >> size >> is.BEGIN_BRACKET;
for ( unsigned int i=0; i<size; ++i )
{
std::string value;
is.readWrappedString( value );
node.setFileName( i, value );
}
is >> is.END_BRACKET;
return true;
}
示例9: writeChildren
static bool writeChildren( osgDB::OutputStream& os, const osg::ProxyNode& node )
{
unsigned int size=node.getNumFileNames(), dynamicLoadedSize=0;
for ( unsigned int i=0; i<size; ++i )
{
if ( !node.getFileName(i).empty() )
dynamicLoadedSize++;
}
unsigned int realSize = size-dynamicLoadedSize; os << realSize;
if ( realSize>0 )
{
os << os.BEGIN_BRACKET << std::endl;
for ( unsigned int i=0; i<size; ++i )
{
if ( !node.getFileName(i).empty() ) continue;
if ( i<node.getNumChildren() )
os << node.getChild(i);
}
os << os.END_BRACKET;
}
os << std::endl;
return true;
}
示例10: apply
void daeWriter::apply( osg::ProxyNode &node )
{
OSG_WARN << "ProxyNode. Missing " << node.getNumChildren() << " children" << std::endl;
}
示例11: writeUserCenter
static bool writeUserCenter( osgDB::OutputStream& os, const osg::ProxyNode& node )
{
os << osg::Vec3d(node.getCenter()) << (double)node.getRadius() << std::endl;
return true;
}
示例12: checkUserCenter
// _userDefinedCenter, _radius
static bool checkUserCenter( const osg::ProxyNode& node )
{
return (node.getCenterMode()==osg::ProxyNode::USER_DEFINED_CENTER)||(node.getCenterMode()==osg::ProxyNode::UNION_OF_BOUNDING_SPHERE_AND_USER_DEFINED);
}
示例13: checkFileNames
// _filenameList
static bool checkFileNames( const osg::ProxyNode& node )
{
return node.getNumFileNames()>0;
}
示例14: checkChildren
// _children
static bool checkChildren( const osg::ProxyNode& node )
{
return node.getNumChildren()>0;
}