19#ifndef KIS_SHEAR_VISITOR_H_
20#define KIS_SHEAR_VISITOR_H_
23#include "kis_progress_subject.h"
24#include "kis_layer_visitor.h"
25#include "kis_transform_worker.h"
26#include "kis_filter_strategy.h"
27#include "kis_undo_adapter.h"
28#include "kis_transaction.h"
29#include "kis_rotate_visitor.h"
31class KisShearVisitor :
public KisLayerVisitor {
33 KisShearVisitor(
double xshear,
double yshear, KisProgressDisplayInterface *progress)
34 : m_xshear(xshear), m_yshear(yshear), m_progress(progress), m_strategy(0), m_undo(0) {};
36 void setStrategy(KisFilterStrategy* strategy) { m_strategy = strategy; }
37 void setUndoAdapter(KisUndoAdapter* undo) { m_undo = undo; }
39 virtual bool visit(KisPaintLayer* layer) {
40 KisPaintDeviceSP dev = layer->paintDevice();
44 KisFilterStrategy* strategy = 0;
46 strategy = m_strategy;
48 strategy =
new KisMitchellFilterStrategy;
50 KisTransaction* t = 0;
52 if (m_undo && m_undo->undo())
53 t =
new KisTransaction(
"", dev.data());
60 v.visitKisPaintDevice(dev);
61 v.shear(m_xshear, m_yshear, m_progress);
63 if (m_undo && m_undo->undo())
64 m_undo->addCommand(t);
74 virtual bool visit(KisGroupLayer* layer) {
80 child = child->nextSibling();
85 virtual bool visit(KisPartLayer*) {
return true; }
86 virtual bool visit(KisAdjustmentLayer *) {
return true; }
90 KisProgressDisplayInterface* m_progress;
91 KisFilterStrategy* m_strategy;
92 KisUndoAdapter* m_undo;
virtual KisLayerSP firstChild() const
Returns the first child layer of this layer (if it supports that).
virtual void setDirty(bool propagate=true)
Overridden to call the private convertMaskToSelection.