Krita Source Code Documentation
Loading...
Searching...
No Matches
transform_stroke_strategy.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2013 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef __TRANSFORM_STROKE_STRATEGY_H
8#define __TRANSFORM_STROKE_STRATEGY_H
9
10#include <QObject>
11#include <QMutex>
12#include <KoUpdater.h>
14#include <kis_types.h>
15#include "tool_transform_args.h"
17#include <kritatooltransform_export.h>
18#include <boost/optional.hpp>
20
25
26
28{
29 Q_OBJECT
30public:
38
39
41 public:
46
47 public:
48 TransformData(Destination _destination, const ToolTransformArgs &_config, KisNodeSP _node)
50 destination(_destination),
51 config(_config),
52 node(_node)
53 {
54 }
55
59 };
60
70
72 public:
77 };
78
80 public:
84 };
85
86public:
88 const QString &filterId,
89 bool forceReset,
90 KisNodeList rootNodes,
91 KisSelectionSP selection,
93
94 ~TransformStrokeStrategy() override;
95
96 void initStrokeCallback() override;
97 void finishStrokeCallback() override;
98 void cancelStrokeCallback() override;
99 void doStrokeCallback(KisStrokeJobData *data) override;
100
101Q_SIGNALS:
104 void sigConvexHullCalculated(QPolygon convexHull, void *cookie);
105
106protected:
107 void postProcessToplevelCommand(KUndo2Command *command) override;
108
109private:
111
112 void clearSelection(KisPaintDeviceSP device);
113
114 bool checkBelongsToSelection(KisPaintDeviceSP device) const;
115
117
121
122 void finishStrokeImpl(bool applyTransform,
123 const ToolTransformArgs &args);
124
125 QPolygon calculateConvexHull();
126
127private:
130 bool m_updatesDisabled = false;
132 QString m_filterId;
134
136
138 QHash<KisPaintDevice*, KisPaintDeviceSP> m_devicesCacheHash;
139
141
143 boost::optional<ToolTransformArgs> m_savedTransformArgs;
151
154
157};
158
159#endif /* __TRANSFORM_STROKE_STRATEGY_H */
TransformData(Destination _destination, const ToolTransformArgs &_config, KisNodeSP _node)
TransformStrokeStrategy(ToolTransformArgs::TransformMode mode, const QString &filterId, bool forceReset, KisNodeList rootNodes, KisSelectionSP selection, KisStrokeUndoFacade *undoFacade, KisUpdatesFacade *updatesFacade)
const KisSavedMacroCommand * m_overriddenCommand
void postProcessToplevelCommand(KUndo2Command *command) override
Applies some modifications (e.g. assigning extra data) to the toplevel command.
QVector< KisDecoratedNodeInterface * > m_disabledDecoratedNodes
void sigTransactionGenerated(TransformTransactionProperties transaction, ToolTransformArgs args, void *cookie)
QHash< KisPaintDevice *, KisPaintDeviceSP > m_devicesCacheHash
KoUpdaterPtr fetchUpdater(KisNodeSP node)
void sigPreviewDeviceReady(KisPaintDeviceSP device)
void doStrokeCallback(KisStrokeJobData *data) override
KisPaintDeviceSP getDeviceCache(KisPaintDeviceSP src)
boost::optional< ToolTransformArgs > m_savedTransformArgs
void sigConvexHullCalculated(QPolygon convexHull, void *cookie)
KisPaintDeviceSP createDeviceCache(KisPaintDeviceSP src)
void clearSelection(KisPaintDeviceSP device)
bool checkBelongsToSelection(KisPaintDeviceSP device) const
bool haveDeviceInCache(KisPaintDeviceSP src)
void finishStrokeImpl(bool applyTransform, const ToolTransformArgs &args)
void putDeviceCache(KisPaintDeviceSP src, KisPaintDeviceSP cache)
QList< KisSelectionMaskSP > m_deactivatedOverlaySelectionMasks
QList< KisNodeSP > m_hiddenProjectionLeaves
ToolTransformArgs::TransformMode m_mode
QVector< const KUndo2Command * > m_skippedWhileMergeCommands
QList< KisSelectionSP > m_deactivatedSelections
TransformAllData(const ToolTransformArgs &_config)