本文整理汇总了C++中TilePagedLOD::setTileNode方法的典型用法代码示例。如果您正苦于以下问题:C++ TilePagedLOD::setTileNode方法的具体用法?C++ TilePagedLOD::setTileNode怎么用?C++ TilePagedLOD::setTileNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TilePagedLOD
的用法示例。
在下文中一共展示了TilePagedLOD::setTileNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
TileGroup::applyUpdate(osg::Node* node)
{
if ( node )
{
OE_DEBUG << LC << "Update received for tile " << _key.str() << std::endl;
TileGroup* update = dynamic_cast<TileGroup*>( node );
if ( !update )
{
OE_WARN << LC << "Internal error: update was not a TileGroup" << std::endl;
return;
}
if ( update->getNumChildren() < 4 )
{
OE_WARN << LC << "Internal error: update did not have 4 children" << std::endl;
return;
}
for(unsigned i=0; i<4; ++i)
{
TileNode* newTileNode = dynamic_cast<TileNode*>( update->getChild(i) );
if ( !newTileNode )
{
OE_WARN << LC << "Internal error; update child was not a TileNode" << std::endl;
return;
}
osg::ref_ptr<TileNode> oldTileNode = 0L;
TilePagedLOD* plod = dynamic_cast<TilePagedLOD*>(_children[i].get());
if ( plod )
{
oldTileNode = plod->getTileNode();
plod->setTileNode( newTileNode );
if ( _live.valid() )
_live->move( oldTileNode.get(), _dead.get() );
}
else
{
// must be a TileNode leaf, so replace it here.
oldTileNode = dynamic_cast<TileNode*>(_children[i].get());
if ( !oldTileNode.valid() )
{
OE_WARN << LC << "Internal error; existing child was not a TilePagedLOD or a TileNode" << std::endl;
return;
}
this->setChild( i, newTileNode );
if ( _live.valid() )
_live->move( oldTileNode.get(), _dead.get() );
}
if ( _live.valid() )
_live->add( newTileNode );
}
}
// deactivate the update agent
_updateAgent = 0L;
}