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:
Robert Osfield
2002-07-18 14:20:01 +00:00
parent f2b6f8c873
commit 8036901ea1
14 changed files with 109 additions and 320 deletions

View File

@@ -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));
}

View File

@@ -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;

View File

@@ -1,8 +1,10 @@
#include <stdio.h>
#include <osg/Notify>
#include <osg/Statistics>
#include <osgUtil/RenderStage>
using namespace osg;
using namespace osgUtil;