Added support for automatically finding CoordinateSystemNode's in the

scene graph and then using them to set up the CoordinateFrame used
by the camera manipulators.
This commit is contained in:
Robert Osfield
2004-05-03 12:04:25 +00:00
parent 04798b4e63
commit b7746ff56e
6 changed files with 100 additions and 27 deletions

View File

@@ -89,7 +89,7 @@ class SG_EXPORT CoordinateSystemNode : public Group
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
CoordinateSystemNode(const CoordinateSystemNode&,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
META_Object(osg,CoordinateSystemNode);
META_Node(osg,CoordinateSystemNode);
/** Set the CoordinateSystem reference string, should be stored in OpenGIS Well Know Text form.*/

View File

@@ -78,7 +78,11 @@ class OSGPRODUCER_EXPORT OsgCameraGroup : public Producer::CameraGroup
const osg::Node* getTopMostSceneData() const;
/** update internal structures w.r.t updated scene data.*/
virtual void updatedSceneData();
void setDisplaySettings( osg::DisplaySettings *ds ) { _ds = ds; }
osg::DisplaySettings *getDisplaySettings() { return _ds.get(); }
@@ -165,7 +169,8 @@ class OSGPRODUCER_EXPORT OsgCameraGroup : public Producer::CameraGroup
protected :
void setUpSceneViewsWithData();
virtual void setUpSceneViewsWithData();
osg::ApplicationUsage* _applicationUsage;

View File

@@ -100,9 +100,13 @@ class OSGPRODUCER_EXPORT Viewer : public OsgCameraGroup, public osgGA::GUIAction
const osg::NodeVisitor* getUpdateVisitor() const { return _updateVisitor.get(); }
void setCoordindateSystemNodePath(const osg::NodePath& nodePath) { _coordinateSystemNodePath = nodePath; }
typedef std::vector< osg::ref_ptr<osg::Node> > RefNodePath;
const osg::NodePath& getCoordindateSystemNodePath() { return _coordinateSystemNodePath; }
void setCoordindateSystemNodePath(const RefNodePath& nodePath) { _coordinateSystemNodePath = nodePath; }
void setCoordindateSystemNodePath(const osg::NodePath& nodePath);
const RefNodePath& getCoordindateSystemNodePath() { return _coordinateSystemNodePath; }
/** Dispatch the cull and draw for each of the Camera's for this frame.*/
virtual void frame();
@@ -166,7 +170,9 @@ class OSGPRODUCER_EXPORT Viewer : public OsgCameraGroup, public osgGA::GUIAction
/** Get the keyboard and mouse usage of this viewer.*/
virtual void getUsage(osg::ApplicationUsage& usage) const;
/** update internal structures w.r.t updated scene data.*/
virtual void updatedSceneData();
protected :
@@ -183,7 +189,8 @@ class OSGPRODUCER_EXPORT Viewer : public OsgCameraGroup, public osgGA::GUIAction
osg::ref_ptr<osg::NodeVisitor> _updateVisitor;
osg::NodePath _coordinateSystemNodePath;
RefNodePath _coordinateSystemNodePath;
bool _recordingAnimationPath;
double _recordingStartTime;