API Documentation
Loading...
Searching...
No Matches
MeasurementCommandsWidget.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: 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;
50 class QTResourceListener;
51 /**--------------------------------------------------------------------------------------------------
52 \brief A widget for interfacing with MeasurementManager to allow the user to measure 3D objects
53 or shapes
54 **/
55 class NDEVR_API MeasurementCommandsWidget : public QWidget
56 {
57 Q_OBJECT
58 public:
59 MeasurementCommandsWidget(QTModelManager* manager, QWidget* parent = nullptr);
60 ~MeasurementCommandsWidget();
61 void setupRibbonStep(RibbonGroup* group);
62 void setupRibbon(RibbonGroup* group, bool setup_start_end);
63 void setDefaultExportFormat(const FileFormat& format, bool select_current_by_default = true);
64 void setControl(MeasurementManager::MeasureMode mode);
65 void setControlEnabled(bool enabled);
66 void removeControl();
67 void hideEvent(QHideEvent* event) override;
68 void showEvent(QShowEvent* event) override;
69 MeasurementManager::MeasureMode mode() const;
70 void setRootModel(const Model& model);
71 bool canHandle(const UUID& id) const;
72 UUID rootModelID() const;
73 void updateFont();
74 protected:
75 void refreshUI(bool force);
76 String modeIcon(MeasurementManager::MeasureMode spec);
77 signals:
78 bool requestVisibleSignal(bool visible);
79 void controlModeSet(MeasurementManager::MeasureMode mode);
80 protected:
81 void setupRibbon(uint04 index, RibbonGroup* group);
82 private:
83 Dictionary<MeasurementManager::MeasureMode, QPointer<QWidget>> m_custom_draw_widgets;
84 Buffer<DynamicPointer<MouseController>> m_mouse_controllers;
85 Buffer<Buffer<Button*>> m_mode_buttons;
86 Buffer<Buffer<Button*>> m_step_buttons;
87 Buffer<Buffer<Buffer<QAction*>>> m_step_actions;
88 Buffer<Button*> m_export_buttons;
89 Buffer<Button*> m_clear_buttons;
90 Buffer<Button*> m_new_buttons;
91 Buffer<uint04> m_key_draw_action_indices;
92 MeasurementManager m_geometry_controller;
93 QTModelManager* m_manager;
94 Ui::MeasurementToolsUI* ui;
95 QTResourceListener* m_enabled_listener;
96 uint04 m_last_step;
97 uint04 m_last_step_count;
98 MeasurementManager::MeasureMode m_last_mode;
99 FileFormat m_default_export_format;
100
101 //Buffer<Button*> m_lock_movement_buttons;
102 bool m_is_enabled;
103 bool m_export_current_by_default;
104 };
105}
106#endif
#define NDEVR_API
Definition DLLInfo.h:50
Definition ACIColor.h:37
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
Definition FontEditor.h:6