root/OpenSceneGraph/trunk/include/osgDB/DatabasePager @ 11143

Revision 11143, 27.3 kB (checked in by robert, 4 years ago)

Refactored DatabasePager? so that it nolonger takes ref_ptr<PagedLOD>, but instead uses a custom version of observer_ptr<>.
This change should make it possible to delete PagedLOD's independantly from the DatabasePager?, and also prevent issues of
consistency of the pager when subgraphs when are cached elsewhere in the application such as in the Registry filecache.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under 
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version.  The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSGDB_DATABASEPAGER
15#define OSGDB_DATABASEPAGER 1
16
17#include <osg/NodeVisitor>
18#include <osg/Group>
19#include <osg/PagedLOD>
20#include <osg/Drawable>
21#include <osg/GraphicsThread>
22#include <osg/FrameStamp>
23#include <osg/ObserverNodePath>
24#include <osg/observer_ptr>
25
26#include <OpenThreads/Thread>
27#include <OpenThreads/Mutex>
28#include <OpenThreads/ScopedLock>
29#include <OpenThreads/Condition>
30
31#include <osgDB/SharedStateManager>
32#include <osgDB/ReaderWriter>
33#include <osgDB/Options>
34
35#include <map>
36#include <list>
37#include <algorithm>
38#include <functional>
39
40namespace osgDB {
41
42
43
44/** Database paging class which manages the loading of files in a background thread,
45  * and synchronizing of loaded models with the main scene graph.*/
46class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandler
47{
48    public :
49
50        typedef OpenThreads::Thread::ThreadPriority ThreadPriority;
51
52        DatabasePager();
53
54        DatabasePager(const DatabasePager& rhs);
55
56        virtual const char* className() const { return "DatabasePager"; }
57
58        /** Create a shallow copy on the DatabasePager.*/
59        virtual DatabasePager* clone() const { return new DatabasePager(*this); }
60
61        /** get the prototype singleton used by DatabasePager::create().*/
62        static osg::ref_ptr<DatabasePager>& prototype();
63       
64        /** create a DatabasePager by cloning DatabasePager::prototype().*/
65        static DatabasePager* create();
66
67       
68
69        /** Add a request to load a node file to end the the database request list.*/
70        virtual void requestNodeFile(const std::string& fileName,osg::Group* group,
71                                     float priority, const osg::FrameStamp* framestamp,
72                                     osg::ref_ptr<osg::Referenced>& databaseRequest,
73                                     const osg::Referenced* options);
74
75        /** Set the priority of the database pager thread(s).*/
76        int setSchedulePriority(OpenThreads::Thread::ThreadPriority priority);
77
78        /** Cancel the database pager thread(s).*/       
79        virtual int cancel();
80       
81        virtual bool isRunning() const;
82       
83        /** Clear all internally cached structures.*/
84        virtual void clear();
85       
86        class OSGDB_EXPORT DatabaseThread : public osg::Referenced, public OpenThreads::Thread
87        {
88        public:
89       
90            enum Mode
91            {
92                HANDLE_ALL_REQUESTS,
93                HANDLE_NON_HTTP,
94                HANDLE_ONLY_HTTP
95            };
96       
97            DatabaseThread(DatabasePager* pager, Mode mode, const std::string& name);
98           
99            DatabaseThread(const DatabaseThread& dt, DatabasePager* pager);
100           
101            void setDone(bool done) { _done = done; }
102            bool getDone() const { return _done; }
103           
104            void setActive(bool active) { _active = active; }
105            bool getActive() const { return _active; }
106
107            virtual int cancel();
108           
109            virtual void run();
110           
111        protected:
112
113            virtual ~DatabaseThread();
114       
115            bool            _done;
116            bool            _active;
117            DatabasePager*  _pager;
118            Mode            _mode;
119            std::string     _name;
120        };
121       
122        void setUpThreads(unsigned int totalNumThreads=2, unsigned int numHttpThreads=1);
123
124        unsigned int addDatabaseThread(DatabaseThread::Mode mode, const std::string& name);
125
126        DatabaseThread* getDatabaseThread(unsigned int i) { return _databaseThreads[i].get(); }
127       
128        const DatabaseThread* getDatabaseThread(unsigned int i) const { return _databaseThreads[i].get(); }
129
130        unsigned int getNumDatabaseThreads() const { return _databaseThreads.size(); }
131       
132        /** Set whether the database pager thread should be paused or not.*/
133        void setDatabasePagerThreadPause(bool pause);
134       
135        /** Get whether the database pager thread should is paused or not.*/
136        bool getDatabasePagerThreadPause() const { return _databasePagerThreadPaused; }
137       
138        /** Set whether new database request calls are accepted or ignored.*/
139        void setAcceptNewDatabaseRequests(bool acceptNewRequests) { _acceptNewRequests = acceptNewRequests; }
140       
141        /** Get whether new database request calls are accepted or ignored.*/
142        bool getAcceptNewDatabaseRequests() const { return _acceptNewRequests; }
143       
144        /** Get the number of frames that are currently active.*/
145        int getNumFramesActive() const { return _numFramesActive; }
146
147        /** Signal the database thread that the update, cull and draw has begun for a new frame.
148          * 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. */
149        virtual void signalBeginFrame(const osg::FrameStamp* framestamp);
150       
151        /** Signal the database thread that the update, cull and draw dispatch has completed.
152          * 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.*/
153        virtual void signalEndFrame();
154       
155
156        /** Find all PagedLOD nodes in a subgraph and register them with
157          * the DatabasePager so it can keep track of expired nodes.
158          * note, should be only be called from the update thread. */
159        virtual void registerPagedLODs(osg::Node* subgraph, int frameNumber = 0);
160
161        /** Set whether the database pager should pre compile OpenGL objects before allowing
162          * them to be merged into the scene graph.
163          * Pre compilation helps reduce the chances of frame drops, but also slows the
164          * speed at which tiles are merged as they have to be compiled first.*/
165        void setDoPreCompile(bool flag) { _doPreCompile = flag; }
166
167        /** Get whether the database pager should pre compile OpenGL objects before allowing
168          * them to be merged into the scene graph.*/
169        bool getDoPreCompile() const { return _doPreCompile; }
170
171
172        /** Set the target frame rate that the DatabasePager should assume.
173          * Typically one would set this to the value refresh rate of your display system i.e. 60Hz.
174          * Default value is 100.
175          * Usage notes.  The TargetFrameRate and the MinimumTimeAvailableForGLCompileAndDeletePerFrame
176          * parameters are not directly used by DatabasePager, but are should be used as a guide for how
177          * long to set aside per frame for compiling and deleting OpenGL objects - ie. the value to use
178          * when calling DatabasePager::compileGLObjectgs(state,availableTime,). The longer amount of
179          * time to set aside  cthe faster databases will be paged in but with increased chance of frame drops,
180          * the lower the amount of time the set aside the slower databases will paged it but with better
181          * chance of avoid any frame drops.  The default values are chosen to achieve the later when running
182          * on a modern mid to high end  PC.
183          * The way to compute the amount of available time use a scheme such as :
184          *    availableTime = maximum(1.0/targetFrameRate - timeTakenDuringUpdateCullAndDraw, minimumTimeAvailableForGLCompileAndDeletePerFrame).
185          */
186        void setTargetFrameRate(double tfr) { _targetFrameRate = tfr; }
187
188        /** Get the target frame rate that the DatabasePager should assume.*/
189        double getTargetFrameRate() const { return _targetFrameRate; }
190       
191        /** Set the minimum amount of time (in seconds) that should be made available for compiling and delete OpenGL objects per frame.
192          * Default value is 0.001 (1 millisecond).
193          * For usage see notes in setTargetFrameRate.*/
194        void setMinimumTimeAvailableForGLCompileAndDeletePerFrame(double ta) { _minimumTimeAvailableForGLCompileAndDeletePerFrame = ta; }
195
196        /** Get the minimum amount of time that should be made available for compiling and delete OpenGL objects per frame.
197          * For usage see notes in setTargetFrameRate.*/
198        double getMinimumTimeAvailableForGLCompileAndDeletePerFrame() const { return _minimumTimeAvailableForGLCompileAndDeletePerFrame; }
199
200        /** Set the maximum number of OpenGL objects that the page should attempt to compile per frame.
201          * Note, Lower values reduces chances of a frame drop but lower the rate that database will be paged in at.
202          * Default value is 8. */
203        void setMaximumNumOfObjectsToCompilePerFrame(unsigned int num) { _maximumNumOfObjectsToCompilePerFrame = num; }
204
205        /** Get the maximum number of OpenGL objects that the page should attempt to compile per frame.*/
206        unsigned int getMaximumNumOfObjectsToCompilePerFrame() const { return _maximumNumOfObjectsToCompilePerFrame; }
207
208
209        /** Set the target maximum number of PagedLOD to maintain in memory.
210          * Note, if more than the target number are required for rendering of a frame then these active PagedLOD are excempt from being expiried.
211          * But once the number of active drops back below the target the inactive PagedLOD will be trimmed back to the target number.*/
212        void setTargetMaximumNumberOfPageLOD(unsigned int target) { _targetMaximumNumberOfPageLOD = target; }
213
214        /** Get the target maximum number of PagedLOD to maintain in memory.*/
215        unsigned int getTargetMaximumNumberOfPageLOD() const { return _targetMaximumNumberOfPageLOD; }
216
217
218        /** Deprecated.*/
219        void setExpiryDelay(double expiryDelay) { _expiryDelay = expiryDelay; }
220       
221        /** Deprecated.*/
222        double getExpiryDelay() const { return _expiryDelay; }
223
224        /** Deprecated.*/
225        void setExpiryFrames(int expiryFrames) { _expiryFrames = expiryFrames; }
226       
227        /** Deprecated.*/
228        int getExpiryFrames() const { return _expiryFrames; }
229
230        /** Deprecated.*/
231        void setReleaseDelay(double releaseDelay);
232       
233        /** Deprecated.*/
234        double getReleaseDelay() const { return _releaseDelay; }
235
236        /** Deprecated.*/
237        void setReleaseFrames(int releaseFrames) { _releaseFrames = releaseFrames; }
238       
239        /** Deprecated.*/
240        int getReleaseFrames() const { return _releaseFrames; }
241
242
243        /** Set whether the removed subgraphs should be deleted in the database thread or not.*/
244        void setDeleteRemovedSubgraphsInDatabaseThread(bool flag) { _deleteRemovedSubgraphsInDatabaseThread = flag; }
245       
246        /** Get whether the removed subgraphs should be deleted in the database thread or not.*/
247        bool getDeleteRemovedSubgraphsInDatabaseThread() const { return _deleteRemovedSubgraphsInDatabaseThread; }
248
249        enum DrawablePolicy
250        {
251            DO_NOT_MODIFY_DRAWABLE_SETTINGS,
252            USE_DISPLAY_LISTS,
253            USE_VERTEX_BUFFER_OBJECTS,
254            USE_VERTEX_ARRAYS
255        };
256
257        /** Set how loaded drawables should be handled w.r.t their display list/vertex buffer object/vertex array settings.*/
258        void setDrawablePolicy(DrawablePolicy policy) { _drawablePolicy = policy; }
259
260        /** Get how loaded drawables should be handled w.r.t their display list/vertex buffer object/vertex array settings.*/
261        DrawablePolicy getDrawablePolicy() const { return _drawablePolicy; }
262
263
264        /** Set whether newly loaded textures should have their UnrefImageDataAfterApply set to a specified value.*/
265        void setUnrefImageDataAfterApplyPolicy(bool changeAutoUnRef, bool valueAutoUnRef) { _changeAutoUnRef = changeAutoUnRef; _valueAutoUnRef = valueAutoUnRef; }
266
267        /** Get whether newly loaded textures should have their UnrefImageDataAfterApply set to a specified value.*/
268        void getUnrefImageDataAfterApplyPolicy(bool& changeAutoUnRef, bool& valueAutoUnRef) const { changeAutoUnRef = _changeAutoUnRef; valueAutoUnRef = _valueAutoUnRef; }
269
270
271        /** Set whether newly loaded textures should have their MaxAnisotopy set to a specified value.*/
272        void setMaxAnisotropyPolicy(bool changeAnisotropy, float valueAnisotropy) { _changeAnisotropy = changeAnisotropy; _valueAnisotropy = valueAnisotropy; }
273
274        /** Set whether newly loaded textures should have their MaxAnisotopy set to a specified value.*/
275        void getMaxAnisotropyPolicy(bool& changeAnisotropy, float& valueAnisotropy) const { changeAnisotropy = _changeAnisotropy; valueAnisotropy = _valueAnisotropy; }
276
277
278        /** Return true if there are pending updates to the scene graph that require a call to updateSceneGraph(double). */
279        bool requiresUpdateSceneGraph() const;
280       
281        /** Merge the changes to the scene graph by calling calling removeExpiredSubgraphs then addLoadedDataToSceneGraph.
282          * Note, must only be called from single thread update phase. */
283        virtual void updateSceneGraph(const osg::FrameStamp& frameStamp);
284               
285        /** Turn the compilation of rendering objects for specified graphics context on (true) or off(false). */
286        void setCompileGLObjectsForContextID(unsigned int contextID, bool on);
287       
288        /** Get whether the compilation of rendering objects for specified graphics context on (true) or off(false). */
289        bool getCompileGLObjectsForContextID(unsigned int contextID);
290
291        /** Return true if an external draw thread should call compileGLObjects(..) or not.*/
292        bool requiresExternalCompileGLObjects(unsigned int contextID) const;
293
294        /** Return true if there are pending compile operations that are required.
295          * If requiresCompileGLObjects() return true the application should call compileGLObjects() .*/
296        bool requiresCompileGLObjects() const;
297
298        /** Compile the rendering objects (display lists,texture objects, VBO's) on loaded subgraph.
299          * note, should only be called from the draw thread.
300          * Note, must only be called from a valid graphics context. */
301        virtual void compileGLObjects(osg::State& state,double& availableTime);
302       
303        /** Compile the rendering objects (display lists,texture objects, VBO's) on loaded subgraph.
304          * note, should only be called from the draw thread.
305          * Note, must only be called from a valid graphics context. */
306        virtual void compileAllGLObjects(osg::State& state);
307
308        /** Report how many items are in the _fileRequestList queue */
309        unsigned int getFileRequestListSize() const { return _fileRequestQueue->_requestList.size() + _httpRequestQueue->_requestList.size(); }
310
311        /** Report how many items are in the _dataToCompileList queue */
312        unsigned int getDataToCompileListSize() const { return _dataToCompileList->_requestList.size(); }
313       
314        /** Report how many items are in the _dataToCompileList queue */
315        unsigned int getDataToMergeListSize() const { return _dataToMergeList->_requestList.size(); }
316
317        /** Report whether any requests are in the pager.*/
318        bool getRequestsInProgress() const;
319       
320        /** 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.*/
321        double getMinimumTimeToMergeTile() const { return _minimumTimeToMergeTile; }
322
323        /** 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.*/
324        double getMaximumTimeToMergeTile() const { return _maximumTimeToMergeTile; }
325
326        /** 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.*/
327        double getAverageTimeToMergeTiles() const { return (_numTilesMerges > 0) ? _totalTimeToMergeTiles/static_cast<double>(_numTilesMerges) : 0; }
328
329        /** Reset the Stats variables.*/
330        void resetStats();
331
332        typedef std::set< osg::ref_ptr<osg::StateSet> >                 StateSetList;
333        typedef std::vector< osg::ref_ptr<osg::Drawable> >              DrawableList;
334        typedef std::pair<StateSetList,DrawableList>                    DataToCompile;
335        typedef std::map< unsigned int, DataToCompile >                 DataToCompileMap;
336        typedef std::set<unsigned int>                                  ActiveGraphicsContexts;
337        typedef std::vector< osg::observer_ptr<osg::GraphicsContext> >  CompileGraphicsContexts;
338
339    protected:
340
341        virtual ~DatabasePager();
342
343        friend class DatabaseThread;
344        friend struct DatabaseRequest;
345
346        struct RequestQueue;
347
348        struct PagedLODObserver : public osg::observer_ptr<osg::PagedLOD>
349        {
350            typedef osg::observer_ptr<osg::PagedLOD> BaseClass;
351
352            PagedLODObserver(osg::PagedLOD* plod):BaseClass(plod) {}
353            PagedLODObserver(const PagedLODObserver& plodObserver):BaseClass(plodObserver) {}
354
355            PagedLODObserver& operator = (const PagedLODObserver& rhs)
356            {
357                (*static_cast<BaseClass*>(this)) = rhs;
358                return *this;
359            }
360
361            virtual void objectDeleted(void* ptr)
362            {
363                BaseClass::objectDeleted(ptr);
364            }
365        };
366
367        typedef std::list< PagedLODObserver >                PagedLODList;
368
369
370        struct DatabaseRequest : public osg::Referenced
371        {
372            DatabaseRequest():
373                osg::Referenced(true),
374                _valid(false),
375                _frameNumberFirstRequest(0),
376                _timestampFirstRequest(0.0),
377                _priorityFirstRequest(0.f),
378                _frameNumberLastRequest(0),
379                _timestampLastRequest(0.0),
380                _priorityLastRequest(0.0f),
381                _numOfRequests(0),
382                _requestQueue(0)
383            {}
384
385            void invalidate();
386
387            bool valid() const { return _valid; }
388
389            bool                                _valid;
390            std::string                         _fileName;
391            int                                 _frameNumberFirstRequest;
392            double                              _timestampFirstRequest;
393            float                               _priorityFirstRequest;
394            int                                 _frameNumberLastRequest;
395            double                              _timestampLastRequest;
396            float                               _priorityLastRequest;
397            unsigned int                        _numOfRequests;
398            osg::ObserverNodePath               _observerNodePath;
399            osg::Group*                         _groupForAddingLoadedSubgraph;
400            osg::ref_ptr<osg::Node>             _loadedModel;
401            DataToCompileMap                    _dataToCompileMap;
402            osg::ref_ptr<Options>               _loadOptions;
403            RequestQueue*                       _requestQueue;
404
405            bool isRequestCurrent (int frameNumber) const
406            {
407                return frameNumber - _frameNumberLastRequest <= 1;
408            }
409        };
410       
411        struct RequestQueue : public osg::Referenced
412        {
413        public:
414            typedef std::vector< osg::ref_ptr<DatabaseRequest> > RequestList;
415
416            void sort();
417
418            RequestList         _requestList;
419            OpenThreads::Mutex  _requestMutex;
420
421        protected:
422            virtual ~RequestQueue();
423        };
424
425       
426        typedef std::vector< osg::ref_ptr<DatabaseThread> > DatabaseThreadList;
427        typedef std::vector<  osg::ref_ptr<osg::Object> > ObjectList;
428
429        struct ReadQueue : public RequestQueue
430        {
431            ReadQueue(DatabasePager* pager, const std::string& name);
432
433            void block() { _block->block(); }
434
435            void release() { _block->release(); }
436
437            void updateBlock()
438            {
439                _block->set((!_requestList.empty() || !_childrenToDeleteList.empty()) &&
440                            !_pager->_databasePagerThreadPaused);
441            }
442
443            void clear();
444
445            void add(DatabaseRequest* databaseRequest);
446
447            void takeFirst(osg::ref_ptr<DatabaseRequest>& databaseRequest);
448
449            osg::ref_ptr<osg::RefBlock> _block;
450
451            DatabasePager*              _pager;
452            std::string                 _name;
453            int                         _frameNumberLastPruned;
454
455            OpenThreads::Mutex          _childrenToDeleteListMutex;
456            ObjectList                  _childrenToDeleteList;
457        };
458
459        // forward declare inner helper classes
460        class FindCompileableGLObjectsVisitor;
461        friend class FindCompileableGLObjectsVisitor;
462       
463        class CountPagedLODsVisitor;
464        class FindPagedLODsVisitor;
465        friend class FindPagedLODsVisitor;
466
467        struct SortFileRequestFunctor;
468        friend struct SortFileRequestFunctor;
469
470       
471        OpenThreads::Mutex              _run_mutex;
472        bool                            _startThreadCalled;
473
474        // Helper functions for determining if objects need to be
475        // compiled.
476        inline static bool isCompiled(const osg::Texture* texture,
477                                      unsigned int contextID)
478        {
479            return( texture->getTextureObject(contextID) != NULL );
480        }
481        // Is texture compiled for all active contexts?
482        inline bool isCompiled(osg::Texture* texture) const
483        {
484            for (ActiveGraphicsContexts::const_iterator iter=_activeGraphicsContexts.begin();
485                   iter!=_activeGraphicsContexts.end(); ++iter )
486            {
487                if ( texture->getTextureObject(*iter) == NULL ) return false;
488            }
489            return true;
490        }
491       
492        inline static bool isCompiled(const osg::StateSet* stateSet,
493                                      unsigned int contextID)
494        {
495            for (unsigned i = 0;
496                 i < stateSet->getTextureAttributeList().size();
497                 ++i)
498            {
499                const osg::Texture* texture
500                    = dynamic_cast<const osg::Texture*>(stateSet->getTextureAttribute(i,osg::StateAttribute::TEXTURE));
501                if (texture && !isCompiled(texture, contextID))
502                    return false;
503            }
504            return true;
505        }
506
507        inline bool isCompiled(osg::StateSet* stateSet)
508        {
509            for (unsigned i = 0;
510                 i < stateSet->getTextureAttributeList().size();
511                 ++i)
512            {
513                osg::Texture* texture
514                    = dynamic_cast<osg::Texture*>(stateSet->getTextureAttribute(i,osg::StateAttribute::TEXTURE));
515                if (texture)
516                {
517                    for (ActiveGraphicsContexts::iterator iter=_activeGraphicsContexts.begin();
518                            iter!=_activeGraphicsContexts.end(); ++iter )
519                    {
520                        if ( texture->getTextureObject(*iter) == NULL ) return false;
521                    }
522                }
523            }
524            return true;
525        }
526       
527        inline static bool isCompiled(const osg::Drawable* drawable,
528                                      unsigned int contextID)
529        {
530            if (drawable->getUseVertexBufferObjects())
531            {
532                // say it's not compiled leaving it up to the compileGLObjects() to handle.
533                return false;
534            }
535            else if (drawable->getUseDisplayList())
536            {
537                return drawable->getDisplayList(contextID) != 0;
538            }
539
540            return true;
541        }
542
543        inline bool isCompiled(const osg::Drawable* drawable) const
544        {
545            if (drawable->getUseVertexBufferObjects())
546            {
547                // say it's not compiled leaving it up to the compileGLObjects() to handle.
548                return false;
549            }
550            if (drawable->getUseDisplayList())
551            {
552                for (ActiveGraphicsContexts::const_iterator iter=_activeGraphicsContexts.begin();
553                        iter!=_activeGraphicsContexts.end(); ++iter )
554                {
555                    if ( drawable->getDisplayList(*iter) == 0 ) return false;
556                }
557            }
558            return true;
559        }
560
561       
562        /** Iterate through the active PagedLOD nodes children removing
563          * children which havn't been visited since specified expiryTime.
564          * note, should be only be called from the update thread. */
565        virtual void removeExpiredSubgraphs(const osg::FrameStamp &frameStamp);
566
567        /** Add the loaded data to the scene graph.*/
568        void addLoadedDataToSceneGraph(const osg::FrameStamp &frameStamp);
569
570
571        bool                            _done;
572        bool                            _acceptNewRequests;
573        bool                            _databasePagerThreadPaused;
574   
575        DatabaseThreadList              _databaseThreads;
576
577        int                             _numFramesActive;
578        mutable OpenThreads::Mutex      _numFramesActiveMutex;
579        int                             _frameNumber;
580
581        osg::ref_ptr<ReadQueue>         _fileRequestQueue;
582        osg::ref_ptr<ReadQueue>         _httpRequestQueue;
583
584         
585        osg::ref_ptr<RequestQueue>      _dataToCompileList;
586
587        DrawablePolicy                  _drawablePolicy;
588
589        bool                            _changeAutoUnRef;
590        bool                            _valueAutoUnRef;
591        bool                            _changeAnisotropy;
592        float                           _valueAnisotropy;
593
594        bool                            _deleteRemovedSubgraphsInDatabaseThread;
595
596        osg::ref_ptr<RequestQueue>      _dataToMergeList;
597       
598        PagedLODList                    _activePagedLODList;
599        PagedLODList                    _inactivePagedLODList;
600       
601        unsigned int                    _targetMaximumNumberOfPageLOD;
602
603        double                          _expiryDelay;
604        int                             _expiryFrames;
605
606        double                          _releaseDelay;
607        int                             _releaseFrames;
608
609        ActiveGraphicsContexts          _activeGraphicsContexts;
610        // CompileGraphicsContexts         _compileGraphicsContexts;
611       
612        bool                            _doPreCompile;
613        double                          _targetFrameRate;
614        double                          _minimumTimeAvailableForGLCompileAndDeletePerFrame;
615        unsigned int                    _maximumNumOfObjectsToCompilePerFrame;
616       
617        double                          _minimumTimeToMergeTile;
618        double                          _maximumTimeToMergeTile;
619        double                          _totalTimeToMergeTiles;
620        unsigned int                    _numTilesMerges;
621       
622        struct CompileOperation : public osg::GraphicsOperation
623        {
624            CompileOperation(DatabasePager* databasePager);
625           
626            virtual void operator () (osg::GraphicsContext* context);
627           
628            osg::observer_ptr<DatabasePager> _databasePager;
629        };
630};
631
632}
633
634#endif
Note: See TracBrowser for help on using the browser.