NDEVR
API Documentation
CameraView.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: Widgets
28File: CameraView
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/UUID.h>
35#include <NDEVR/Angle.h>
36#include <NDEVR/Pointer.h>
37#include <NDEVR/Buffer.h>
38#include <QPointer>
39#include <QFrame>
40namespace NDEVR
41{
42 class File;
44 class Camera;
51 class DESIGN_WIDGETS_API CameraView : public QFrame
52 {
53 Q_OBJECT
54 public:
58 enum SwapMode
59 {
60 e_no_swap
61 , e_swap_normal
62 , e_swap_resize
63 };
67 enum RecordingState
68 {
69 e_recording
70 , e_paused
71 , e_stopped
72 };
77 CameraView(QWidget* parent = nullptr)
78 : QFrame(parent)
79 {}
80 virtual ~CameraView() {}
81 //void enterEvent(QEvent*) override;
82 //void leaveEvent(QEvent*) override;
86 virtual void updateView() = 0;
91 virtual void setTouchTheme(bool touch_theme) = 0;
96 virtual void setSwapMode(SwapMode mode) = 0;
101 virtual UUID id() const = 0;
106 virtual ConstPointer<Camera> camera() const = 0;
111 virtual DynamicPointer<Camera> camera() = 0;
117 bool event(QEvent* event) override;
122 virtual void setIconSizeMultiplier(fltp04){};
127 virtual void addWidget(const QPointer<QWidget>&) {};
132 virtual void removeWidget(const QPointer<QWidget>&) {};
137 virtual void setCameraRotation(Angle<fltp08>) {};
142 virtual void setCameraZoom(fltp08) {};
147 virtual Angle<fltp08> cameraRotation() { return Angle<fltp08>(0); }
151 virtual void resetToolRibbon() {};
156 virtual void disableContextMenu(bool disable) { m_disable_context_menu = disable; }
161 virtual void showToolRibbon(bool) {};
166 virtual QSize sizeHint() const override;
171 virtual QWidget* cameraToolbar() { return nullptr; };
176 virtual RecordingState recordingState() const { return RecordingState::e_stopped; }
182 virtual void addContextCustomMenu(const UUID&, ContextMenuCallback*) {};
187 virtual void requestShowInfoDisplay(bool) {};
188 signals:
189 void viewportSelectionSignal(UUID camera, Buffer<UUID> selection);
190 void viewportShowing();
191 void requestCameraCopy(UUID signal, bool);
192 void requestSwapSignal(UUID signal);
193 void requestRedrawAllSignal();
194 void viewHiddenSignal();
195 void recordingStateChangedSignal(RecordingState state);
196 void onScreenshotSaved(const File& file);
197 void onVideoSaved(const File& file);
198 void requestSelectedSignal();
199 void requestMoveable(bool moveable);
200 protected:
201 bool m_disable_context_menu = false;
202 };
203}
A core object representing a user view as well as convenience functions for moving this view through ...
Definition Camera.h:95
Allows for customization of what is shown when the user right-clicks or accesses the ContextMenu for ...
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
Definition File.h:53
The primary namespace for the NDEVR SDK.