API Documentation
Loading...
Searching...
No Matches
OrientationEditor.h
Go to the documentation of this file.
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: OrientationEditor
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/Resource.h>
35#include <NDEVR/Matrix.h>
36#include <NDEVR/Pointer.h>
37#include <NDEVR/Unit.h>
38#include <QWidget>
39namespace Ui
40{
41 class OrientationEditorUI;
42}
43class QBoxLayout;
44namespace NDEVR
45{
46 class QTResourceListener;
47 class String;
48 class QCustomDial;
49 class QCustomLineEdit;
50 /**--------------------------------------------------------------------------------------------------
51 \brief A dialog where the user can set a 3D orientation of an object.
52 **/
53 class NDEVR_WIDGETS_API OrientationEditor : public QWidget
54 {
55 Q_OBJECT
56 public:
58 {
60 , e_small_horizontal
61 , e_small_vertical
62 , e_tiny_horizontal
63 , e_tiny_vertical
64 };
65 explicit OrientationEditor(QWidget* parent = nullptr);
71 void setOffsetTitle(const TranslatedString& title);
73 void setScaleTitle(const TranslatedString& title);
74 void setRotationTitle(const TranslatedString& roll, const TranslatedString& pitch, const TranslatedString& yaw);
77 QBoxLayout* offsetLayout();
79 void setMatrix(const Matrix<fltp08>& matrix);
80 void resizeEvent(QResizeEvent *event) override;
82 virtual QSize minimumSizeHint() const override;
83 virtual QSize sizeHint() const override;
85 void setAutoHideDials(bool auto_hide_dials);
86 signals:
90 void updated();
94 void edited();
95 public slots:
101 private slots:
102 void updatePositionFromUI();
103 void updateOrientationFromDials();
104 void updateOrientationFromUI();
105 void updateScaleFromUI();
106 void updateScaleFieldsX();
107 void updateScaleFieldsY();
108 void updateScaleFieldsZ();
109 public:
113
117
121
128 protected:
133 Ui::OrientationEditorUI* ui;
134 };
135}
136
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:59
Definition Matrix.hpp:176
A dialog where the user can set a 3D orientation of an object.
Definition OrientationEditor.h:54
void setOffsetLabels(const TranslatedString &x, const TranslatedString &y, const TranslatedString &z)
Ui::OrientationEditorUI * ui
Definition OrientationEditor.h:133
Resource< Vector< 3, fltp08 > > min_position
Definition OrientationEditor.h:122
Resource< Vector< 3, bool > > show_position
Definition OrientationEditor.h:110
Resource< Vector< 3, bool > > show_orientation
Definition OrientationEditor.h:112
Resource< Vector< 3, Angle< fltp08 > > > max_orientation
Definition OrientationEditor.h:119
QBoxLayout * offsetLayout()
Resource< Vector< 3, Angle< fltp08 > > > min_orientation
Definition OrientationEditor.h:123
Vector< 3, fltp08 > m_aspect_ratio
Definition OrientationEditor.h:129
QCustomDial * getUIDial(uint01 orientation)
Resource< ConstPointer< Unit > > size_unit
Definition OrientationEditor.h:126
OrientationEditor(QWidget *parent=nullptr)
Resource< Vector< 3, fltp08 > > min_scale
Definition OrientationEditor.h:124
Resource< Vector< 3, fltp08 > > max_scale
Definition OrientationEditor.h:120
Resource< Vector< 3, fltp08 > > scale
Definition OrientationEditor.h:116
Vector< 3, Angle< fltp08 > > getUIDialRotation() const
virtual QSize sizeHint() const override
Vector< 3, fltp08 > getUIScale() const
virtual QSize minimumSizeHint() const override
Resource< ConstPointer< Unit > > position_unit
Definition OrientationEditor.h:127
Vector< 3, fltp08 > getUILocation() const
Resource< Vector< 3, fltp08 > > max_position
Definition OrientationEditor.h:118
Matrix< fltp08 > getMatrix()
void setAutoHideDials(bool auto_hide_dials)
Resource< Vector< 3, bool > > show_scale
Definition OrientationEditor.h:111
QCustomLineEdit * getUILineEdit(uint01 orientation)
void resizeEvent(QResizeEvent *event) override
QTResourceListener * m_units_listener
Definition OrientationEditor.h:132
void setSizeMode(SizeMode mode)
SizeMode
Definition OrientationEditor.h:58
void setMatrix(const Matrix< fltp08 > &matrix)
SizeMode m_size_mode
Definition OrientationEditor.h:130
bool m_auto_hide_dials
Definition OrientationEditor.h:131
Resource< Vector< 3, Angle< fltp08 > > > orientation
Definition OrientationEditor.h:115
void setOffsetTitle(const TranslatedString &title)
Resource< Vector< 3, fltp08 > > position
Definition OrientationEditor.h:114
void setRotationTitle(const TranslatedString &roll, const TranslatedString &pitch, const TranslatedString &yaw)
void setScaleTitle(const TranslatedString &title)
Resource< ConstPointer< Unit > > angle_unit
Definition OrientationEditor.h:125
Vector< 3, Angle< fltp08 > > getUIRotation() const
Provides a rounded range control (like a speedometer or potentiometer).
Definition QCustomDial.h:71
A line edit allows users to enter and edit a single line of plain text with useful editing functions,...
Definition QCustomLineEdit.h:56
Definition QTTools.h:168
A core part of the engine, stores variables that can be listened to with ResourceListener which will ...
Definition Toggle.h:41
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
Definition ACIColor.h:37
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:80
Definition FontEditor.h:6