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:1507
@ e_file
Definition DesignObject.h:116
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:319
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
Definition GLESGraphicsWindow.cpp:106
void paintGL(GraphicsUpdateArguments &args)
Definition GLESGraphicsWindow.cpp:115
~GLESGraphicsWindow()
Definition GLESGraphicsWindow.cpp:85
void * getSurface() override
Definition GLESGraphicsWindow.cpp:90
GLESGraphicsWindow(QWindow *parent, Qt::WindowFlags flags)
Definition GLESGraphicsWindow.cpp:65
void updateInstance() override
Definition GLESGraphicsWindow.h:29
void finishFrame(GraphicsUpdateArguments &args) final override
Definition GLESGraphicsWindow.cpp:95
Definition GraphicsUpdateArguments.h:40
Definition QtGraphicsWindow.h:125
Definition QtGraphicsWindow.h:54
Definition QTModelManager.h:94
Definition ViewportFactory.h:8
Definition VirtualCameraView.h:62
void setModelManager(QTModelManager *manager, bool auto_add_models)
Definition VirtualCameraView.cpp:612
void setCamera(const DynamicPointer< Camera > &camera)
Definition VirtualCameraView.cpp:577
Definition ACIColor.h:37