NDEVR
API Documentation
GeometrySurfacingWidget.h
1#pragma once
2#include "DLLInfo.h"
3#include "NDEVR/Headers/SelectionWidget.h"
4#include "NDEVR/Headers/ModelCommandsWidget.h"
5#include "NDEVR/Headers/DesignObjectWidgetInterface.h"
6namespace Ui
7{
8 class GeometrySurfacingUI;
9}
10namespace NDEVR
11{
12 class SurfacingDescription;
13 class QCustomLineEdit;
17 class GeometrySurfacingWidget : public QWidget, public DesignObjectWidgetInterface
18 {
19 Q_OBJECT
20 public:
23 GeometrySurfacingWidget(QWidget* parent = nullptr);
28 QSize sizeHint() const override;
34 void executeSurfacing(UUID target);
40 bool event(QEvent* event) override;
44 signals:
49 protected slots:
54 protected:
58 QWidget* createWidget(SurfacingDescription* description_ptr);
61 void onTargetUpdated(UUID) override;
62 protected:
64 Ui::GeometrySurfacingUI* ui;
65 UUID m_preview_surface = Constant<UUID>::Invalid;
66 };
67
72 {
73 public:
81 virtual TranslatedString group() const override;
84 virtual TranslatedString hint() const override;
87 virtual TranslatedString expandedHint() const override;
93 virtual bool processKeyEvent(const KeyEvent& event, DesignObjectLookup* lookup, Camera* camera) override;
97 virtual bool selectionModeAllowed(const SubSelectionMode& mode) const override;
100 virtual void refreshState(ModelEditController& controller) override;
103 virtual SubSelectionMode defaultSelectionMode() const override;
106 virtual void setupFilters(SelectionController* controller) override;
109 virtual void onSelect(const Buffer<UUID>& selection) override;
112 virtual bool isSelecting() const override;
114 virtual void onCancel() override;
117 virtual QWidget* editWidget() override;
118 protected:
121 };
122
127 {
128 public:
131 virtual UUID id() const final override;
136 virtual Buffer<Button*> getButtons(DesignWidget::PropertiesStruct props, const Buffer<DynamicPointer<QTDesignObject>>& selection) final override;
140 virtual void updateButtonStates(DesignWidget::PropertiesStruct props, const Buffer<DynamicPointer<QTDesignObject>>& selection) final override;
143 virtual SurfaceSelectionButtonFactory* clone() final override;
144 protected:
146 Button* m_button = nullptr;
148 };
149}
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
A core widget that allows the user to click one of many button types.
Definition Button.h:68
A core object representing a user view as well as convenience functions for moving this view through ...
Definition Camera.h:95
A core class where all Design Objects including models, materials, and geometries are stored.
A widget showing key properties of a DesignObject selection, used primarily in a SelectionWidget.
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:356
virtual TranslatedString expandedHint() const override
Returns an expanded hint description.
virtual bool isSelecting() const override
Returns whether the tool is currently in selection mode.
virtual bool selectionModeAllowed(const SubSelectionMode &mode) const override
Checks whether the given sub-selection mode is allowed.
virtual void onSelect(const Buffer< UUID > &selection) override
Called when a selection is made.
virtual void refreshState(ModelEditController &controller) override
Refreshes the tool state based on the current edit controller.
virtual TranslatedString hint() const override
Returns a short hint description.
virtual void setupFilters(SelectionController *controller) override
Configures selection filters for the surfacing tool.
virtual void onCancel() override
Cancels the current surfacing operation.
virtual ~GeometrySurfacingFunction()
Destroys the GeometrySurfacingFunction.
virtual bool processKeyEvent(const KeyEvent &event, DesignObjectLookup *lookup, Camera *camera) override
Processes a keyboard event during surfacing mode.
virtual SubSelectionMode defaultSelectionMode() const override
Returns the default sub-selection mode for this function.
GeometrySurfacingWidget * m_widget
The surfacing configuration widget.
QTModelManager * m_manager
The application model manager.
GeometrySurfacingFunction(QTModelManager *manager)
Constructs a GeometrySurfacingFunction.
virtual QWidget * editWidget() override
Returns the editing widget for this function.
virtual TranslatedString group() const override
Returns the function group name.
A widget that provides a UI for configuring and executing geometry surfacing operations on point clou...
void updateUIFromAvailableFilters()
Updates the UI controls based on available surfacing filter engines.
UUID m_preview_surface
The UUID of the current preview surface model.
QWidget * createWidget(SurfacingDescription *description_ptr)
Creates the UI widget for a specific surfacing description.
Ui::GeometrySurfacingUI * ui
The auto-generated UI form.
void executeSurfacing(UUID target)
Executes the surfacing operation on the specified target.
QSize sizeHint() const override
Returns the preferred size hint for this widget.
void setToDefaults()
Resets all surfacing parameters to their defaults.
bool event(QEvent *event) override
Handles widget events.
static uint04 AvailableSurfacingEngines()
Returns the number of available surfacing engines.
void executeFilters()
Executes the currently configured surfacing filters.
void finishedSignal()
Emitted when the surfacing operation is finished.
GeometrySurfacingWidget(QWidget *parent=nullptr)
Constructs a GeometrySurfacingWidget.
void generatePreview()
Generates a preview of the surfacing result.
void onTargetUpdated(UUID) override
Called when the target model selection changes.
void aboutToPerformSurfacingSignal()
Emitted just before a surfacing operation begins.
UUID setupPreviewSurface()
Sets up and returns the UUID of the preview surface model.
Buffer< SurfacingDescription * > m_available_filters
Available surfacing filter engines.
Describes a user key press event used to trigger behavior in the NDEVR API.
Definition Event.h:49
Takes user input in order to modify a model in real-time.
A line edit allows users to enter and edit a single line of plain text with useful editing functions,...
A pointer to a DesignObject within a QTModelManager that receives and emits update signals based on t...
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
Can be used to add functionality to the ModelCommandsWidget by showing a unique widget when the actio...
A factory for creating custom buttons that appear when objects are selected.
Allows user to select data in a DesignObjectLookup.
A SelectionButtonFactory that creates surfacing action buttons in the selection context menu.
virtual Buffer< Button * > getButtons(DesignWidget::PropertiesStruct props, const Buffer< DynamicPointer< QTDesignObject > > &selection) final override
Creates the surfacing buttons for the current selection.
virtual SurfaceSelectionButtonFactory * clone() final override
Creates a clone of this factory.
virtual void updateButtonStates(DesignWidget::PropertiesStruct props, const Buffer< DynamicPointer< QTDesignObject > > &selection) final override
Updates the enabled/visible states of surfacing buttons.
Buffer< DynamicPointer< QTDesignObject > > m_selection
The current design object selection.
Button * m_button
The surfacing action button.
virtual UUID id() const final override
Returns the unique identifier for this factory.
GeometrySurfacingWidget * m_widget
The surfacing widget shown when button is clicked.
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:61
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
SubSelectionMode
Defines the mode of sub-selection used by the SelectionController.