VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
QGLWidgetAsOsgContext.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsgQt/vrvOsgQt.h>
13 
14 #include <osgViewer/Viewer>
15 #include <QtOpenGL/QGLWidget>
16 
17 QT_BEGIN_NAMESPACE
18 class QOpenGLContext;
19 class QSurface;
20 QT_END_NAMESPACE
21 
22 namespace makVrv
23 {
24  class DtDe;
25 
29  class DT_DLL_VRVOSGQT QGLWidgetAsOsgContext : public osgViewer::GraphicsWindowEmbedded
30  {
31  public:
32 
34  osg::GraphicsContext::Traits* traits, QOpenGLContext* openGLContext);
35 
36  virtual QGLWidget* widget();
37  virtual void setWidget(QGLWidget* widget);
38  virtual bool valid() const;
39 
40  virtual bool realizeImplementation();
41 
42  virtual bool isRealizedImplementation() const;
43 
44  virtual void closeImplementation();
45 
46  virtual void grabFocus();
47 
48  virtual void grabFocusIfPointerInWindow();
49 
50  virtual bool makeCurrentImplementation();
51 
52  virtual bool releaseContextImplementation();
53 
54  virtual void swapBuffersImplementation();
55 
56  virtual void requestWarpPointer(float x, float y);
57 
58  virtual void useCursor(bool onOff);
59 
66  virtual QOpenGLContext* singleVrvOpenGLContext();
67 
68  public:
75  static QGLWidget* lastCurrentWidget(void);
76  protected:
80 
81  // The VRV single opengl context.
82  QOpenGLContext* myOpenGLContext;
83 
84  // The target suface that is being drawn to.
85  QSurface* myTargetSurface;
86 
88  };
89 }
QGLWidget * myWidget
Definition: QGLWidgetAsOsgContext.h:77
bool myRealizeCalled
Definition: QGLWidgetAsOsgContext.h:79
DtDe & myDe
Definition: QGLWidgetAsOsgContext.h:78
#define DT_DLL_VRVOSGQT
Definition: vrvOsgQt.h:22
Contains DLL export macros.
QOpenGLContext * myOpenGLContext
Definition: QGLWidgetAsOsgContext.h:82
static QGLWidget * theLastCurrentWidget
Definition: QGLWidgetAsOsgContext.h:87
QSurface * myTargetSurface
Definition: QGLWidgetAsOsgContext.h:85
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
Internal class for embedding The OpenGL Qt code into OSG. needs documentation This class is created a...
Definition: QGLWidgetAsOsgContext.h:29

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)