NDEVR
API Documentation
GraphicsSession.h
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/GraphicsPipeline.h>
4#include <NDEVR/Pointer.h>
5#include <NDEVR/UUID.h>
6#include <NDEVR/Dictionary.h>
7#include <NDEVR/Set.h>
8#include <NDEVR/Geometry.h>
9namespace NDEVR
10{
11 class Model;
12 class String;
13 class Material;
14 class Scene;
15 enum class PrimitiveProperty;
16
21 class NDEVR_GRAPHICS_API GraphicsSession : public GraphicsPipeline
22 {
23 public:
31
43
44 virtual ~GraphicsSession(){}
47 virtual void addCamera(const UUID& object);
50 virtual void readShader(const StringView& shader) = 0;
53 virtual void removeCamera(const UUID& camera);
57 virtual bool addRenderGeometry(const Geometry& geo) = 0;
60 virtual void removeRenderGeometry(const Geometry& geo) = 0;
65 virtual void postClearAll();
68 virtual UUID uuid() = 0;
71 bool isActive() const { return m_is_active; }
74 void setActive(bool active) { m_is_active = active; }
75 protected:
78 bool m_needs_clear_all = false;
79 bool m_is_active = false;
80 };
81}
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:356
A core class within the model hierarchy containing vertex-based data (Usually 3D data) within a set c...
Definition Geometry.h:143
A GraphicsPipeline is a set of resources that are chained together to correctly render something.
A GraphicsPipeline that is responsible for setting up and rendering the resources of a DesignObjectLo...
virtual void removeRenderGeometry(const Geometry &geo)=0
Removes a geometry from rendering.
virtual DynamicPointer< GraphicsPipeline > createRenderPipeline()=0
Creates a new render pipeline for a viewport.
virtual void readShader(const StringView &shader)=0
Reads and compiles a shader for use in rendering.
virtual void postClearAll()
Called after all scene objects have been cleared.
bool m_needs_command_refresh
Whether command buffers need refreshing.
Buffer< UUID > m_added_cameras
Cameras registered with this session.
void setActive(bool active)
Sets whether this session is active.
virtual UUID uuid()=0
Returns the unique identifier for this session.
bool m_is_active
Whether this session is currently active.
virtual void addCamera(const UUID &object)
Adds a camera to this session.
AddObjectMode
Modes for adding objects to the session.
@ e_ensure_pipeline_and_add
Ensure the pipeline and add the object.
@ e_add_object
Add the object only.
@ e_ensure_pipeline
Ensure the pipeline exists for the object.
bool m_needs_clear_all
Whether a full clear is pending.
virtual bool addRenderGeometry(const Geometry &geo)=0
Adds a geometry for rendering.
bool isActive() const
Checks whether this session is active.
virtual ~GraphicsSession()
Destructor.
virtual void removeCamera(const UUID &camera)
Removes a camera from this session.
Container responsible for storing and setting the appearance of a Model or Geometry within the NDEVR ...
Definition Material.h:153
A core class that represents a node on model hierarchy.
Definition Model.h:292
The root Model that is responsible for storing the underlying data for all Scene Models.
Definition Scene.h:52
The core String View class for the NDEVR API.
Definition StringView.h:58
The core String class for the NDEVR API.
Definition String.h:95
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:62
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:61
The primary namespace for the NDEVR SDK.
PrimitiveProperty
Describes which rendering property a primitive index buffer corresponds to.
Geometry geo
The tracked geometry.
Time last_modified_time
Last time this geometry was modified.
GeometryUpdateObject(const Geometry &geo)
Constructs the update object.