本文整理汇总了C++中osg::Group::getStateSet方法的典型用法代码示例。如果您正苦于以下问题:C++ Group::getStateSet方法的具体用法?C++ Group::getStateSet怎么用?C++ Group::getStateSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osg::Group
的用法示例。
在下文中一共展示了Group::getStateSet方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apply
void StatsVisitor::apply(osg::Group& node)
{
if (node.getStateSet())
{
apply(*node.getStateSet());
}
++_numInstancedGroup;
_groupSet.insert(&node);
traverse(node);
}
示例2: apply
void WriterNodeVisitor::apply(osg::Group &node)
{
pushStateSet(node.getStateSet());
Lib3dsMeshInstanceNode * parent = _cur3dsNode;
#if DISABLE_3DS_ANIMATION
osg::Matrix mat( osg::computeLocalToWorld(getNodePath()) );
apply3DSMatrixNode(node, &mat, "grp");
#else
apply3DSMatrixNode(node, NULL, "grp");
#endif
if (succeeded())
traverse(node);
_cur3dsNode = parent;
popStateSet(node.getStateSet());
}
示例3: apply
void CVRCullVisitor::apply(osg::Group& node)
{
bool status = _cullingStatus;
bool firstStatus = _firstCullStatus;
if(isCulled(node))
{
_firstCullStatus = firstStatus;
_cullingStatus = status;
return;
}
// push the culling mode.
pushCurrentMask();
// push the node's state.
StateSet* node_state = node.getStateSet();
if(node_state)
pushStateSet(node_state);
handle_cull_callbacks_and_traverse(node);
// pop the node's state off the render graph stack.
if(node_state)
popStateSet();
// pop the culling mode.
popCurrentMask();
_firstCullStatus = firstStatus;
_cullingStatus = status;
}
示例4: pushStateSet
void
CountsVisitor::apply(osg::Group& node)
{
pushStateSet(node.getStateSet());
_groups++;
osg::ref_ptr<osg::Object> rp = (osg::Object*)&node;
_uGroups.insert(rp);
_totalChildren += node.getNumChildren();
apply(node.getStateSet());
if (++_depth > _maxDepth)
_maxDepth = _depth;
traverse((osg::Node&)node);
_depth--;
popStateSet();
}
示例5: guard
void
FltExportVisitor::apply( osg::Group& node )
{
ScopedStatePushPop guard( this, node.getStateSet() );
if (_firstNode)
{
// On input, a FLT header creates a Group node.
// On export, we always write a Header record, but then the first Node
// we export is the Group that was created from the original input Header.
// On successive roundtrips, this results in increased redundant top-level Group nodes/records.
// Avoid this by NOT outputting anything for a top-level Group node.
_firstNode = false;
traverse( node );
return;
}
// A Group node could indicate one of many possible records.
// Header record -- Don't need to support this here. We always output a header.
// Group record -- HIGH
// Child of an LOD node -- HIGH Currently write out a Group record regardless.
// InstanceDefinition/InstanceReference -- MED -- multiparented Group is an instance
// Extension record -- MED
// Object record -- MED
// LightPointSystem record (if psgSim::MultiSwitch) -- LOW
osgSim::MultiSwitch* multiSwitch = dynamic_cast<osgSim::MultiSwitch*>( &node );
if (multiSwitch)
{
writeSwitch( multiSwitch );
}
else
{
osgSim::ObjectRecordData* ord =
dynamic_cast< osgSim::ObjectRecordData* >( node.getUserData() );
if (ord)
{
// This Group should write an Object Record.
writeObject( node, ord );
}
else
{
// Handle other cases here.
// For now, just output a Group record.
writeGroup( node );
}
}
writeMatrix( node.getUserData() );
writeComment( node );
writePushTraverseWritePop( node );
}