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{
43 {
44 Q_OBJECT
45 public:
46 DesignObjectVisibleButton(const DynamicPointer<QTDesignObject>& object, QWidget* parent = nullptr)
47 : Button(parent)
48 {
49 init();
50 setTarget(object);
51 }
52 DesignObjectVisibleButton(QWidget* parent = nullptr)
53 : Button(parent)
54 {
55 init();
56 setEnabled(false);
57 }
58 void setShowMeshVisibleToggle(bool show, bool toggled)
59 {
60 m_show_mesh_visible_toggle = show;
61 updateToggles();
62 if(m_show_mesh)
63 m_show_mesh->setChecked(toggled);
64 }
65 void setShowLineworkVisibleToggle(bool show, bool toggled)
66 {
67 m_show_linework_visible_toggle = show;
68 updateToggles();
69 if (m_show_linework)
70 m_show_linework->setChecked(toggled);
71 }
72 void setShowPointsVisibleToggle(bool show, bool toggled)
73 {
74 m_show_points_visible_toggle = show;
75 updateToggles();
76 if (m_show_points)
77 m_show_points->setChecked(toggled);
78 }
79 protected:
80 void onClicked();
81 void onTargetUpdated(UUID) override;
82 protected:
83 void updateToggles();
84 void init();
85 protected:
86
87 bool m_show_mesh_visible_toggle = false;
88 bool m_show_linework_visible_toggle = false;
89 bool m_show_points_visible_toggle = false;
90
91 Toggle* m_show_points = nullptr;
92 Toggle* m_show_linework = nullptr;
93 Toggle* m_show_mesh = nullptr;
94
95 QWidgetAction* m_show_mesh_group = nullptr;
96 QWidgetAction* m_show_linework_group = nullptr;
97 QWidgetAction* m_show_points_group = nullptr;
98 QMenu* m_menu = nullptr;
99 };
100}
#define NDEVR_API
Definition DLLInfo.h:67
Definition Button.h:60
Definition DesignObjectVisibleButton.h:43
DesignObjectVisibleButton(const DynamicPointer< QTDesignObject > &object, QWidget *parent=nullptr)
Definition DesignObjectVisibleButton.h:46
void setShowLineworkVisibleToggle(bool show, bool toggled)
Definition DesignObjectVisibleButton.h:65
void setShowMeshVisibleToggle(bool show, bool toggled)
Definition DesignObjectVisibleButton.h:58
void setShowPointsVisibleToggle(bool show, bool toggled)
Definition DesignObjectVisibleButton.h:72
DesignObjectVisibleButton(QWidget *parent=nullptr)
Definition DesignObjectVisibleButton.h:52
Definition DesignObjectWidgetInterface.h:8
Definition Pointer.hpp:303
Definition Toggle.h:45
Definition UUID.h:66
Definition ACIColor.h:37