From 2fe34c0b6d695eb444f558065d0f19f1623b7ee4 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 22 Jan 2004 10:43:59 +0000 Subject: [PATCH] Added setName("TileContent") on the subgraphs that represent the contents of the tiles, this name is then searched for during the TileMapper pre cull traversal to help cut short traversals, and thereby improve its performance. --- src/osgPlugins/txp/ReaderWriterTXP.cpp | 4 ++++ src/osgPlugins/txp/TileMapper.cpp | 14 +++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/osgPlugins/txp/ReaderWriterTXP.cpp b/src/osgPlugins/txp/ReaderWriterTXP.cpp index 554fbb122..f720b4bab 100644 --- a/src/osgPlugins/txp/ReaderWriterTXP.cpp +++ b/src/osgPlugins/txp/ReaderWriterTXP.cpp @@ -66,6 +66,8 @@ osgDB::ReaderWriter::ReadResult ReaderWriterTXP::readNode(const std::string& fil return ReadResult::ERROR_IN_READING_FILE; osg::ref_ptr tileContent = getTileContent(info,x,y,lod,archive); + + tileContent->setName("TileContent"); int numLods = archive->getNumLODs(); if (lod < (numLods-1)) @@ -124,6 +126,8 @@ osgDB::ReaderWriter::ReadResult ReaderWriterTXP::readNode(const std::string& fil osg::ref_ptr tileContent = getTileContent(info,tileX,tileY,tileLOD,archive); + tileContent->setName("TileContent"); + if (tileLOD < (numLods-1)) { char pagedLODfile[1024]; diff --git a/src/osgPlugins/txp/TileMapper.cpp b/src/osgPlugins/txp/TileMapper.cpp index 1fb7f51f8..82ce5bf83 100644 --- a/src/osgPlugins/txp/TileMapper.cpp +++ b/src/osgPlugins/txp/TileMapper.cpp @@ -44,6 +44,12 @@ float TileMapper::getDistanceFromEyePoint(const osg::Vec3& pos, bool withLODScal void TileMapper::apply(osg::Node& node) { + if (node.getName()=="TileContent") + { + _containsGeode = true; + return; + } + if (isCulled(node)) return; // push the culling mode. @@ -57,6 +63,12 @@ void TileMapper::apply(osg::Node& node) void TileMapper::apply(osg::Group& node) { + if (node.getName()=="TileContent") + { + _containsGeode = true; + return; + } + if (isCulled(node)) return; // push the culling mode. @@ -348,7 +360,7 @@ void TileMapper::checkValidityOfAllVisibleTiles() } while (!toRemoveList.empty()); - if (!_blackListedNodeSet.empty()) std::cout<<"********** We have blacked list "<<_blackListedNodeSet.size()<