2003-01-21 21:14:29 +08:00
|
|
|
/* -*-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.
|
|
|
|
*/
|
|
|
|
|
2003-01-18 02:34:35 +08:00
|
|
|
#ifndef OSG_CAMERA_GROUP_H
|
|
|
|
#define OSG_CAMERA_GROUP_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <Producer/CameraGroup>
|
2003-01-19 06:07:59 +08:00
|
|
|
|
2003-01-21 21:14:29 +08:00
|
|
|
#include <osg/Group>
|
2003-01-18 02:34:35 +08:00
|
|
|
#include <osg/StateSet>
|
|
|
|
#include <osg/FrameStamp>
|
|
|
|
#include <osg/DisplaySettings>
|
|
|
|
|
|
|
|
#include <osgProducer/SceneHandler>
|
|
|
|
|
|
|
|
namespace osgProducer {
|
|
|
|
|
2003-01-19 06:07:59 +08:00
|
|
|
class OSGPRODUCER_EXPORT CameraGroup : public Producer::CameraGroup
|
2003-01-18 02:34:35 +08:00
|
|
|
{
|
|
|
|
public :
|
|
|
|
|
|
|
|
typedef std::vector <osgProducer::SceneHandler *> SceneHandlerList;
|
|
|
|
|
2003-01-19 06:07:59 +08:00
|
|
|
CameraGroup();
|
2003-01-18 02:34:35 +08:00
|
|
|
|
2003-01-19 06:07:59 +08:00
|
|
|
CameraGroup(Producer::CameraConfig *cfg);
|
2003-01-18 02:34:35 +08:00
|
|
|
|
2003-01-19 06:07:59 +08:00
|
|
|
CameraGroup(const std::string& configFile);
|
2003-01-18 02:34:35 +08:00
|
|
|
|
|
|
|
virtual ~CameraGroup() {}
|
|
|
|
|
2003-01-19 06:07:59 +08:00
|
|
|
|
2003-01-21 21:14:29 +08:00
|
|
|
|
2003-01-19 06:07:59 +08:00
|
|
|
void setSceneData( osg::Node *scene );
|
2003-01-18 02:34:35 +08:00
|
|
|
|
2003-01-19 06:07:59 +08:00
|
|
|
osg::Node *getSceneData() { return _scene_data.get(); }
|
|
|
|
|
|
|
|
const osg::Node *getSceneData() const { return _scene_data.get(); }
|
|
|
|
|
2003-01-18 02:34:35 +08:00
|
|
|
|
2003-01-21 21:14:29 +08:00
|
|
|
|
|
|
|
void setSceneDecorator( osg::Group* decorator);
|
|
|
|
|
|
|
|
osg::Group* getSceneDecorator() { return _scene_decorator.get(); }
|
|
|
|
|
|
|
|
const osg::Group* getSceneDecorator() const { return _scene_decorator.get(); }
|
|
|
|
|
|
|
|
|
2003-01-31 00:11:39 +08:00
|
|
|
osg::Node* getTopMostSceneData();
|
|
|
|
|
|
|
|
const osg::Node* getTopMostSceneData() const;
|
|
|
|
|
2003-01-18 02:34:35 +08:00
|
|
|
|
|
|
|
void setDisplaySettings( osg::DisplaySettings *ds ) { _ds = ds; }
|
|
|
|
|
|
|
|
osg::DisplaySettings *getDisplaySettings() { return _ds.get(); }
|
|
|
|
|
|
|
|
const osg::DisplaySettings *getDisplaySettings() const { return _ds.get(); }
|
|
|
|
|
|
|
|
|
|
|
|
|
2003-01-19 06:07:59 +08:00
|
|
|
void setFrameStamp( osg::FrameStamp* fs );
|
2003-01-18 02:34:35 +08:00
|
|
|
|
|
|
|
osg::FrameStamp *getFrameStamp() { return _frameStamp.get(); }
|
|
|
|
|
|
|
|
const osg::FrameStamp *getFrameStamp() const { return _frameStamp.get(); }
|
|
|
|
|
|
|
|
|
2003-01-19 06:07:59 +08:00
|
|
|
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 );
|
2003-01-18 02:34:35 +08:00
|
|
|
|
|
|
|
osg::Vec4& getBackgroundColor() { return _background_color; }
|
|
|
|
|
|
|
|
const osg::Vec4& getBackgroundColor() const { return _background_color; }
|
|
|
|
|
2003-01-19 06:07:59 +08:00
|
|
|
|
2003-01-21 21:14:29 +08:00
|
|
|
void setLODScale( float scale );
|
2003-01-19 06:07:59 +08:00
|
|
|
|
|
|
|
void setFusionDistance( osgUtil::SceneView::FusionDistanceMode mode,float value=1.0f);
|
|
|
|
|
|
|
|
|
|
|
|
void advance();
|
|
|
|
|
|
|
|
|
2003-01-21 21:14:29 +08:00
|
|
|
virtual void realize( ThreadingModel thread_model= SingleThreaded );
|
2003-01-19 06:07:59 +08:00
|
|
|
|
|
|
|
|
|
|
|
virtual void frame();
|
|
|
|
|
|
|
|
|
|
|
|
protected :
|
|
|
|
|
2003-01-21 21:14:29 +08:00
|
|
|
void setUpSceneViewsWithData();
|
|
|
|
|
|
|
|
|
|
|
|
osg::ref_ptr<osg::Node> _scene_data;
|
|
|
|
osg::ref_ptr<osg::Group> _scene_decorator;
|
2003-01-19 06:07:59 +08:00
|
|
|
|
2003-01-21 21:14:29 +08:00
|
|
|
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;
|
2003-01-18 02:34:35 +08:00
|
|
|
|
2003-01-21 21:14:29 +08:00
|
|
|
void _init();
|
2003-01-18 02:34:35 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|