NDEVR
API Documentation
VulkanGraphicsWindow.h
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: NDEVR
28File: QTGraphicsWindow
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/QtVulkanSession.h>
35#include <NDEVR/QTGraphicsWindow.h>
36#include <NDEVR/VirtualCameraView.h>
37#include <NDEVR/QTModelManager.h>
38#include <NDEVR/ViewportFactory.h>
39#include <NDEVR/WindowContainer.h>
40#include <QWidget>
41#include <QWindow>
42#include <QAbstractScrollArea>
43class QVulkanInstance;
44struct VkSurfaceKHR_T;
45namespace NDEVR
46{
47 class Renderer;
48 class BasicThread;
55 class VULKAN_INTERFACE_API VulkanGraphicsWindow : public QTGraphicsWindow
56 {
57 Q_OBJECT
58 public:
62 explicit VulkanGraphicsWindow(QWindow* parent, Qt::WindowFlags flags);
64 ~VulkanGraphicsWindow();
67 void setModelManager(QTModelManager* manager) override;
69 virtual void initialize() override;
72 void* getSurface() override;
75 void finishFrame(GraphicsUpdateArguments& args) final override;
77 void updateInstance() override;
80 void exposeEvent(QExposeEvent*) override;
81 public:
84 static void SetupVulkanInstance(QTModelManager* manager);
87 static QVulkanInstance* DefaultQTVulkanInstance();
88 private:
89#ifdef MAC_OS_X_VERSION_10_0
90 VkSurfaceKHR_T* m_mac_os_surface = nullptr;
91#endif
92 QVulkanInstance* m_qt_instance = nullptr;
93 };
100 {
101 public:
107 virtual VirtualCameraView* createView(const DynamicPointer<Camera>& camera, DesignObjectLookup* model_manager, QWidget* parent = nullptr) override;
113 virtual bool canCreateView(const DynamicPointer<Camera>& camera, DesignObjectLookup* model_manager, bool ignore_active) override;
115 virtual void resetToDefaults() override;
116 };
117
118}
119
Simple version of ResourceListener which allows for a simple function callback that will be executed ...
A thread that executes a user-provided callback function concurrently.
Definition BasicThread.h:47
A core class where all Design Objects including models, materials, and geometries are stored.
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:356
A Window used to render 3D graphics.
A ResourceListener which will always be executed on the main UI thread and can be tied to a Qt Object...
Definition QTTools.h:493
An object that renders a specific Camera object, typically run on a different thread than the main UI...
Definition Renderer.h:53
A service which can generate Viewports based on Camera data.
A Viewport for rendering 3D objects in the scene with the NDEVR Graphics Engine.
A QTGraphicsWindow for rendering using Vulkan.
virtual VirtualCameraView * createView(const DynamicPointer< Camera > &camera, DesignObjectLookup *model_manager, QWidget *parent=nullptr) override
Creates a Vulkan-based virtual camera view.
virtual bool canCreateView(const DynamicPointer< Camera > &camera, DesignObjectLookup *model_manager, bool ignore_active) override
Checks whether this factory can create a view for the given camera.
virtual void resetToDefaults() override
Resets the factory to its default configuration.
The primary namespace for the NDEVR SDK.