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/SoftwareService.h>
36#include <NDEVR/SnapsEditorWidget.h>
37#include <NDEVR/QTModelManager.h>
38#include <NDEVR/MouseController.h>
39#include <NDEVR/SelectionController.h>
40#include <NDEVR/ModelEditController.h>
41#include <QWidget>
42class QVBoxLayout;
43namespace NDEVR
44{
45 class Ribbon;
46 class Button;
47 class RibbonGroup;
48 class QTResourceListener;
49 class RibbonSubGroup;
50 class QCustomStackedWidget;
51 class ModelOffsetCommandWidget;
52 class VertexOffsetWidget;
53 /**--------------------------------------------------------------------------------------------------
54 \brief Can be used to add functionality to the ModelCammandsWidget by showing a unique widget
55 when the action is undertaken.
56 **/
57 class QtModelFunction : public ModelFunction, public SoftwareService
58 {
59 public:
60 virtual QWidget* editWidget() = 0;
61 virtual bool shouldShowInterface() const override { return true; }
62 };
63 /**--------------------------------------------------------------------------------------------------
64 \brief A widget for interfacing with ModelEditController to allow the user to edit or modify objects
65 in the 3D environment.
66 **/
67 class NDEVR_API ModelCommandsWidget : public QWidget, public SoftwareServiceManager
68 {
69 Q_OBJECT
70 public:
71 ModelCommandsWidget(QTModelManager* manager, QWidget *parent = nullptr);
72 virtual ~ModelCommandsWidget();
73 void setupCommandModeRibbon(RibbonGroup* group);
74#if NDEVR_GRIPS
75 void setupGripModeRibbon(RibbonGroup* group);
76#endif
77 void setControl(ModelEditController::ModelEditMode mode);
78 void setControl(UUID mode);
79 void setControlEnabled(bool is_enabled);
80 void removeControl(bool keep_existing);
81 void updateCheckedButtons();
82 protected:
83 void refreshUI(bool force);
84 void updateSelectionMode(bool force);
85 void init();
86 void refreshButtonEnabled();
87 void refreshMaskWidgets();
88 void setupForOffsetCommand();
89 void setupForVertexOffsetCommand();
90 signals:
91 void controlModeSet(ModelEditController::ModelEditMode mode);
92 void requestVisibleSignal(bool visible);
93 protected slots:
94 void onSelectedSlot(Buffer<UUID> ids, bool is_selected);
95 private:
96 Buffer<DynamicPointer<MouseController>> m_mouse_controllers;
97 SnapsEditorWidget* m_snaps_widget;
98 QTModelManager* m_manager;
99 Buffer<uint04> m_key_draw_action_indices;
100 Ribbon* m_draw_type_ribbon;
101 ModelEditController::ModelEditMode m_last_command_mode;
102 SubSelectionMode m_last_selection_mode;
103 Buffer<RibbonSubGroup*> m_inverted_sections;
104 RibbonSubGroup* m_selection_sections = nullptr;
105 RibbonSubGroup* m_mask_sections = nullptr;
106 Buffer<Button*> m_mask_buttons;
107 QTResourceListener* m_enabled_listener;
108 Buffer<Buffer<Button*>> m_command_mode_buttons;
109 Buffer<Buffer<Button*>> m_grip_mode_buttons;
110 Buffer<Dictionary<UUID, Button*>> m_command_function_buttons;
111 Buffer<Button*> m_selection_mode_buttons;
112 UUID m_controller_id;
113 QTimer* m_mask_highlight_timer;
114 uint04 m_mask_highlight_request;
115 QCustomStackedWidget* m_stacked_widget;
116 ModelOffsetCommandWidget* m_offset_command_widget;
117 VertexOffsetWidget* m_vertex_offset_command_widget;
118 QCustomLabel* m_hint_label;
119 bool m_is_enabled;
120 bool m_last_inverted;
121 bool m_is_dirty;
122 };
123}
124#endif
125
#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