API Documentation
Loading...
Searching...
No Matches
SelectionWidget.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: SelectionWidget
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/QTDesignObject.h>
35#include <NDEVR/QTModelManager.h>
36#include <NDEVR/DesignObjectWidgetInterface.h>
37#include <NDEVR/DesignWidget.h>
38#include <NDEVR/OrientationEditor.h>
39#include <NDEVR/CommandLockObject.h>
40namespace NDEVR
41{
42 class RibbonSubGroup;
43 class QModelViewCapture;
44 class Button;
45 class SmoothButton;
46 class DesignWidget;
47 class CameraLocationCombo;
48 class FilteringWidget;
49 class DesignObjectVisibleButton;
50 class GridButton;
51 class GeoReferenceDialog;
52 class SmoothDialog;
53
55 {
56 public:
57 virtual UUID id() const = 0;
61 public:
62 static Buffer<SelectionButtonFactory*> DefaultFactories();
63 static void RegisterDefault(SelectionButtonFactory* factory);
64 protected:
66 };
74 {
75 Q_OBJECT
76
77 public:
79 {
81 , e_small_horizontal
82 , e_small_vertical
83 , e_tiny_horizontal
84 , e_tiny_vertical
85 };
86 SelectionWidget(QTModelManager* manager, const String& selection_type, QWidget *parent = nullptr);
89 void createGroup();
90 void setSelectionType(const String& type);
91 void setSizeMode(SizeMode mode);
92 void resizeEvent(QResizeEvent *event) override;
93 bool canShow(UUID id) const;
94 bool isShowing(UUID id) const;
95 bool event(QEvent* ev) override;
96 void updateSelected();
97 void clear();
98 void onTargetUpdated(UUID id) override;
99 void updateControls();
100 void onAddedSlot(UUID id);
101 void onTargetUpdatedSlot(UUID id);
102 void addFactory(SelectionButtonFactory* factory);
103 virtual bool processKeyEvent(const String& id, const KeyEvent& key_event, DesignObjectLookup* lookup, Camera* camera) override;
104 void resetKeyControllerToDefaults() override;
105 public slots:
106 void onSelectedSlot(Buffer<UUID> id, bool selected);
107 signals:
110 private:
111 void updateTitle();
112 void startClearSignalTimer();
113 void stopClearSignalTimer();
114 void startUpdateSignalTimer();
115 void stopUpdateSignalTimer();
116 protected:
120 DesignObjectVisibleButton* m_visible_button = nullptr;
121 Button* m_flip_normal_button = nullptr;
122 Button* m_delete_button = nullptr;
123 Button* m_export_button = nullptr;
124 Button* m_smooth_button = nullptr;
125 Button* m_fill_holes_button = nullptr;
126 Button* m_surface_button = nullptr;
127 Button* m_geometry_button = nullptr;
128 Button* m_wireframe_button = nullptr;
129 Button* m_two_sided_button = nullptr;
130 Button* m_gridlines_button = nullptr;
131 Button* m_register_button = nullptr;
132 Button* m_geo_reference_button = nullptr;
133 Button* m_group_explode_button = nullptr;
134
135 GridButton* m_grid_button_container = nullptr;
136 Button* m_filter_button = nullptr;
137 SmoothButton* m_smooth_logic = nullptr;
139 OrientationEditor* m_orientation_editor = nullptr;
140 DesignWidget* m_design_widget = nullptr;
141 QTModelManager* m_manager = nullptr;
142 FilteringWidget* m_filtering_widget = nullptr;
143 SmoothDialog* m_smooth_dialog = nullptr;
150 QBoxLayout* m_layout;
153 };
154}
#define NDEVR_API
Definition DLLInfo.h:67
The core class for assigning actions to key-presses and registering them as a program-wide service.
Definition KeyController.h:61
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
Definition Button.h:60
Definition DesignObjectLookup.h:61
Definition DesignObjectVisibleButton.h:43
Definition DesignObjectWidgetInterface.h:8
Definition DesignWidget.h:46
Definition Dictionary.h:48
Definition Pointer.hpp:303
Definition FilteringWidget.h:12
Definition Event.h:42
Definition OrientationEditor.h:51
Definition QTModelManager.h:94
Definition RibbonSubGroup.h:43
Definition SelectionWidget.h:55
virtual Buffer< Button * > getButtons()=0
virtual SelectionButtonFactory * clone()=0
static Dictionary< UUID, SelectionButtonFactory * > s_default_factories
Definition SelectionWidget.h:65
virtual UUID id() const =0
virtual void updateButtonStates(DesignWidget::PropertiesStruct props, const Buffer< DynamicPointer< QTDesignObject > > &selection)=0
Definition SelectionWidget.h:74
Dictionary< UUID, Buffer< Button * > > m_selection_factory_buttons
Definition SelectionWidget.h:118
UUID m_capture_uuid_yaw
Definition SelectionWidget.h:146
UUID m_command_id
Definition SelectionWidget.h:149
QTimer * m_hide_timer
Definition SelectionWidget.h:151
Time m_last_modified_time
Definition SelectionWidget.h:138
UUID m_capture_uuid_roll
Definition SelectionWidget.h:145
UUID m_capture_uuid_pitch
Definition SelectionWidget.h:144
SizeMode
Definition SelectionWidget.h:79
String m_selection_type
Definition SelectionWidget.h:148
SizeMode m_size_mode
Definition SelectionWidget.h:117
RibbonSubGroup * m_basic_commands
Definition SelectionWidget.h:147
Dictionary< UUID, SelectionButtonFactory * > m_selection_button_factories
Definition SelectionWidget.h:119
~SelectionWidget()
Definition SelectionWidget.h:87
QTimer * m_update_timer
Definition SelectionWidget.h:152
QBoxLayout * m_layout
Definition SelectionWidget.h:150
Definition SmoothButton.h:43
Definition String.h:40
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
Definition UUID.h:66
Definition ACIColor.h:37
NDEVRSelectionAction
Definition SelectionWidget.h:68
@ e_delete_selection
Definition SelectionWidget.h:70
@ e_save_selection
Definition SelectionWidget.h:69
@ e_selection_action_size
Definition SelectionWidget.h:71
Definition DesignWidget.h:50