API Documentation
Loading...
Searching...
No Matches
ModelCommandsWidget.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: ModelCommandsWidget
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#if NDEVR_VIEWPORT
35#include <NDEVR/SnapsEditorWidget.h>
36#include <NDEVR/QTModelManager.h>
37#include <NDEVR/MouseController.h>
38#include <NDEVR/SelectionController.h>
39#include <NDEVR/ModelEditController.h>
40#include <QWidget>
41class QVBoxLayout;
42namespace NDEVR
43{
44 class Ribbon;
45 class Button;
46 class RibbonGroup;
47 class QTResourceListener;
48 class RibbonSubGroup;
49 class QCustomStackedWidget;
50 class ModelOffsetCommandWidget;
51 class VertexOffsetWidget;
52 class QtModelFunction : public ModelFunction
53 {
54 public:
55 virtual QWidget* editWidget() = 0;
56 virtual bool shouldShowInterface() const override { return true; }
57 };
58 class NDEVR_API ModelCommandsWidget : public QWidget
59 {
60 Q_OBJECT
61 public:
62 ModelCommandsWidget(QTModelManager* manager, QWidget *parent = nullptr);
63 virtual ~ModelCommandsWidget();
64 void setupCommandModeRibbon(RibbonGroup* group);
65#if NDEVR_GRIPS
66 void setupGripModeRibbon(RibbonGroup* group);
67#endif
68 void setControl(ModelEditController::ModelEditMode mode);
69 void setControl(UUID mode);
70 void setControlEnabled(bool is_enabled);
71 void removeControl(bool keep_existing);
72 void updateCheckedButtons();
73 protected:
74 void refreshUI(bool force);
75 void updateSelectionMode(bool force);
76 void init();
77 void refreshButtonEnabled();
78 void refreshMaskWidgets();
79 void setupForOffsetCommand();
80 void setupForVertexOffsetCommand();
81 signals:
82 void controlModeSet(ModelEditController::ModelEditMode mode);
83 void requestVisibleSignal(bool visible);
84 protected slots:
85 void onSelectedSlot(Buffer<UUID> ids, bool is_selected);
86 private:
87 Buffer<DynamicPointer<MouseController>> m_mouse_controllers;
88 SnapsEditorWidget* m_snaps_widget;
89 QTModelManager* m_manager;
90 Buffer<uint04> m_key_draw_action_indices;
91 Ribbon* m_draw_type_ribbon;
92 ModelEditController::ModelEditMode m_last_command_mode;
93 SubSelectionMode m_last_selection_mode;
94 Buffer<RibbonSubGroup*> m_inverted_sections;
95 RibbonSubGroup* m_selection_sections = nullptr;
96 RibbonSubGroup* m_mask_sections = nullptr;
97 Buffer<Button*> m_mask_buttons;
98 QTResourceListener* m_enabled_listener;
99 Buffer<Buffer<Button*>> m_command_mode_buttons;
100 Buffer<Buffer<Button*>> m_grip_mode_buttons;
101 Buffer<Dictionary<UUID, Button*>> m_command_function_buttons;
102 Buffer<Button*> m_selection_mode_buttons;
103 UUID m_controller_id;
104 QTimer* m_mask_highlight_timer;
105 uint04 m_mask_highlight_request;
106 QCustomStackedWidget* m_stacked_widget;
107 ModelOffsetCommandWidget* m_offset_command_widget;
108 VertexOffsetWidget* m_vertex_offset_command_widget;
109 QCustomLabel* m_hint_label;
110 bool m_is_enabled;
111 bool m_last_inverted;
112 bool m_is_dirty;
113 };
114}
115#endif
116
#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