API Documentation
Loading...
Searching...
No Matches
GLESGraphicsSession.h
Go to the documentation of this file.
1#pragma once
7#include "Base/Headers/UUID.h"
8#include <QOpenGLTexture>
9#include <QOpenGLBuffer>
10#include <QOpenGLVertexArrayObject>
11namespace NDEVR
12{
13 class OpenGLBuffer;
14 class GLESShader;
15 class GLESRenderObject;
16 class GLESVertexManager;
17 class GLESMaterialManager;
18 /**--------------------------------------------------------------------------------------------------
19 \brief Creates and manages the resources necessary for converting a DesignObjectLookup into 3D rendered
20 data in the OpenGL engine.
21 **/
22 class GLESGraphicsSession : public QObject, public GraphicsSession
23 {
24 Q_OBJECT
25 public:
27 virtual ~GLESGraphicsSession() override;
28 void clearAll();
29 virtual void readShader(const String&) override {}
30 virtual void removeModel(const UUID&) override { m_needs_model_refresh = true; }
31 virtual void removeMaterial(const UUID&) override { m_needs_model_refresh = true; }
32 virtual void removeGeometry(const UUID&) override { m_needs_model_refresh = true; }
35 virtual void postClearAll() override
36 {
37
38 }
39 virtual void setupScene(GraphicsUpdateArguments& args) override;
40 void addRenderObject(const Scene& scene, const Model& model, const Material& mat, const Geometry& mesh, PrimitiveProperty property) override;
41
42 virtual UUID uuid() override
43 {
44 return m_device->id();
45 };
46
47
48 virtual bool runCommand(GraphicsUpdateArguments&) override
49 {
50 return true;
51 }
53 virtual void commit(GraphicsUpdateArguments& args) override;
54 virtual void updateUniformBuffer(GraphicsUpdateArguments& args) override;
55 virtual bool createPipeline(GraphicsUpdateArguments& args) override;
56 //virtual void setDevice(const DynamicPointer<GraphicsDevice>& instance) = 0;
57 virtual const ConstPointer<GraphicsDevice>& device() const override;
58 virtual const DynamicPointer<GraphicsDevice>& device() override;
59 virtual bool hasCommand() const override
60 {
61 return true;
62 }
63 virtual void drawFrame(GraphicsUpdateArguments& args) override;
64 virtual void ensureLastRenderComplete() override {};
65 virtual void cleanup() override {};
66 virtual void setWindowInstance(WindowInstance*) override {};
67 virtual void cleanResources() override {};
68 virtual void init(GraphicsUpdateArguments& args) override;
69 protected:
77 private:
78 bool m_is_init = false;
79 };
80
81}
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
Definition GraphicsPipeline.h:42
A hash-based key-value store, useful for quick associative lookups. Key features include:
Definition Dictionary.h:61
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:320
Creates and manages the resources necessary for converting a DesignObjectLookup into 3D rendered data...
Definition GLESGraphicsSession.h:23
virtual DynamicPointer< GraphicsPipeline > createRenderPipeline() override
virtual UUID uuid() override
Definition GLESGraphicsSession.h:42
virtual void setWindowInstance(WindowInstance *) override
Definition GLESGraphicsSession.h:66
virtual const DynamicPointer< GraphicsDevice > & device() override
virtual void cleanup() override
Definition GLESGraphicsSession.h:65
Dictionary< UUID, DynamicPointer< GLESMaterialManager > > m_material_managers
Definition GLESGraphicsSession.h:72
virtual void readShader(const String &) override
Definition GLESGraphicsSession.h:29
virtual void ensureLastRenderComplete() override
Definition GLESGraphicsSession.h:64
virtual void postClearAll() override
Definition GLESGraphicsSession.h:35
virtual ~GLESGraphicsSession() override
virtual void cleanResources() override
Definition GLESGraphicsSession.h:67
virtual void checkModelStructure(GraphicsUpdateArguments &args)
virtual bool createPipeline(GraphicsUpdateArguments &args) override
virtual void drawFrame(GraphicsUpdateArguments &args) override
GLESGraphicsSession(const DynamicPointer< GLESGraphicsDevice > &device)
DynamicPointer< GLESGraphicsDevice > m_device
Definition GLESGraphicsSession.h:74
Dictionary< UUID, DynamicPointer< GLESVertexManager > > m_vertex_managers
Definition GLESGraphicsSession.h:71
virtual void removeMaterial(const UUID &) override
Definition GLESGraphicsSession.h:31
DynamicPointer< GraphicsDevice > m_graphics_device
Definition GLESGraphicsSession.h:75
virtual void updateUniformBuffer(GraphicsUpdateArguments &args) override
virtual void removeModel(const UUID &) override
Definition GLESGraphicsSession.h:30
virtual const ConstPointer< GraphicsDevice > & device() const override
Dictionary< UUID, DynamicPointer< GLESCameraManager > > m_camera_managers
Definition GLESGraphicsSession.h:70
Dictionary< UUID, GLESRenderObject * > m_pipelines
Definition GLESGraphicsSession.h:73
DynamicPointer< GLESShaderManager > m_shader_manager
Definition GLESGraphicsSession.h:76
virtual void init(GraphicsUpdateArguments &args) override
DynamicPointer< GLESCameraManager > getCameraManager(const UUID &camera)
virtual bool hasCommand() const override
Definition GLESGraphicsSession.h:59
virtual bool runCommand(GraphicsUpdateArguments &) override
Definition GLESGraphicsSession.h:48
void addRenderObject(const Scene &scene, const Model &model, const Material &mat, const Geometry &mesh, PrimitiveProperty property) override
virtual void commit(GraphicsUpdateArguments &args) override
virtual void removeGeometry(const UUID &) override
Definition GLESGraphicsSession.h:32
virtual void setupScene(GraphicsUpdateArguments &args) override
A core class within the model heirarchy containing vertex-based data (Usually 3D data) within a set c...
Definition Geometry.h:64
A GraphicsPipeline that is responsible for setting up and rendering the resources of a DesignObjectLo...
Definition GraphicsSession.h:19
bool m_needs_model_refresh
Definition GraphicsSession.h:41
Options that are used for performing an update on a Graphics Engine call.
Definition GraphicsUpdateArguments.h:43
Container responsible for storing and setting the appearance of a Model or Geometry within the NDEVR ...
Definition Material.h:51
A core class that represents a node on model heirarchy. This node may contain a Geometry or one or mo...
Definition Model.h:58
The root Model that is responsible for storing the underlying data for all Scene Models.
Definition Model.h:492
The core String class for the NDEVR API.
Definition String.h:69
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
Definition ACIColor.h:37
PrimitiveProperty
Definition DesignObjectBase.h:44