API Documentation
Loading...
Searching...
No Matches
DrawCommandsWidget.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
35#include <NDEVR/MouseController.h>
36#include <NDEVR/GeometryMaker.h>
37#include <QWidget>
38#include <QPointer>
39namespace Ui
40{
41 class DrawTool;
42}
43namespace NDEVR
44{
45 class Ribbon;
46 class Button;
47 class DesignWidget;
48 class RibbonGroup;
49 class Editor;
50 class QTResourceListener;
51 /**--------------------------------------------------------------------------------------------------
52 \brief A widget for interfacing with GeometryMaker to allow the user to draw 3D objects or shapes
53 **/
54 class NDEVR_API DrawCommandsWidget : public QWidget
55 {
56 Q_OBJECT
57 public:
58 DrawCommandsWidget(QTModelManager* manager, QWidget *parent = nullptr);
59 ~DrawCommandsWidget();
60 void setupRibbonStep(RibbonGroup* group);
61 void setupRibbon(RibbonGroup* group, bool add_2D, bool add_3D);
62 void setControl(GeometryMaker::GeometryCreateMode mode);
63 void setControlEnabled(bool enabled);
64 void removeControl(bool keep_existing);
65 void hideEvent(QHideEvent *event) override;
66 void showLocalRibbon(bool show_ribbon);
67 GeometryMaker::GeometryCreateMode mode() const;
68 void addCustomDrawWidget(GeometryMaker::GeometryCreateMode create_mode, Editor* widget);
69 void removeCustomDrawWidget(GeometryMaker::GeometryCreateMode create_mode);
70 protected:
71 void refreshUI(bool force);
72 void updateSnapIcon();
73 String specIcon(GeometryMaker::GeometrySpecMode spec);
74 TranslatedString specText(GeometryMaker::GeometrySpecMode spec);
75 void updateSpecificContainer();
76 signals:
77 bool requestVisibleSignal(bool visible);
78 void controlModeSet(GeometryMaker::GeometryCreateMode mode);
79 protected slots:
80 void onSelectedSlot(Buffer<UUID> ids, bool is_selected);
81 void onDeletedSlot(UUID id);
82 void setStep(uint04 step, GeometryMaker::GeometrySpecMode mode);
83 public:
84 Resource<Model*> root_model;
85 protected:
86 void setupRibbon();
87 void setupRibbonSteps(RibbonGroup* group);
88 void setupRibbon2D(uint04 index, RibbonGroup* group);
89 void setupRibbon3D(uint04 index, RibbonGroup* group);
90 private:
91 Dictionary<GeometryMaker::GeometryCreateMode, QPointer<Editor>> m_custom_draw_widgets;
92 Buffer<DynamicPointer<MouseController>> m_mouse_controllers;
93 GeometryMaker m_geometry_controller;
94 QTModelManager* m_manager;
95 DesignWidget* m_design_widget;
96 Buffer<uint04> m_key_draw_action_indices;
97 Ui::DrawTool* ui;
98 Ribbon* m_draw_type_ribbon;
99
100 Buffer<Buffer<Button*>> m_mode_buttons;
101 Buffer<Buffer<Button*>> m_step_buttons;
102 Buffer<Buffer<Buffer<QAction*>>> m_step_actions;
103 QTResourceListener* m_enabled_listener;
104 uint04 m_last_step;
105 uint04 m_last_step_count;
106 GeometryMaker::GeometryCreateMode m_last_mode;
107 UUID m_controller_id;
108 Buffer<Button*> m_finished_buttons;
109 Buffer<Button*> m_clear_buttons;
110 //Buffer<Button*> m_lock_movement_buttons;
111 bool m_is_enabled;
112 bool m_measurement_mode;
113 };
114}
115#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