2f74b2cf7c
OsgSceneHandler to avoid the namespace bug under VS6. Removed the osgproducer demo (its now been replaced by examples/osgviewer.)
142 lines
4.0 KiB
C++
142 lines
4.0 KiB
C++
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2003 Robert Osfield
|
|
*
|
|
* This library is open source and may be redistributed and/or modified under
|
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
|
* (at your option) any later version. The full license is in LICENSE file
|
|
* included with this distribution, and on the openscenegraph.org website.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* OpenSceneGraph Public License for more details.
|
|
*/
|
|
|
|
#ifndef OSGPRODUCER_OSGCAMERAGROUP_H
|
|
#define OSGPRODUCER_OSGCAMERAGROUP_H 1
|
|
|
|
|
|
#include <Producer/CameraGroup>
|
|
|
|
#include <osg/ArgumentParser>
|
|
#include <osg/Group>
|
|
#include <osg/StateSet>
|
|
#include <osg/FrameStamp>
|
|
#include <osg/DisplaySettings>
|
|
|
|
#include <osgProducer/OsgSceneHandler>
|
|
|
|
namespace osgProducer {
|
|
|
|
class OSGPRODUCER_EXPORT OsgCameraGroup : public Producer::CameraGroup
|
|
{
|
|
public :
|
|
|
|
OsgCameraGroup();
|
|
|
|
OsgCameraGroup(Producer::CameraConfig *cfg);
|
|
|
|
OsgCameraGroup(const std::string& configFile);
|
|
|
|
OsgCameraGroup(osg::ArgumentParser& arguments);
|
|
|
|
virtual ~OsgCameraGroup() {}
|
|
|
|
|
|
typedef std::vector <osgProducer::OsgSceneHandler*> SceneHandlerList;
|
|
|
|
|
|
SceneHandlerList& getSceneHandlerList() { return _shvec;}
|
|
|
|
const SceneHandlerList& getSceneHandlerList() const { return _shvec;}
|
|
|
|
|
|
void setSceneData( osg::Node *scene );
|
|
|
|
osg::Node *getSceneData() { return _scene_data.get(); }
|
|
|
|
const osg::Node *getSceneData() const { return _scene_data.get(); }
|
|
|
|
|
|
|
|
void setSceneDecorator( osg::Group* decorator);
|
|
|
|
osg::Group* getSceneDecorator() { return _scene_decorator.get(); }
|
|
|
|
const osg::Group* getSceneDecorator() const { return _scene_decorator.get(); }
|
|
|
|
|
|
osg::Node* getTopMostSceneData();
|
|
|
|
const osg::Node* getTopMostSceneData() const;
|
|
|
|
|
|
void setDisplaySettings( osg::DisplaySettings *ds ) { _ds = ds; }
|
|
|
|
osg::DisplaySettings *getDisplaySettings() { return _ds.get(); }
|
|
|
|
const osg::DisplaySettings *getDisplaySettings() const { return _ds.get(); }
|
|
|
|
|
|
|
|
void setFrameStamp( osg::FrameStamp* fs );
|
|
|
|
osg::FrameStamp *getFrameStamp() { return _frameStamp.get(); }
|
|
|
|
const osg::FrameStamp *getFrameStamp() const { return _frameStamp.get(); }
|
|
|
|
|
|
void setGlobalStateSet( osg::StateSet *sset );
|
|
|
|
osg::StateSet *getGlobalStateSet() { return _global_stateset.get(); }
|
|
|
|
const osg::StateSet *getGlobalStateSet() const { return _global_stateset.get(); }
|
|
|
|
|
|
void setBackgroundColor( const osg::Vec4& backgroundColor );
|
|
|
|
osg::Vec4& getBackgroundColor() { return _background_color; }
|
|
|
|
const osg::Vec4& getBackgroundColor() const { return _background_color; }
|
|
|
|
|
|
void setLODScale( float scale );
|
|
|
|
void setFusionDistance( osgUtil::SceneView::FusionDistanceMode mode,float value=1.0f);
|
|
|
|
|
|
void advance();
|
|
|
|
|
|
virtual void realize( ThreadingModel thread_model= SingleThreaded );
|
|
|
|
|
|
virtual void frame();
|
|
|
|
|
|
protected :
|
|
|
|
void setUpSceneViewsWithData();
|
|
|
|
|
|
osg::ref_ptr<osg::Node> _scene_data;
|
|
osg::ref_ptr<osg::Group> _scene_decorator;
|
|
|
|
osg::ref_ptr<osg::StateSet> _global_stateset;
|
|
osg::Vec4 _background_color;
|
|
float _LODScale;
|
|
|
|
osgUtil::SceneView::FusionDistanceMode _fusionDistanceMode;
|
|
float _fusionDistanceValue;
|
|
|
|
SceneHandlerList _shvec;
|
|
osg::ref_ptr<osg::DisplaySettings> _ds;
|
|
bool _initialized;
|
|
osg::ref_ptr<osg::FrameStamp> _frameStamp;
|
|
|
|
void _init();
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|