Rewrote osg:Statistics so that it is PrimitiveFunctor as is now completely
decoupled from osg::Drawable. The Drawable::getStats() virtual method no longer exists. Updated the Viewer to use the osg::Statistics incarnation and reformated stats to clean it up.
This commit is contained in:
@@ -493,7 +493,7 @@ void IntersectVisitor::apply(Geode& geode)
|
||||
{
|
||||
if (!enterNode(geode)) return;
|
||||
|
||||
for(int i = 0; i < geode.getNumDrawables(); i++ )
|
||||
for(unsigned int i = 0; i < geode.getNumDrawables(); i++ )
|
||||
{
|
||||
intersect(*geode.getDrawable(i));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include <osgUtil/RenderBin>
|
||||
#include <osgUtil/RenderStage>
|
||||
|
||||
#include <osg/Statistics>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
using namespace osg;
|
||||
@@ -186,13 +188,10 @@ bool RenderBin::getStats(osg::Statistics* primStats)
|
||||
Drawable* dw= rl->_drawable;
|
||||
primStats->addOpaque(); // number of geosets
|
||||
if (rl->_modelview.get()) primStats->addMatrix(); // number of matrices
|
||||
if (dw) { // then tot up the types 1-14
|
||||
// commenting out as having intrusive stats in base classes is
|
||||
// undersirable.
|
||||
dw->getStats(*primStats); // use sub-class to find the stats for each drawable
|
||||
|
||||
// use an AttributeOption to get the stats we require.
|
||||
dw->applyAttributeOperation(*primStats);
|
||||
if (dw)
|
||||
{
|
||||
// then tot up the primtive types and no vertices.
|
||||
dw->applyPrimitiveOperation(*primStats); // use sub-class to find the stats for each drawable
|
||||
}
|
||||
}
|
||||
somestats=true;
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#include <stdio.h>
|
||||
#include <osg/Notify>
|
||||
#include <osg/Statistics>
|
||||
|
||||
#include <osgUtil/RenderStage>
|
||||
|
||||
|
||||
using namespace osg;
|
||||
using namespace osgUtil;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user