| [5757] | 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 OSGVIEWER_SCENE |
|---|
| 15 | #define OSGVIEWER_SCENE 1 |
|---|
| 16 | |
|---|
| 17 | #include <osgGA/GUIEventHandler> |
|---|
| 18 | #include <osgGA/EventVisitor> |
|---|
| 19 | #include <osgDB/DatabasePager> |
|---|
| [8633] | 20 | #include <osgDB/ImagePager> |
|---|
| [5757] | 21 | |
|---|
| 22 | #include <osgViewer/Export> |
|---|
| 23 | |
|---|
| 24 | #include <list> |
|---|
| 25 | |
|---|
| 26 | namespace osgViewer{ |
|---|
| 27 | |
|---|
| [7648] | 28 | /** Scene holds the higher level reference to a single scene graph.*/ |
|---|
| [7209] | 29 | class OSGVIEWER_EXPORT Scene : public osg::Referenced |
|---|
| [5757] | 30 | { |
|---|
| 31 | public: |
|---|
| 32 | |
|---|
| 33 | void setSceneData(osg::Node* node); |
|---|
| 34 | osg::Node* getSceneData(); |
|---|
| 35 | const osg::Node* getSceneData() const; |
|---|
| 36 | |
|---|
| [8633] | 37 | |
|---|
| [5757] | 38 | void setDatabasePager(osgDB::DatabasePager* dp); |
|---|
| 39 | osgDB::DatabasePager* getDatabasePager() { return _databasePager.get(); } |
|---|
| 40 | const osgDB::DatabasePager* getDatabasePager() const { return _databasePager.get(); } |
|---|
| 41 | |
|---|
| [8633] | 42 | void setImagePager(osgDB::ImagePager* ip); |
|---|
| 43 | osgDB::ImagePager* getImagePager() { return _imagePager.get(); } |
|---|
| 44 | const osgDB::ImagePager* getImagePager() const { return _imagePager.get(); } |
|---|
| 45 | |
|---|
| [10520] | 46 | void updateSceneGraph(osg::NodeVisitor& updateVisitor); |
|---|
| [8633] | 47 | |
|---|
| [10520] | 48 | |
|---|
| [7209] | 49 | /** Get the Scene object that has the specified node assigned to it. |
|---|
| 50 | * return 0 if no Scene has yet been assigned the specified node.*/ |
|---|
| 51 | static Scene* getScene(osg::Node* node); |
|---|
| [6239] | 52 | |
|---|
| [7453] | 53 | protected: |
|---|
| [6239] | 54 | |
|---|
| [7453] | 55 | Scene(); |
|---|
| 56 | virtual ~Scene(); |
|---|
| 57 | |
|---|
| 58 | /** Get the Scene object that has the specified node assigned to it. |
|---|
| 59 | * or return a new Scene if no Scene has yet been assigned the specified node.*/ |
|---|
| 60 | static Scene* getOrCreateScene(osg::Node* node); |
|---|
| 61 | |
|---|
| 62 | friend class View; |
|---|
| [5757] | 63 | |
|---|
| 64 | osg::ref_ptr<osg::Node> _sceneData; |
|---|
| 65 | |
|---|
| 66 | osg::ref_ptr<osgDB::DatabasePager> _databasePager; |
|---|
| [8633] | 67 | osg::ref_ptr<osgDB::ImagePager> _imagePager; |
|---|
| [5757] | 68 | }; |
|---|
| 69 | |
|---|
| 70 | |
|---|
| 71 | } |
|---|
| 72 | |
|---|
| 73 | #endif |
|---|