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

#include <KoPathToolHandle.h>

+ Inheritance diagram for ParameterHandle:

Public Member Functions

QRectF boundingRect () const override
 
bool check (const QList< KoPathShape * > &selectedShapes) override
 
KoInteractionStrategyhandleMousePress (KoPointerEvent *event) override
 
void paint (QPainter &painter, const KoViewConverter &converter, qreal handleRadius, int decorationThickness) override
 
 ParameterHandle (KoPathTool *tool, KoParameterShape *parameterShape, int handleId)
 
- Public Member Functions inherited from KoPathToolHandle
 KoPathToolHandle (KoPathTool *tool)
 
virtual void trySelectHandle ()
 
virtual ~KoPathToolHandle ()
 

Protected Attributes

int m_handleId
 
KoParameterShapem_parameterShape
 
- Protected Attributes inherited from KoPathToolHandle
KoPathToolm_tool
 

Detailed Description

Definition at line 62 of file KoPathToolHandle.h.

Constructor & Destructor Documentation

◆ ParameterHandle()

ParameterHandle::ParameterHandle ( KoPathTool * tool,
KoParameterShape * parameterShape,
int handleId )

Definition at line 162 of file KoPathToolHandle.cpp.

163 : KoPathToolHandle(tool)
164 , m_parameterShape(parameterShape)
165 , m_handleId(handleId)
166{
167}
KoPathToolHandle(KoPathTool *tool)
KoParameterShape * m_parameterShape

Member Function Documentation

◆ boundingRect()

QRectF ParameterHandle::boundingRect ( ) const
overridevirtual

Implements KoPathToolHandle.

Definition at line 176 of file KoPathToolHandle.cpp.

177{
179}
QPointF handlePosition(int handleId) const
Get the handle position.
QPointF shapeToDocument(const QPointF &point) const
Transforms point from shape coordinates to document coordinates.
Definition KoShape.cpp:1201

References KoParameterShape::handlePosition(), m_handleId, m_parameterShape, and KoShape::shapeToDocument().

◆ check()

bool ParameterHandle::check ( const QList< KoPathShape * > & selectedShapes)
overridevirtual

Implements KoPathToolHandle.

Definition at line 192 of file KoPathToolHandle.cpp.

193{
194 return selectedShapes.contains(m_parameterShape);
195}

References m_parameterShape.

◆ handleMousePress()

KoInteractionStrategy * ParameterHandle::handleMousePress ( KoPointerEvent * event)
overridevirtual

Implements KoPathToolHandle.

Definition at line 181 of file KoPathToolHandle.cpp.

182{
183 if (event->button() & Qt::LeftButton) {
184 KoPathToolSelection * selection = dynamic_cast<KoPathToolSelection*>(m_tool->selection());
185 if (selection)
186 selection->clear();
188 }
189 return 0;
190}
Strategy for changing control points of parametric shapes.
KoPathTool * m_tool
Handle the selection of points.
void clear()
Clear the selection.
KoToolSelection * selection() override
Qt::MouseButton button() const
return button pressed (see QMouseEvent::button());

References KoPointerEvent::button(), KoPathToolSelection::clear(), m_handleId, m_parameterShape, KoPathToolHandle::m_tool, and KoPathTool::selection().

◆ paint()

void ParameterHandle::paint ( QPainter & painter,
const KoViewConverter & converter,
qreal handleRadius,
int decorationThickness )
overridevirtual

Implements KoPathToolHandle.

Definition at line 169 of file KoPathToolHandle.cpp.

170{
171 KisHandlePainterHelper helper = KoShape::createHandlePainterHelperView(&painter, m_parameterShape, converter, handleRadius, decorationThickness);
174}
The KisHandlePainterHelper class is a special helper for painting handles around objects....
void setHandleStyle(const KisHandleStyle &style)
static KisHandleStyle & highlightedPrimaryHandles()
void paintHandle(KisHandlePainterHelper &handlesHelper, int handleId)
Paint the given handles.
static KisHandlePainterHelper createHandlePainterHelperView(QPainter *painter, KoShape *shape, const KoViewConverter &converter, qreal handleRadius=0.0, int decorationThickness=1)
Definition KoShape.cpp:1177

References KoShape::createHandlePainterHelperView(), KisHandleStyle::highlightedPrimaryHandles(), m_handleId, m_parameterShape, KoParameterShape::paintHandle(), and KisHandlePainterHelper::setHandleStyle().

Member Data Documentation

◆ m_handleId

int ParameterHandle::m_handleId
protected

Definition at line 72 of file KoPathToolHandle.h.

◆ m_parameterShape

KoParameterShape* ParameterHandle::m_parameterShape
protected

Definition at line 71 of file KoPathToolHandle.h.


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