NDEVR
API Documentation
SnapsEditorWidget.h
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: SnapsEditorWidget
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/RibbonSubGroup.h>
34#include <NDEVR/SnapsManager.h>
35#include <NDEVR/Pointer.h>
36#include "DLLInfo.h"
37namespace NDEVR
38{
39 class Button;
44 class NDEVR_API SnapsEditorWidget : public RibbonSubGroup
45 {
46 Q_OBJECT
47 public:
53 SnapsEditorWidget(const DynamicPointer<SnapsManager>& snap_manager, QWidget* parent = nullptr);
58 void setupButton(Button* button);
60 void updateUI();
61 QSize sizeHint() const override;
62 public slots:
64 void clearAll();
66 void selectAll();
71 void updateFromUI(Button* button);
72 private:
73 Button* end_point;
74 Button* axis;
75 Button* edge_snap;
76 Button* parallel;
77 //Button*extension;
78 Button* center;
79 Button* point_snap;
80 //Button*perpendicular;
81 //Button*mid_point;
82 Button* select_all;
83 Button* clear_all;
84 QWidget* m_selection_buttons;
85 DynamicPointer<SnapsManager> m_snap_manager;
86 };
87}
A core widget that allows the user to click one of many button types.
Definition Button.h:68
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:356
RibbonSubGroup(QWidget *parent=nullptr)
Constructs a ribbon sub-group widget.
void selectAll()
Enables all snap types.
SnapsEditorWidget(const DynamicPointer< SnapsManager > &snap_manager, QWidget *parent=nullptr)
Constructs a snaps editor widget for the given snap manager.
void clearAll()
Disables all snap types.
void updateFromUI(Button *button)
Updates the snap manager from a toggled UI button.
void setupButton(Button *button)
Configures a button for snap toggle behavior.
void updateUI()
Updates all button states to reflect the current snap manager settings.
The primary namespace for the NDEVR SDK.