Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_tool_brush.cc
Go to the documentation of this file.
1/*
2 * kis_tool_brush.cc - part of Krita
3 *
4 * SPDX-FileCopyrightText: 2003-2004 Boudewijn Rempt <boud@valdyas.org>
5 * SPDX-FileCopyrightText: 2015 Moritz Molch <kde@moritzmolch.de>
6 *
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
9
10#include "kis_tool_brush.h"
11#include <kis_icon.h>
12
13#include <QCheckBox>
14#include <QComboBox>
15
16#include <klocalizedstring.h>
17#include <QAction>
18#include <QLabel>
19#include <kactioncollection.h>
20
21#include <KoCanvasBase.h>
22#include <KoCanvasController.h>
23
24#include <kis_action_registry.h>
25#include "kis_cursor.h"
26#include "kis_config.h"
27#include "kis_slider_spin_box.h"
28#include "kundo2magicstring.h"
29
30#include <KisUsageLogger.h>
31#include "kis_types.h"
32#include "kis_tool.h"
33#include "kis_paintop_preset.h"
37#include "canvas/kis_canvas2.h"
38#include "KisViewManager.h"
39
40#define MAXIMUM_SMOOTHNESS_DISTANCE 1000.0 // 0..1000.0 == weight in gui
41#define MAXIMUM_MAGNETISM 1000
42
43
44void KisToolBrush::addSmoothingAction(int enumId, const QString &id)
45{
50 QAction *a = action(id);
51 connect(a, SIGNAL(triggered()), &m_signalMapper, SLOT(map()));
52 m_signalMapper.setMapping(a, enumId);
53}
54
56 : KisToolFreehand(canvas,
57 KisCursor::load("tool_freehand_cursor.xpm", 2, 2),
58 kundo2_i18n("Freehand Brush Stroke"))
59{
60 setObjectName("tool_brush");
62
63 connect(this, SIGNAL(smoothingTypeChanged()), this, SLOT(resetCursorStyle()));
64
66 addSmoothingAction(KisSmoothingOptions::SIMPLE_SMOOTHING, "set_simple_brush_smoothing");
67 addSmoothingAction(KisSmoothingOptions::WEIGHTED_SMOOTHING, "set_weighted_brush_smoothing");
68 addSmoothingAction(KisSmoothingOptions::STABILIZER, "set_stabilizer_brush_smoothing");
69 addSmoothingAction(KisSmoothingOptions::PIXEL_PERFECT, "set_pixel_perfect_smoothing");
70}
71
75
76void KisToolBrush::activate(const QSet<KoShape*> &shapes)
77{
79 connect(&m_signalMapper, SIGNAL(mapped(int)), SLOT(slotSetSmoothingType(int)), Qt::UniqueConnection);
80
81 m_configGroup = KSharedConfig::openConfig()->group(toolId());
82 optionWidgets(); // Ensure m_chkAssistant is initialized.
83 QAction *toggleaction = action("toggle_assistant");
84 connect(toggleaction, SIGNAL(triggered(bool)), m_chkAssistant, SLOT(toggle()), Qt::UniqueConnection);
85}
86
88{
89 disconnect(&m_signalMapper, 0, this, 0);
90 QAction *toggleaction = action("toggle_assistant");
91 disconnect(toggleaction, 0, m_chkAssistant, 0);
92
94}
95
97{
98 return smoothingOptions()->smoothingType();
99}
100
102{
103 return smoothingOptions()->smoothPressure();
104}
105
107{
108 return smoothingOptions()->smoothnessDistanceMin();
109}
110
112{
113 return smoothingOptions()->smoothnessDistanceMax();
114}
115
117{
118 return smoothingOptions()->tailAggressiveness();
119}
120
122{
127 if (m_cmbSmoothingType->currentIndex() != index) {
128 m_cmbSmoothingType->setCurrentIndex(index);
129 }
130
131 switch (index) {
134 m_lblSmoothnessDistanceMin->setVisible(false);
135 m_sliderSmoothnessDistanceMin->setVisible(false);
136 m_lblSmoothnessDistanceMax->setVisible(false);
137 m_sliderSmoothnessDistanceMax->setVisible(false);
138 m_distanceAspectButton->setVisible(false);
145 break;
148 m_lblSmoothnessDistanceMin->setVisible(false);
149 m_sliderSmoothnessDistanceMin->setVisible(false);
150 m_lblSmoothnessDistanceMax->setVisible(false);
151 m_sliderSmoothnessDistanceMax->setVisible(false);
152 m_distanceAspectButton->setVisible(false);
159 break;
162 m_lblSmoothnessDistanceMin->setVisible(true);
163 m_sliderSmoothnessDistanceMin->setVisible(true);
164 m_lblSmoothnessDistanceMax->setVisible(true);
165 m_sliderSmoothnessDistanceMax->setVisible(true);
166 m_distanceAspectButton->setVisible(true);
173 break;
176 m_lblSmoothnessDistanceMin->setVisible(true);
177 m_sliderSmoothnessDistanceMin->setVisible(true);
178 m_lblSmoothnessDistanceMax->setVisible(true);
179 m_sliderSmoothnessDistanceMax->setVisible(true);
180 m_distanceAspectButton->setVisible(true);
186
187 // scalable distance option is disabled due to bug 421314
189 break;
191 default:
193 m_lblSmoothnessDistanceMin->setVisible(false);
194 m_sliderSmoothnessDistanceMin->setVisible(false);
195 m_lblSmoothnessDistanceMax->setVisible(false);
196 m_sliderSmoothnessDistanceMax->setVisible(false);
197 m_distanceAspectButton->setVisible(false);
204 }
206
207 Q_EMIT smoothingTypeChanged();
208}
209
211{
212 const qreal oldValueMin = m_sliderSmoothnessDistanceMin->value();
213 const qreal oldValueMax = m_sliderSmoothnessDistanceMax->value();
214
216 m_lblSmoothnessDistanceMin->setText(i18n("Sample Count at Max Speed:"));
218 m_sliderSmoothnessDistanceMin->setSingleStep(1);
219 m_sliderSmoothnessDistanceMin->setExponentRatio(3.0); // help pick smaller values
220
221 if (!qFuzzyCompare(m_sliderSmoothnessDistanceMin->value(), oldValueMin)) {
222 // the slider will emit the change signal automatically
223 m_sliderSmoothnessDistanceMin->setValue(qRound(oldValueMin));
224 }
225
226 m_lblSmoothnessDistanceMax->setText(i18n("Sample Count at Min Speed:"));
228 m_sliderSmoothnessDistanceMax->setSingleStep(1);
229 m_sliderSmoothnessDistanceMax->setExponentRatio(3.0); // help pick smaller values
230
231 if (!qFuzzyCompare(m_sliderSmoothnessDistanceMax->value(), oldValueMax)) {
232 // the slider will emit the change signal automatically
233 m_sliderSmoothnessDistanceMax->setValue(qRound(oldValueMax));
234 }
235 } else {
236 m_lblSmoothnessDistanceMin->setText(i18n("Distance at Max Speed:"));
238 m_sliderSmoothnessDistanceMin->setSingleStep(1);
239 m_sliderSmoothnessDistanceMin->setExponentRatio(3.0); // help pick smaller values
240
241 if (!qFuzzyCompare(m_sliderSmoothnessDistanceMin->value(), oldValueMin)) {
242 // the slider will emit the change signal automatically
244 }
245
246 m_lblSmoothnessDistanceMax->setText(i18n("Distance at Min Speed:"));
248 m_sliderSmoothnessDistanceMax->setSingleStep(1);
249 m_sliderSmoothnessDistanceMax->setExponentRatio(3.0); // help pick smaller values
250
251 if (!qFuzzyCompare(m_sliderSmoothnessDistanceMax->value(), oldValueMax)) {
252 // the slider will emit the change signal automatically
254 }
255 }
256}
257
259{
260 smoothingOptions()->setSmoothnessDistanceMin(distance);
262}
263
265{
266 smoothingOptions()->setSmoothnessDistanceMax(distance);
268}
269
271{
272 smoothingOptions()->setSmoothnessDistanceKeepAspectRatio(value);
273}
274
276{
277 smoothingOptions()->setTailAggressiveness(argh_rhhrr);
279}
280
281// used with weighted smoothing
283{
284 smoothingOptions()->setSmoothPressure(value);
285}
286
288{
289 m_magnetism = expf(magnetism / (double)MAXIMUM_MAGNETISM) / expf(1.0);
290}
291
293{
294 return smoothingOptions()->useScalableDistance();
295}
296
297// used with weighted smoothing
299{
300 smoothingOptions()->setUseScalableDistance(value);
301
303}
304
306{
307 KisConfig cfg(true);
308 CursorStyle cursorStyle = cfg.newCursorStyle();
309
310 // When the stabilizer is in use, we avoid using the brush outline cursor,
311 // because it would hide the real position of the cursor to the user,
312 // yielding unexpected results.
315 cursorStyle == CURSOR_STYLE_NO_CURSOR) {
316
318 } else {
320 }
321
323}
324
325// stabilizer brush settings
327{
328 return smoothingOptions()->useDelayDistance();
329}
330
332{
333 return smoothingOptions()->delayDistance();
334}
335
337{
338 smoothingOptions()->setUseDelayDistance(value);
339 m_sliderDelayDistance->setEnabled(value);
341
343}
344
346{
347 smoothingOptions()->setDelayDistance(value);
348 Q_EMIT delayDistanceChanged();
349}
350
352{
353 smoothingOptions()->setFinishStabilizedCurve(value);
354
356}
357
359{
360 return smoothingOptions()->finishStabilizedCurve();
361}
362
364{
365 smoothingOptions()->setStabilizeSensors(value);
367}
368
370{
371 return smoothingOptions()->stabilizeSensors();
372}
373
400
402{
403 QWidget *optionsWidget = KisToolFreehand::createOptionWidget();
404 optionsWidget->setObjectName(toolId() + "option widget");
405
406 // See https://bugs.kde.org/show_bug.cgi?id=316896
407 QWidget *specialSpacer = new QWidget(optionsWidget);
408 specialSpacer->setObjectName("SpecialSpacer");
409 specialSpacer->setFixedSize(0, 0);
410 optionsWidget->layout()->addWidget(specialSpacer);
411
412 // Line smoothing configuration
413 m_cmbSmoothingType = new QComboBox(optionsWidget);
415 << i18nc("@item:inlistbox Brush Smoothing", "None")
416 << i18nc("@item:inlistbox Brush Smoothing", "Basic")
417 << i18nc("@item:inlistbox Brush Smoothing", "Weighted")
418 << i18nc("@item:inlistbox Brush Smoothing", "Stabilizer")
419 << i18nc("@item:inlistbox Brush Smoothing", "Pixel"));
420 connect(m_cmbSmoothingType, SIGNAL(currentIndexChanged(int)), this, SLOT(slotSetSmoothingType(int)));
421 addOptionWidgetOption(m_cmbSmoothingType, new QLabel(i18n("Brush Smoothing:"), optionsWidget));
422
423 // Smoothness Distance
425 m_sliderSmoothnessDistanceMin->setEnabled(true);
426 m_lblSmoothnessDistanceMin = new QLabel(optionsWidget);
427
429 m_sliderSmoothnessDistanceMax->setEnabled(true);
430 m_lblSmoothnessDistanceMax = new QLabel(optionsWidget);
431
433 // make sure that initialization of the value happens **after** we
434 // have configured the slider's range in updateSmoothnessDistanceLabel()
435 connect(m_sliderSmoothnessDistanceMin, SIGNAL(valueChanged(qreal)), SLOT(slotSetSmoothnessDistanceMin(qreal)));
436 m_sliderSmoothnessDistanceMin->setValue(smoothingOptions()->smoothnessDistanceMin());
437
438 connect(m_sliderSmoothnessDistanceMax, SIGNAL(valueChanged(qreal)), SLOT(slotSetSmoothnessDistanceMax(qreal)));
439 m_sliderSmoothnessDistanceMax->setValue(smoothingOptions()->smoothnessDistanceMax());
440
441 // Create KoAspectButton
442 m_distanceAspectButton = new KoAspectButton(optionsWidget);
443 m_distanceAspectButton->setKeepAspectRatio(smoothingOptions()->smoothnessDistanceKeepAspectRatio());
444 m_distanceAspectButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
445 m_distanceAspectButton->setMinimumSize(QSize(24, 24));
446 connect(m_distanceAspectButton, SIGNAL(keepAspectRatioChanged(bool)), SLOT(slotSetSmoothnessDistanceKeepAspectRatio(bool)));
447
448 // Add distanceLabels
449 QWidget* distanceLabelWidget = new QWidget(optionsWidget);
450 QVBoxLayout* distanceLabelLayout = new QVBoxLayout(distanceLabelWidget);
451 distanceLabelLayout->setContentsMargins(0,0,0,0);
452 distanceLabelLayout->setSpacing(5);
453 distanceLabelLayout->addWidget(m_lblSmoothnessDistanceMin);
454 distanceLabelLayout->addWidget(m_lblSmoothnessDistanceMax);
455
456 // Add distanceSliders
457 QWidget* distanceSliderWidget = new QWidget(optionsWidget);
458 QGridLayout* distanceSliderLayout = new QGridLayout(distanceSliderWidget);
459 distanceSliderLayout->setContentsMargins(0,0,0,0);
460 distanceSliderLayout->setHorizontalSpacing(0);
461 distanceSliderLayout->setVerticalSpacing(5);
462 distanceSliderLayout->addWidget(m_sliderSmoothnessDistanceMin, 0, 0, 1, 1);
463 distanceSliderLayout->addWidget(m_sliderSmoothnessDistanceMax, 1, 0, 1, 1);
464 distanceSliderLayout->addWidget(m_distanceAspectButton, 0, 1, 2, 1);
465
466 addOptionWidgetOption(distanceSliderWidget, distanceLabelWidget);
467
468 KisAspectRatioLocker *distanceAspectLocker = new KisAspectRatioLocker(this);
470
471 // Finish stabilizer curve
472 m_chkFinishStabilizedCurve = new QCheckBox(optionsWidget);
473 connect(m_chkFinishStabilizedCurve, SIGNAL(toggled(bool)), this, SLOT(setFinishStabilizedCurve(bool)));
475 m_chkFinishStabilizedCurve->setMinimumHeight(m_cmbSmoothingType->sizeHint().height()-3);
476
477 // Delay Distance for Stabilizer
478 QWidget* delayWidget = new QWidget(optionsWidget);
479 QHBoxLayout* delayLayout = new QHBoxLayout(delayWidget);
480 delayLayout->setContentsMargins(0,0,0,0);
481 delayLayout->setSpacing(1);
482 QLabel* delayLabel = new QLabel(i18n("Delay:"), optionsWidget);
483 delayLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
484 delayLayout->addWidget(delayLabel);
485 m_chkDelayDistance = new QCheckBox(optionsWidget);
486 m_chkDelayDistance->setLayoutDirection(Qt::RightToLeft);
487 delayWidget->setToolTip(i18n("Delay the brush stroke to make the line smoother"));
488 connect(m_chkDelayDistance, SIGNAL(toggled(bool)), this, SLOT(setUseDelayDistance(bool)));
489 delayLayout->addWidget(m_chkDelayDistance);
491 m_sliderDelayDistance->setToolTip(i18n("Radius where the brush is blocked"));
493 m_sliderDelayDistance->setExponentRatio(3.0); // help pick smaller values
494 m_sliderDelayDistance->setSuffix(i18n(" px"));
495 connect(m_sliderDelayDistance, SIGNAL(valueChanged(qreal)), SLOT(setDelayDistance(qreal)));
496
498 addOptionWidgetOption(m_chkFinishStabilizedCurve, new QLabel(i18n("Finish line:"), optionsWidget));
499
502 // if the state is not flipped, then the previous line doesn't generate any signals
504
505 // Stabilize sensors
506 m_chkStabilizeSensors = new QCheckBox(optionsWidget);
507 connect(m_chkStabilizeSensors, SIGNAL(toggled(bool)), this, SLOT(setStabilizeSensors(bool)));
509 m_chkStabilizeSensors->setMinimumHeight(m_cmbSmoothingType->sizeHint().height()-3);
510 addOptionWidgetOption(m_chkStabilizeSensors, new QLabel(i18n("Stabilize Sensors:"), optionsWidget));
511
514 m_sliderTailAggressiveness->setSingleStep(0.01);
515 m_sliderTailAggressiveness->setEnabled(true);
516 connect(m_sliderTailAggressiveness, SIGNAL(valueChanged(qreal)), SLOT(slotSetTailAggressiveness(qreal)));
517 m_sliderTailAggressiveness->setValue(smoothingOptions()->tailAggressiveness());
518 addOptionWidgetOption(m_sliderTailAggressiveness, new QLabel(i18n("Stroke Ending:"), optionsWidget));
519
520 m_chkSmoothPressure = new QCheckBox(optionsWidget);
521 m_chkSmoothPressure->setMinimumHeight(m_cmbSmoothingType->sizeHint().height()-3);
523 connect(m_chkSmoothPressure, SIGNAL(toggled(bool)), this, SLOT(setSmoothPressure(bool)));
524 addOptionWidgetOption(m_chkSmoothPressure, new QLabel(QString("%1:").arg(i18n("Smooth Pressure")), optionsWidget));
525
526 m_chkUseScalableDistance = new QCheckBox(optionsWidget);
528 m_chkUseScalableDistance->setMinimumHeight(m_cmbSmoothingType->sizeHint().height()-3);
529 m_chkUseScalableDistance->setToolTip(i18nc("@info:tooltip",
530 "Scalable distance takes zoom level "
531 "into account and makes the distance "
532 "be visually constant whatever zoom "
533 "level is chosen"));
534 connect(m_chkUseScalableDistance, SIGNAL(toggled(bool)), this, SLOT(setUseScalableDistance(bool)));
535 addOptionWidgetOption(m_chkUseScalableDistance, new QLabel(QString("%1:").arg(i18n("Scalable Distance")), optionsWidget));
536
537 // add a line spacer so we know that the next set of options are for different settings
538 QFrame* line = new QFrame(optionsWidget);
539 line->setObjectName(QString::fromUtf8("line"));
540 line->setFrameStyle(QFrame::HLine | QFrame::Sunken);
542
543 // Drawing assistant configuration
544 QWidget* assistantWidget = new QWidget(optionsWidget);
545 QGridLayout* assistantLayout = new QGridLayout(assistantWidget);
546 assistantLayout->setContentsMargins(10,0,0,0);
547 assistantLayout->setSpacing(5);
548
549 m_chkAssistant = new QCheckBox(optionsWidget);
550 m_chkAssistant->setText(i18n("Snap to Assistants"));
551
552 assistantWidget->setToolTip(i18n("You need to add Assistants before this tool will work."));
553 connect(m_chkAssistant, SIGNAL(toggled(bool)), this, SLOT(setAssistant(bool)));
554 addOptionWidgetOption(assistantWidget, m_chkAssistant);
555
556 m_sliderMagnetism = new KisSliderSpinBox(optionsWidget);
557 m_sliderMagnetism->setToolTip(i18n("Assistant Magnetism"));
559
561 connect(m_sliderMagnetism, SIGNAL(valueChanged(int)), SLOT(slotSetMagnetism(int)));
562
563 QLabel* magnetismLabel = new QLabel(i18n("Magnetism:"), optionsWidget);
565
566 QLabel* snapSingleLabel = new QLabel(i18n("Snap to Single Line"), optionsWidget);
567
568 m_chkOnlyOneAssistant = new QCheckBox(optionsWidget);
569 m_chkOnlyOneAssistant->setToolTip(i18nc("@info:tooltip","Make it only snap to a single assistant line, prevents snapping mess while using the infinite assistants."));
570 m_chkOnlyOneAssistant->setCheckState(Qt::Checked); // turn on by default.
571 connect(m_chkOnlyOneAssistant, SIGNAL(toggled(bool)), this, SLOT(setOnlyOneAssistantSnap(bool)));
573
574 QLabel* snapEraserLabel = new QLabel(i18n("Snap Eraser"), optionsWidget);
575
576 m_chkSnapEraser = new QCheckBox(optionsWidget);
577 m_chkSnapEraser->setToolTip(i18nc("@info:tooltip","Enable snapping when using erasers"));
578 m_chkSnapEraser->setCheckState(Qt::Unchecked); // turn off by default.
579 connect(m_chkSnapEraser, SIGNAL(toggled(bool)), this, SLOT(setSnapEraser(bool)));
580 addOptionWidgetOption(m_chkSnapEraser, snapEraserLabel);
581
582 // set the assistant snapping options to hidden by default and toggle their visibility based off snapping checkbox
583 m_sliderMagnetism->setVisible(false);
584 m_chkOnlyOneAssistant->setVisible(false);
585 m_chkSnapEraser->setVisible(false);
586 magnetismLabel->setVisible(false);
587 snapSingleLabel->setVisible(false);
588 snapEraserLabel->setVisible(false);
589
590 connect(m_chkAssistant, SIGNAL(toggled(bool)), m_sliderMagnetism, SLOT(setVisible(bool)));
591 connect(m_chkAssistant, SIGNAL(toggled(bool)), m_chkOnlyOneAssistant, SLOT(setVisible(bool)));
592 connect(m_chkAssistant, SIGNAL(toggled(bool)), m_chkSnapEraser, SLOT(setVisible(bool)));
593 connect(m_chkAssistant, SIGNAL(toggled(bool)), magnetismLabel, SLOT(setVisible(bool)));
594 connect(m_chkAssistant, SIGNAL(toggled(bool)), snapSingleLabel, SLOT(setVisible(bool)));
595 connect(m_chkAssistant, SIGNAL(toggled(bool)), snapEraserLabel, SLOT(setVisible(bool)));
596
597 KisConfig cfg(true);
598
600
601 return optionsWidget;
602}
603
605{
607
609
610 actions << actionRegistry->makeQAction("set_no_brush_smoothing", this);
611 actions << actionRegistry->makeQAction("set_simple_brush_smoothing", this);
612 actions << actionRegistry->makeQAction("set_weighted_brush_smoothing", this);
613 actions << actionRegistry->makeQAction("set_stabilizer_brush_smoothing", this);
614 actions << actionRegistry->makeQAction("set_pixel_perfect_smoothing", this);
615 actions << actionRegistry->makeQAction("toggle_assistant", this);
616
617 return actions;
618
619}
float value(const T *src, size_t ch)
QList< QString > QStringList
qreal distance(const QPointF &p1, const QPointF &p2)
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
QAction * makeQAction(const QString &name, QObject *parent=0)
static KisActionRegistry * instance()
void connectSpinBoxes(SpinBoxType *spinOne, SpinBoxType *spinTwo, KoAspectButton *aspectButton)
int lineSmoothingType(bool defaultValue=false) const
CursorStyle newCursorStyle(bool defaultValue=false) const
static QCursor roundCursor()
Definition kis_cursor.cc:39
This class is a spinbox in which you can click and drag to set the value. A slider like bar is displa...
void setValue(qreal newValue)
void setRange(qreal newMinimum, qreal newMaximum, int newNumberOfDecimals=0, bool computeNewFastSliderStep=true)
Set the minimum and the maximum values of the range.
void setExponentRatio(qreal newExponentRatio)
void setMapping(QObject *sender, int id)
This class is a spinbox in which you can click and drag to set the value. A slider like bar is displa...
void setValue(int newValue)
void setRange(int newMinimum, int newMaximum, bool computeNewFastSliderStep=true)
Set the minimum and the maximum values of the range, computing a new "fast slider step" based on the ...
QList< QAction * > createActionsImpl() override
createActionsImpl should be reimplemented if the tool needs any actions. The actions should have a va...
KisSignalMapper m_signalMapper
void addSmoothingAction(int enumId, const QString &id)
void smoothnessQualityChanged()
void resetCursorStyle() override
KConfigGroup m_configGroup
void slotSetSmoothnessDistanceKeepAspectRatio(bool value)
QCheckBox * m_chkSnapEraser
bool finishStabilizedCurve
void setUseDelayDistance(bool value)
void stabilizeSensorsChanged()
KisDoubleSliderSpinBox * m_sliderTailAggressiveness
void finishStabilizedCurveChanged()
void setDelayDistance(qreal value)
KisToolBrush(KoCanvasBase *canvas)
QCheckBox * m_chkDelayDistance
QCheckBox * m_chkOnlyOneAssistant
QComboBox * m_cmbSmoothingType
void updateSmoothnessDistanceLabel()
void updateSettingsViews() override
void setStabilizeSensors(bool value)
void smoothnessFactorChanged()
void slotSetMagnetism(int magnetism)
void smoothPressureChanged()
KisDoubleSliderSpinBox * m_sliderSmoothnessDistanceMin
QLabel * m_lblSmoothnessDistanceMin
void useDelayDistanceChanged()
QCheckBox * m_chkSmoothPressure
qreal smoothnessFactor
void useScalableDistanceChanged()
~KisToolBrush() override
void setSmoothPressure(bool value)
void setFinishStabilizedCurve(bool value)
void slotSetSmoothingType(int index)
bool useScalableDistance
void slotSetTailAggressiveness(qreal argh_rhhrr)
void delayDistanceChanged()
QCheckBox * m_chkAssistant
QCheckBox * m_chkUseScalableDistance
void activate(const QSet< KoShape * > &shapes) override
KoAspectButton * m_distanceAspectButton
QCheckBox * m_chkFinishStabilizedCurve
void deactivate() override
KisSliderSpinBox * m_sliderMagnetism
void slotSetSmoothnessDistanceMax(qreal distance)
QCheckBox * m_chkStabilizeSensors
void setUseScalableDistance(bool value)
KisDoubleSliderSpinBox * m_sliderSmoothnessDistanceMax
void slotSetSmoothnessDistanceMin(qreal distance)
QWidget * createOptionWidget() override
void smoothingTypeChanged()
QLabel * m_lblSmoothnessDistanceMax
KisDoubleSliderSpinBox * m_sliderDelayDistance
void setSnapEraser(bool assistant)
void deactivate() override
void activate(const QSet< KoShape * > &shapes) override
void setOnlyOneAssistantSnap(bool assistant)
void setAssistant(bool assistant)
KisSmoothingOptionsSP smoothingOptions() const
void resetCursorStyle() override
QList< QAction * > createActionsImpl() override
createActionsImpl should be reimplemented if the tool needs any actions. The actions should have a va...
void enableControl(QWidget *control, bool value)
virtual void addOptionWidgetOption(QWidget *control, QWidget *label=nullptr)
Add a widget and a label to the current option widget layout.
void showControl(QWidget *control, bool value)
void setKeepAspectRatio(bool keep)
Q_INVOKABLE QString toolId() const
virtual QWidget * createOptionWidget()
void setIsOpacityPresetMode(bool value)
void useCursor(const QCursor &cursor)
QAction * action(const QString &name) const
QList< QPointer< QWidget > > optionWidgets()
static bool qFuzzyCompare(half p1, half p2)
CursorStyle
Definition kis_global.h:62
@ CURSOR_STYLE_NO_CURSOR
Definition kis_global.h:63
#define MAXIMUM_SMOOTHNESS_DISTANCE
#define MAXIMUM_MAGNETISM
KUndo2MagicString kundo2_i18n(const char *text)
virtual void updateSettingsViews()
Definition kis_tool.cc:168
bool overrideCursorIfNotEditable()
Override the cursor appropriately if current node is not editable.
Definition kis_tool.cc:618