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
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);
90 void setSelectionType(const String& type);
92 void resizeEvent(QResizeEvent *event) override;
93 bool canShow(UUID id) const;
94 bool isShowing(UUID id) const;
95 bool event(QEvent* ev) override;
97 void clear();
98 void onTargetUpdated(UUID id) override;
103 virtual bool processKeyEvent(const String& id, const KeyEvent& key_event, DesignObjectLookup* lookup, Camera* camera) 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:50
The core class for assigning actions to key-presses and registering them as a program-wide service.
Definition KeyController.h:71
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
A core widget that allows the user to click one of many button types.
Definition Button.h:66
A core class where all Design Objects including models, materials, and geometries are stored....
Definition DesignObjectLookup.h:65
A class for easily showing or hiding a Model in 3D space.
Definition DesignObjectVisibleButton.h:46
A base class for interacting with one or more DesignObjects.
Definition DesignObjectWidgetInterface.h:11
A widget showing key properties of a DesignObject selection, used primarily in a SelectionWidget.
Definition DesignWidget.h:49
A hash-based key-value store, useful for quick associative lookups. Key features include:
Definition Dictionary.h:61
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:320
A widget allowing the user to select a FilterDescription and adjust its properties and execute a filt...
Definition FilteringWidget.h:16
A class which describes a user key press.
Definition Event.h:49
A dialog where the user can set a 3D orientation of an object.
Definition OrientationEditor.h:54
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
Definition QTModelManager.h:105
Represents a sub-section of "Tab" of a ribbon represting a grouping of buttons or widgets within a ta...
Definition RibbonSubGroup.h:47
Definition SelectionWidget.h:55
virtual Buffer< Button * > getButtons()=0
virtual SelectionButtonFactory * clone()=0
virtual UUID id() const =0
virtual void updateButtonStates(DesignWidget::PropertiesStruct props, const Buffer< DynamicPointer< QTDesignObject > > &selection)=0
static Dictionary< UUID, SelectionButtonFactory * > s_default_factories
Definition SelectionWidget.h:65
static void RegisterDefault(SelectionButtonFactory *factory)
static Buffer< SelectionButtonFactory * > DefaultFactories()
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
SelectionWidget(QTModelManager *manager, const String &selection_type, QWidget *parent=nullptr)
UUID m_command_id
Definition SelectionWidget.h:149
void setSelectionType(const String &type)
QTimer * m_hide_timer
Definition SelectionWidget.h:151
Time m_last_modified_time
Definition SelectionWidget.h:138
void addFactory(SelectionButtonFactory *factory)
UUID m_capture_uuid_roll
Definition SelectionWidget.h:145
void onTargetUpdatedSlot(UUID id)
void resetKeyControllerToDefaults() override
bool event(QEvent *ev) override
void resizeEvent(QResizeEvent *event) override
void onTargetUpdated(UUID id) override
UUID m_capture_uuid_pitch
Definition SelectionWidget.h:144
void setSizeMode(SizeMode mode)
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
void onSelectedSlot(Buffer< UUID > id, bool selected)
QTimer * m_update_timer
Definition SelectionWidget.h:152
bool isShowing(UUID id) const
QBoxLayout * m_layout
Definition SelectionWidget.h:150
bool canShow(UUID id) const
virtual bool processKeyEvent(const String &id, const KeyEvent &key_event, DesignObjectLookup *lookup, Camera *camera) override
void onAddedSlot(UUID id)
A widget allowing the user to select options and execute smoothing a 3D mesh.
Definition SmoothButton.h:46
The core String class for the NDEVR API.
Definition String.h:69
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
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:53