OpenSceneGraph
3.5.1
|
Database paging class which manages the loading of files in a background thread, and synchronizing of loaded models with the main scene graph. More...
Classes | |
struct | DatabaseRequest |
class | DatabaseThread |
struct | PagedLODList |
struct | ReadQueue |
struct | RequestQueue |
Public Types | |
enum | DrawablePolicy { DO_NOT_MODIFY_DRAWABLE_SETTINGS, USE_DISPLAY_LISTS, USE_VERTEX_BUFFER_OBJECTS, USE_VERTEX_ARRAYS } |
typedef OpenThreads::Thread::ThreadPriority | ThreadPriority |
typedef std::set< osg::ref_ptr< osg::StateSet > > | StateSetList |
typedef std::vector< osg::ref_ptr< osg::Drawable > > | DrawableList |
typedef std::list< osg::ref_ptr< osg::Object > > | ObjectList |
Public Member Functions | |
DatabasePager () | |
DatabasePager (const DatabasePager &rhs) | |
virtual const char * | className () const |
virtual DatabasePager * | clone () const |
Create a shallow copy on the DatabasePager. More... | |
virtual void | requestNodeFile (const std::string &fileName, osg::NodePath &nodePath, float priority, const osg::FrameStamp *framestamp, osg::ref_ptr< osg::Referenced > &databaseRequest, const osg::Referenced *options) |
Add a request to load a node file to end the database request list. More... | |
int | setSchedulePriority (OpenThreads::Thread::ThreadPriority priority) |
Set the priority of the database pager thread(s). More... | |
virtual int | cancel () |
Cancel the database pager thread(s). More... | |
virtual bool | isRunning () const |
virtual void | clear () |
Clear all internally cached structures. More... | |
void | setUpThreads (unsigned int totalNumThreads=2, unsigned int numHttpThreads=1) |
virtual unsigned int | addDatabaseThread (DatabaseThread::Mode mode, const std::string &name) |
DatabaseThread * | getDatabaseThread (unsigned int i) |
const DatabaseThread * | getDatabaseThread (unsigned int i) const |
unsigned int | getNumDatabaseThreads () const |
void | setDatabasePagerThreadPause (bool pause) |
Set whether the database pager thread should be paused or not. More... | |
bool | getDatabasePagerThreadPause () const |
Get whether the database pager thread should is paused or not. More... | |
void | setAcceptNewDatabaseRequests (bool acceptNewRequests) |
Set whether new database request calls are accepted or ignored. More... | |
bool | getAcceptNewDatabaseRequests () const |
Get whether new database request calls are accepted or ignored. More... | |
int | getNumFramesActive () const |
Get the number of frames that are currently active. More... | |
virtual void | signalBeginFrame (const osg::FrameStamp *framestamp) |
Signal the database thread that the update, cull and draw has begun for a new frame. More... | |
virtual void | signalEndFrame () |
Signal the database thread that the update, cull and draw dispatch has completed. More... | |
virtual void | registerPagedLODs (osg::Node *subgraph, unsigned int frameNumber=0) |
Find all PagedLOD nodes in a subgraph and register them with the DatabasePager so it can keep track of expired nodes. More... | |
void | setIncrementalCompileOperation (osgUtil::IncrementalCompileOperation *ico) |
Set the incremental compile operation. More... | |
osgUtil::IncrementalCompileOperation * | getIncrementalCompileOperation () |
Get the incremental compile operation. More... | |
void | setDoPreCompile (bool flag) |
Set whether the database pager should pre compile OpenGL objects before allowing them to be merged into the scene graph. More... | |
bool | getDoPreCompile () const |
Get whether the database pager should pre compile OpenGL objects before allowing them to be merged into the scene graph. More... | |
void | setTargetMaximumNumberOfPageLOD (unsigned int target) |
Set the target maximum number of PagedLOD to maintain in memory. More... | |
unsigned int | getTargetMaximumNumberOfPageLOD () const |
Get the target maximum number of PagedLOD to maintain in memory. 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 | setDrawablePolicy (DrawablePolicy policy) |
Set how loaded drawables should be handled w.r.t their display list/vertex buffer object/vertex array settings. More... | |
DrawablePolicy | getDrawablePolicy () const |
Get how loaded drawables should be handled w.r.t their display list/vertex buffer object/vertex array settings. More... | |
void | setApplyPBOToImages (bool assignPBOToImages) |
Set whether newly loaded textures should have a PixelBufferObject assigned to them to aid download to the GPU. More... | |
bool | getApplyPBOToImages () const |
Get whether newly loaded textures should have a PixelBufferObject assigned to them. 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... | |
bool | requiresUpdateSceneGraph () const |
Return true if there are pending updates to the scene graph that require a call to updateSceneGraph(double). More... | |
virtual void | updateSceneGraph (const osg::FrameStamp &frameStamp) |
Merge the changes to the scene graph by calling calling removeExpiredSubgraphs then addLoadedDataToSceneGraph. More... | |
unsigned int | getFileRequestListSize () const |
Report how many items are in the _fileRequestList queue. More... | |
unsigned int | getDataToCompileListSize () const |
Report how many items are in the _dataToCompileList queue. More... | |
unsigned int | getDataToMergeListSize () const |
Report how many items are in the _dataToMergeList queue. More... | |
bool | getRequestsInProgress () const |
Report whether any requests are in the pager. More... | |
double | getMinimumTimeToMergeTile () const |
Get the minimum time between the first request for a tile to be loaded and the time of its merge into the main scene graph. More... | |
double | getMaximumTimeToMergeTile () const |
Get the maximum time between the first request for a tile to be loaded and the time of its merge into the main scene graph. More... | |
double | getAverageTimeToMergeTiles () const |
Get the average time between the first request for a tile to be loaded and the time of its merge into the main scene graph. More... | |
void | resetStats () |
Reset the Stats variables. More... | |
void | setMarkerObject (osg::Object *mo) |
osg::Object * | getMarkerObject () |
const osg::Object * | getMarkerObject () const |
Public Member Functions inherited from osg::NodeVisitor::DatabaseRequestHandler | |
DatabaseRequestHandler () | |
Public Member Functions inherited from osg::Referenced | |
Referenced () | |
Referenced (bool threadSafeRefUnref) | |
Referenced (const Referenced &) | |
Referenced & | operator= (const Referenced &) |
virtual void | setThreadSafeRefUnref (bool threadSafe) |
Set whether to use a mutex to ensure ref() and unref() are thread safe. More... | |
bool | getThreadSafeRefUnref () const |
Get whether a mutex is used to ensure ref() and unref() are thread safe. More... | |
OpenThreads::Mutex * | getRefMutex () const |
Get the mutex used to ensure thread safety of ref()/unref(). More... | |
int | ref () const |
Increment the reference count by one, indicating that this object has another pointer which is referencing it. More... | |
int | unref () const |
Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More... | |
int | unref_nodelete () const |
Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More... | |
int | referenceCount () const |
Return the number of pointers currently referencing this object. More... | |
ObserverSet * | getObserverSet () const |
Get the ObserverSet if one is attached, otherwise return NULL. More... | |
ObserverSet * | getOrCreateObserverSet () const |
Get the ObserverSet if one is attached, otherwise create an ObserverSet, attach it, then return this newly created ObserverSet. More... | |
void | addObserver (Observer *observer) const |
Add a Observer that is observing this object, notify the Observer when this object gets deleted. More... | |
void | removeObserver (Observer *observer) const |
Remove Observer that is observing this object. More... | |
Static Public Member Functions | |
static osg::ref_ptr< DatabasePager > & | prototype () |
get the prototype singleton used by DatabasePager::create(). More... | |
static DatabasePager * | create () |
create a DatabasePager by cloning DatabasePager::prototype(). More... | |
Static Public Member Functions inherited from osg::Referenced | |
static OpenThreads::Mutex * | getGlobalReferencedMutex () |
Get the optional global Referenced mutex, this can be shared between all osg::Referenced. More... | |
static void | setThreadSafeReferenceCounting (bool enableThreadSafeReferenceCounting) |
Set whether reference counting should use a mutex for thread safe reference counting. More... | |
static bool | getThreadSafeReferenceCounting () |
Get whether reference counting is active. More... | |
static void | setDeleteHandler (DeleteHandler *handler) |
Set a DeleteHandler to which deletion of all referenced counted objects will be delegated. More... | |
static DeleteHandler * | getDeleteHandler () |
Get a DeleteHandler. More... | |
Protected Types | |
typedef std::vector< osg::ref_ptr< DatabaseThread > > | DatabaseThreadList |
Protected Member Functions | |
virtual | ~DatabasePager () |
void | compileCompleted (DatabaseRequest *databaseRequest) |
virtual void | removeExpiredSubgraphs (const osg::FrameStamp &frameStamp) |
Iterate through the active PagedLOD nodes children removing children which havn't been visited since specified expiryTime. More... | |
void | addLoadedDataToSceneGraph (const osg::FrameStamp &frameStamp) |
Add the loaded data to the scene graph. More... | |
Protected Member Functions inherited from osg::NodeVisitor::DatabaseRequestHandler | |
virtual | ~DatabaseRequestHandler () |
Protected Member Functions inherited from osg::Referenced | |
virtual | ~Referenced () |
void | signalObserversAndDelete (bool signalDelete, bool doDelete) const |
void | deleteUsingDeleteHandler () const |
Friends | |
class | DatabaseThread |
struct | DatabaseRequest |
class | FindCompileableGLObjectsVisitor |
struct | DatabasePagerCompileCompletedCallback |
class | FindPagedLODsVisitor |
struct | SortFileRequestFunctor |
Database paging class which manages the loading of files in a background thread, and synchronizing of loaded models with the main scene graph.
|
protected |
typedef std::vector< osg::ref_ptr<osg::Drawable> > osgDB::DatabasePager::DrawableList |
typedef std::list< osg::ref_ptr<osg::Object> > osgDB::DatabasePager::ObjectList |
typedef std::set< osg::ref_ptr<osg::StateSet> > osgDB::DatabasePager::StateSetList |
typedef OpenThreads::Thread::ThreadPriority osgDB::DatabasePager::ThreadPriority |
osgDB::DatabasePager::DatabasePager | ( | ) |
osgDB::DatabasePager::DatabasePager | ( | const DatabasePager & | rhs | ) |
|
protectedvirtual |
|
virtual |
|
protected |
Add the loaded data to the scene graph.
|
virtual |
Cancel the database pager thread(s).
|
inlinevirtual |
|
virtual |
Clear all internally cached structures.
|
inlinevirtual |
Create a shallow copy on the DatabasePager.
|
protected |
|
static |
create a DatabasePager by cloning DatabasePager::prototype().
|
inline |
Get whether new database request calls are accepted or ignored.
|
inline |
Get whether newly loaded textures should have a PixelBufferObject assigned to them.
|
inline |
Get the average time between the first request for a tile to be loaded and the time of its merge into the main scene graph.
|
inline |
Get whether the database pager thread should is paused or not.
|
inline |
|
inline |
|
inline |
Report how many items are in the _dataToCompileList queue.
|
inline |
Report how many items are in the _dataToMergeList queue.
|
inline |
Get whether the removed subgraphs should be deleted in the database thread or not.
|
inline |
Get whether the database pager should pre compile OpenGL objects before allowing them to be merged into the scene graph.
|
inline |
Get how loaded drawables should be handled w.r.t their display list/vertex buffer object/vertex array settings.
|
inline |
Report how many items are in the _fileRequestList queue.
|
inline |
Get the incremental compile operation.
|
inline |
|
inline |
|
inline |
Set whether newly loaded textures should have their MaxAnisotopy set to a specified value.
|
inline |
Get the maximum time between the first request for a tile to be loaded and the time of its merge into the main scene graph.
|
inline |
Get the minimum time between the first request for a tile to be loaded and the time of its merge into the main scene graph.
|
inline |
|
inline |
Get the number of frames that are currently active.
bool osgDB::DatabasePager::getRequestsInProgress | ( | ) | const |
Report whether any requests are in the pager.
|
inline |
Get the target maximum number of PagedLOD to maintain in memory.
|
inline |
Get whether newly loaded textures should have their UnrefImageDataAfterApply set to a specified value.
|
virtual |
|
static |
get the prototype singleton used by DatabasePager::create().
|
virtual |
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.
|
protectedvirtual |
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.
|
virtual |
Add a request to load a node file to end the database request list.
Implements osg::NodeVisitor::DatabaseRequestHandler.
bool osgDB::DatabasePager::requiresUpdateSceneGraph | ( | ) | const |
Return true if there are pending updates to the scene graph that require a call to updateSceneGraph(double).
void osgDB::DatabasePager::resetStats | ( | ) |
Reset the Stats variables.
|
inline |
Set whether new database request calls are accepted or ignored.
|
inline |
Set whether newly loaded textures should have a PixelBufferObject assigned to them to aid download to the GPU.
void osgDB::DatabasePager::setDatabasePagerThreadPause | ( | bool | pause | ) |
Set whether the database pager thread should be paused or not.
|
inline |
Set whether the removed subgraphs should be deleted in the database thread or not.
|
inline |
Set whether the database pager should pre compile OpenGL objects before allowing them to be merged into the scene graph.
Pre compilation helps reduce the chances of frame drops, but also slows the speed at which tiles are merged as they have to be compiled first.
|
inline |
Set how loaded drawables should be handled w.r.t their display list/vertex buffer object/vertex array settings.
void osgDB::DatabasePager::setIncrementalCompileOperation | ( | osgUtil::IncrementalCompileOperation * | ico | ) |
Set the incremental compile operation.
Used to manage the OpenGL object compilation and merging of subgraphs in a way that avoids overloading the rendering of frame with too many new objects in one frame.
|
inline |
|
inline |
Set whether newly loaded textures should have their MaxAnisotopy set to a specified value.
int osgDB::DatabasePager::setSchedulePriority | ( | OpenThreads::Thread::ThreadPriority | priority | ) |
Set the priority of the database pager thread(s).
|
inline |
Set the target maximum number of PagedLOD to maintain in memory.
Note, if more than the target number are required for rendering of a frame then these active PagedLOD are excempt from being expiried. But once the number of active drops back below the target the inactive PagedLOD will be trimmed back to the target number.
|
inline |
Set whether newly loaded textures should have their UnrefImageDataAfterApply set to a specified value.
void osgDB::DatabasePager::setUpThreads | ( | unsigned int | totalNumThreads = 2 , |
unsigned int | numHttpThreads = 1 |
||
) |
|
virtual |
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.
|
virtual |
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.
|
virtual |
Merge the changes to the scene graph by calling calling removeExpiredSubgraphs then addLoadedDataToSceneGraph.
Note, must only be called from single thread update phase.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Generated at Wed Nov 11 2015 22:14:52 for the OpenSceneGraph by doxygen 1.8.10. |