OpendTect-6_4
6.4
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
od6.4.5
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
RCS: $Id$
11
________________________________________________________________________
12
13
*/
14
15
#include <osg/GraphicsContext>
16
17
#include "
visscene.h
"
18
#include "
ui3dviewerbody.h
"
19
26
class
SwapCallback
:
public
osg::GraphicsContext::SwapCallback
27
{
28
public
:
29
SwapCallback
(
ui3DViewerBody
* body )
30
:
scene_
( 0 )
31
,
nrleft_
( 2 )
32
,
body_
( body )
33
{}
34
void
swapBuffersImplementation
(osg::GraphicsContext* gc)
35
{
36
gc->swapBuffersImplementation();
37
if
(
scene_
&&
nrleft_
)
38
{
39
nrleft_
--;
40
if
( !
nrleft_
)
41
{
42
scene_
->
contextIsUp
.trigger();
43
CallBack::addToMainThread
(
mCB
(
body_
,
ui3DViewerBody
,
44
removeSwapCallback));
45
}
46
}
47
}
48
49
50
int
nrleft_
;
51
visBase::Scene
*
scene_
;
52
ui3DViewerBody
*
body_
;
53
};
54
55
#endif
SwapCallback::scene_
visBase::Scene * scene_
Definition:
swapbuffercallback.h:51
SwapCallback::swapBuffersImplementation
void swapBuffersImplementation(osg::GraphicsContext *gc)
Definition:
swapbuffercallback.h:34
SwapCallback::nrleft_
int nrleft_
Definition:
swapbuffercallback.h:50
ui3DViewerBody
Baseclass for different body implementation (direct & indirect) of OSG.
Definition:
ui3dviewerbody.h:61
SwapCallback
Class for a swap callback. This class triggers on the second render that the context is up an running...
Definition:
swapbuffercallback.h:26
mCB
#define mCB(obj, clss, fn)
To make your CallBack. Used in many places, especially the UI.
Definition:
callback.h:42
SwapCallback::SwapCallback
SwapCallback(ui3DViewerBody *body)
Definition:
swapbuffercallback.h:29
visBase::Scene::contextIsUp
Notifier< Scene > contextIsUp
Definition:
visscene.h:76
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:40
SwapCallback::body_
ui3DViewerBody * body_
Definition:
swapbuffercallback.h:52
Generated at for the
OpendTect
seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019