forked from dardok/eqEarth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.h
95 lines (68 loc) · 2.33 KB
/
config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#pragma once
#include <eq/eq.h>
#include "initData.h"
#include "frameData.h"
#include "view.h"
#include "viewer.h"
#include <osg/Node>
#include <osgEarthUtil/Controls>
namespace eqEarth
{
class Config : public eq::Config
{
public:
Config( eq::ServerPtr parent );
protected:
virtual ~Config( );
public:
virtual bool init( );
virtual bool exit( );
virtual uint32_t startFrame( );
virtual uint32_t finishFrame( );
void setInitData( const InitData& initData ) { _initData = initData; }
const InitData& getInitData( ) const { return _initData; }
bool mapInitData( const eq::uint128_t& initDataID );
bool handleEvent( eq::EventType type, const eq::KeyEvent& event ) override;
bool handleEvent( eq::EventType type, const eq::PointerEvent& event ) override;
public:
void setThreadHint( bool thread_hint ) { _thread_hint = thread_hint; }
osgUtil::IncrementalCompileOperation*
getIncrementalCompileOperation( ) const { return _ico.get( ); }
osgViewer::View* takeOrCreateOSGView( const eq::uint128_t& sceneID );
void releaseOSGView( osgViewer::View* view );
void createOverlay( osgEarth::Util::Controls::ControlCanvas* cc,
eq::View* view );
#if 0
CompositeViewer *getViewer( ) { return _viewer; }
const CompositeViewer *getViewer( ) const { return _viewer; }
#endif
void setZMode( bool zmode );
void setZValue( float zvalue );
private:
osg::Group* getScene( const eq::uint128_t& sceneID, osgViewer::View* view );
void cleanup( );
protected:
InitData _initData;
FrameData _frameData;
osg::ref_ptr< osg::Group > _scene;
osg::Uniform *_zmode;
osg::Uniform *_zvalue;
osg::ref_ptr< osgUtil::IncrementalCompileOperation > _ico;
osg::ref_ptr< osgDB::DatabasePager > _pager;
lunchbox::Lock _viewer_lock;
osg::ref_ptr< CompositeViewer > _viewer;
osg::ref_ptr< osgGA::EventQueue > _eventQueue;
osg::ref_ptr< osg::GraphicsContext > _gc;
bool _thread_hint;
uint32_t _appRenderTick;
private:
View* selectCurrentView( const eq::uint128_t& viewID );
void handleMouseEvent( eq::EventType type, const eq::PointerEvent& event, View* view,
double time );
#if 0
void updateCurrentWorldPointer( const eq::ConfigEvent& event );
#endif
bool appInitGL( bool pbuffer = true );
struct ViewCollector;
};
}