Show
Ignore:
Timestamp:
03/21/12 18:36:20 (3 years ago)
Author:
robert
Message:

Ran script to remove trailing spaces and tabs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osgDB/DatabasePager

    r12990 r13041  
    1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield  
     1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 
    22 * 
    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  
     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 
    55 * (at your option) any later version.  The full license is in LICENSE file 
    66 * included with this distribution, and on the openscenegraph.org website. 
    7  *  
     7 * 
    88 * This library is distributed in the hope that it will be useful, 
    99 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
     10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1111 * OpenSceneGraph Public License for more details. 
    1212*/ 
     
    4545 
    4646 
    47 /** Database paging class which manages the loading of files in a background thread,  
     47/** Database paging class which manages the loading of files in a background thread, 
    4848  * and synchronizing of loaded models with the main scene graph.*/ 
    4949class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandler 
     
    6464        /** get the prototype singleton used by DatabasePager::create().*/ 
    6565        static osg::ref_ptr<DatabasePager>& prototype(); 
    66          
     66 
    6767        /** create a DatabasePager by cloning DatabasePager::prototype().*/ 
    6868        static DatabasePager* create(); 
    6969 
    70          
     70 
    7171 
    7272        /** Add a request to load a node file to end the the database request list.*/ 
     
    7979        int setSchedulePriority(OpenThreads::Thread::ThreadPriority priority); 
    8080 
    81         /** Cancel the database pager thread(s).*/         
     81        /** Cancel the database pager thread(s).*/ 
    8282        virtual int cancel(); 
    83          
     83 
    8484        virtual bool isRunning() const; 
    85          
     85 
    8686        /** Clear all internally cached structures.*/ 
    8787        virtual void clear(); 
    88          
     88 
    8989        class OSGDB_EXPORT DatabaseThread : public osg::Referenced, public OpenThreads::Thread 
    9090        { 
    9191        public: 
    92          
     92 
    9393            enum Mode 
    9494            { 
     
    9797                HANDLE_ONLY_HTTP 
    9898            }; 
    99          
     99 
    100100            DatabaseThread(DatabasePager* pager, Mode mode, const std::string& name); 
    101              
     101 
    102102            DatabaseThread(const DatabaseThread& dt, DatabasePager* pager); 
    103103 
     
    107107            void setDone(bool done) { _done.exchange(done?1:0); } 
    108108            bool getDone() const { return _done!=0; } 
    109              
     109 
    110110            void setActive(bool active) { _active = active; } 
    111111            bool getActive() const { return _active; } 
    112112 
    113113            virtual int cancel(); 
    114              
     114 
    115115            virtual void run(); 
    116              
     116 
    117117        protected: 
    118118 
    119119            virtual ~DatabaseThread(); 
    120          
     120 
    121121            OpenThreads::Atomic _done; 
    122122            volatile bool       _active; 
     
    126126 
    127127        }; 
    128          
     128 
    129129        void setUpThreads(unsigned int totalNumThreads=2, unsigned int numHttpThreads=1); 
    130130 
     
    132132 
    133133        DatabaseThread* getDatabaseThread(unsigned int i) { return _databaseThreads[i].get(); } 
    134          
     134 
    135135        const DatabaseThread* getDatabaseThread(unsigned int i) const { return _databaseThreads[i].get(); } 
    136136 
    137137        unsigned int getNumDatabaseThreads() const { return _databaseThreads.size(); } 
    138          
     138 
    139139        /** Set whether the database pager thread should be paused or not.*/ 
    140140        void setDatabasePagerThreadPause(bool pause); 
    141          
     141 
    142142        /** Get whether the database pager thread should is paused or not.*/ 
    143143        bool getDatabasePagerThreadPause() const { return _databasePagerThreadPaused; } 
    144          
     144 
    145145        /** Set whether new database request calls are accepted or ignored.*/ 
    146146        void setAcceptNewDatabaseRequests(bool acceptNewRequests) { _acceptNewRequests = acceptNewRequests; } 
    147          
     147 
    148148        /** Get whether new database request calls are accepted or ignored.*/ 
    149149        bool getAcceptNewDatabaseRequests() const { return _acceptNewRequests; } 
    150          
     150 
    151151        /** Get the number of frames that are currently active.*/ 
    152152        int getNumFramesActive() const { return _numFramesActive; } 
     
    155155          * 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. */ 
    156156        virtual void signalBeginFrame(const osg::FrameStamp* framestamp); 
    157          
     157 
    158158        /** Signal the database thread that the update, cull and draw dispatch has completed. 
    159159          * 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.*/ 
    160160        virtual void signalEndFrame(); 
    161          
    162  
    163         /** Find all PagedLOD nodes in a subgraph and register them with  
     161 
     162 
     163        /** Find all PagedLOD nodes in a subgraph and register them with 
    164164          * the DatabasePager so it can keep track of expired nodes. 
    165165          * note, should be only be called from the update thread. */ 
     
    198198        /** Set whether the removed subgraphs should be deleted in the database thread or not.*/ 
    199199        void setDeleteRemovedSubgraphsInDatabaseThread(bool flag) { _deleteRemovedSubgraphsInDatabaseThread = flag; } 
    200          
     200 
    201201        /** Get whether the removed subgraphs should be deleted in the database thread or not.*/ 
    202202        bool getDeleteRemovedSubgraphsInDatabaseThread() const { return _deleteRemovedSubgraphsInDatabaseThread; } 
     
    240240        /** Return true if there are pending updates to the scene graph that require a call to updateSceneGraph(double). */ 
    241241        bool requiresUpdateSceneGraph() const; 
    242          
     242 
    243243        /** Merge the changes to the scene graph by calling calling removeExpiredSubgraphs then addLoadedDataToSceneGraph. 
    244244          * Note, must only be called from single thread update phase. */ 
     
    250250        /** Report how many items are in the _dataToCompileList queue */ 
    251251        unsigned int getDataToCompileListSize() const { return _dataToCompileList->size(); } 
    252          
     252 
    253253        /** Report how many items are in the _dataToMergeList queue */ 
    254254        unsigned int getDataToMergeListSize() const { return _dataToMergeList->size(); } 
     
    256256        /** Report whether any requests are in the pager.*/ 
    257257        bool getRequestsInProgress() const; 
    258          
     258 
    259259        /** 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.*/ 
    260260        double getMinimumTimeToMergeTile() const { return _minimumTimeToMergeTile; } 
     
    325325            float                       _priorityLastRequest; 
    326326            unsigned int                _numOfRequests; 
    327              
     327 
    328328            osg::observer_ptr<osg::Node>        _terrain; 
    329329            osg::observer_ptr<osg::Group>       _group; 
     
    381381        }; 
    382382 
    383          
     383 
    384384        typedef std::vector< osg::ref_ptr<DatabaseThread> > DatabaseThreadList; 
    385385 
     
    416416        friend struct SortFileRequestFunctor; 
    417417 
    418          
     418 
    419419        OpenThreads::Mutex              _run_mutex; 
    420420        OpenThreads::Mutex              _dr_mutex;