Added default constructor implemention to LOD and PagedLOD.

Added verbose messages to DatabasePager.
This commit is contained in:
Robert Osfield
2003-07-10 14:53:07 +00:00
parent 7432eee381
commit 606daca904
9 changed files with 30 additions and 13 deletions

View File

@@ -36,7 +36,7 @@ class SG_EXPORT LOD : public Group
{
public :
LOD() {}
LOD();
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
LOD(const LOD&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);

View File

@@ -24,7 +24,7 @@ class SG_EXPORT PagedLOD : public LOD
{
public :
PagedLOD() {}
PagedLOD();
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
PagedLOD(const PagedLOD&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);

View File

@@ -45,7 +45,7 @@ class OSGPRODUCER_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseReques
/** Add the loaded data to the scene graph.*/
void addLoadedDataToSceneGraph();
void addLoadedDataToSceneGraph(double timeStamp);
/** Find all PagedLOD nodes in a subgraph and register them with

View File

@@ -114,7 +114,7 @@ Drawable::Drawable()
_useDisplayList = true;
_supportsVertexBufferObjects = false;
_useVertexBufferObjects = true;
_useVertexBufferObjects = false;
}
Drawable::Drawable(const Drawable& drawable,const CopyOp& copyop):

View File

@@ -16,6 +16,11 @@
using namespace osg;
LOD::LOD():
_centerMode(USE_BOUNDING_SPHERE_CENTER)
{
}
LOD::LOD(const LOD& lod,const CopyOp& copyop):
Group(lod,copyop),
_centerMode(lod._centerMode),

View File

@@ -2,6 +2,11 @@
using namespace osg;
PagedLOD::PagedLOD()
{
_centerMode = USER_DEFINED_CENTER;
}
PagedLOD::PagedLOD(const PagedLOD& plod,const CopyOp& copyop):
LOD(plod,copyop)
{

View File

@@ -253,7 +253,7 @@ void DatabasePager::run()
join();
}
void DatabasePager::addLoadedDataToSceneGraph()
void DatabasePager::addLoadedDataToSceneGraph(double timeStamp)
{
DatabaseRequestList localFileLoadedList;
@@ -269,8 +269,15 @@ void DatabasePager::addLoadedDataToSceneGraph()
{
DatabaseRequest* databaseRequest = itr->get();
registerPagedLODs(databaseRequest->_loadedModel.get());
databaseRequest->_groupForAddingLoadedSubgraph->addChild(databaseRequest->_loadedModel.get());
//std::cout<<"merged subgraph"<<databaseRequest->_fileName<<" after "<<databaseRequest->_numOfRequests<<" requests."<<std::endl;
osg::Group* group = databaseRequest->_groupForAddingLoadedSubgraph.get();
osg::PagedLOD* plod = dynamic_cast<osg::PagedLOD*>(group);
if (plod)
{
plod->setTimeStamp(plod->getNumChildren(),timeStamp);
}
group->addChild(databaseRequest->_loadedModel.get());
std::cout<<"merged subgraph"<<databaseRequest->_fileName<<" after "<<databaseRequest->_numOfRequests<<" requests."<<std::endl;
}
@@ -393,7 +400,7 @@ void DatabasePager::compileRenderingObjects(osg::State& state)
itr!=sslist.end() && elapsedTime<_maximumTimeForCompiling;
++itr)
{
//std::cout<<" Compiling stateset"<<(*itr).get()<<std::endl;
std::cout<<" Compiling stateset "<<(*itr).get()<<std::endl;
(*itr)->compile(state);
elapsedTime = timer.delta_s(start_tick,timer.tick());
}
@@ -410,7 +417,7 @@ void DatabasePager::compileRenderingObjects(osg::State& state)
itr!=dwlist.end() && elapsedTime<_maximumTimeForCompiling;
++itr)
{
//std::cout<<" Compiling drawable"<<(*itr).get()<<std::endl;
std::cout<<" Compiling drawable "<<(*itr).get()<<std::endl;
(*itr)->compile(state);
elapsedTime = timer.delta_s(start_tick,timer.tick());
}
@@ -434,7 +441,7 @@ void DatabasePager::compileRenderingObjects(osg::State& state)
if (allCompiled)
{
//std::cout<<"All compiled"<<std::endl;
std::cout<<"All compiled"<<std::endl;
// we've compile all of the current databaseRequest so we can now pop it off the
// to compile list and place it on the merge list.
@@ -453,7 +460,7 @@ void DatabasePager::compileRenderingObjects(osg::State& state)
}
else
{
//std::cout<<"Not all compiled"<<std::endl;
std::cout<<"Not all compiled"<<std::endl;
databaseRequest = 0;
}

View File

@@ -399,7 +399,7 @@ void Viewer::update()
_databasePager->removeExpiredSubgraphs(_frameStamp->getReferenceTime());
// add the newly loaded data into the scene graph.
_databasePager->addLoadedDataToSceneGraph();
_databasePager->addLoadedDataToSceneGraph(_frameStamp->getReferenceTime());
}

View File

@@ -59,7 +59,7 @@ public:
_helpInitialized(false),
_statsInitialized(false)
{
_fs.resize(20);
_fs.resize(10);
_index = 0;
_veh->getOsgCameraGroup()->setStatsHandler(this);