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 class NDEVR_API MeasurementCommandsWidget : public QWidget
52 {
53 Q_OBJECT
54 public:
55 MeasurementCommandsWidget(QTModelManager* manager, QWidget* parent = nullptr);
56 ~MeasurementCommandsWidget();
57 void setupRibbonStep(RibbonGroup* group);
58 void setupRibbon(RibbonGroup* group, bool setup_start_end);
59 void setDefaultExportFormat(const FileFormat& format, bool select_current_by_default = true);
60 void setControl(MeasurementManager::MeasureMode mode);
61 void setControlEnabled(bool enabled);
62 void removeControl();
63 void hideEvent(QHideEvent* event) override;
64 void showEvent(QShowEvent* event) override;
65 MeasurementManager::MeasureMode mode() const;
66 void setRootModel(const Model& model);
67 bool canHandle(const UUID& id) const;
68 UUID rootModelID() const;
69 void updateFont();
70 protected:
71 void refreshUI(bool force);
72 String modeIcon(MeasurementManager::MeasureMode spec);
73 signals:
74 bool requestVisibleSignal(bool visible);
75 void controlModeSet(MeasurementManager::MeasureMode mode);
76 protected:
77 void setupRibbon(uint04 index, RibbonGroup* group);
78 private:
79 Dictionary<MeasurementManager::MeasureMode, QPointer<QWidget>> m_custom_draw_widgets;
80 Buffer<DynamicPointer<MouseController>> m_mouse_controllers;
81 Buffer<Buffer<Button*>> m_mode_buttons;
82 Buffer<Buffer<Button*>> m_step_buttons;
83 Buffer<Buffer<Buffer<QAction*>>> m_step_actions;
84 Buffer<Button*> m_export_buttons;
85 Buffer<Button*> m_clear_buttons;
86 Buffer<Button*> m_new_buttons;
87 Buffer<uint04> m_key_draw_action_indices;
88 MeasurementManager m_geometry_controller;
89 QTModelManager* m_manager;
90 Ui::MeasurementToolsUI* ui;
91 QTResourceListener* m_enabled_listener;
92 uint04 m_last_step;
93 uint04 m_last_step_count;
94 MeasurementManager::MeasureMode m_last_mode;
95 FileFormat m_default_export_format;
96
97 //Buffer<Button*> m_lock_movement_buttons;
98 bool m_is_enabled;
99 bool m_export_current_by_default;
100 };
101}
102#endif
#define NDEVR_API
Definition DLLInfo.h:67
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:115
Definition FontEditor.h:6