API Documentation
Loading...
Searching...
No Matches
PointWidget.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: NDEVR
28File: PointWidget
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/QTTools.h>
35#include <NDEVR/Vertex.h>
36#include <NDEVR/Unit.h>
37#include <NDEVR/Pointer.h>
38#include <NDEVR/Matrix.h>
39#include <QPointer>
40namespace Ui
41{
42 class PointWidgetUI;
43}
44class QGridLayout;
45namespace NDEVR
46{
47 class QCustomLabel;
48 class QCustomLineEdit;
49 class DimensionWidgets;
50 class GNSSCallback;
51
52 /**--------------------------------------------------------------------------------------------------
53 \brief Allows the user to input an N-dimensional point (up to 4 dimensions) with an optinal unit.
54 Also allows other widgets, such as a GNSS take reading button, to be added into the layout.
55 **/
56 class NDEVR_WIDGETS_API PointWidget : public QWidget
57 {
58 Q_OBJECT
59 private:
60 class PreTransform;
61 public:
63 {
64 public:
65 virtual QWidget* createGNSSWidget(UUID gps_name, PointWidget* point_widget) = 0;
66 };
67 PointWidget(QWidget* parent = nullptr);
68 void setDimensionCount(uint01 dim_count);
73 void setEditable(bool editable);
74 void setMinPoint(const Vertex<3, fltp08>& point);
75 void setMaxPoint(const Vertex<3, fltp08>& point);
76 void setStep(fltp08 step);
77 void setUseLabelAbreviation(bool use_label_abv);
78 void setFontMultiplier(fltp04 size_mult);
83 void setUnit(const ConstPointer<Unit>& unit);
84 const ConstPointer<Unit>& unit() const;
85 void setTransform(const Matrix<fltp08>& mat);
86 void setLabel(uint01 dimension, const TranslatedString& label);
87 void setSurveySettings(QWidget* survey_settings);
92 void setNumberOfLines(uint04 line_count);
93 bool isDefault() const;
94 void setPreTransform(PreTransform* transform);
95 QPointer<QWidget> surveySettings() const { return m_survey_settings; }
96 signals:
97 void edited2();
100 protected slots:
103 protected:
105 {
106 public:
107 virtual void preTransform(Vertex<3, fltp08>& point) = 0;
108 virtual void postTransform(Vertex<3, fltp08>& point) = 0;
109 virtual bool isValid() const = 0;
110 };
112 private:
113 void refreshLayout();
114 protected:
125 QGridLayout* m_layout;
126 PreTransform* m_pre_transform = nullptr;
127 QPointer<QWidget> m_survey_settings = nullptr;
129 };
130}
131
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:59
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
Definition GraphicsPipeline.h:42
Definition Matrix.hpp:176
Definition PointWidget.h:63
virtual QWidget * createGNSSWidget(UUID gps_name, PointWidget *point_widget)=0
Definition PointWidget.h:105
virtual void preTransform(Vertex< 3, fltp08 > &point)=0
virtual void postTransform(Vertex< 3, fltp08 > &point)=0
virtual bool isValid() const =0
Allows the user to input an N-dimensional point (up to 4 dimensions) with an optinal unit....
Definition PointWidget.h:57
PointWidget(QWidget *parent=nullptr)
bool m_use_label_abv
Definition PointWidget.h:128
Matrix< fltp08 > m_matrix
Definition PointWidget.h:116
void setNumberOfLines(uint04 line_count)
void setStep(fltp08 step)
void setMaxPoint(const Vertex< 3, fltp08 > &point)
Vertex< 3, fltp08 > getPoint() const
void setPoint(Vertex< 2, fltp08 > point)
void setPoint(Vertex< 3, fltp08 > point)
const ConstPointer< Unit > & unit() const
Vertex< 3, fltp08 > m_default_point
Definition PointWidget.h:120
Vector< 4, TranslatedString > m_custom_labels
Definition PointWidget.h:121
bool isDefault() const
void setMinPoint(const Vertex< 3, fltp08 > &point)
fltp08 m_w_point
Definition PointWidget.h:119
Vertex< 3, fltp08 > placeholderPoint() const
void setEditable(bool editable)
void setUnitToApplicationSpatialUnit()
void setPreTransform(PreTransform *transform)
void setUnitToApplicationAngleUnit()
QGridLayout * m_layout
Definition PointWidget.h:125
Vertex< 3, fltp08 > m_point
Definition PointWidget.h:118
void setUnitToApplicationDistanceUnit()
void setUseLabelAbreviation(bool use_label_abv)
void setUnit(const ConstPointer< Unit > &unit)
QTResourceListener * m_default_units_listener
Definition PointWidget.h:115
void setFontMultiplier(fltp04 size_mult)
void setTransform(const Matrix< fltp08 > &mat)
void setDecimalCount(uint04 count)
void setUnitToApplicationOrientationUnit()
Vector< 4, DimensionWidgets * > m_dimension_widgets
Definition PointWidget.h:122
void setDefaultPoint(const Vertex< 3, fltp08 > &point)
uint01 m_dimension_count
Definition PointWidget.h:123
void setDimensionCount(uint01 dim_count)
uint04 m_layout_line_count
Definition PointWidget.h:124
void setLabel(uint01 dimension, const TranslatedString &label)
Vertex< 3, fltp08 > calculatePoint() const
void setPoint(Vertex< 4, fltp08 > point)
void setSurveySettings(QWidget *survey_settings)
void setRawUnit(const ConstPointer< Unit > &unit)
QPointer< QWidget > surveySettings() const
Definition PointWidget.h:95
ConstPointer< Unit > m_unit
Definition PointWidget.h:117
void surveySettingsRequested()
Definition QTTools.h:168
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
A vertex or point. A specific type of Vector used primarily for spacial location information.
Definition Vertex.hpp:48
Definition ACIColor.h:37
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
Definition BaseValues.hpp:127
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:80
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
Definition FontEditor.h:6