OpendTect-6_4  6.4
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:
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();
44  removeSwapCallback));
45  }
46  }
47  }
48 
49 
50  int nrleft_;
53 };
54 
55 #endif
visBase::Scene * scene_
Definition: swapbuffercallback.h:51
void swapBuffersImplementation(osg::GraphicsContext *gc)
Definition: swapbuffercallback.h:34
int nrleft_
Definition: swapbuffercallback.h:50
Baseclass for different body implementation (direct & indirect) of OSG.
Definition: ui3dviewerbody.h:61
Class for a swap callback. This class triggers on the second render that the context is up an running...
Definition: swapbuffercallback.h:26
#define mCB(obj, clss, fn)
To make your CallBack. Used in many places, especially the UI.
Definition: callback.h:42
SwapCallback(ui3DViewerBody *body)
Definition: swapbuffercallback.h:29
Notifier< Scene > contextIsUp
Definition: visscene.h:76
static bool addToMainThread(const CallBack &, CallBacker *=0)
Scene manages all DataObjects and has some managing functions such as the selection management and va...
Definition: visscene.h:40
ui3DViewerBody * body_
Definition: swapbuffercallback.h:52

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019