From David Callu, added getOrCreateScene method, made contractors protected.

From Robert Osfield, made getOrCreateScene protected and made View a friend
of Scene to all it to construct Scene objects itself.
This commit is contained in:
Robert Osfield
2007-09-22 16:50:45 +00:00
parent 82b0f004e9
commit da70320707
2 changed files with 23 additions and 5 deletions

View File

@@ -29,9 +29,6 @@ class OSGVIEWER_EXPORT Scene : public osg::Referenced
{
public:
Scene();
virtual ~Scene();
void setSceneData(osg::Node* node);
osg::Node* getSceneData();
const osg::Node* getSceneData() const;
@@ -44,8 +41,16 @@ class OSGVIEWER_EXPORT Scene : public osg::Referenced
* return 0 if no Scene has yet been assigned the specified node.*/
static Scene* getScene(osg::Node* node);
protected:
Scene();
virtual ~Scene();
/** Get the Scene object that has the specified node assigned to it.
* or return a new Scene if no Scene has yet been assigned the specified node.*/
static Scene* getOrCreateScene(osg::Node* node);
friend class View;
osg::ref_ptr<osg::Node> _sceneData;