NDEVR
API Documentation
ViewportManager.h
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{
12 class Camera;
13#if NDEVR_VIEWPORT
17 class DESIGN_WIDGETS_API ViewportManager
18 {
19 public:
31 virtual bool removeView(QPointer<DockWidget<CameraView>> view) = 0;
37 virtual bool addView(QPointer<DockWidget<CameraView>> view) = 0;
53 virtual DockWidget<CameraView>* viewport(const UUID& id) const;
66 virtual void layoutViews(ViewportLayout camera_theme, DesignObjectLookup* manager, Buffer<QPointer<DockWidget<CameraView>>>& removed_views);
71 virtual UUID activeViewport() const { return m_active_viewport; }
76 virtual CameraView* mainViewport();
87 virtual bool hasViewport(const UUID& id) const { return m_view_docks.hasKey(id); }
93 virtual uint04 layoutIndex(const UUID& id) const;
94 public:
102 protected:
103 UUID m_active_viewport = Constant<UUID>::Invalid;
106 bool m_is_dirty = false;
107 };
108#endif
109}
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
A core object representing a user view as well as convenience functions for moving this view through ...
Definition Camera.h:95
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
Provides a wrapper for a widget that can be docked inside a Container or floated as a top-level windo...
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.
virtual void onGlobalLayoutUpdated(Buffer< QPointer< DockWidget< CameraView > > > &)
Called when the global viewport layout has been updated.
virtual bool addView(QPointer< DockWidget< CameraView > > view)=0
Adds the given view dock widget to the layout.
UUID m_active_viewport
The UUID of the currently active viewport.
ViewportLayout m_current_layout
The current viewport layout arrangement.
virtual Buffer< QPointer< DockWidget< CameraView > > > views() const
Returns all managed viewport dock widgets.
virtual void layoutViews(ViewportLayout camera_theme, DesignObjectLookup *manager, Buffer< QPointer< DockWidget< CameraView > > > &removed_views)
Arranges viewports according to the specified layout theme.
virtual bool removeView(QPointer< DockWidget< CameraView > > view)=0
Removes the given view dock widget from the layout.
virtual QCustomDockWidget * mainViewportDock()
Returns the dock widget containing the main viewport.
virtual void onViewsSwapped(DockWidget< CameraView > *camera_a, DockWidget< CameraView > *camera_b)
Called when two viewport dock widgets have been swapped in the layout.
virtual DockWidget< CameraView > * removeViewport(const UUID &id)
Removes the viewport with the given ID from management.
virtual UUID activeViewport() const
Returns the UUID of the currently active viewport.
virtual DockWidget< CameraView > * viewport(const UUID &id) const
Returns the viewport dock widget with the given ID.
virtual uint04 layoutIndex(const UUID &id) const
Returns the layout index of the viewport with the given ID.
virtual bool hasViewport(const UUID &id) const
Checks whether a viewport with the given ID is managed.
Dictionary< UUID, QPointer< DockWidget< CameraView > > > m_view_docks
Map of viewport UUIDs to their dock widgets.
virtual DockWidget< CameraView > * createView(DynamicPointer< Camera > &camera, DesignObjectLookup *manager)
Creates a new viewport dock widget for the given camera.
bool m_is_dirty
Whether the layout needs to be refreshed.
virtual CameraView * mainViewport()
Returns the main (primary) camera view.
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...