API Documentation
Loading...
Searching...
No Matches
ViewportManager.h
Go to the documentation of this file.
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/CameraView.h>
4#include <NDEVR/QCustomDockWidget.h>
5#include <NDEVR/ViewportLayout.h>
6#include <NDEVR/Buffer.h>
7#include <NDEVR/Set.h>
8#include <QPointer>
9namespace NDEVR
10{
11 class DesignObjectLookup;
12 class Camera;
13#if NDEVR_VIEWPORT
14 /**--------------------------------------------------------------------------------------------------
15 \brief Logic for placing Viewports or Camera Views into widgets.
16 **/
17 class DESIGN_WIDGETS_API ViewportManager
18 {
19 public:
20 virtual DockWidget<CameraView>* removeViewport(const UUID& id);
21 virtual bool removeView(QPointer<DockWidget<CameraView>> view) = 0;
22 virtual bool addView(QPointer<DockWidget<CameraView>> view) = 0;
23 virtual void onGlobalLayoutUpdated(Buffer<QPointer<DockWidget<CameraView>>>&) {};
24 virtual Buffer<QPointer<DockWidget<CameraView>>> views() const;
25 virtual DockWidget<CameraView>* viewport(const UUID& id) const;
26 virtual void onViewsSwapped(DockWidget<CameraView>* camera_a, DockWidget<CameraView>* camera_b);
27 virtual void layoutViews(ViewportLayout camera_theme, DesignObjectLookup* manager, Buffer<QPointer<DockWidget<CameraView>>>& removed_views);
28 virtual UUID activeViewport() const { return m_active_viewport; }
29 virtual CameraView* mainViewport();
30 virtual QCustomDockWidget* mainViewportDock();
31 virtual bool hasViewport(const UUID& id) const { return m_view_docks.hasKey(id); }
32 virtual uint04 layoutIndex(const UUID& id) const;
33 public:
34 virtual DockWidget<CameraView>* createView(DynamicPointer<Camera>& camera, DesignObjectLookup* manager);
35 protected:
36 UUID m_active_viewport = Constant<UUID>::Invalid;
37 Dictionary<UUID, QPointer<DockWidget<CameraView>>> m_view_docks;
38 ViewportLayout m_current_layout;
39 bool m_is_dirty = false;
40 };
41#endif
42}
#define DESIGN_WIDGETS_API
Definition DLLInfo.h:56
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