VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MFCClasses.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2019 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 #ifndef MFCClasses_H
6 #define MFCClasses_H
7 
8 #include <afxwin.h>
9 #include <GL/GL.h>
10 #include <osg/GraphicsContext>
11 #include <osgViewer/GraphicsWindow>
12 #include <vlutil/vlPerformanceStats.h>
13 #include <vrvCore/DtDe.h>
14 #include <vrvCore/DtDeMainWindow.h>
15 #include <vrvCore/DtWindow.h>
17 #include <vrvOsg/DtOsgWindow.h>
18 #include <vrvOsg/vrvOsg.h>
19 
22 {
23 public:
25 
26  //DtDeMainWindow Interface
28  virtual void setApplicationTitle(const std::string& appName);
29 
31  virtual std::string DtMfcMainWindow::applicationTitle() const;
32 
34  virtual void setApplicationIcon(const std::string& iconName);
35 
37  virtual void setShowQuitDialogOnClose(bool value);
38 
40  virtual void destroyWindow();
41 
43  virtual void quit();
44 
45 protected:
47 
48 };
49 
51 
54 {
55 public:
56  UINT_PTR m_unpTimer;
57 
60 
62  virtual ~DtEmbeddedMfcOsgWindow();
63 
65  virtual bool isValid() const;
66 
68  virtual void setPosition(int x,int y);
69 
71  virtual void resize(int width,int height);
72 
76  virtual void sizeChanged(int width,int height);
77 
78  //Create the OpenGL Window
79  void oglCreate(CRect rect, CWnd *parent);
80 
82  void oglInitialize(bool doubleBuffer, bool stereo, unsigned int colorBits,
83  unsigned int depthBits, unsigned int stencilBits, bool vsync);
84 
85  bool isRealizedImplementation() const;
86 
88  void oglClose();
89 
91  bool makeCurrent();
92 
94  bool release();
95 
97  void swapBuffers();
98 
100  void setVSync(bool enabled);
101 
102  // Added message classes:
103  afx_msg void OnPaint();
104  afx_msg void OnSize(UINT nType, int cx, int cy);
105  afx_msg void OnDraw(CDC *pDC);
106  afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
107  afx_msg void OnMouseMove(UINT nFlags, CPoint point);
108  afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
109  afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
110  afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
111  afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
112  afx_msg void OnMButtonDown(UINT nFlags, CPoint point);
113  afx_msg void OnMButtonUp(UINT nFlags, CPoint point);
114 
115  DECLARE_MESSAGE_MAP()
116 
117 private:
118 
121  HDC myHDC;
122  HGLRC myHGLRC;
124 
125 };
126 
128 class DtEmbeddedMfcOsgWindowCreator : public makVrv::DtWindowCreator
129 {
130 public:
131 
133  virtual makVrv::DtWindow* create(makVrv::DtDe& de,
135 };
136 
137 
139 class DtMfcControlAsOsgContext : public osgViewer::GraphicsWindowEmbedded
140 {
141 public:
142 
144  DtEmbeddedMfcOsgWindow* wnd, osg::GraphicsContext::Traits* traits);
145 
146  virtual bool valid() const;
147  virtual bool realizeImplementation();
148  virtual bool isRealizedImplementation() const;
149  virtual void closeImplementation();
150  virtual void grabFocus();
151  virtual void grabFocusIfPointerInWindow();
152  virtual bool makeCurrentImplementation();
153  virtual bool releaseContextImplementation();
154  virtual void swapBuffersImplementation();
155  virtual void requestWarpPointer( float x, float y );
156  virtual void useCursor( bool onOff );
157 
158 protected:
161 };
162 
165 {
166 public:
167 
170 
171 protected:
172 
174  virtual makVrv::DtDeMainWindow* createMainWindow(makVrv::DtDe& de);
175 };
176 
177 
178 #endif
int myPixelFormat
Definition: MFCClasses.h:123
virtual void destroyWindow()
Destroy the window.
afx_msg void OnMButtonDown(UINT nFlags, CPoint point)
Abstract Base class.
Definition: DtWindow.h:25
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct)
void oglCreate(CRect rect, CWnd *parent)
afx_msg void OnDraw(CDC *pDC)
Provides a MFC Main Window.
Definition: MFCClasses.h:164
afx_msg void OnRButtonDown(UINT nFlags, CPoint point)
Simple MFC based Main Window.
Definition: MFCClasses.h:21
virtual int width() const
Get the window width.
DtMfcControlAsOsgContext * myControl
Definition: MFCClasses.h:119
Contains makVrv::DtViewFactory class.
virtual void sizeChanged(int width, int height)
Called when the size of the window has changed.
DtDe & de()
Accessor to get the de;.
Definition: DtWindow.h:82
DtEmbeddedMfcOsgWindow(makVrv::DtDe &de, makVrv::DtWindowConfiguration &wc)
CTOR.
afx_msg void OnLButtonDown(UINT nFlags, CPoint point)
bool isRealizedImplementation() const
HGLRC myHGLRC
Definition: MFCClasses.h:122
afx_msg void OnPaint()
A simple OpenGL OSG control window.
Definition: MFCClasses.h:53
afx_msg void OnSize(UINT nType, int cx, int cy)
virtual void resize(int width, int height)
Resize the window.
Creator class for making the Embedded Mfc window.
Definition: MFCClasses.h:128
afx_msg void OnRButtonUp(UINT nFlags, CPoint point)
The abstract main window provider.
Definition: DtDeMainWindow.h:66
Contains makVrv::DtDe class.
This owns a list of channel configurations.
Definition: DtWindowConfiguration.h:31
virtual bool isValid() const
Check to see if the window is still valid.
Contains makVrv::DtDeMainWindow class.
DtEmbeddedMfcOsgWindow * myControl
Definition: MFCClasses.h:159
afx_msg void OnMButtonUp(UINT nFlags, CPoint point)
void oglInitialize(bool doubleBuffer, bool stereo, unsigned int colorBits, unsigned int depthBits, unsigned int stencilBits, bool vsync)
Initialize the OpenGL context.
HDC myHDC
Definition: MFCClasses.h:121
virtual int height() const
Get the window height.
afx_msg void OnLButtonUp(UINT nFlags, CPoint point)
virtual void quit()
Quit the application.
void setVSync(bool enabled)
Control this window&#39;s vsync.
Contains makVrv::DtIgView class.
DtDe & de()
Definition: DtDeMainWindow.h:50
void oglClose()
Deinitialize OpenGL.
The abstract main window class.
Definition: DtDeMainWindow.h:23
void swapBuffers()
Swap this window&#39;s OpenGL buffers.
makVrv::DtDe & myDe
Definition: MFCClasses.h:160
bool release()
Release this window&#39;s context.
afx_msg void OnMouseMove(UINT nFlags, CPoint point)
virtual void setApplicationIcon(const std::string &iconName)
Set the application&#39;s icon, typically use a resource name.
CWnd * myHWnd
Definition: MFCClasses.h:120
bool myShowQuitFlag
Definition: MFCClasses.h:46
Contains DLL export macros.
virtual void setApplicationTitle(const std::string &appName)
Set the application&#39;s name, typically for the Title Bar.
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
virtual std::string applicationTitle() const
Get the application&#39;s name.
Contains makVrv::DtOsgView class.
virtual ~DtEmbeddedMfcOsgWindow()
DTOR.
virtual void setPosition(int x, int y)
Set the position of the window in screen coordinates.
DtMfcMainWindow(makVrv::DtDe &de)
A basic OSG display window, used to get the osg context for a display window.
Definition: DtOsgWindow.h:36
bool makeCurrent()
Make this window&#39;s context current.
Internal class for embedding The OpenGL Qt code into OSG.
Definition: MFCClasses.h:139
virtual void setShowQuitDialogOnClose(bool value)
Set whether or not to show quit dialog on close if this is the last window.
UINT_PTR m_unpTimer
Definition: MFCClasses.h:56

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)