Krita Source Code Documentation
Loading...
Searching...
No Matches
ShapeMeshGradientEditStrategy Class Reference

#include <ShapeMeshGradientEditStrategy.h>

+ Inheritance diagram for ShapeMeshGradientEditStrategy:

Classes

struct  Private
 

Public Member Functions

KUndo2CommandcreateCommand () override
 
void finishInteraction (Qt::KeyboardModifiers modifiers) override
 
void handleMouseMove (const QPointF &mouseLocation, Qt::KeyboardModifiers modifiers) override
 
 ShapeMeshGradientEditStrategy (KoToolBase *tool, KoFlake::FillVariant fillVariant, KoShape *shape, KoShapeMeshGradientHandles::Handle startHandle, const QPointF &clicked)
 
 ~ShapeMeshGradientEditStrategy ()
 
- Public Member Functions inherited from KoInteractionStrategy
virtual void cancelInteraction ()
 
 KoInteractionStrategy (KoToolBase *parent)
 constructor
 
virtual void paint (QPainter &painter, const KoViewConverter &converter)
 
KoToolBasetool () const
 
virtual ~KoInteractionStrategy ()
 Destructor.
 

Private Attributes

QScopedPointer< Privatem_d
 

Additional Inherited Members

- Protected Member Functions inherited from KoInteractionStrategy
uint decorationThickness () const
 
uint grabSensitivity () const
 Convenience function to get the global grab sensitivity.
 
uint handleRadius () const
 Convenience function to get the global handle radius.
 
 KoInteractionStrategy (KoInteractionStrategyPrivate &)
 constructor
 
- Protected Attributes inherited from KoInteractionStrategy
KoInteractionStrategyPrivated_ptr
 

Detailed Description

Definition at line 15 of file ShapeMeshGradientEditStrategy.h.

Constructor & Destructor Documentation

◆ ShapeMeshGradientEditStrategy()

ShapeMeshGradientEditStrategy::ShapeMeshGradientEditStrategy ( KoToolBase * tool,
KoFlake::FillVariant fillVariant,
KoShape * shape,
KoShapeMeshGradientHandles::Handle startHandle,
const QPointF & clicked )

Definition at line 28 of file ShapeMeshGradientEditStrategy.cpp.

34 , m_d(new Private(clicked, shape, fillVariant))
35{
36 m_d->startHandle = startHandle;
37}
KoInteractionStrategy(KoToolBase *parent)
constructor

References m_d.

◆ ~ShapeMeshGradientEditStrategy()

ShapeMeshGradientEditStrategy::~ShapeMeshGradientEditStrategy ( )

Definition at line 39 of file ShapeMeshGradientEditStrategy.cpp.

40{
41}

Member Function Documentation

◆ createCommand()

KUndo2Command * ShapeMeshGradientEditStrategy::createCommand ( )
overridevirtual

For interactions that are undo-able this method should be implemented to return such a command. Implementations should return 0 otherwise.

Returns
a command, or 0.

Implements KoInteractionStrategy.

Definition at line 54 of file ShapeMeshGradientEditStrategy.cpp.

55{
56 return m_d->intermediateCommand ?
57 new KisCommandUtils::SkipFirstRedoWrapper(m_d->intermediateCommand.take()) :
58 nullptr;
59}

References m_d.

◆ finishInteraction()

void ShapeMeshGradientEditStrategy::finishInteraction ( Qt::KeyboardModifiers modifiers)
overridevirtual

Override to make final changes to the data on the end of an interaction.

Implements KoInteractionStrategy.

Definition at line 61 of file ShapeMeshGradientEditStrategy.cpp.

62{
63 Q_UNUSED(modifiers)
64}

◆ handleMouseMove()

void ShapeMeshGradientEditStrategy::handleMouseMove ( const QPointF & mouseLocation,
Qt::KeyboardModifiers modifiers )
overridevirtual

Extending classes should implement this method to update the selectedShapes based on the new mouse position.

Parameters
mouseLocationthe new location in pt
modifiersOR-ed set of keys pressed.

Implements KoInteractionStrategy.

Definition at line 43 of file ShapeMeshGradientEditStrategy.cpp.

45{
46 Q_UNUSED(modifiers);
47
48
50 m_d->handles.moveGradientHandle(m_d->startHandle, mouseLocation),
51 m_d->intermediateCommand);
52}
void redoAndMergeIntoAccumulatingCommand(KUndo2Command *cmd, QScopedPointer< KUndo2Command > &accumulatingCommand)

References m_d, and KisCommandUtils::redoAndMergeIntoAccumulatingCommand().

Member Data Documentation

◆ m_d

QScopedPointer<Private> ShapeMeshGradientEditStrategy::m_d
private

Definition at line 33 of file ShapeMeshGradientEditStrategy.h.


The documentation for this class was generated from the following files: