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

Strategy to rubber select points of a path shape. More...

#include <KoPathPointRubberSelectStrategy.h>

+ Inheritance diagram for KoPathPointRubberSelectStrategy:

Public Member Functions

void cancelInteraction () override
 
void finishInteraction (Qt::KeyboardModifiers modifiers) override
 
void handleMouseMove (const QPointF &p, Qt::KeyboardModifiers modifiers) override
 
 KoPathPointRubberSelectStrategy (KoPathTool *tool, const QPointF &clicked)
 
 ~KoPathPointRubberSelectStrategy () override
 
- Public Member Functions inherited from KoShapeRubberSelectStrategy
KUndo2CommandcreateCommand () override
 
void handleMouseMove (const QPointF &mouseLocation, Qt::KeyboardModifiers modifiers) override
 
 KoShapeRubberSelectStrategy (KoToolBase *tool, const QPointF &clicked, bool useSnapToGrid=false)
 
void paint (QPainter &painter, const KoViewConverter &converter) override
 
- Public Member Functions inherited from KoInteractionStrategy
 KoInteractionStrategy (KoToolBase *parent)
 constructor
 
KoToolBasetool () const
 
virtual ~KoInteractionStrategy ()
 Destructor.
 

Private Attributes

KoPathToolm_tool
 pointer to the path tool
 

Additional Inherited Members

- Protected Types inherited from KoShapeRubberSelectStrategy
enum  SelectionMode { CrossingSelection , CoveringSelection }
 
- Protected Member Functions inherited from KoShapeRubberSelectStrategy
virtual SelectionMode currentMode () const
 
 KoShapeRubberSelectStrategy (KoShapeRubberSelectStrategyPrivate &)
 constructor
 
QRectF selectedRectangle () const
 
- 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

Strategy to rubber select points of a path shape.

Definition at line 18 of file KoPathPointRubberSelectStrategy.h.

Constructor & Destructor Documentation

◆ KoPathPointRubberSelectStrategy()

KoPathPointRubberSelectStrategy::KoPathPointRubberSelectStrategy ( KoPathTool * tool,
const QPointF & clicked )

Definition at line 15 of file KoPathPointRubberSelectStrategy.cpp.

17 , m_tool(tool)
18{
19}
KoPathTool * m_tool
pointer to the path tool
KoShapeRubberSelectStrategy(KoToolBase *tool, const QPointF &clicked, bool useSnapToGrid=false)

◆ ~KoPathPointRubberSelectStrategy()

KoPathPointRubberSelectStrategy::~KoPathPointRubberSelectStrategy ( )
inlineoverride

Definition at line 22 of file KoPathPointRubberSelectStrategy.h.

22{}

Member Function Documentation

◆ cancelInteraction()

void KoPathPointRubberSelectStrategy::cancelInteraction ( )
overridevirtual

This method will undo frames based interactions by calling createCommand() and unexecuting that.

Reimplemented from KoInteractionStrategy.

Definition at line 46 of file KoPathPointRubberSelectStrategy.cpp.

47{
49
50 m_tool->canvas()->updateCanvas(d->selectedRect().normalized() |
52}
virtual void updateCanvas(const QRectF &rc)=0
QRectF decorationsRect() const override
KoCanvasBase * canvas() const
Returns the canvas the tool is working on.

References KoToolBase::canvas(), KoPathTool::decorationsRect(), m_tool, and KoCanvasBase::updateCanvas().

◆ finishInteraction()

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

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

Implements KoInteractionStrategy.

Definition at line 31 of file KoPathPointRubberSelectStrategy.cpp.

32{
34 KoPathToolSelection * selection = dynamic_cast<KoPathToolSelection*>(m_tool->selection());
35 if (!selection) {
36 return;
37 }
38
39 const QRectF oldDirtyRect = d->selectedRect().normalized() | m_tool->decorationsRect();
40 selection->selectPoints(d->selectedRect(), !(modifiers & Qt::ShiftModifier));
41 m_tool->canvas()->updateCanvas(oldDirtyRect |
42 d->selectedRect().normalized() |
44}
Handle the selection of points.
void selectPoints(const QRectF &rect, bool clearSelection)
Select points in rect.
KoToolSelection * selection() override

References KoToolBase::canvas(), KoPathTool::decorationsRect(), m_tool, KoPathTool::selection(), KoPathToolSelection::selectPoints(), and KoCanvasBase::updateCanvas().

◆ handleMouseMove()

void KoPathPointRubberSelectStrategy::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 21 of file KoPathPointRubberSelectStrategy.cpp.

22{
23 KoPathToolSelection * selection = dynamic_cast<KoPathToolSelection*>(m_tool->selection());
24 if (selection && !(modifiers & Qt::ShiftModifier)) {
25 selection->clear();
26 }
27
29}
const Params2D p
void clear()
Clear the selection.
void handleMouseMove(const QPointF &mouseLocation, Qt::KeyboardModifiers modifiers) override

References KoPathToolSelection::clear(), KoShapeRubberSelectStrategy::handleMouseMove(), m_tool, p, and KoPathTool::selection().

Member Data Documentation

◆ m_tool

KoPathTool* KoPathPointRubberSelectStrategy::m_tool
private

pointer to the path tool

Definition at line 30 of file KoPathPointRubberSelectStrategy.h.


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