API Documentation
Loading...
Searching...
No Matches
TilingButton.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: TilingButton
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/QTDesignObject.h>
34#include <NDEVR/Button.h>
35#include <NDEVR/QCustomLineEdit.h>
36#include <QWidgetAction>
37#include <QActionGroup>
38#include <QMenu>
39#include <QWidgetAction>
40namespace NDEVR
41{
43 {
44 Q_OBJECT
45 public:
48 , m_target(nullptr)
49 , m_combo(combo)
50 , m_animation_time(1.0)
52 , m_has_pending(false)
54 {
55 setTarget(target);
56 setup();
58 m_combo->setPopupMode(QToolButton::ToolButtonPopupMode::InstantPopup);
59 m_combo->setArrowType(Qt::ArrowType::NoArrow);
60 }
61 void setup()
62 {
63 m_menu = new QMenu();
64 {
65 m_menu->addSection("Lighting");
69 m_smooth_normals_angle->setEnabled(false);
70 m_smooth_normals_group = new QWidgetAction(m_menu);
71
72 m_smooth_normal_angle_group = new QWidgetAction(m_menu);
76 }
77 m_menu->addSection("Mesh");
78
79 m_menu->addSeparator();
80 m_no_smoothing = m_menu->addAction(tr("No Smoothing"), [this]
81 {
83 });
84
85 m_light_smoothing = m_menu->addAction(tr("Light Smoothing"), [this]
86 {
88 });
89 m_normal_smoothing = m_menu->addAction(tr("Normal Smoothing"), [this]
90 {
92 });
93
94 m_heavy_smoothing = m_menu->addAction(tr("Heavy Smoothing"), [this]
95 {
97 });
98
99 m_max_smoothing = m_menu->addAction(tr("Max Smoothing"), [this]
100 {
101 valueChanged();
102 });
103
104
105 m_menu->addSeparator();
106 m_smooth_intensity_group = new QActionGroup(this);
107
108 m_no_smoothing->setCheckable(true);
109 m_light_smoothing->setCheckable(true);
110 m_normal_smoothing->setCheckable(true);
111 m_heavy_smoothing->setCheckable(true);
112 m_max_smoothing->setCheckable(true);
113
119 m_smooth_intensity_group->setExclusive(true);
120
121 m_no_smoothing->setChecked(true);
122 }
123 void onChanged() final override
124 {
126 }
127 public slots:
129 {
131 }
133 {
134 m_target = target;
135 /*if(m_target->is<Model>())
136 {
137 Model model = m_target->getAs<Model>();
138 Buffer<Geometry> model.getMeshDescendents();
139 }*/
140 }
141 public:
142 void performSmoothing() const
143 {
144
145 }
146
147 signals:
149 protected:
151 Button* m_combo = nullptr;
155 QMenu* m_menu = nullptr;
156 QAction* m_no_smoothing = nullptr;
157 QAction* m_light_smoothing = nullptr;
158 QAction* m_normal_smoothing = nullptr;
159 QAction* m_heavy_smoothing = nullptr;
160 QAction* m_max_smoothing = nullptr;
164 QWidgetAction* m_smooth_mode_group = nullptr;
165 QWidgetAction* m_retain_size_group = nullptr;
166 QWidgetAction* m_smooth_normals_group = nullptr;
167 QWidgetAction* m_smooth_normal_angle_group = nullptr;
168 QActionGroup* m_smooth_intensity_group = nullptr;
169 };
170}
#define _tqa(var)
Definition QTTools.h:192
#define _t(english_string)
Definition Translator.h:87
Definition Button.h:60
void setMenu(QMenu *menu)
Definition Button.cpp:1526
Definition Pointer.hpp:303
Definition QCustomLineEdit.h:118
void setup(const TranslatedString &title)
Definition QCustomLineEdit.h:156
void setPlaceholderText(const QString &value)
Definition QCustomLineEdit.cpp:670
Definition QTTools.h:172
Definition QTModelManager.h:94
Definition TilingButton.h:43
QAction * m_no_smoothing
Definition TilingButton.h:156
DynamicPointer< QTDesignObject > m_target
Definition TilingButton.h:150
QAction * m_max_smoothing
Definition TilingButton.h:160
bool m_include_smooth_types
Definition TilingButton.h:163
void setup()
Definition TilingButton.h:61
QActionGroup * m_smooth_intensity_group
Definition TilingButton.h:168
QAction * m_normal_smoothing
Definition TilingButton.h:158
void performSmoothing() const
Definition TilingButton.h:142
QCustomLineEdit * m_smooth_normals_angle
Definition TilingButton.h:152
Button * m_combo
Definition TilingButton.h:151
bool m_include_retain_size
Definition TilingButton.h:161
QWidgetAction * m_smooth_mode_group
Definition TilingButton.h:164
void onChanged() final override
Definition TilingButton.h:123
void requestSettingsSignal()
QAction * m_light_smoothing
Definition TilingButton.h:157
QAction * m_heavy_smoothing
Definition TilingButton.h:159
QTModelManager * m_manager
Definition TilingButton.h:153
QMenu * m_menu
Definition TilingButton.h:155
TilingButton(const DynamicPointer< QTDesignObject > &target, Button *combo)
Definition TilingButton.h:46
TimeSpan m_animation_time
Definition TilingButton.h:154
QWidgetAction * m_smooth_normal_angle_group
Definition TilingButton.h:167
bool m_has_pending
Definition TilingButton.h:162
void valueChanged()
Definition TilingButton.h:128
QWidgetAction * m_smooth_normals_group
Definition TilingButton.h:166
void setTarget(const DynamicPointer< QTDesignObject > &target)
Definition TilingButton.h:132
QWidgetAction * m_retain_size_group
Definition TilingButton.h:165
Definition TimeSpan.h:40
Definition ACIColor.h:37