本文整理汇总了C++中osg::Node::getNumParents方法的典型用法代码示例。如果您正苦于以下问题:C++ Node::getNumParents方法的具体用法?C++ Node::getNumParents怎么用?C++ Node::getNumParents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osg::Node
的用法示例。
在下文中一共展示了Node::getNumParents方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
ShaderGenerator::duplicateSharedNode(osg::Node& node)
{
if ( node.getNumParents() > 1 )
{
for(int i=1; i<(int)node.getNumParents(); ++i)
{
osg::Group* parent = node.getParent(i);
osg::Node* replicant = osg::clone(
&node,
osg::CopyOp::DEEP_COPY_NODES | osg::CopyOp::DEEP_COPY_DRAWABLES | osg::CopyOp::DEEP_COPY_ARRAYS);
parent->replaceChild(&node, replicant);
}
}
}
示例2: vc
void
OcclusionQueryVisitor::addOQN( osg::Node& node )
{
VertexCounter vc( _occluderThreshold );
node.accept( vc );
if (vc.exceeded())
{
// Insert OQN(s) above this node.
unsigned int np = node.getNumParents();
while (np--)
{
osg::Group* parent = dynamic_cast<osg::Group*>( node.getParent( np ) );
if (parent != NULL)
{
osg::ref_ptr<osg::OcclusionQueryNode> oqn = new osg::OcclusionQueryNode();
oqn->addChild( &node );
parent->replaceChild( &node, oqn.get() );
oqn->setName( getNextOQNName() );
// Set all OQNs to use the same query StateSets (instead of multiple copies
// of the same StateSet) for efficiency.
oqn->setQueryStateSet( _state.get() );
oqn->setDebugStateSet( _debugState.get() );
}
}
}
}
示例3: apply
virtual void apply(osg::Node& node)
{
if (node.getNumParents()==0 || &node==_haltTraversalAtNode)
{
_nodePaths.push_back(getNodePath());
}
else
{
traverse(node);
}
}
示例4: apply
virtual void apply( osg::Node& node )
{
if( ( node.getNumParents() == 0 ) ||
( &node == m_stopNode.get() ) )
{
_finalNodePath = getNodePath();
}
else
{
osg::NodeVisitor::traverse( node );
}
}
示例5: apply
void GetWorldCoorOfNode::apply(osg::Node & node)
{
if (!done)
{
if ( 0 == node.getNumParents() ) // no parents
{
wcMatrix->set( osg::computeLocalToWorld(this->getNodePath()) );
done = true;
}
traverse(node);
}
}
示例6: apply
virtual void apply(osg::Node &node)
{
if ( 0 == node.getNumParents() ) // no parents
wcMatrix.set( osg::computeLocalToWorld(this->getNodePath()) );
traverse(node);
}