API Documentation
Loading...
Searching...
No Matches
VirtualCameraView.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: VirtualCameraView
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
36#include "Base/Headers/UUID.h"
39
40#include <QWidget>
41class QPropertyAnimation;
42class QParallelAnimationGroup;
43namespace NDEVR
44{
45 class BackgroundandLightingEditor;
46 class QTModelManager;
47 class CameraToolbar;
48 class QTGraphicsWindow;
49 class QTGraphicsWidget;
50 class CameraEditor;
51 class CameraRulerMenu;
52 class Camera;
53 class CameraManager;
54 class QCustomDockWidget;
55 class Ruler;
56 class Button;
57 class File;
58 class String;
59 class QTResourceListener;
60 class ContextMenuCallback;
61 /**--------------------------------------------------------------------------------------------------
62 \brief A Viewport for rendering 3D objects in the scene with the NDEVR Graphics Engine. Users interact
63 with this view via the ContextMenuCallback and MouseController. A QTGraphicsWindow renders the content.
64 **/
66 {
67 Q_OBJECT
68 public:
69 VirtualCameraView(QTGraphicsWidget* widget, const DynamicPointer<Camera>& camera, QTModelManager* model_manager, QWidget* parent = nullptr);
70 VirtualCameraView(QTGraphicsWidget* widget, QWidget* parent = nullptr);
72 void dragEnterEvent(QDragEnterEvent *event) override;
73 void dropEvent(QDropEvent *event) override;
74 void updateView() override;
75 void setSwapMode(SwapMode mode) override;
76 void setCamera(const DynamicPointer<Camera>& camera);
77 void setModelManager(QTModelManager* manager, bool auto_add_models);
78 void addModels(const Buffer<UUID>& ids) override;
79 void clearModels() override;
80 QTGraphicsWindow* graphicsWindow() const { return m_graphics_window; }
81 QWidget* cameraToolbar() override;
82 bool event(QEvent* e) override;
83 void setTouchTheme(bool touch_theme) override;
84 void showToolRibbon(bool visible) override;
85 void resetToolRibbon() override;
86 UUID id() const override;
87 virtual ConstPointer<Camera> camera() const override;
88 virtual DynamicPointer<Camera> camera() override;
89 virtual void addWidget(const QPointer<QWidget>& widget) override;
90 virtual void removeWidget(const QPointer<QWidget>& widget) override;
92 QImage screenshot();
93 void screenshotToClipboard(bool include_background);
94#if NDEVR_IMAGE_MODEL
95 void screenshotToObject(bool include_background);
96#endif
98 void toPDF(const File& pdf_file);
99 void addContextCustomMenu(const UUID& id, ContextMenuCallback* callback) override;
101 void requestShowInfoDisplay(bool should_show) override;
102 protected:
103 void init();
105 protected slots:
106 void showContextMenu(const QPoint &pos);
107 void requestCameraLink(bool selected);
108 void onMaterialDeleted(UUID material);
110
113 protected:
117 CameraToolbar* m_camera_toolbar;
125 CameraRulerMenu* m_ruler_combo;
133 bool m_should_show_info = true;
134 };
135}
#define NDEVR_GRAPHICS_API
Definition DLLInfo.h:56
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
A core widget that allows the user to click one of many button types.
Definition Button.h:66
A simple frame for displaying Viewport data to a user. Data is rendered by a given Rendering engine b...
Definition CameraView.h:50
SwapMode
Definition CameraView.h:54
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
Definition GraphicsPipeline.h:42
Allows for customization of what is shown when the user right-clicks or accesses the ContextMenu for ...
Definition ContextMenuManager.h:41
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
Logic for reading or writing to a file as well as navigating filesystems.
Definition File.h:48
A Widget wrapper around a QTGraphicsWindow that allows it to be used inside the UI framework.
Definition QtGraphicsWindow.h:132
A Window used to render 3D graphics. This container allows for a different graphics backend to be use...
Definition QtGraphicsWindow.h:58
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
Definition QTModelManager.h:105
Definition QTTools.h:168
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
A Viewport for rendering 3D objects in the scene with the NDEVR Graphics Engine. Users interact with ...
Definition VirtualCameraView.h:66
String getCursorID() const
CameraRulerMenu * m_ruler_combo
Definition VirtualCameraView.h:125
void showContextMenu(const QPoint &pos)
QTResourceListener * m_cursor_listener
Definition VirtualCameraView.h:118
VirtualCameraView(QTGraphicsWidget *widget, const DynamicPointer< Camera > &camera, QTModelManager *model_manager, QWidget *parent=nullptr)
void showToolRibbon(bool visible) override
void setModelManager(QTModelManager *manager, bool auto_add_models)
QTGraphicsWindow * graphicsWindow() const
Definition VirtualCameraView.h:80
void setSwapMode(SwapMode mode) override
Dictionary< UUID, ContextMenuCallback * > m_custom_context_callbacks
Definition VirtualCameraView.h:114
Ruler * m_top_ruler
Definition VirtualCameraView.h:123
virtual ConstPointer< Camera > camera() const override
bool m_show_toolbar
Definition VirtualCameraView.h:127
bool m_show_top_ruler_perspective
Definition VirtualCameraView.h:131
void clearModels() override
CameraToolbar * m_camera_toolbar
Definition VirtualCameraView.h:117
bool m_show_top_ruler_ortho
Definition VirtualCameraView.h:130
void onMaterialDeleted(UUID material)
void updateView() override
void screenshotToPrint(uint04 index=Constant< uint04 >::Invalid)
bool m_show_edge_ruler_ortho
Definition VirtualCameraView.h:128
void objectRefresh(UUID id)
bool m_show_edge_ruler_perspective
Definition VirtualCameraView.h:129
QTResourceListener * m_orientation_listener
Definition VirtualCameraView.h:121
QTResourceListener * m_orthograhic_listener
Definition VirtualCameraView.h:120
void dragEnterEvent(QDragEnterEvent *event) override
virtual void addWidget(const QPointer< QWidget > &widget) override
void requestCameraLink(bool selected)
bool event(QEvent *e) override
QWidget * cameraToolbar() override
void resetToolRibbon() override
QTResourceListener * m_selection_info_listener
Definition VirtualCameraView.h:119
void requestShowInfoDisplay(bool should_show) override
void screenshotToClipboard(bool include_background)
QTGraphicsWindow * m_graphics_window
Definition VirtualCameraView.h:115
void addModels(const Buffer< UUID > &ids) override
QTGraphicsWidget * m_graphics_widget
Definition VirtualCameraView.h:126
virtual void removeWidget(const QPointer< QWidget > &widget) override
void addContextCustomMenu(const UUID &id, ContextMenuCallback *callback) override
UUID id() const override
VirtualCameraView(QTGraphicsWidget *widget, QWidget *parent=nullptr)
virtual DynamicPointer< Camera > camera() override
void setTouchTheme(bool touch_theme) override
void dropEvent(QDropEvent *event) override
QTModelManager * m_model_manager
Definition VirtualCameraView.h:116
void setCamera(const DynamicPointer< Camera > &camera)
Button * m_ruler_button
Definition VirtualCameraView.h:124
bool m_touch_theme
Definition VirtualCameraView.h:132
void toPDF(const File &pdf_file)
Ruler * m_side_ruler
Definition VirtualCameraView.h:122
Definition ACIColor.h:37
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233