From 325dc0f6b75e544aa129ae1b64d11345efd98224 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 21 Jul 2003 08:19:36 +0000 Subject: [PATCH] Moved DatabasePager into from osgProducer into osgDB. This means that osgDB is now dependant on OpenThreads. --- VisualStudio/osgDB/osgDB.dsp | 8 ++++++++ VisualStudio/osgProducer/osgProducer.dsp | 8 -------- include/{osgProducer => osgDB}/DatabasePager | 10 +++++----- include/osgProducer/OsgCameraGroup | 5 +++-- src/osgDB/GNUmakefile | 1 + src/osgProducer/GNUmakefile | 1 - src/osgProducer/Viewer.cpp | 6 +++--- 7 files changed, 20 insertions(+), 19 deletions(-) rename include/{osgProducer => osgDB}/DatabasePager (95%) diff --git a/VisualStudio/osgDB/osgDB.dsp b/VisualStudio/osgDB/osgDB.dsp index ec0bd47e6..1d768f136 100755 --- a/VisualStudio/osgDB/osgDB.dsp +++ b/VisualStudio/osgDB/osgDB.dsp @@ -93,6 +93,10 @@ LINK32=link.exe # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File +SOURCE=..\..\src\osgProducer\DatabasePager.cpp +# End Source File +# Begin Source File + SOURCE=..\..\Src\osgDB\DotOsgWrapper.cpp # End Source File # Begin Source File @@ -149,6 +153,10 @@ SOURCE=..\..\Src\osgDB\WriteFile.cpp # PROP Default_Filter ";h;hpp;hxx;hm;inl" # Begin Source File +SOURCE=..\..\Include\osgProducer\DatabasePager +# End Source File +# Begin Source File + SOURCE=..\..\Include\osgDB\DotOsgWrapper # End Source File # Begin Source File diff --git a/VisualStudio/osgProducer/osgProducer.dsp b/VisualStudio/osgProducer/osgProducer.dsp index b180762a4..e9f1119fe 100755 --- a/VisualStudio/osgProducer/osgProducer.dsp +++ b/VisualStudio/osgProducer/osgProducer.dsp @@ -95,10 +95,6 @@ LINK32=link.exe # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File -SOURCE=..\..\src\osgProducer\DatabasePager.cpp -# End Source File -# Begin Source File - SOURCE=..\..\src\osgProducer\EventAdapter.cpp # End Source File # Begin Source File @@ -131,10 +127,6 @@ SOURCE=..\..\src\osgProducer\ViewerEventHandler.cpp # PROP Default_Filter ";h;hpp;hxx;hm;inl" # Begin Source File -SOURCE=..\..\Include\osgProducer\DatabasePager -# End Source File -# Begin Source File - SOURCE=..\..\Include\osgProducer\EventAdapter # End Source File # Begin Source File diff --git a/include/osgProducer/DatabasePager b/include/osgDB/DatabasePager similarity index 95% rename from include/osgProducer/DatabasePager rename to include/osgDB/DatabasePager index fdb18d407..b79f065b2 100644 --- a/include/osgProducer/DatabasePager +++ b/include/osgDB/DatabasePager @@ -11,8 +11,8 @@ * OpenSceneGraph Public License for more details. */ -#ifndef OSGPRODUCER_DATABASEPAGER -#define OSGPRODUCER_DATABASEPAGER 1 +#ifndef OSGDB_DATABASEPAGER +#define OSGDB_DATABASEPAGER 1 #include #include @@ -22,16 +22,16 @@ #include #include -#include +#include #include #include -namespace osgProducer { +namespace osgDB { /** Database paging class which manages the loading of files in a background thread, * and syncronizing of loaded models with the main scene graph.*/ -class OSGPRODUCER_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandler, public OpenThreads::Thread +class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandler, public OpenThreads::Thread { public : diff --git a/include/osgProducer/OsgCameraGroup b/include/osgProducer/OsgCameraGroup index 22b7ea858..6a35abf4d 100644 --- a/include/osgProducer/OsgCameraGroup +++ b/include/osgProducer/OsgCameraGroup @@ -26,8 +26,9 @@ #include #include +#include + #include -#include namespace osgProducer { @@ -190,7 +191,7 @@ class OSGPRODUCER_EXPORT OsgCameraGroup : public Producer::CameraGroup osg::Timer_t _start_tick; osg::ref_ptr _frameStamp; - osg::ref_ptr _databasePager; + osg::ref_ptr _databasePager; void _init(); }; diff --git a/src/osgDB/GNUmakefile b/src/osgDB/GNUmakefile index fe530b6d7..96ae788b6 100644 --- a/src/osgDB/GNUmakefile +++ b/src/osgDB/GNUmakefile @@ -2,6 +2,7 @@ TOPDIR = ../.. include $(TOPDIR)/Make/makedefs CXXFILES =\ + DatabasePager.cpp\ DynamicLibrary.cpp\ FileNameUtils.cpp\ FileUtils.cpp\ diff --git a/src/osgProducer/GNUmakefile b/src/osgProducer/GNUmakefile index e25b30258..9c44ca20f 100644 --- a/src/osgProducer/GNUmakefile +++ b/src/osgProducer/GNUmakefile @@ -2,7 +2,6 @@ TOPDIR = ../.. include $(TOPDIR)/Make/makedefs CXXFILES =\ - DatabasePager.cpp\ EventAdapter.cpp\ KeyboardMouseCallback.cpp\ OsgCameraGroup.cpp\ diff --git a/src/osgProducer/Viewer.cpp b/src/osgProducer/Viewer.cpp index ac53a82a8..ba9a2c32a 100644 --- a/src/osgProducer/Viewer.cpp +++ b/src/osgProducer/Viewer.cpp @@ -300,7 +300,7 @@ class DatabasePagerCompileCallback : public OsgSceneHandler::Callback { public: - DatabasePagerCompileCallback(DatabasePager* databasePager): + DatabasePagerCompileCallback(osgDB::DatabasePager* databasePager): _databasePager(databasePager) {} @@ -314,7 +314,7 @@ public: _databasePager->compileRenderingObjects(*(sh.getSceneView()->getState()),availableTime); } - osg::ref_ptr _databasePager; + osg::ref_ptr _databasePager; }; bool Viewer::realize() @@ -326,7 +326,7 @@ bool Viewer::realize() // by default set up the DatabasePager. { - _databasePager = new DatabasePager; + _databasePager = new osgDB::DatabasePager; _databasePager->registerPagedLODs(getTopMostSceneData()); for(SceneHandlerList::iterator p=_shvec.begin();