NDEVR
API Documentation
BoundsWidget.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: BoundsWidget
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/Bounds.h>
35#include <NDEVR/Unit.h>
36#include <NDEVR/Matrix.h>
37#include <NDEVR/QCustomTabWidget.h>
38#include <QPointer>
39#include <QWidget>
40class QVBoxLayout;
41namespace NDEVR
42{
43 template<class t_type>
44 class ConstPointer;
45 struct Unit;
46 class PointWidget;
51 class NDEVR_WIDGETS_API BoundsWidget : public QCustomTabWidget
52 {
53 Q_OBJECT
54 public:
59 BoundsWidget(QWidget* parent = nullptr);
64 void setDimensionCount(uint01 dim_count);
81 void setHorizontal(bool horizontal);
86 void setEditable(bool editable);
91 void setBounds(const Bounds<3, fltp08>& bounds);
96 void setMinPoint(const Vertex<3, fltp08>& point);
101 void setMaxPoint(const Vertex<3, fltp08>& point);
106 void setStep(fltp08 step);
111 void setUseLabelAbreviation(bool use_label_abv);
126 const ConstPointer<Unit>& unit() const;
131 void setTransform(const Matrix<fltp08>& mat);
137 void setLabel(uint01 dimension, const TranslatedString& label);
142 void setSurveySettings(QWidget* survey_settings);
167 void setNumberOfLines(uint04 line_count);
172 bool isDefault() const;
173 signals:
177 void edited2();
186 protected slots:
199 private:
203 void refreshLayout();
208 void _setUnit(const ConstPointer<Unit>& unit);
215 void _setBounds(const Bounds<3, fltp08>& bounds, bool set_max_min, bool set_center_size);
216 protected:
221 QVBoxLayout* m_min_max_layout;
222 QVBoxLayout* m_center_size_layout;
223 };
224}
225
void setLabel(uint01 dimension, const TranslatedString &label)
Sets a custom label for a specific dimension.
void setDefaultBounds(const Bounds< 3, fltp08 > &bounds)
Sets the default bounds used as placeholder values.
void setSurveySettings(QWidget *survey_settings)
Sets a widget that provides survey settings access from the bounds widget.
PointWidget * m_center
Widget for entering the center point of the bounds.
void setUnitToApplicationOrientationUnit()
Configures the widget to use the application's orientation unit for display.
void setBounds(const Bounds< 3, fltp08 > &bounds)
Sets the bounds displayed in the widget.
PointWidget * m_max
Widget for entering the maximum point of the bounds.
void setStep(fltp08 step)
Sets the step increment for the bounds input fields.
void onFinishedSlot()
Slot called when the user finishes editing in either tab.
Bounds< 3, fltp08 > placeholderBounds() const
Returns the placeholder bounds displayed when no user input has been provided.
void setNumberOfLines(uint04 line_count)
Sets the number of input lines (rows) displayed per point widget.
void setMaxPoint(const Vertex< 3, fltp08 > &point)
Sets the maximum point of the bounds.
void surveySettingsRequested()
Emitted when the user requests to open survey settings.
void setUseLabelAbreviation(bool use_label_abv)
Sets whether to use abbreviated labels for dimensions (e.g., "X" instead of "X Axis").
const ConstPointer< Unit > & unit() const
Returns the current unit used for display and conversion.
void setEditable(bool editable)
Sets whether the bounds values are editable by the user.
QVBoxLayout * m_min_max_layout
Layout for the min/max corner tab.
void onCenterSizeUpdatedSlot()
Slot called when the center/size tab fields are updated by the user.
QVBoxLayout * m_center_size_layout
Layout for the center/size tab.
void setNumberOfDecimals(uint04 count)
Sets the number of decimal places shown in the bounds fields.
void setDimensionCount(uint01 dim_count)
Sets the number of spatial dimensions displayed (1 to 3).
PointWidget * m_min
Widget for entering the minimum point of the bounds.
PointWidget * m_size
Widget for entering the size of the bounds.
void editingFinished()
Emitted when the user finishes editing the bounds.
void setUnit(const ConstPointer< Unit > &unit)
Sets the unit used for displaying and converting bounds values.
void setUnitToApplicationSpatialUnit()
Configures the widget to use the application's spatial unit for display.
void setHorizontal(bool horizontal)
Sets whether the min/max fields are laid out horizontally.
void setUnitToApplicationAngleUnit()
Configures the widget to use the application's angle unit for display.
void onCornersUpdatedSlot()
Slot called when the corners (min/max) tab fields are updated by the user.
void setTransform(const Matrix< fltp08 > &mat)
Sets a transformation matrix applied to the bounds before display.
Bounds< 3, fltp08 > calculateBounds() const
Calculates and returns the current bounds from the widget's input fields.
Bounds< 3, fltp08 > getBounds() const
Returns the current bounds value held by the widget.
bool isDefault() const
Checks whether the widget is still showing its default (unmodified) values.
BoundsWidget(QWidget *parent=nullptr)
Constructs a BoundsWidget with an optional parent widget.
void edited2()
Emitted when the bounds value has been edited by the user.
void setMinPoint(const Vertex< 3, fltp08 > &point)
Sets the minimum point of the bounds.
A specification of upper and lower bounds in N-dimensions.
Definition Bounds.hpp:54
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
Definition Pointer.hpp:276
Templated logic for doing matrix multiplication.
Definition Matrix.hpp:182
Allows the user to input an N-dimensional point (up to 4 dimensions) with an optional unit.
Definition PointWidget.h:58
QCustomTabWidget(QWidget *parent=nullptr)
Constructs a tab widget.
int count() const
Returns the number of tabs in the widget.
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
A point in N-dimensional space, used primarily for spatial location information.
Definition Vertex.hpp:44
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...
double fltp08
Defines an alias representing an 8 byte floating-point number.
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Defines a unit of measurement for converting and displaying data values.
Definition Unit.h:39