NDEVR
API Documentation
CameraPane.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: NDEVR
28File: CameraPane
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#if NDEVR_VIEWPORT
35#include <NDEVR/ViewportManager.h>
36#include <NDEVR/ContainerWidget.h>
37#include <NDEVR/QCustomDockWidget.h>
38#include <NDEVR/SnapLocation.h>
39#include <NDEVR/ViewportLayout.h>
40#include <NDEVR/Pointer.h>
41namespace NDEVR
42{
44 class QTModelManager;
45 class QTWindowManager;
46 class CameraToolbar;
47 class Camera;
48 class CameraView;
49 class CustomDockButton;
51 class Toolbar;
55 class NDEVR_API CameraPane : public QWidget, public ViewportManager
56 {
57 Q_OBJECT
58 public:
65 CameraPane(QTWindowManager* window_manager, QTModelManager* manager, QWidget* parent = nullptr);
70 void setTouchTheme(bool touch_theme);
80 void setSelectedCamera(UUID camera);
86 bool removeView(QPointer<DockWidget<CameraView>> view) override;
92 bool addView(QPointer<DockWidget<CameraView>> view) override;
97 void addWidget(const QPointer<QWidget>& widget);
104 void layoutViews(ViewportLayout camera_theme, DesignObjectLookup* manager, Buffer<QPointer<DockWidget<CameraView>>>& removed_views) override;
109 void removeWidget(const QPointer<QWidget>& widget);
115 bool removeCamera(const UUID& camera);
141 QSize sizeHint() const override;
150 bool sharedToolbar() const;
160 void setRibbonArea(RibbonArea ribbon_area);
161 signals:
171 protected slots:
180 void onCameraDelete(UUID camera);
181 protected:
193 };
194}
195#endif
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
bool sharedToolbar() const
Returns whether camera views share a single toolbar.
bool m_cameras_moveable
Whether camera views can be rearranged by the user.
Definition CameraPane.h:191
void updateCamerasClosable() const
Updates whether each camera view can be closed by the user.
QSize sizeHint() const override
Returns the recommended size for this widget.
void cameraThemeChanged(ViewportLayoutTheme theme)
Emitted when the camera layout theme changes.
Dictionary< UUID, QTResourceListener * > m_click_listeners
Listeners for camera click events.
Definition CameraPane.h:188
QTWindowManager * m_window_manager
The window manager for dialog and layout services.
Definition CameraPane.h:184
void makeCurrentConfigDefault()
Saves the current camera layout as the default configuration.
void layoutViews(ViewportLayout camera_theme, DesignObjectLookup *manager, Buffer< QPointer< DockWidget< CameraView > > > &removed_views) override
Rearranges all camera views according to the specified layout.
ContainerWidget * m_camera_area
The container managing the camera dock layout.
Definition CameraPane.h:186
void createListeners(UUID id)
Creates resource listeners for the camera with the given UUID.
RibbonArea m_ribbon_area
The ribbon area position for the toolbar.
Definition CameraPane.h:190
CustomDockButton * m_add_camera_button
Button for adding new cameras.
Definition CameraPane.h:182
bool removeCamera(const DynamicPointer< Camera > &camera)
Removes the specified camera from the pane.
Buffer< QPointer< QWidget > > m_extra_widgets
Additional widgets embedded in the pane.
Definition CameraPane.h:185
bool removeCamera(const UUID &camera)
Removes the camera with the given UUID from the pane.
void addWidget(const QPointer< QWidget > &widget)
Adds an extra widget to the camera pane layout.
void onViewsSwapped(DockWidget< CameraView > *camera_a, DockWidget< CameraView > *camera_b) override
Called when two camera views are swapped in the layout.
void removeWidget(const QPointer< QWidget > &widget)
Removes an extra widget from the camera pane layout.
CustomDockButton * addCameraButton()
Returns the button used to add new cameras.
Toolbar * m_toolbar
The shared camera toolbar.
Definition CameraPane.h:189
void onCameraDelete(UUID camera)
Slot invoked when a camera is deleted.
void setSelectedCamera(UUID camera)
Sets the currently selected camera by UUID.
void activeCameraChangedSignal()
Emitted when the active camera selection changes.
CameraPane(QTWindowManager *window_manager, QTModelManager *manager, QWidget *parent=nullptr)
Constructs a CameraPane that manages multiple viewport views.
QTModelManager * m_model_manager
The model manager providing data context.
Definition CameraPane.h:183
void setTouchTheme(bool touch_theme)
Enables or disables the touch-optimized theme for camera controls.
bool addView(QPointer< DockWidget< CameraView > > view) override
Adds a camera view to the pane.
void onClearAllSlot()
Slot invoked to clear all camera views from the pane.
ViewportLayoutTheme cameraTheme() const
Returns the current viewport layout theme.
Definition CameraPane.h:75
Dictionary< UUID, QTResourceListener * > m_hover_listeners
Listeners for camera hover events.
Definition CameraPane.h:187
void setRibbonArea(RibbonArea ribbon_area)
Sets the ribbon area where the camera toolbar is displayed.
bool m_touch_theme
Whether the touch-optimized theme is active.
Definition CameraPane.h:192
bool removeView(QPointer< DockWidget< CameraView > > view) override
Removes a camera view from the pane.
Typically shown under a virtual camera view, allows the user to input various settings for a camera o...
A core object representing a user view as well as convenience functions for moving this view through ...
Definition Camera.h:95
manages a series of SectionContent that can share the same space or lay out in various patterns inclu...
A DockItem that represents a button.
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 type-safe dock widget that wraps a specific widget type.
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:356
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
A ResourceListener which will always be executed on the main UI thread and can be tied to a Qt Object...
Definition QTTools.h:493
Manages all windows and logic surrounding dialogs and views for displaying and managing a 3D environm...
Class which displays progress and the current action being performed.
Definition Toolbar.h:15
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:61
Stores information for how to construct a group of viewports such as those in the center 3D panel.
Logic for placing Viewports or Camera Views into widgets.
ViewportLayout m_current_layout
The current viewport layout arrangement.
A Viewport for rendering 3D objects in the scene with the NDEVR Graphics Engine.
The primary namespace for the NDEVR SDK.
RibbonArea
Requests a ribbon or tab area to be in a certain location and orientation relative to another widget.
Definition RibbonArea.h:71
@ e_left
Ribbon positioned on the left, oriented vertically.
Definition RibbonArea.h:75
ViewportLayoutTheme
The potential layouts of multiple viewports within the NDEVR engine.