void statusNode(osg::ref_ptr<osg::Node> node,int& verNum,int& faceNum)
{
osg::ref_ptr<osgUtil::StatsVisitor> sv=new osgUtil::StatsVisitor();
sv->apply(*node);
sv->totalUpStats();
unsigned int unique_primitives = 0;
osgUtil::Statistics::PrimitiveCountMap::iterator pcmitr;
for(pcmitr =sv->_uniqueStats.GetPrimitivesBegin();
pcmitr !=sv-> _uniqueStats.GetPrimitivesEnd();
++pcmitr)
{
unique_primitives += pcmitr->second;
}
verNum=sv->_uniqueStats._vertexCount;
faceNum=unique_primitives;
}
时间: 2024-10-03 22:40:13