DatabasePager
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSGDB_DATABASEPAGER
#define OSGDB_DATABASEPAGER 1
#include <osg/NodeVisitor>
#include <osg/Group>
#include <osg/PagedLOD>
#include <osg/Drawable>
#include <osg/GraphicsThread>
#include <osg/FrameStamp>
#include <osg/ObserverNodePath>
#include <osg/observer_ptr>
#include <OpenThreads/Thread>
#include <OpenThreads/Mutex>
#include <OpenThreads/ScopedLock>
#include <OpenThreads/Condition>
#include <osgUtil/IncrementalCompileOperation>
#include <osgDB/SharedStateManager>
#include <osgDB/ReaderWriter>
#include <osgDB/Options>
#include <map>
#include <list>
#include <algorithm>
#include <functional>
namespace osgDB {
class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandler
{
public :
typedef OpenThreads::Thread::ThreadPriority ThreadPriority;
DatabasePager();
DatabasePager(const DatabasePager& rhs);
virtual const char* className() const { return "DatabasePager"; }
virtual DatabasePager* clone() const { return new DatabasePager(*this); }
static osg::ref_ptr<DatabasePager>& prototype();
static DatabasePager* create();
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);
int setSchedulePriority(OpenThreads::Thread::ThreadPriority priority);
virtual int cancel();
virtual bool isRunning() const;
virtual void clear();
class OSGDB_EXPORT DatabaseThread : public osg::Referenced, public OpenThreads::Thread
{
public:
enum Mode
{
HANDLE_ALL_REQUESTS,
HANDLE_NON_HTTP,
HANDLE_ONLY_HTTP
};
DatabaseThread(DatabasePager* pager, Mode mode, const std::string& name);
DatabaseThread(const DatabaseThread& dt, DatabasePager* pager);
void setName(const std::string& name) { _name = name; }
const std::string& getName() const { return _name; }
void setDone(bool done) { _done.exchange(done?1:0); }
bool getDone() const { return _done!=0; }
void setActive(bool active) { _active = active; }
bool getActive() const { return _active; }
virtual int cancel();
virtual void run();
protected:
virtual ~DatabaseThread();
OpenThreads::Atomic _done;
volatile bool _active;
DatabasePager* _pager;
Mode _mode;
std::string _name;
};
virtual void setProcessorAffinity(const OpenThreads::Affinity& affinity);
OpenThreads::Affinity& getProcessorAffinity() { return _affinity; }
const OpenThreads::Affinity& getProcessorAffinity() const { return _affinity; }
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) { return _databaseThreads[i].get(); }
const DatabaseThread* getDatabaseThread(unsigned int i) const { return _databaseThreads[i].get(); }
unsigned int getNumDatabaseThreads() const { return static_cast<unsigned int>(_databaseThreads.size()); }
void setDatabasePagerThreadPause(bool pause);
bool getDatabasePagerThreadPause() const { return _databasePagerThreadPaused; }
void setAcceptNewDatabaseRequests(bool acceptNewRequests) { _acceptNewRequests = acceptNewRequests; }
bool getAcceptNewDatabaseRequests() const { return _acceptNewRequests; }
int getNumFramesActive() const { return _numFramesActive; }
virtual void signalBeginFrame(const osg::FrameStamp* framestamp);
virtual void signalEndFrame();
virtual void registerPagedLODs(osg::Node* subgraph, unsigned int frameNumber = 0);
void setIncrementalCompileOperation(osgUtil::IncrementalCompileOperation* ico);
osgUtil::IncrementalCompileOperation* getIncrementalCompileOperation() { return _incrementalCompileOperation.get(); }
void setDoPreCompile(bool flag) { _doPreCompile = flag; }
bool getDoPreCompile() const { return _doPreCompile; }
void setTargetMaximumNumberOfPageLOD(unsigned int target) { _targetMaximumNumberOfPageLOD = target; }
unsigned int getTargetMaximumNumberOfPageLOD() const { return _targetMaximumNumberOfPageLOD; }
void setDeleteRemovedSubgraphsInDatabaseThread(bool flag) { _deleteRemovedSubgraphsInDatabaseThread = flag; }
bool getDeleteRemovedSubgraphsInDatabaseThread() const { return _deleteRemovedSubgraphsInDatabaseThread; }
enum DrawablePolicy
{
DO_NOT_MODIFY_DRAWABLE_SETTINGS,
USE_DISPLAY_LISTS,
USE_VERTEX_BUFFER_OBJECTS,
USE_VERTEX_ARRAYS
};
void setDrawablePolicy(DrawablePolicy policy) { _drawablePolicy = policy; }
DrawablePolicy getDrawablePolicy() const { return _drawablePolicy; }
void setApplyPBOToImages(bool assignPBOToImages) { _assignPBOToImages = assignPBOToImages; }
bool getApplyPBOToImages() const { return _assignPBOToImages; }
void setUnrefImageDataAfterApplyPolicy(bool changeAutoUnRef, bool valueAutoUnRef) { _changeAutoUnRef = changeAutoUnRef; _valueAutoUnRef = valueAutoUnRef; }
void getUnrefImageDataAfterApplyPolicy(bool& changeAutoUnRef, bool& valueAutoUnRef) const { changeAutoUnRef = _changeAutoUnRef; valueAutoUnRef = _valueAutoUnRef; }
void setMaxAnisotropyPolicy(bool changeAnisotropy, float valueAnisotropy) { _changeAnisotropy = changeAnisotropy; _valueAnisotropy = valueAnisotropy; }
void getMaxAnisotropyPolicy(bool& changeAnisotropy, float& valueAnisotropy) const { changeAnisotropy = _changeAnisotropy; valueAnisotropy = _valueAnisotropy; }
bool requiresUpdateSceneGraph() const;
virtual void updateSceneGraph(const osg::FrameStamp& frameStamp);
bool requiresRedraw() const;
unsigned int getFileRequestListSize() const { return static_cast<unsigned int>(_fileRequestQueue->size() + _httpRequestQueue->size()); }
unsigned int getDataToCompileListSize() const { return static_cast<unsigned int>(_dataToCompileList->size()); }
unsigned int getDataToMergeListSize() const { return static_cast<unsigned int>(_dataToMergeList->size()); }
bool getRequestsInProgress() const;
double getMinimumTimeToMergeTile() const { return _minimumTimeToMergeTile; }
double getMaximumTimeToMergeTile() const { return _maximumTimeToMergeTile; }
double getAverageTimeToMergeTiles() const { return (_numTilesMerges > 0) ? _totalTimeToMergeTiles/static_cast<double>(_numTilesMerges) : 0; }
void resetStats();
typedef std::set< osg::ref_ptr<osg::StateSet> > StateSetList;
typedef std::vector< osg::ref_ptr<osg::Drawable> > DrawableList;
class ExpirePagedLODsVisitor;
typedef std::list< osg::ref_ptr<osg::Object> > ObjectList;
struct PagedLODList : public osg::Referenced
{
virtual PagedLODList* clone() = 0;
virtual void clear() = 0;
virtual unsigned int size() = 0;
virtual void removeExpiredChildren(int numberChildrenToRemove, double expiryTime, unsigned int expiryFrame, ObjectList& childrenRemoved, bool visitActive) = 0;
virtual void removeNodes(osg::NodeList& nodesToRemove) = 0;
virtual void insertPagedLOD(const osg::observer_ptr<osg::PagedLOD>& plod) = 0;
virtual bool containsPagedLOD(const osg::observer_ptr<osg::PagedLOD>& plod) const = 0;
};
void setMarkerObject(osg::Object* mo) { _markerObject = mo; }
osg::Object* getMarkerObject() { return _markerObject.get(); }
const osg::Object* getMarkerObject() const { return _markerObject.get(); }
protected:
virtual ~DatabasePager();
friend class DatabaseThread;
friend struct DatabaseRequest;
struct RequestQueue;
struct OSGDB_EXPORT DatabaseRequest : public osg::Referenced
{
DatabaseRequest():
osg::Referenced(true),
_valid(false),
_frameNumberFirstRequest(0),
_timestampFirstRequest(0.0),
_priorityFirstRequest(0.f),
_frameNumberLastRequest(0),
_timestampLastRequest(0.0),
_priorityLastRequest(0.0f),
_numOfRequests(0),
_groupExpired(false)
{}
void invalidate();
bool valid() const { return _valid; }
bool isRequestCurrent (int frameNumber) const
{
return _valid && (frameNumber - _frameNumberLastRequest <= 1);
}
bool _valid;
std::string _fileName;
unsigned int _frameNumberFirstRequest;
double _timestampFirstRequest;
float _priorityFirstRequest;
unsigned int _frameNumberLastRequest;
double _timestampLastRequest;
float _priorityLastRequest;
unsigned int _numOfRequests;
osg::observer_ptr<osg::Node> _terrain;
osg::observer_ptr<osg::Group> _group;
osg::ref_ptr<osg::Node> _loadedModel;
osg::ref_ptr<Options> _loadOptions;
osg::ref_ptr<ObjectCache> _objectCache;
osg::observer_ptr<osgUtil::IncrementalCompileOperation::CompileSet> _compileSet;
bool _groupExpired; // flag used only in update thread
};
struct OSGDB_EXPORT RequestQueue : public osg::Referenced
{
public:
RequestQueue(DatabasePager* pager);
void add(DatabaseRequest* databaseRequest);
void remove(DatabaseRequest* databaseRequest);
void addNoLock(DatabaseRequest* databaseRequest);
void takeFirst(osg::ref_ptr<DatabaseRequest>& databaseRequest);
bool pruneOldRequestsAndCheckIfEmpty();
virtual void updateBlock() {}
void invalidate(DatabaseRequest* dr);
bool empty();
unsigned int size();
void clear();
typedef std::list< osg::ref_ptr<DatabaseRequest> > RequestList;
void swap(RequestList& requestList);
DatabasePager* _pager;
RequestList _requestList;
OpenThreads::Mutex _requestMutex;
unsigned int _frameNumberLastPruned;
protected:
virtual ~RequestQueue();
};
typedef std::vector< osg::ref_ptr<DatabaseThread> > DatabaseThreadList;
struct OSGDB_EXPORT ReadQueue : public RequestQueue
{
ReadQueue(DatabasePager* pager, const std::string& name);
void block() { _block->block(); }
void release() { _block->release(); }
virtual void updateBlock();
osg::ref_ptr<osg::RefBlock> _block;
std::string _name;
OpenThreads::Mutex _childrenToDeleteListMutex;
ObjectList _childrenToDeleteList;
};
// forward declare inner helper classes
class FindCompileableGLObjectsVisitor;
friend class FindCompileableGLObjectsVisitor;
struct DatabasePagerCompileCompletedCallback;
friend struct DatabasePagerCompileCompletedCallback;
class FindPagedLODsVisitor;
friend class FindPagedLODsVisitor;
struct SortFileRequestFunctor;
friend struct SortFileRequestFunctor;
OpenThreads::Mutex _run_mutex;
OpenThreads::Mutex _dr_mutex;
bool _startThreadCalled;
void compileCompleted(DatabaseRequest* databaseRequest);
virtual void removeExpiredSubgraphs(const osg::FrameStamp &frameStamp);
void addLoadedDataToSceneGraph(const osg::FrameStamp &frameStamp);
OpenThreads::Affinity _affinity;
bool _done;
bool _acceptNewRequests;
bool _databasePagerThreadPaused;
DatabaseThreadList _databaseThreads;
int _numFramesActive;
mutable OpenThreads::Mutex _numFramesActiveMutex;
OpenThreads::Atomic _frameNumber;
osg::ref_ptr<ReadQueue> _fileRequestQueue;
osg::ref_ptr<ReadQueue> _httpRequestQueue;
osg::ref_ptr<RequestQueue> _dataToCompileList;
osg::ref_ptr<RequestQueue> _dataToMergeList;
DrawablePolicy _drawablePolicy;
bool _assignPBOToImages;
bool _changeAutoUnRef;
bool _valueAutoUnRef;
bool _changeAnisotropy;
float _valueAnisotropy;
bool _deleteRemovedSubgraphsInDatabaseThread;
osg::ref_ptr<PagedLODList> _activePagedLODList;
unsigned int _targetMaximumNumberOfPageLOD;
bool _doPreCompile;
osg::ref_ptr<osgUtil::IncrementalCompileOperation> _incrementalCompileOperation;
double _minimumTimeToMergeTile;
double _maximumTimeToMergeTile;
double _totalTimeToMergeTiles;
unsigned int _numTilesMerges;
osg::ref_ptr<osg::Object> _markerObject;
};
}
#endif
Condition
Drawable
FrameStamp
GraphicsThread
Group
IncrementalCompileOperation
Mutex
NodeVisitor
ObserverNodePath
Options
PagedLOD
ReaderWriter
ScopedLock
SharedStateManager
Thread
OpenThreads::Affinity
Simple container for specifying which CPU a thread should have affinity with. An empty Affinity....
Definition Affinity:34
OpenThreads::Atomic
This class provides an atomic increment and decrement operation.
Definition Atomic:48
OpenThreads::Mutex
This class provides an object-oriented thread mutex interface.
Definition Mutex:31
OpenThreads::Thread
This class provides an object-oriented thread interface.
Definition Thread:48
OpenThreads::Thread::ThreadPriority
ThreadPriority
Definition Thread:77
osgDB::DatabasePager::DatabaseThread
Definition DatabasePager:90
osgDB::DatabasePager::DatabaseThread::run
virtual void run()
osgDB::DatabasePager::DatabaseThread::setActive
void setActive(bool active)
Definition DatabasePager:110
osgDB::DatabasePager::DatabaseThread::setDone
void setDone(bool done)
Definition DatabasePager:107
osgDB::DatabasePager::DatabaseThread::_name
std::string _name
Definition DatabasePager:125
osgDB::DatabasePager::DatabaseThread::cancel
virtual int cancel()
osgDB::DatabasePager::DatabaseThread::getName
const std::string & getName() const
Definition DatabasePager:105
osgDB::DatabasePager::DatabaseThread::~DatabaseThread
virtual ~DatabaseThread()
osgDB::DatabasePager::DatabaseThread::getActive
bool getActive() const
Definition DatabasePager:111
osgDB::DatabasePager::DatabaseThread::_pager
DatabasePager * _pager
Definition DatabasePager:123
osgDB::DatabasePager::DatabaseThread::_done
OpenThreads::Atomic _done
Definition DatabasePager:121
osgDB::DatabasePager::DatabaseThread::setName
void setName(const std::string &name)
Definition DatabasePager:104
osgDB::DatabasePager::DatabaseThread::_mode
Mode _mode
Definition DatabasePager:124
osgDB::DatabasePager::DatabaseThread::getDone
bool getDone() const
Definition DatabasePager:108
osgDB::DatabasePager::DatabaseThread::DatabaseThread
DatabaseThread(const DatabaseThread &dt, DatabasePager *pager)
osgDB::DatabasePager::DatabaseThread::_active
volatile bool _active
Definition DatabasePager:122
osgDB::DatabasePager::DatabaseThread::DatabaseThread
DatabaseThread(DatabasePager *pager, Mode mode, const std::string &name)
osgDB::DatabasePager::DatabaseThread::Mode
Mode
Definition DatabasePager:94
osgDB::DatabasePager::DatabaseThread::HANDLE_NON_HTTP
@ HANDLE_NON_HTTP
Definition DatabasePager:96
osgDB::DatabasePager::DatabaseThread::HANDLE_ALL_REQUESTS
@ HANDLE_ALL_REQUESTS
Definition DatabasePager:95
osgDB::DatabasePager::DatabaseThread::HANDLE_ONLY_HTTP
@ HANDLE_ONLY_HTTP
Definition DatabasePager:97
osgDB::DatabasePager::_maximumTimeToMergeTile
double _maximumTimeToMergeTile
Definition DatabasePager:482
osgDB::DatabasePager::removeExpiredSubgraphs
virtual void removeExpiredSubgraphs(const osg::FrameStamp &frameStamp)
osgDB::DatabasePager::getMaximumTimeToMergeTile
double getMaximumTimeToMergeTile() const
Definition DatabasePager:270
osgDB::DatabasePager::_acceptNewRequests
bool _acceptNewRequests
Definition DatabasePager:448
osgDB::DatabasePager::_dr_mutex
OpenThreads::Mutex _dr_mutex
Definition DatabasePager:431
osgDB::DatabasePager::requiresUpdateSceneGraph
bool requiresUpdateSceneGraph() const
osgDB::DatabasePager::getAcceptNewDatabaseRequests
bool getAcceptNewDatabaseRequests() const
Definition DatabasePager:153
osgDB::DatabasePager::setProcessorAffinity
virtual void setProcessorAffinity(const OpenThreads::Affinity &affinity)
osgDB::DatabasePager::getDatabaseThread
DatabaseThread * getDatabaseThread(unsigned int i)
Definition DatabasePager:137
osgDB::DatabasePager::resetStats
void resetStats()
osgDB::DatabasePager::_dataToCompileList
osg::ref_ptr< RequestQueue > _dataToCompileList
Definition DatabasePager:459
osgDB::DatabasePager::requiresRedraw
bool requiresRedraw() const
osgDB::DatabasePager::getMarkerObject
const osg::Object * getMarkerObject() const
Definition DatabasePager:298
osgDB::DatabasePager::getMarkerObject
osg::Object * getMarkerObject()
Definition DatabasePager:297
osgDB::DatabasePager::DatabaseThreadList
std::vector< osg::ref_ptr< DatabaseThread > > DatabaseThreadList
Definition DatabasePager:395
osgDB::DatabasePager::SortFileRequestFunctor
friend struct SortFileRequestFunctor
Definition DatabasePager:427
osgDB::DatabasePager::setDrawablePolicy
void setDrawablePolicy(DrawablePolicy policy)
Definition DatabasePager:217
osgDB::DatabasePager::_httpRequestQueue
osg::ref_ptr< ReadQueue > _httpRequestQueue
Definition DatabasePager:458
osgDB::DatabasePager::_minimumTimeToMergeTile
double _minimumTimeToMergeTile
Definition DatabasePager:481
osgDB::DatabasePager::_incrementalCompileOperation
osg::ref_ptr< osgUtil::IncrementalCompileOperation > _incrementalCompileOperation
Definition DatabasePager:478
osgDB::DatabasePager::_numFramesActive
int _numFramesActive
Definition DatabasePager:453
osgDB::DatabasePager::getNumFramesActive
int getNumFramesActive() const
Definition DatabasePager:156
osgDB::DatabasePager::setSchedulePriority
int setSchedulePriority(OpenThreads::Thread::ThreadPriority priority)
osgDB::DatabasePager::~DatabasePager
virtual ~DatabasePager()
osgDB::DatabasePager::getDrawablePolicy
DrawablePolicy getDrawablePolicy() const
Definition DatabasePager:220
osgDB::DatabasePager::ObjectList
std::list< osg::ref_ptr< osg::Object > > ObjectList
Definition DatabasePager:283
osgDB::DatabasePager::getTargetMaximumNumberOfPageLOD
unsigned int getTargetMaximumNumberOfPageLOD() const
Definition DatabasePager:199
osgDB::DatabasePager::setDoPreCompile
void setDoPreCompile(bool flag)
Definition DatabasePager:185
osgDB::DatabasePager::getProcessorAffinity
OpenThreads::Affinity & getProcessorAffinity()
Definition DatabasePager:130
osgDB::DatabasePager::requestNodeFile
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)
osgDB::DatabasePager::getDataToMergeListSize
unsigned int getDataToMergeListSize() const
Definition DatabasePager:261
osgDB::DatabasePager::getFileRequestListSize
unsigned int getFileRequestListSize() const
Definition DatabasePager:255
osgDB::DatabasePager::_activePagedLODList
osg::ref_ptr< PagedLODList > _activePagedLODList
Definition DatabasePager:473
osgDB::DatabasePager::clear
virtual void clear()
osgDB::DatabasePager::getNumDatabaseThreads
unsigned int getNumDatabaseThreads() const
Definition DatabasePager:141
osgDB::DatabasePager::getAverageTimeToMergeTiles
double getAverageTimeToMergeTiles() const
Definition DatabasePager:273
osgDB::DatabasePager::updateSceneGraph
virtual void updateSceneGraph(const osg::FrameStamp &frameStamp)
osgDB::DatabasePager::setTargetMaximumNumberOfPageLOD
void setTargetMaximumNumberOfPageLOD(unsigned int target)
Definition DatabasePager:196
osgDB::DatabasePager::setDatabasePagerThreadPause
void setDatabasePagerThreadPause(bool pause)
osgDB::DatabasePager::_affinity
OpenThreads::Affinity _affinity
Definition DatabasePager:445
osgDB::DatabasePager::getUnrefImageDataAfterApplyPolicy
void getUnrefImageDataAfterApplyPolicy(bool &changeAutoUnRef, bool &valueAutoUnRef) const
Definition DatabasePager:234
osgDB::DatabasePager::getProcessorAffinity
const OpenThreads::Affinity & getProcessorAffinity() const
Definition DatabasePager:131
osgDB::DatabasePager::create
static DatabasePager * create()
osgDB::DatabasePager::compileCompleted
void compileCompleted(DatabaseRequest *databaseRequest)
osgDB::DatabasePager::setUnrefImageDataAfterApplyPolicy
void setUnrefImageDataAfterApplyPolicy(bool changeAutoUnRef, bool valueAutoUnRef)
Definition DatabasePager:231
osgDB::DatabasePager::cancel
virtual int cancel()
osgDB::DatabasePager::DrawableList
std::vector< osg::ref_ptr< osg::Drawable > > DrawableList
Definition DatabasePager:279
osgDB::DatabasePager::DatabasePager
DatabasePager(const DatabasePager &rhs)
osgDB::DatabasePager::_doPreCompile
bool _doPreCompile
Definition DatabasePager:477
osgDB::DatabasePager::ThreadPriority
OpenThreads::Thread::ThreadPriority ThreadPriority
Definition DatabasePager:53
osgDB::DatabasePager::FindCompileableGLObjectsVisitor
friend class FindCompileableGLObjectsVisitor
Definition DatabasePager:418
osgDB::DatabasePager::getIncrementalCompileOperation
osgUtil::IncrementalCompileOperation * getIncrementalCompileOperation()
Definition DatabasePager:178
osgDB::DatabasePager::_assignPBOToImages
bool _assignPBOToImages
Definition DatabasePager:464
osgDB::DatabasePager::_fileRequestQueue
osg::ref_ptr< ReadQueue > _fileRequestQueue
Definition DatabasePager:457
osgDB::DatabasePager::setUpThreads
void setUpThreads(unsigned int totalNumThreads=2, unsigned int numHttpThreads=1)
osgDB::DatabasePager::FindPagedLODsVisitor
friend class FindPagedLODsVisitor
Definition DatabasePager:424
osgDB::DatabasePager::DatabasePagerCompileCompletedCallback
friend struct DatabasePagerCompileCompletedCallback
Definition DatabasePager:421
osgDB::DatabasePager::getApplyPBOToImages
bool getApplyPBOToImages() const
Definition DatabasePager:227
osgDB::DatabasePager::getMaxAnisotropyPolicy
void getMaxAnisotropyPolicy(bool &changeAnisotropy, float &valueAnisotropy) const
Definition DatabasePager:241
osgDB::DatabasePager::isRunning
virtual bool isRunning() const
osgDB::DatabasePager::_changeAnisotropy
bool _changeAnisotropy
Definition DatabasePager:467
osgDB::DatabasePager::StateSetList
std::set< osg::ref_ptr< osg::StateSet > > StateSetList
Definition DatabasePager:278
osgDB::DatabasePager::className
virtual const char * className() const
Definition DatabasePager:59
osgDB::DatabasePager::getDeleteRemovedSubgraphsInDatabaseThread
bool getDeleteRemovedSubgraphsInDatabaseThread() const
Definition DatabasePager:206
osgDB::DatabasePager::_numTilesMerges
unsigned int _numTilesMerges
Definition DatabasePager:484
osgDB::DatabasePager::registerPagedLODs
virtual void registerPagedLODs(osg::Node *subgraph, unsigned int frameNumber=0)
osgDB::DatabasePager::getDatabaseThread
const DatabaseThread * getDatabaseThread(unsigned int i) const
Definition DatabasePager:139
osgDB::DatabasePager::_databasePagerThreadPaused
bool _databasePagerThreadPaused
Definition DatabasePager:449
osgDB::DatabasePager::_changeAutoUnRef
bool _changeAutoUnRef
Definition DatabasePager:465
osgDB::DatabasePager::getMinimumTimeToMergeTile
double getMinimumTimeToMergeTile() const
Definition DatabasePager:267
osgDB::DatabasePager::setDeleteRemovedSubgraphsInDatabaseThread
void setDeleteRemovedSubgraphsInDatabaseThread(bool flag)
Definition DatabasePager:203
osgDB::DatabasePager::DatabasePager
DatabasePager()
osgDB::DatabasePager::_startThreadCalled
bool _startThreadCalled
Definition DatabasePager:432
osgDB::DatabasePager::getDataToCompileListSize
unsigned int getDataToCompileListSize() const
Definition DatabasePager:258
osgDB::DatabasePager::_deleteRemovedSubgraphsInDatabaseThread
bool _deleteRemovedSubgraphsInDatabaseThread
Definition DatabasePager:470
osgDB::DatabasePager::_done
bool _done
Definition DatabasePager:447
osgDB::DatabasePager::_databaseThreads
DatabaseThreadList _databaseThreads
Definition DatabasePager:451
osgDB::DatabasePager::addDatabaseThread
virtual unsigned int addDatabaseThread(DatabaseThread::Mode mode, const std::string &name)
osgDB::DatabasePager::setApplyPBOToImages
void setApplyPBOToImages(bool assignPBOToImages)
Definition DatabasePager:224
osgDB::DatabasePager::clone
virtual DatabasePager * clone() const
Definition DatabasePager:62
osgDB::DatabasePager::setIncrementalCompileOperation
void setIncrementalCompileOperation(osgUtil::IncrementalCompileOperation *ico)
osgDB::DatabasePager::signalBeginFrame
virtual void signalBeginFrame(const osg::FrameStamp *framestamp)
osgDB::DatabasePager::getRequestsInProgress
bool getRequestsInProgress() const
osgDB::DatabasePager::prototype
static osg::ref_ptr< DatabasePager > & prototype()
osgDB::DatabasePager::_targetMaximumNumberOfPageLOD
unsigned int _targetMaximumNumberOfPageLOD
Definition DatabasePager:475
osgDB::DatabasePager::_dataToMergeList
osg::ref_ptr< RequestQueue > _dataToMergeList
Definition DatabasePager:460
osgDB::DatabasePager::_frameNumber
OpenThreads::Atomic _frameNumber
Definition DatabasePager:455
osgDB::DatabasePager::_markerObject
osg::ref_ptr< osg::Object > _markerObject
Definition DatabasePager:486
osgDB::DatabasePager::addLoadedDataToSceneGraph
void addLoadedDataToSceneGraph(const osg::FrameStamp &frameStamp)
osgDB::DatabasePager::DrawablePolicy
DrawablePolicy
Definition DatabasePager:209
osgDB::DatabasePager::USE_VERTEX_BUFFER_OBJECTS
@ USE_VERTEX_BUFFER_OBJECTS
Definition DatabasePager:212
osgDB::DatabasePager::USE_VERTEX_ARRAYS
@ USE_VERTEX_ARRAYS
Definition DatabasePager:213
osgDB::DatabasePager::DO_NOT_MODIFY_DRAWABLE_SETTINGS
@ DO_NOT_MODIFY_DRAWABLE_SETTINGS
Definition DatabasePager:210
osgDB::DatabasePager::USE_DISPLAY_LISTS
@ USE_DISPLAY_LISTS
Definition DatabasePager:211
osgDB::DatabasePager::setAcceptNewDatabaseRequests
void setAcceptNewDatabaseRequests(bool acceptNewRequests)
Definition DatabasePager:150
osgDB::DatabasePager::_drawablePolicy
DrawablePolicy _drawablePolicy
Definition DatabasePager:462
osgDB::DatabasePager::_totalTimeToMergeTiles
double _totalTimeToMergeTiles
Definition DatabasePager:483
osgDB::DatabasePager::getDatabasePagerThreadPause
bool getDatabasePagerThreadPause() const
Definition DatabasePager:147
osgDB::DatabasePager::_valueAutoUnRef
bool _valueAutoUnRef
Definition DatabasePager:466
osgDB::DatabasePager::_valueAnisotropy
float _valueAnisotropy
Definition DatabasePager:468
osgDB::DatabasePager::_run_mutex
OpenThreads::Mutex _run_mutex
Definition DatabasePager:430
osgDB::DatabasePager::_numFramesActiveMutex
OpenThreads::Mutex _numFramesActiveMutex
Definition DatabasePager:454
osgDB::DatabasePager::setMaxAnisotropyPolicy
void setMaxAnisotropyPolicy(bool changeAnisotropy, float valueAnisotropy)
Definition DatabasePager:238
osgDB::DatabasePager::signalEndFrame
virtual void signalEndFrame()
osgDB::DatabasePager::setMarkerObject
void setMarkerObject(osg::Object *mo)
Definition DatabasePager:296
osgDB::DatabasePager::getDoPreCompile
bool getDoPreCompile() const
Definition DatabasePager:189
osgUtil::IncrementalCompileOperation
Definition IncrementalCompileOperation:56
osg::FrameStamp
Definition FrameStamp:35
osg::NodeVisitor::DatabaseRequestHandler
Definition NodeVisitor:364
osg::Node
Definition Node:72
osg::Object
Definition Object:61
osg::Referenced
Definition Referenced:44
osg::Referenced::Referenced
Referenced()
osg::observer_ptr
Definition observer_ptr:39
osg::ref_ptr
Definition ref_ptr:32
osgDB
Definition Archive:24
osg
Definition AlphaFunc:19
osg::NodeList
std::vector< ref_ptr< Node > > NodeList
Definition Group:22
osg::NodePath
std::vector< Node * > NodePath
Definition Node:47
observer_ptr
OSGDB_EXPORT
#define OSGDB_EXPORT
Definition osgDB/Export:39
osgDB::DatabasePager::DatabaseRequest
Definition DatabasePager:310
osgDB::DatabasePager::DatabaseRequest::_priorityFirstRequest
float _priorityFirstRequest
Definition DatabasePager:337
osgDB::DatabasePager::DatabaseRequest::invalidate
void invalidate()
osgDB::DatabasePager::DatabaseRequest::_frameNumberFirstRequest
unsigned int _frameNumberFirstRequest
Definition DatabasePager:335
osgDB::DatabasePager::DatabaseRequest::isRequestCurrent
bool isRequestCurrent(int frameNumber) const
Definition DatabasePager:328
osgDB::DatabasePager::DatabaseRequest::_numOfRequests
unsigned int _numOfRequests
Definition DatabasePager:341
osgDB::DatabasePager::DatabaseRequest::_loadedModel
osg::ref_ptr< osg::Node > _loadedModel
Definition DatabasePager:346
osgDB::DatabasePager::DatabaseRequest::_group
osg::observer_ptr< osg::Group > _group
Definition DatabasePager:344
osgDB::DatabasePager::DatabaseRequest::_valid
bool _valid
Definition DatabasePager:333
osgDB::DatabasePager::DatabaseRequest::_timestampFirstRequest
double _timestampFirstRequest
Definition DatabasePager:336
osgDB::DatabasePager::DatabaseRequest::_loadOptions
osg::ref_ptr< Options > _loadOptions
Definition DatabasePager:347
osgDB::DatabasePager::DatabaseRequest::_compileSet
osg::observer_ptr< osgUtil::IncrementalCompileOperation::CompileSet > _compileSet
Definition DatabasePager:350
osgDB::DatabasePager::DatabaseRequest::_objectCache
osg::ref_ptr< ObjectCache > _objectCache
Definition DatabasePager:348
osgDB::DatabasePager::DatabaseRequest::_timestampLastRequest
double _timestampLastRequest
Definition DatabasePager:339
osgDB::DatabasePager::DatabaseRequest::_frameNumberLastRequest
unsigned int _frameNumberLastRequest
Definition DatabasePager:338
osgDB::DatabasePager::DatabaseRequest::valid
bool valid() const
Definition DatabasePager:326
osgDB::DatabasePager::DatabaseRequest::_groupExpired
bool _groupExpired
Definition DatabasePager:351
osgDB::DatabasePager::DatabaseRequest::_priorityLastRequest
float _priorityLastRequest
Definition DatabasePager:340
osgDB::DatabasePager::DatabaseRequest::_terrain
osg::observer_ptr< osg::Node > _terrain
Definition DatabasePager:343
osgDB::DatabasePager::DatabaseRequest::DatabaseRequest
DatabaseRequest()
Definition DatabasePager:311
osgDB::DatabasePager::DatabaseRequest::_fileName
std::string _fileName
Definition DatabasePager:334
osgDB::DatabasePager::PagedLODList
Definition DatabasePager:286
osgDB::DatabasePager::PagedLODList::size
virtual unsigned int size()=0
osgDB::DatabasePager::PagedLODList::removeExpiredChildren
virtual void removeExpiredChildren(int numberChildrenToRemove, double expiryTime, unsigned int expiryFrame, ObjectList &childrenRemoved, bool visitActive)=0
osgDB::DatabasePager::PagedLODList::insertPagedLOD
virtual void insertPagedLOD(const osg::observer_ptr< osg::PagedLOD > &plod)=0
osgDB::DatabasePager::PagedLODList::containsPagedLOD
virtual bool containsPagedLOD(const osg::observer_ptr< osg::PagedLOD > &plod) const =0
osgDB::DatabasePager::PagedLODList::clear
virtual void clear()=0
osgDB::DatabasePager::PagedLODList::clone
virtual PagedLODList * clone()=0
osgDB::DatabasePager::PagedLODList::removeNodes
virtual void removeNodes(osg::NodeList &nodesToRemove)=0
osgDB::DatabasePager::ReadQueue::block
void block()
Definition DatabasePager:401
osgDB::DatabasePager::ReadQueue::ReadQueue
ReadQueue(DatabasePager *pager, const std::string &name)
osgDB::DatabasePager::ReadQueue::_name
std::string _name
Definition DatabasePager:410
osgDB::DatabasePager::ReadQueue::_childrenToDeleteList
ObjectList _childrenToDeleteList
Definition DatabasePager:413
osgDB::DatabasePager::ReadQueue::release
void release()
Definition DatabasePager:403
osgDB::DatabasePager::ReadQueue::updateBlock
virtual void updateBlock()
osgDB::DatabasePager::ReadQueue::_childrenToDeleteListMutex
OpenThreads::Mutex _childrenToDeleteListMutex
Definition DatabasePager:412
osgDB::DatabasePager::ReadQueue::_block
osg::ref_ptr< osg::RefBlock > _block
Definition DatabasePager:408
osgDB::DatabasePager::RequestQueue
Definition DatabasePager:356
osgDB::DatabasePager::RequestQueue::pruneOldRequestsAndCheckIfEmpty
bool pruneOldRequestsAndCheckIfEmpty()
prune all the old requests and then return true if requestList left empty
osgDB::DatabasePager::RequestQueue::add
void add(DatabaseRequest *databaseRequest)
osgDB::DatabasePager::RequestQueue::RequestQueue
RequestQueue(DatabasePager *pager)
osgDB::DatabasePager::RequestQueue::invalidate
void invalidate(DatabaseRequest *dr)
osgDB::DatabasePager::RequestQueue::swap
void swap(RequestList &requestList)
osgDB::DatabasePager::RequestQueue::remove
void remove(DatabaseRequest *databaseRequest)
osgDB::DatabasePager::RequestQueue::_requestMutex
OpenThreads::Mutex _requestMutex
Definition DatabasePager:387
osgDB::DatabasePager::RequestQueue::~RequestQueue
virtual ~RequestQueue()
osgDB::DatabasePager::RequestQueue::size
unsigned int size()
osgDB::DatabasePager::RequestQueue::_requestList
RequestList _requestList
Definition DatabasePager:386
osgDB::DatabasePager::RequestQueue::takeFirst
void takeFirst(osg::ref_ptr< DatabaseRequest > &databaseRequest)
osgDB::DatabasePager::RequestQueue::RequestList
std::list< osg::ref_ptr< DatabaseRequest > > RequestList
Definition DatabasePager:382
osgDB::DatabasePager::RequestQueue::_pager
DatabasePager * _pager
Definition DatabasePager:385
osgDB::DatabasePager::RequestQueue::empty
bool empty()
osgDB::DatabasePager::RequestQueue::_frameNumberLastPruned
unsigned int _frameNumberLastPruned
Definition DatabasePager:388
osgDB::DatabasePager::RequestQueue::updateBlock
virtual void updateBlock()
Definition DatabasePager:371
osgDB::DatabasePager::RequestQueue::clear
void clear()
osgDB::DatabasePager::RequestQueue::addNoLock
void addNoLock(DatabaseRequest *databaseRequest)