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 /**--------------------------------------------------------------------------------------------------
49 \brief Information relating to capturing a 3D view into a 2D raster image.
50 **/
51 struct CaptureInfo
52 {
53 Vector<2, uint04> size = { 128, 128 };
54 fltp08 reference_size = 128.0;
55 Vector<3, Angle<fltp08>> angle_offsets;
56 SnapLocation snap = SnapLocation::e_no_snap;
57 UUID target_object = Constant<UUID>::Invalid;
58 Buffer<UUID> included_objects;
59 RGBColor background = { 255, 255, 255, 0};
60 bool orthographic = false;
61 bool auto_crop = false;
62 bool operator==(const CaptureInfo& info) const
63 {
64 return (snap == info.snap)
65 && (target_object == info.target_object)
66 && (included_objects == info.included_objects)
67 && (orthographic == info.orthographic)
68 && (background == info.background)
69 && (reference_size == info.reference_size)
70 && (size == info.size)
71 && (auto_crop == info.auto_crop);
72 }
73 };
74 /**--------------------------------------------------------------------------------------------------
75 \brief A request to capture the 3D view as a 2D image.
76 **/
77 struct CaptureRequest : public CaptureInfo
78 {
79 CaptureRequest(UUID id)
80 : m_id(id)
81 {}
82 CaptureRequest(UUID id, const CaptureInfo& info, const std::function<void(const QImage& image)>& n_callback)
83 : CaptureInfo(info)
84 , m_id(id)
85 , callback(n_callback)
86 {}
87 UUID uuid() const { return m_id; }
88 bool operator==(const CaptureInfo& info) const
89 {
90 return (snap == info.snap)
91 && (target_object == info.target_object)
92 && (included_objects == info.included_objects)
93 && (orthographic == info.orthographic)
94 && (background == info.background)
95 && (auto_crop == info.auto_crop)
96 && (reference_size == info.reference_size)
97 && (size == info.size);
98 }
99 UUID m_id;
100 std::function<void(const QImage& image)> callback = nullptr;
101 };
102
103}
104#endif
bool operator==(const VkVertexInputAttributeDescription &a, const VkVertexInputAttributeDescription &b)
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:149