NDEVR
API Documentation
CameraLocationWidget.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: CameraLocationCombo
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/QTModelManager.h>
34#if NDEVR_VIEWPORT
35#include <NDEVR/QTWindowManager.h>
36#include <NDEVR/QTDesignObject.h>
37#include <NDEVR/DesignObjectWidgetInterface.h>
38#include <NDEVR/CameraPane.h>
39#include <NDEVR/Button.h>
40#include <NDEVR/QTTools.h>
41#include <NDEVR/Camera.h>
42#include <NDEVR/Pointer.h>
43#include <QAction>
44#include <QRadioButton>
45#include <QActionGroup>
46#include <QMenu>
47#include <QHBoxLayout>
48namespace NDEVR
49{
53 class NDEVR_API CameraLocationWidget : public QTResourceListener, public DesignObjectWidgetInterface
54 {
55 Q_OBJECT
56 public:
72 void removeTarget(const DynamicPointer<QTDesignObject>& object) override;
77 void addTarget(const DynamicPointer<QTDesignObject>& object) override;
81 void setupMenu();
90 void onZoom(SnapLocation location);
99 virtual void onTargetUpdated(UUID) override;
109 QWidget* widget() const;
115 signals:
120 protected:
124 void setup();
125 protected:
129 QRadioButton* m_perspective = nullptr;
130 QRadioButton* m_orthographic = nullptr;
131 Button* m_top = nullptr;
132 Button* m_bottom = nullptr;
133 Button* m_front = nullptr;
134 Button* m_back = nullptr;
135 Button* m_left = nullptr;
136 Button* m_right = nullptr;
137 QAction* m_settings = nullptr;
138 QWidget* m_widget;
140 };
141}
142#endif
A core widget that allows the user to click one of many button types.
Definition Button.h:68
Button * m_back
Button to snap camera to back view.
QAction * m_settings
Action to open camera settings.
Button * m_front
Button to snap camera to front view.
CameraLocationWidget(QTModelManager *manager, DynamicPointer< Camera > camera)
Constructs a CameraLocationWidget bound to the given camera.
void valueChanged()
Called when the selected camera location value changes.
void setCamera(const DynamicPointer< Camera > &camera)
Sets the camera whose location is controlled by this widget.
DynamicPointer< Camera > camera() const
Returns the currently bound camera.
void addTarget(const DynamicPointer< QTDesignObject > &object) override
Adds a design object target to this widget.
void requestSettingsSignal()
Emitted to request that camera settings be shown.
void setupMenu()
Creates and populates the menu with snap location options.
Button * m_left
Button to snap camera to left view.
QWidget * m_widget
The container widget for this camera location UI.
bool m_has_pending
Whether a pending update is queued.
QRadioButton * m_orthographic
Radio button for orthographic projection.
void setupAutoCamera()
Configures auto-camera behavior for automatic view adjustment.
QWidget * widget() const
Returns the underlying QWidget for this camera location widget.
TimeSpan m_animation_time
Duration of the camera snap animation.
Button * m_bottom
Button to snap camera to bottom view.
Button * m_right
Button to snap camera to right view.
QTModelManager * m_manager
The model manager providing data context.
CameraLocationWidget(QTModelManager *manager)
Constructs a CameraLocationWidget without an initial camera.
void removeTarget(const DynamicPointer< QTDesignObject > &object) override
Removes a design object target from this widget.
DynamicPointer< Camera > m_active_camera
The camera controlled by this widget.
void setup()
Initializes the widget layout and connects signals.
QRadioButton * m_perspective
Radio button for perspective projection.
Button * m_top
Button to snap camera to top view.
virtual void onTargetUpdated(UUID) override
Called when a target design object is updated.
void onZoom(SnapLocation location)
Snaps the camera to the specified location.
QTModelManager * manager() const
Returns the current model manager.
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...
QTResourceListener(const std::function< void()> &callback, QObject *parent)
Constructs a resource listener that invokes the given callback on the UI thread.
Stores a time span, or difference between two times, with an optional start time.
Definition TimeSpan.h:46
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:61
The primary namespace for the NDEVR SDK.
SnapLocation
A list of directions that a view can be pointed relative to an object or scene.