API Documentation
Loading...
Searching...
No Matches
QModelViewCapture.h
Go to the documentation of this file.
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: NDEVR
28File: QModelViewCapture
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#if NDEVR_VIEWPORT
35#include <NDEVR/SnapLocation.h>
36#include <NDEVR/UUID.h>
37#include <NDEVR/RGBColor.h>
38#include <NDEVR/Angle.h>
39#include <NDEVR/Buffer.h>
40#include <QImage>
41#include <functional>
42namespace NDEVR
43{
44 class Renderer;
45 class GraphicsDevice;
46 class QTModelManager;
47 class BasicThread;
48 struct CaptureInfo
49 {
50 Vector<2, uint04> size = { 128, 128 };
51 fltp08 reference_size = 128.0;
52 Vector<3, Angle<fltp08>> angle_offsets;
53 SnapLocation snap = SnapLocation::e_no_snap;
54 UUID target_object = Constant<UUID>::NaN;
55 Buffer<UUID> included_objects;
56 RGBColor background = { 255, 255, 255, 0};
57 bool orthographic = false;
58 bool auto_crop = false;
59 bool operator==(const CaptureInfo& info) const
60 {
61 return (snap == info.snap)
62 && (target_object == info.target_object)
63 && (included_objects == info.included_objects)
64 && (orthographic == info.orthographic)
65 && (background == info.background)
66 && (reference_size == info.reference_size)
67 && (size == info.size)
68 && (auto_crop == info.auto_crop);
69 }
70 };
71 struct CaptureRequest : public CaptureInfo
72 {
73 CaptureRequest(UUID id)
74 : m_id(id)
75 {}
76 CaptureRequest(UUID id, const CaptureInfo& info, const std::function<void(const QImage& image)>& n_callback)
77 : CaptureInfo(info)
78 , m_id(id)
79 , callback(n_callback)
80 {}
81 UUID uuid() const { return m_id; }
82 bool operator==(const CaptureInfo& info) const
83 {
84 return (snap == info.snap)
85 && (target_object == info.target_object)
86 && (included_objects == info.included_objects)
87 && (orthographic == info.orthographic)
88 && (background == info.background)
89 && (auto_crop == info.auto_crop)
90 && (reference_size == info.reference_size)
91 && (size == info.size);
92 }
93 UUID m_id;
94 std::function<void(const QImage& image)> callback = nullptr;
95 };
96
97}
98#endif
bool operator==(const VkVertexInputAttributeDescription &a, const VkVertexInputAttributeDescription &b)
Definition VulkanRenderObject.cpp:18
Definition ACIColor.h:37
SnapLocation
A list of directions that a view can be pointed relative to an object or scene.
Definition ViewLocation.h:40
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:176