NDEVR
API Documentation
MeasurementCommandsWidget.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: DrawCommandsWidget
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/QTModelManager.h>
34#if NDEVR_VIEWPORT && NDEVR_MEASURE_MODELS
35#include <NDEVR/MouseController.h>
36#include <NDEVR/MeasurementManager.h>
37#include <NDEVR/FileFormat.h>
38#include <QWidget>
39#include <QPointer>
40namespace Ui
41{
42 class MeasurementToolsUI;
43}
44namespace NDEVR
45{
46 class Ribbon;
47 class Button;
48 class DesignWidget;
49 class RibbonGroup;
55 class NDEVR_API MeasurementCommandsWidget : public QWidget
56 {
57 Q_OBJECT
58 public:
64 MeasurementCommandsWidget(QTModelManager* manager, QWidget* parent = nullptr);
68 ~MeasurementCommandsWidget();
73 void setupRibbonStep(RibbonGroup* group);
79 void setupRibbon(RibbonGroup* group, bool setup_start_end);
85 void setDefaultExportFormat(const FileFormat& format, bool select_current_by_default = true);
90 void setControl(MeasurementManager::MeasureMode mode);
95 void setControlEnabled(bool enabled);
99 void removeControl();
104 void hideEvent(QHideEvent* event) override;
109 void showEvent(QShowEvent* event) override;
114 MeasurementManager::MeasureMode mode() const;
119 void setRootModel(const Model& model);
125 bool canHandle(const UUID& id) const;
130 UUID rootModelID() const;
131 protected:
136 void refreshUI(bool force);
142 StringView modeIcon(MeasurementManager::MeasureMode spec);
143 signals:
149 bool requestVisibleSignal(bool visible);
154 void controlModeSet(MeasurementManager::MeasureMode mode);
155 protected slots:
159 void onPointCloudDistanceChange();
160 protected:
164 void init();
170 void setupRibbon(uint04 index, RibbonGroup* group);
171 private:
172 Dictionary<MeasurementManager::MeasureMode, QPointer<QWidget>> m_custom_draw_widgets;
173 Buffer<DynamicPointer<MouseController>> m_mouse_controllers;
174 Buffer<Buffer<Button*>> m_mode_buttons;
175 Buffer<Buffer<Button*>> m_step_buttons;
176 Buffer<Buffer<Buffer<QAction*>>> m_step_actions;
177 Buffer<Button*> m_export_buttons;
178 Buffer<Button*> m_clear_buttons;
179 Buffer<Button*> m_new_buttons;
180 Buffer<uint04> m_key_draw_action_indices;
181 MeasurementManager m_geometry_controller;
182 QTModelManager* m_manager;
183 Ui::MeasurementToolsUI* ui;
184 QTResourceListener* m_enabled_listener;
185 uint04 m_last_step;
186 uint04 m_last_step_count;
187 MeasurementManager::MeasureMode m_last_mode;
188 FileFormat m_default_export_format;
189
190 //Buffer<Button*> m_lock_movement_buttons;
191 bool m_is_enabled;
192 bool m_export_current_by_default;
193 };
194}
195#endif
A core widget that allows the user to click one of many button types.
Definition Button.h:68
A widget showing key properties of a DesignObject selection, used primarily in a SelectionWidget.
A ResourceListener which will always be executed on the main UI thread and can be tied to a Qt Object...
Definition QTTools.h:493
Represents the "Tab" of a widget.
Definition RibbonGroup.h:52
The UI ribbon is a horizontal menu bar typically located at the top of the application interface or a...
Definition Ribbon.h:56
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...