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 class NDEVR_WIDGETS_API OrientationEditor : public QWidget
51 {
52 Q_OBJECT
53 public:
55 {
57 , e_small_horizontal
58 , e_small_vertical
59 , e_tiny_horizontal
60 , e_tiny_vertical
61 };
62 explicit OrientationEditor(QWidget* parent = nullptr);
64 Vector<3, fltp08> getUILocation() const;
65 Vector<3, Angle<fltp08>> getUIRotation() const;
66 Vector<3, Angle<fltp08>> getUIDialRotation() const;
67 Vector<3, fltp08> getUIScale() const;
68 void setOffsetTitle(const TranslatedString& title);
69 void setOffsetLabels(const TranslatedString& x, const TranslatedString& y, const TranslatedString& z);
70 void setScaleTitle(const TranslatedString& title);
71 void setRotationTitle(const TranslatedString& roll, const TranslatedString& pitch, const TranslatedString& yaw);
72 QCustomDial* getUIDial(uint01 orientation);
73 QCustomLineEdit* getUILineEdit(uint01 orientation);
74 QBoxLayout* offsetLayout();
75 Matrix<fltp08> getMatrix();
76 void setMatrix(const Matrix<fltp08>& matrix);
77 void resizeEvent(QResizeEvent *event) override;
79 virtual QSize minimumSizeHint() const override;
80 virtual QSize sizeHint() const override;
81 void updateLayoutSize();
82 void setAutoHideDials(bool auto_hide_dials);
83 signals:
87 void updated();
91 void edited();
92 public slots:
93 void updatePosition();
94 void updateOrientation();
95 void updateScale();
96 void lockAspectRatio();
97 void setSizeMode(SizeMode mode);
98 private slots:
99 void updatePositionFromUI();
100 void updateOrientationFromDials();
101 void updateOrientationFromUI();
102 void updateScaleFromUI();
103 void updateScaleFieldsX();
104 void updateScaleFieldsY();
105 void updateScaleFieldsZ();
106 public:
110
114
118
125 protected:
130 Ui::OrientationEditorUI* ui;
131 };
132}
133
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:81
Definition Matrix.hpp:173
Definition OrientationEditor.h:51
Ui::OrientationEditorUI * ui
Definition OrientationEditor.h:130
Resource< Vector< 3, fltp08 > > min_position
Definition OrientationEditor.h:119
Resource< Vector< 3, bool > > show_position
Definition OrientationEditor.h:107
Resource< Vector< 3, bool > > show_orientation
Definition OrientationEditor.h:109
Resource< Vector< 3, Angle< fltp08 > > > max_orientation
Definition OrientationEditor.h:116
Resource< Vector< 3, Angle< fltp08 > > > min_orientation
Definition OrientationEditor.h:120
Vector< 3, fltp08 > m_aspect_ratio
Definition OrientationEditor.h:126
Resource< ConstPointer< Unit > > size_unit
Definition OrientationEditor.h:123
Resource< Vector< 3, fltp08 > > min_scale
Definition OrientationEditor.h:121
Resource< Vector< 3, fltp08 > > max_scale
Definition OrientationEditor.h:117
Resource< Vector< 3, fltp08 > > scale
Definition OrientationEditor.h:113
Resource< ConstPointer< Unit > > position_unit
Definition OrientationEditor.h:124
Resource< Vector< 3, fltp08 > > max_position
Definition OrientationEditor.h:115
Resource< Vector< 3, bool > > show_scale
Definition OrientationEditor.h:108
QTResourceListener * m_units_listener
Definition OrientationEditor.h:129
SizeMode
Definition OrientationEditor.h:55
SizeMode m_size_mode
Definition OrientationEditor.h:127
bool m_auto_hide_dials
Definition OrientationEditor.h:128
Resource< Vector< 3, Angle< fltp08 > > > orientation
Definition OrientationEditor.h:112
Resource< Vector< 3, fltp08 > > position
Definition OrientationEditor.h:111
Resource< ConstPointer< Unit > > angle_unit
Definition OrientationEditor.h:122
Definition QCustomDial.h:58
Definition QCustomLineEdit.h:118
Definition QTTools.h:183
Definition Toggle.h:41
Definition TranslatedString.h:9
An element of a vector space. An element of the real coordinate space Rn Basis vector,...
Definition Vector.hpp:62
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:98
Definition FontEditor.h:6