API Documentation
Loading...
Searching...
No Matches
DesignObjectVisibleButton.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: DesignObjectVisibleButton
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/DesignObjectWidgetInterface.h>
35#include <NDEVR/QTDesignObject.h>
36#include <NDEVR/Button.h>
37#include <NDEVR/Toggle.h>
38#include <QWidgetAction>
39
40namespace NDEVR
41{
42 /**--------------------------------------------------------------------------------------------------
43 \brief A class for easily showing or hiding a Model in 3D space.
44 **/
46 {
47 Q_OBJECT
48 public:
49 DesignObjectVisibleButton(const DynamicPointer<QTDesignObject>& object, QWidget* parent = nullptr)
50 : Button(parent)
51 {
52 init();
53 setTarget(object);
54 }
55 DesignObjectVisibleButton(QWidget* parent = nullptr)
56 : Button(parent)
57 {
58 init();
59 setEnabled(false);
60 }
61 void setShowMeshVisibleToggle(bool show, bool toggled)
62 {
63 m_show_mesh_visible_toggle = show;
64 updateToggles();
65 if(m_show_mesh)
66 m_show_mesh->setChecked(toggled);
67 }
68 void setShowLineworkVisibleToggle(bool show, bool toggled)
69 {
70 m_show_linework_visible_toggle = show;
71 updateToggles();
72 if (m_show_linework)
73 m_show_linework->setChecked(toggled);
74 }
75 void setShowPointsVisibleToggle(bool show, bool toggled)
76 {
77 m_show_points_visible_toggle = show;
78 updateToggles();
79 if (m_show_points)
80 m_show_points->setChecked(toggled);
81 }
82 protected:
83 void onClicked();
84 void onTargetUpdated(UUID) override;
85 protected:
87 void init();
88 protected:
89
90 bool m_show_mesh_visible_toggle = false;
91 bool m_show_linework_visible_toggle = false;
92 bool m_show_points_visible_toggle = false;
93
94 Toggle* m_show_points = nullptr;
95 Toggle* m_show_linework = nullptr;
96 Toggle* m_show_mesh = nullptr;
97
98 QWidgetAction* m_show_mesh_group = nullptr;
99 QWidgetAction* m_show_linework_group = nullptr;
100 QWidgetAction* m_show_points_group = nullptr;
101 QMenu* m_menu = nullptr;
102 };
103}
#define NDEVR_API
Definition DLLInfo.h:50
A core widget that allows the user to click one of many button types.
Definition Button.h:66
A class for easily showing or hiding a Model in 3D space.
Definition DesignObjectVisibleButton.h:46
DesignObjectVisibleButton(const DynamicPointer< QTDesignObject > &object, QWidget *parent=nullptr)
Definition DesignObjectVisibleButton.h:49
void setShowLineworkVisibleToggle(bool show, bool toggled)
Definition DesignObjectVisibleButton.h:68
void onTargetUpdated(UUID) override
void setShowMeshVisibleToggle(bool show, bool toggled)
Definition DesignObjectVisibleButton.h:61
void setShowPointsVisibleToggle(bool show, bool toggled)
Definition DesignObjectVisibleButton.h:75
DesignObjectVisibleButton(QWidget *parent=nullptr)
Definition DesignObjectVisibleButton.h:55
A base class for interacting with one or more DesignObjects.
Definition DesignObjectWidgetInterface.h:11
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:320
A Button that toggles between on and off. In desktop mode this looks like a checkbox and in touch mod...
Definition Toggle.h:49
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