API Documentation
Loading...
Searching...
No Matches
GLESGraphicsWindow.h
Go to the documentation of this file.
1#pragma once
11#include <QOpenGLShaderProgram>
12#include <QOpenGLTexture>
13#include <QOpenGLBuffer>
14#include <QOpenGLVertexArrayObject>
15#include <QOpenGLFunctions>
16namespace NDEVR
17{
18 /**--------------------------------------------------------------------------------------------------
19 \brief The core Window used to render a viewport with OpenGL
20 **/
22 {
23 public:
24 //explicit QTGraphicsWindow(QWindow* parent, UUID camera, Log* log, QTModelManager* manager, Qt::WindowFlags flags);
25 explicit GLESGraphicsWindow(QWindow* parent, Qt::WindowFlags flags);
27 void* getSurface() override;
28 void finishFrame(GraphicsUpdateArguments& args) final override;
29 void updateInstance() override {};
30 public:
31 void initialize() override;
33 };
34 /**--------------------------------------------------------------------------------------------------
35 \brief Allows the software to generate OpenGL windows when requested that are rendered with OpenGL
36 **/
38 {
39 public:
40 virtual VirtualCameraView* createView(const DynamicPointer<Camera>& camera, DesignObjectLookup* model_manager, bool auto_add_models = true, QWidget* parent = nullptr) override
41 {
42 QTModelManager* qt_model_manager = dynamic_cast<QTModelManager*>(model_manager);
43 if (qt_model_manager == nullptr)
44 return nullptr;
45 GLESGraphicsWindow* window = new GLESGraphicsWindow(nullptr, Qt::WindowType::Sheet | Qt::FramelessWindowHint);
46 //window->setModelManager(model_manager, auto_add_models);
47 //window->setCamera(camera->uuid());
48 QTGraphicsWidget* widget = new QTGraphicsWidget(window, parent);
49 VirtualCameraView* view = new VirtualCameraView(widget, parent);
50 view->setModelManager(qt_model_manager, auto_add_models);
51 view->setCamera(camera);
52 return view;
53 }
54 virtual bool canCreateView(const DynamicPointer<Camera>& camera, DesignObjectLookup* model_manager) override
55 {
56 QTModelManager* qt_model_manager = dynamic_cast<QTModelManager*>(model_manager);
57 if (qt_model_manager == nullptr)
58 return false;
59 if (camera->getProperty<File>(DesignObject::e_file).size() > 0)
60 return false;
61 return true;
62 }
63 virtual void resetToDefaults() override
64 {
65 }
66 };
67}
constexpr t_index_type size() const
Definition Buffer.hpp:823
@ e_file
Definition DesignObject.h:115
A core class where all Design Objects including models, materials, and geometries are stored....
Definition DesignObjectLookup.h:65
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:320
Logic for reading or writing to a file as well as navigating filesystems.
Definition File.h:48
Allows the software to generate OpenGL windows when requested that are rendered with OpenGL.
Definition GLESGraphicsWindow.h:38
virtual void resetToDefaults() override
Definition GLESGraphicsWindow.h:63
virtual VirtualCameraView * createView(const DynamicPointer< Camera > &camera, DesignObjectLookup *model_manager, bool auto_add_models=true, QWidget *parent=nullptr) override
Definition GLESGraphicsWindow.h:40
virtual bool canCreateView(const DynamicPointer< Camera > &camera, DesignObjectLookup *model_manager) override
Definition GLESGraphicsWindow.h:54
The core Window used to render a viewport with OpenGL.
Definition GLESGraphicsWindow.h:22
void initialize() override
void paintGL(GraphicsUpdateArguments &args)
void * getSurface() override
GLESGraphicsWindow(QWindow *parent, Qt::WindowFlags flags)
void updateInstance() override
Definition GLESGraphicsWindow.h:29
void finishFrame(GraphicsUpdateArguments &args) final override
Options that are used for performing an update on a Graphics Engine call.
Definition GraphicsUpdateArguments.h:43
A Widget wrapper around a QTGraphicsWindow that allows it to be used inside the UI framework.
Definition QtGraphicsWindow.h:132
A Window used to render 3D graphics. This container allows for a different graphics backend to be use...
Definition QtGraphicsWindow.h:58
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
Definition QTModelManager.h:105
A service which can generate Viewports based on Camera data.
Definition ViewportFactory.h:11
A Viewport for rendering 3D objects in the scene with the NDEVR Graphics Engine. Users interact with ...
Definition VirtualCameraView.h:66
void setModelManager(QTModelManager *manager, bool auto_add_models)
void setCamera(const DynamicPointer< Camera > &camera)
Definition ACIColor.h:37