Made a few of the public methods virtual, and moved more of the class

methods to protected scope.
This commit is contained in:
Robert Osfield 2004-11-17 14:25:17 +00:00
parent 724738d81a
commit e9c403839d
2 changed files with 21 additions and 12 deletions

View File

@ -99,7 +99,7 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl
virtual int cancel(); virtual int cancel();
/** Clear all internally cached structures.*/ /** Clear all internally cached structures.*/
void clear(); virtual void clear();
/** Set whether the database pager thread should be paused or not.*/ /** Set whether the database pager thread should be paused or not.*/
void setDatabasePagerThreadPause(bool pause); void setDatabasePagerThreadPause(bool pause);
@ -143,17 +143,17 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl
/** Signal the database thread that the update, cull and draw has begun for a new frame. /** Signal the database thread that the update, cull and draw has begun for a new frame.
* Note, this is called by the application so that the database pager can go to sleep while the CPU is busy on the main rendering threads. */ * Note, this is called by the application so that the database pager can go to sleep while the CPU is busy on the main rendering threads. */
void signalBeginFrame(const osg::FrameStamp* framestamp); virtual void signalBeginFrame(const osg::FrameStamp* framestamp);
/** Signal the database thread that the update, cull and draw dispatch has completed. /** Signal the database thread that the update, cull and draw dispatch has completed.
* Note, this is called by the application so that the database pager can go to wake back up now the main rendering threads are iddle waiting for the next frame.*/ * Note, this is called by the application so that the database pager can go to wake back up now the main rendering threads are iddle waiting for the next frame.*/
void signalEndFrame(); virtual void signalEndFrame();
/** Find all PagedLOD nodes in a subgraph and register them with /** Find all PagedLOD nodes in a subgraph and register them with
* the DatabasePager so it can keep track of expired nodes. * the DatabasePager so it can keep track of expired nodes.
* note, should be only be called from the update thread. */ * note, should be only be called from the update thread. */
void registerPagedLODs(osg::Node* subgraph); virtual void registerPagedLODs(osg::Node* subgraph);
/** Set the amount of time that a subgraph will be kept without being visited in the cull traversal /** Set the amount of time that a subgraph will be kept without being visited in the cull traversal
@ -190,7 +190,7 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl
/** Merge the changes to the scene graph by calling calling removeExpiredSubgraphs then addLoadedDataToSceneGraph. /** Merge the changes to the scene graph by calling calling removeExpiredSubgraphs then addLoadedDataToSceneGraph.
* Note, must only be called from single thread update phase. */ * Note, must only be called from single thread update phase. */
void updateSceneGraph(double currentFrameTime) virtual void updateSceneGraph(double currentFrameTime)
{ {
removeExpiredSubgraphs(currentFrameTime); removeExpiredSubgraphs(currentFrameTime);
addLoadedDataToSceneGraph(currentFrameTime); addLoadedDataToSceneGraph(currentFrameTime);
@ -210,10 +210,12 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl
/** Compile the rendering objects (display lists,texture objects, VBO's) on loaded subgraph. /** Compile the rendering objects (display lists,texture objects, VBO's) on loaded subgraph.
* note, should only be called from the draw thread. * note, should only be called from the draw thread.
* Note, must only be called from a valid graphics context. */ * Note, must only be called from a valid graphics context. */
void compileGLObjects(osg::State& state,double& availableTime); virtual void compileGLObjects(osg::State& state,double& availableTime);
public: protected:
virtual ~DatabasePager();
typedef std::list< osg::ref_ptr<osg::PagedLOD> > PagedLODList; typedef std::list< osg::ref_ptr<osg::PagedLOD> > PagedLODList;
@ -249,9 +251,16 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl
typedef std::vector< osg::ref_ptr<DatabaseRequest> > DatabaseRequestList; typedef std::vector< osg::ref_ptr<DatabaseRequest> > DatabaseRequestList;
typedef std::vector< osg::ref_ptr<osg::Object> > ObjectList; typedef std::vector< osg::ref_ptr<osg::Object> > ObjectList;
protected : // forward declare inner helper classes
class FindCompileableGLObjectsVisitor;
friend class FindCompileableGLObjectsVisitor;
class FindPagedLODsVisitor;
friend class FindPagedLODsVisitor;
class SortFileRequestFunctor;
friend class SortFileRequestFunctor;
virtual ~DatabasePager();
OpenThreads::Mutex _run_mutex; OpenThreads::Mutex _run_mutex;
bool _startThreadCalled; bool _startThreadCalled;

View File

@ -253,7 +253,7 @@ void DatabasePager::signalEndFrame()
} }
class FindCompileableGLObjectsVisitor : public osg::NodeVisitor class DatabasePager::FindCompileableGLObjectsVisitor : public osg::NodeVisitor
{ {
public: public:
FindCompileableGLObjectsVisitor(DatabasePager::DataToCompile& dataToCompile, FindCompileableGLObjectsVisitor(DatabasePager::DataToCompile& dataToCompile,
@ -333,7 +333,7 @@ public:
}; };
struct SortFileRequestFunctor struct DatabasePager::SortFileRequestFunctor
{ {
bool operator() (const osg::ref_ptr<DatabasePager::DatabaseRequest>& lhs,const osg::ref_ptr<DatabasePager::DatabaseRequest>& rhs) const bool operator() (const osg::ref_ptr<DatabasePager::DatabaseRequest>& lhs,const osg::ref_ptr<DatabasePager::DatabaseRequest>& rhs) const
{ {
@ -726,7 +726,7 @@ void DatabasePager::removeExpiredSubgraphs(double currentFrameTime)
} }
class FindPagedLODsVisitor : public osg::NodeVisitor class DatabasePager::FindPagedLODsVisitor : public osg::NodeVisitor
{ {
public: public:
FindPagedLODsVisitor(DatabasePager::PagedLODList& pagedLODList): FindPagedLODsVisitor(DatabasePager::PagedLODList& pagedLODList):