Changeset 8633

Show
Ignore:
Timestamp:
07/21/08 11:47:39 (6 years ago)
Author:
robert
Message:

First cut of osgDB::ImagePager? for updating osg::ImageSequence?

Location:
OpenSceneGraph/trunk
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osgViewer/Scene

    r7648 r8633  
    1818#include <osgGA/EventVisitor> 
    1919#include <osgDB/DatabasePager> 
     20#include <osgDB/ImagePager> 
    2021 
    2122#include <osgViewer/Export> 
     
    3435        const osg::Node* getSceneData() const; 
    3536 
     37 
    3638        void setDatabasePager(osgDB::DatabasePager* dp); 
    3739        osgDB::DatabasePager* getDatabasePager() { return _databasePager.get(); } 
    3840        const osgDB::DatabasePager* getDatabasePager() const { return _databasePager.get(); } 
     41 
     42 
     43        void setImagePager(osgDB::ImagePager* ip); 
     44        osgDB::ImagePager* getImagePager() { return _imagePager.get(); } 
     45        const osgDB::ImagePager* getImagePager() const { return _imagePager.get(); } 
     46 
    3947 
    4048        /** Get the Scene object that has the specified node assigned to it. 
     
    5664 
    5765        osg::ref_ptr<osgDB::DatabasePager>  _databasePager; 
     66        osg::ref_ptr<osgDB::ImagePager>     _imagePager; 
    5867}; 
    5968 
  • OpenSceneGraph/trunk/include/osgViewer/View

    r8398 r8633  
    7272        const osg::Node* getSceneData() const { return _scene.valid() ? _scene->getSceneData() : 0; } 
    7373 
     74 
    7475        /** Set the View's database pager.*/ 
    7576        void setDatabasePager(osgDB::DatabasePager* dp); 
     
    8081        /** Get the const View's database pager.*/ 
    8182        const osgDB::DatabasePager* getDatabasePager() const; 
     83 
     84 
     85        /** Set the View's image pager.*/ 
     86        void setImagePager(osgDB::ImagePager* ip); 
     87 
     88        /** Get the View's image pager.*/ 
     89        osgDB::ImagePager* getImagePager(); 
     90 
     91        /** Get the const View's image pager.*/ 
     92        const osgDB::ImagePager* getImagePager() const; 
     93 
    8294 
    8395        /* Set the EventQueue that View uses to integrate external non window related events.*/ 
  • OpenSceneGraph/trunk/src/osgDB/CMakeLists.txt

    r8620 r8633  
    2121    ${HEADER_PATH}/FileUtils 
    2222    ${HEADER_PATH}/ImageOptions 
     23    ${HEADER_PATH}/ImagePager 
    2324    ${HEADER_PATH}/Input 
    2425    ${HEADER_PATH}/Output 
     
    4748    FileUtils.cpp 
    4849    ImageOptions.cpp 
     50    ImagePager.cpp 
    4951    Input.cpp 
    5052    Output.cpp 
  • OpenSceneGraph/trunk/src/osgDB/DatabasePager.cpp

    r8543 r8633  
     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 
    114#include <osgDB/DatabasePager> 
    215#include <osgDB/WriteFile> 
  • OpenSceneGraph/trunk/src/osgViewer/CompositeViewer.cpp

    r8512 r8633  
    973973        } 
    974974 
     975        if (scene->getImagePager()) 
     976        {     
     977            // synchronize changes required by the DatabasePager thread to the scene graph 
     978            scene->getImagePager()->updateSceneGraph(_frameStamp->getReferenceTime()); 
     979        } 
     980 
    975981    } 
    976982 
  • OpenSceneGraph/trunk/src/osgViewer/Scene.cpp

    r7453 r8633  
    2525{ 
    2626    setDatabasePager(osgDB::DatabasePager::create()); 
     27    setImagePager(new osgDB::ImagePager); 
    2728     
    2829    OpenThreads::ScopedLock<OpenThreads::Mutex> lock(s_sceneCacheMutex); 
     
    7273} 
    7374 
     75void Scene::setImagePager(osgDB::ImagePager* ip) 
     76{ 
     77    _imagePager = ip; 
     78} 
     79 
    7480 
    7581Scene* Scene::getScene(osg::Node* node) 
  • OpenSceneGraph/trunk/src/osgViewer/View.cpp

    r8559 r8633  
    296296{ 
    297297    return _scene->getDatabasePager(); 
     298} 
     299 
     300 
     301void View::setImagePager(osgDB::ImagePager* dp) 
     302{ 
     303    _scene->setImagePager(dp); 
     304} 
     305 
     306osgDB::ImagePager* View::getImagePager() 
     307{ 
     308    return _scene->getImagePager(); 
     309} 
     310 
     311const osgDB::ImagePager* View::getImagePager() const 
     312{ 
     313    return _scene->getImagePager(); 
    298314} 
    299315 
  • OpenSceneGraph/trunk/src/osgViewer/Viewer.cpp

    r8406 r8633  
    892892    } 
    893893 
     894    if (_scene->getImagePager()) 
     895    {     
     896        // synchronize changes required by the DatabasePager thread to the scene graph 
     897        _scene->getImagePager()->updateSceneGraph(_frameStamp->getReferenceTime()); 
     898    } 
     899 
    894900    if (_updateOperations.valid()) 
    895901    {