class OSGDB_EXPORT osgDB::DatabasePager

Database paging class which manages the loading of files in a background thread, and syncronizing of loaded models with the main scene graph

Inheritance:


Public Classes

[more]struct DatabaseRequest: public osg::Referenced

Public Methods

[more] DatabasePager()
[more]virtual void requestNodeFile(const std::string& fileName, osg::Group* group, float priority, const osg::FrameStamp* framestamp)
Add a request to load a node file to end the the database request list
[more]virtual void run()
run does the database paging
[more]void setUseFrameBlock(bool useFrameBlock)
Set the use of the frame block which, if enabled, blocks the DatabasePager from executing which the current frame is being drawn.
[more]bool getUseFrameBlock() const
Get the whether UseFrameBlock is on or off
[more]Block* getFrameBlock()
[more]void setThreadPriorityDuringFrame(ThreadPriority duringFrame)
Set the priority of the database pager thread during the frame (ie.
[more]ThreadPriority getThreadPriorityDuringFrame() const
Get the priority of the database pager thread during the frame
[more]void setThreadPriorityOutwithFrame(ThreadPriority outwithFrame)
Set the priority of the database pager thread when the frame is not being exectuted (ie.
[more]ThreadPriority getThreadPriorityOutwithFrame() const
Get the priority of the database pager thread when the frame is not being exectuted
[more]void signalBeginFrame(const osg::FrameStamp* framestamp)
Signal the database thread that the update, cull and draw has begun for a new frame.
[more]void signalEndFrame()
Signal the database thread that the update, cull and draw dispatch has completed.
[more]void registerPagedLODs(osg::Node* subgraph)
Find all PagedLOD nodes in a subgraph and register them with the DatabasePager so it can keep track of expired nodes.
[more]void setExpiryDelay(double expiryDelay)
Set the amount of time that a subgraph will be kept without being visited in the cull traversal before being removed
[more]double getExpiryDelay() const
Get the amount of time that a subgraph will be kept without being visited in the cull traversal before being removed
[more]void setDeleteRemovedSubgraphsInDatabaseThread(bool flag)
set whether the removed subgraphs should be deleted in the database thread or not
[more]bool getDeleteRemovedSubgraphsInDatabaseThread() const
get whether the removed subgraphs should be deleted in the database thread or not
[more]void setUnrefImageDataAfterApplyPolicy(bool changeAutoUnRef, bool valueAutoUnRef)
set whether newly loaded textures should have their UnrefImageDataAfterApply set to a specified value
[more]void getUnrefImageDataAfterApplyPolicy(bool& changeAutoUnRef, bool& valueAutoUnRef) const
get whether newly loaded textures should have their UnrefImageDataAfterApply set to a specified value
[more]void setMaxAnisotropyPolicy(bool changeAnisotropy, float valueAnisotropy)
set whether newly loaded textures should have their MaxAnisotopy set to a specified value
[more]void getMaxAnisotropyPolicy(bool& changeAnisotropy, float& valueAnisotropy) const
set whether newly loaded textures should have their MaxAnisotopy set to a specified value
[more]void removeExpiredSubgraphs(double currentFrameTime)
Iterate through the active PagedLOD nodes children removing children which havn't been visited since specified expiryTime.
[more]void addLoadedDataToSceneGraph(double currentFrameTime)
Add the loaded data to the scene graph
[more]void updateSceneGraph(double currentFrameTime)
Merge the changes to the scene graph by calling calling removeExpiredSubgraphs then addLoadedDataToSceneGraph
[more]void setCompileGLObjectsForContexID(unsigned int contextID, bool on)
Turn the compilation of rendering objects for specfied graphics context on (true) or off(false)
[more]bool getCompileGLObjectsForContexID(unsigned int contextID)
Get whether the compilation of rendering objects for specfied graphics context on (true) or off(false)
[more]void compileGLObjects(osg::State& state, double& availableTime)
Compile the rendering objects (display lists,texture objects, VBO's) on loaded subgraph.

Public

[more]typedef std::vector< osg::ref_ptr<osg::PagedLOD> > PagedLODList
[more]typedef std::vector< osg::ref_ptr<osg::StateSet> > StateSetList
[more]typedef std::vector< osg::ref_ptr<osg::Drawable> > DrawableList
[more]typedef std::pair<StateSetList,DrawableList> DataToCompile
[more]typedef std::map< unsigned int, DataToCompile > DataToCompileMap
[more]typedef std::set<unsigned int> ActiveGraphicsContexts
[more]typedef std::vector< osg::ref_ptr<DatabaseRequest> > DatabaseRequestList
[more]typedef std::vector< osg::ref_ptr<osg::Object> > ObjectList

Protected Fields

[more]bool _useFrameBlock
[more]osg::ref_ptr<Block> _frameBlock
[more]int _frameNumber
[more]ThreadPriority _threadPriorityDuringFrame
[more]ThreadPriority _threadPriorityOutwithFrame
[more]DatabaseRequestList _fileRequestList
[more]OpenThreads::Mutex _fileRequestListMutex
[more]osg::ref_ptr<Block> _fileRequestListEmptyBlock
[more]DatabaseRequestList _dataToCompileList
[more]OpenThreads::Mutex _dataToCompileListMutex
[more]bool _changeAutoUnRef
[more]bool _valueAutoUnRef
[more]bool _changeAnisotropy
[more]float _valueAnisotropy
[more]bool _deleteRemovedSubgraphsInDatabaseThread
[more]ObjectList _childrenToDeleteList
[more]OpenThreads::Mutex _childrenToDeleteListMutex
[more]DatabaseRequestList _dataToMergeList
[more]OpenThreads::Mutex _dataToMergeListMutex
[more]PagedLODList _pagedLODList
[more]double _expiryDelay
[more]ActiveGraphicsContexts _activeGraphicsContexts

Protected Methods

[more]virtual ~DatabasePager()


Documentation

Database paging class which manages the loading of files in a background thread, and syncronizing of loaded models with the main scene graph
o DatabasePager()

ovirtual void requestNodeFile(const std::string& fileName, osg::Group* group, float priority, const osg::FrameStamp* framestamp)
Add a request to load a node file to end the the database request list

ovirtual void run()
run does the database paging

ovoid setUseFrameBlock(bool useFrameBlock)
Set the use of the frame block which, if enabled, blocks the DatabasePager from executing which the current frame is being drawn. When a single processor machine is being used it can be useful to block on frame to help prevent the database paging thread from slowing the cull and draw traversals which in turn can cause frame drops.

obool getUseFrameBlock() const
Get the whether UseFrameBlock is on or off

oBlock* getFrameBlock()

ovoid setThreadPriorityDuringFrame(ThreadPriority duringFrame)
Set the priority of the database pager thread during the frame (ie. while cull and draw are running.)

oThreadPriority getThreadPriorityDuringFrame() const
Get the priority of the database pager thread during the frame

ovoid setThreadPriorityOutwithFrame(ThreadPriority outwithFrame)
Set the priority of the database pager thread when the frame is not being exectuted (ie. before or after cull and draw have run.)

oThreadPriority getThreadPriorityOutwithFrame() const
Get the priority of the database pager thread when the frame is not being exectuted

ovoid signalBeginFrame(const osg::FrameStamp* framestamp)
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.

ovoid signalEndFrame()
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.

ovoid registerPagedLODs(osg::Node* subgraph)
Find all PagedLOD nodes in a subgraph and register them with the DatabasePager so it can keep track of expired nodes. note, should be only be called from the update thread.

ovoid setExpiryDelay(double expiryDelay)
Set the amount of time that a subgraph will be kept without being visited in the cull traversal before being removed

odouble getExpiryDelay() const
Get the amount of time that a subgraph will be kept without being visited in the cull traversal before being removed

ovoid setDeleteRemovedSubgraphsInDatabaseThread(bool flag)
set whether the removed subgraphs should be deleted in the database thread or not

obool getDeleteRemovedSubgraphsInDatabaseThread() const
get whether the removed subgraphs should be deleted in the database thread or not

ovoid setUnrefImageDataAfterApplyPolicy(bool changeAutoUnRef, bool valueAutoUnRef)
set whether newly loaded textures should have their UnrefImageDataAfterApply set to a specified value

ovoid getUnrefImageDataAfterApplyPolicy(bool& changeAutoUnRef, bool& valueAutoUnRef) const
get whether newly loaded textures should have their UnrefImageDataAfterApply set to a specified value

ovoid setMaxAnisotropyPolicy(bool changeAnisotropy, float valueAnisotropy)
set whether newly loaded textures should have their MaxAnisotopy set to a specified value

ovoid getMaxAnisotropyPolicy(bool& changeAnisotropy, float& valueAnisotropy) const
set whether newly loaded textures should have their MaxAnisotopy set to a specified value

ovoid removeExpiredSubgraphs(double currentFrameTime)
Iterate through the active PagedLOD nodes children removing children which havn't been visited since specified expiryTime. note, should be only be called from the update thread.

ovoid addLoadedDataToSceneGraph(double currentFrameTime)
Add the loaded data to the scene graph

ovoid updateSceneGraph(double currentFrameTime)
Merge the changes to the scene graph by calling calling removeExpiredSubgraphs then addLoadedDataToSceneGraph

ovoid setCompileGLObjectsForContexID(unsigned int contextID, bool on)
Turn the compilation of rendering objects for specfied graphics context on (true) or off(false)

obool getCompileGLObjectsForContexID(unsigned int contextID)
Get whether the compilation of rendering objects for specfied graphics context on (true) or off(false)

ovoid compileGLObjects(osg::State& state, double& availableTime)
Compile the rendering objects (display lists,texture objects, VBO's) on loaded subgraph. note, should only be called from the draw thread.

otypedef std::vector< osg::ref_ptr<osg::PagedLOD> > PagedLODList

otypedef std::vector< osg::ref_ptr<osg::StateSet> > StateSetList

otypedef std::vector< osg::ref_ptr<osg::Drawable> > DrawableList

otypedef std::pair<StateSetList,DrawableList> DataToCompile

otypedef std::map< unsigned int, DataToCompile > DataToCompileMap

otypedef std::set<unsigned int> ActiveGraphicsContexts

ostruct DatabaseRequest: public osg::Referenced

o DatabaseRequest()

ostd::string _fileName

oint _frameNumberFirstRequest

odouble _timestampFirstRequest

ofloat _priorityFirstRequest

oint _frameNumberLastRequest

odouble _timestampLastRequest

ofloat _priorityLastRequest

ounsigned int _numOfRequests

oosg::ref_ptr<osg::Group> _groupForAddingLoadedSubgraph

oosg::ref_ptr<osg::Node> _loadedModel

oDataToCompileMap _dataToCompileMap

otypedef std::vector< osg::ref_ptr<DatabaseRequest> > DatabaseRequestList

otypedef std::vector< osg::ref_ptr<osg::Object> > ObjectList

ovirtual ~DatabasePager()

obool _useFrameBlock

oosg::ref_ptr<Block> _frameBlock

oint _frameNumber

oThreadPriority _threadPriorityDuringFrame

oThreadPriority _threadPriorityOutwithFrame

oDatabaseRequestList _fileRequestList

oOpenThreads::Mutex _fileRequestListMutex

oosg::ref_ptr<Block> _fileRequestListEmptyBlock

oDatabaseRequestList _dataToCompileList

oOpenThreads::Mutex _dataToCompileListMutex

obool _changeAutoUnRef

obool _valueAutoUnRef

obool _changeAnisotropy

ofloat _valueAnisotropy

obool _deleteRemovedSubgraphsInDatabaseThread

oObjectList _childrenToDeleteList

oOpenThreads::Mutex _childrenToDeleteListMutex

oDatabaseRequestList _dataToMergeList

oOpenThreads::Mutex _dataToMergeListMutex

oPagedLODList _pagedLODList

odouble _expiryDelay

oActiveGraphicsContexts _activeGraphicsContexts


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.