NDEVR
API Documentation
GraphicsUpdateArguments.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: Graphics
28File: UpdateArguments
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include "GraphicsPipeline.h"
35#include <NDEVR/DesignObjectLookup.h>
36namespace NDEVR
37{
38 class Image;
43 class NDEVR_GRAPHICS_API GraphicsUpdateArguments
44 {
45 public:
50
53 bool isDrawing() const;
66 void setBufferRecreation(bool needed);
67 void setScreenDrawAll(bool screen_draw)
68 {
69 for (auto it = needs_screen_draw.begin(); it != needs_screen_draw.end(); ++it)
70 it.value() = screen_draw;
71 }
72 bool shouldDraw(const UUID& id) const
73 {
74 if (!hidden_items.isNull())
75 {
76 auto value = hidden_items->find(id);
77 if (value != hidden_items->end())
78 return false;
79 }
80 if (visible_items.isNull())
81 return true;
82 auto value = visible_items->find(id);
83 return value != visible_items->end();
84 }
87 std::function<void()> ensure_render_complete;
94 RGBColor background_color = RGBColor(255, 255, 255, 255);
99 void* frame_resource = nullptr;
102 uint04 frame_index = Constant<uint04>::Invalid;
104 Image* grab_image = nullptr;
106 protected:
109 };
110}
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
Definition Pointer.hpp:276
A core class where all Design Objects including models, materials, and geometries are stored.
A hash-based key-value store, useful for quick associative lookups.
Definition Dictionary.h:64
A physical or virtual device used with the NDEVR Rendering Engine.
void finishPipelineRecreation()
Marks pipeline recreation as complete.
bool needsPipelineRecreation() const
Checks whether the pipeline needs recreation.
fltp04 depth_bias
Depth bias for polygon offset.
bool isDrawing() const
Checks whether a draw operation is currently in progress.
Time refresh_command_time
Time of the last command refresh.
Buffer< bool > should_draw_cache
Cached draw flags for models.
Dictionary< UUID, bool > needs_screen_draw
Per-camera screen draw flags.
std::function< void()> ensure_render_complete
Callback to ensure the previous render is complete.
bool m_needs_buffer_recreation
Whether buffers need recreation.
RGBColor background_color
Viewport background color.
void setBufferRecreation(bool needed)
Sets whether buffer recreation is needed.
DesignObjectLookup * lookup
The design object lookup.
Material override_material
Material override applied to all objects.
void * frame_resource
Opaque per-frame resource handle.
Image * grab_image
Target image for screen capture.
Time frame_time
Timestamp of the current frame.
void setPipelineRecreationNeeded()
Marks the pipeline as needing recreation.
ConstPointer< Set< UUID > > hidden_items
Set of explicitly hidden item UUIDs.
Vector< 2, uint04 > window_size
Viewport width and height in pixels.
UUID camera
UUID of the camera being rendered.
GraphicsUpdateArguments()
Default constructor.
uint04 frame_index
Index of the current frame in the swap chain.
uint04 multisample_count
Number of multisample samples.
ConstPointer< Set< UUID > > visible_items
Set of explicitly visible item UUIDs (null = show all).
uint04 frame_count
Total number of frames rendered.
bool m_needs_pipeline_recreation
Whether the pipeline needs recreation.
bool needsBufferRecreation() const
Checks whether buffers need recreation.
GraphicsDevice * device
The active graphics device.
bool is_grab_image
Whether an image grab is pending.
~GraphicsUpdateArguments()
Destructor.
A root class that stores an an array of pixel data that can be displayed as an Image.
Definition Image.h:40
A light-weight wrapper that will be a no-op if there is not a valid log reference,...
Container responsible for storing and setting the appearance of a Model or Geometry within the NDEVR ...
Definition Material.h:153
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:57
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
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
Definition Vector.hpp:62
The primary namespace for the NDEVR SDK.
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...