Changed the DatabasePager so that it bypasses the Registry::readNode() method and calls

readNodeImplementation() directly to avoid calling the KdTreeBuilder.   

Updated wrappers.
This commit is contained in:
Robert Osfield
2008-07-06 18:27:10 +00:00
parent 3965fe357b
commit c4e8d6ee42
14 changed files with 214 additions and 115 deletions

View File

@@ -25,6 +25,7 @@
#include <osg/TexEnvCombine>
#include <osg/Program>
#include <osg/Math>
#include <osg/Timer>
using namespace osgTerrain;
@@ -232,6 +233,8 @@ void GeometryTechnique::generateGeometry(Locator* masterLocator, const osg::Vec3
double i_sampleFactor = 1.0;
double j_sampleFactor = 1.0;
osg::notify(osg::NOTICE)<<"Sample ratio="<<sampleRatio<<std::endl;
if (sampleRatio!=1.0f)
{
@@ -647,9 +650,14 @@ void GeometryTechnique::generateGeometry(Locator* masterLocator, const osg::Vec3
if (osgDB::Registry::instance()->getBuildKdTreesHint()==osgDB::ReaderWriter::Options::BUILD_KDTREES &&
osgDB::Registry::instance()->getKdTreeBuilder())
{
osg::Timer_t before = osg::Timer::instance()->tick();
//osg::notify(osg::NOTICE)<<"osgTerrain::GeometryTechnique::build kd tree"<<std::endl;
buffer._geode->accept(*(osgDB::Registry::instance()->getKdTreeBuilder()));
//osg::notify(osg::NOTICE)<<"after"<<std::endl;
osg::ref_ptr<osg::KdTreeBuilder> builder = osgDB::Registry::instance()->getKdTreeBuilder()->clone();
buffer._geode->accept(*builder);
osg::Timer_t after = osg::Timer::instance()->tick();
osg::notify(osg::NOTICE)<<"KdTree build time "<<osg::Timer::instance()->delta_m(before, after)<<std::endl;
}
}