OpendTect
6.3
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
master_od_source
src
uiOSG
swapbuffercallback.h
Go to the documentation of this file.
1
#ifndef swapbuffercallback_h
2
#define swapbuffercallback_h
3
4
/*+
5
________________________________________________________________________
6
7
(C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8
Author: K. Tingdahl
9
Date: Oct 2015
10
________________________________________________________________________
11
12
*/
13
14
#include <osg/GraphicsContext>
15
16
#include "
visscene.h
"
17
#include "
ui3dviewerbody.h
"
18
25
class
SwapCallback
:
public
osg::GraphicsContext::SwapCallback
26
{
27
public
:
28
SwapCallback
(
ui3DViewerBody
* body )
29
:
scene_
( 0 )
30
,
nrleft_
( 2 )
31
,
body_
( body )
32
{}
33
void
swapBuffersImplementation
(osg::GraphicsContext* gc)
34
{
35
gc->swapBuffersImplementation();
36
if
(
scene_
&&
nrleft_
)
37
{
38
nrleft_
--;
39
if
( !
nrleft_
)
40
{
41
scene_
->
contextIsUp
.trigger();
42
CallBack::addToMainThread
(
mCB
(
body_
,
ui3DViewerBody
,
43
removeSwapCallback));
44
}
45
}
46
}
47
48
49
int
nrleft_
;
50
visBase::Scene
*
scene_
;
51
ui3DViewerBody
*
body_
;
52
};
53
54
#endif
SwapCallback::scene_
visBase::Scene * scene_
Definition:
swapbuffercallback.h:50
SwapCallback::swapBuffersImplementation
void swapBuffersImplementation(osg::GraphicsContext *gc)
Definition:
swapbuffercallback.h:33
SwapCallback::nrleft_
int nrleft_
Definition:
swapbuffercallback.h:49
ui3DViewerBody
Baseclass for different body implementation (direct & indirect) of OSG.
Definition:
ui3dviewerbody.h:59
SwapCallback
Class for a swap callback. This class triggers on the second render that the context is up an running...
Definition:
swapbuffercallback.h:25
mCB
#define mCB(obj, clss, fn)
To make your CallBack. Used in many places, especially the UI.
Definition:
callback.h:41
SwapCallback::SwapCallback
SwapCallback(ui3DViewerBody *body)
Definition:
swapbuffercallback.h:28
visBase::Scene::contextIsUp
Notifier< Scene > contextIsUp
Definition:
visscene.h:74
CallBack::addToMainThread
static bool addToMainThread(const CallBack &, CallBacker *=0)
visscene.h
ui3dviewerbody.h
visBase::Scene
Scene manages all DataObjects and has some managing functions such as the selection management and va...
Definition:
visscene.h:38
SwapCallback::body_
ui3DViewerBody * body_
Definition:
swapbuffercallback.h:51
Generated at for the
OpendTect
seismic interpretation project. Copyright (C): dGB Beheer B. V. 2017