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, KoColorDisplayRendererInterface *renderInterface) 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 63 of file KoPathToolHandle.h.

Constructor & Destructor Documentation

◆ ParameterHandle()

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

Definition at line 163 of file KoPathToolHandle.cpp.

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

Member Function Documentation

◆ boundingRect()

QRectF ParameterHandle::boundingRect ( ) const
overridevirtual

Implements KoPathToolHandle.

Definition at line 178 of file KoPathToolHandle.cpp.

179{
181}
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:1001

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

◆ check()

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

Implements KoPathToolHandle.

Definition at line 194 of file KoPathToolHandle.cpp.

195{
196 return selectedShapes.contains(m_parameterShape);
197}

References m_parameterShape.

◆ handleMousePress()

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

Implements KoPathToolHandle.

Definition at line 183 of file KoPathToolHandle.cpp.

184{
185 if (event->button() & Qt::LeftButton) {
186 KoPathToolSelection * selection = dynamic_cast<KoPathToolSelection*>(m_tool->selection());
187 if (selection)
188 selection->clear();
190 }
191 return 0;
192}
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,
KoColorDisplayRendererInterface * renderInterface )
overridevirtual

Implements KoPathToolHandle.

Definition at line 170 of file KoPathToolHandle.cpp.

171{
172 KisHandlePainterHelper helper = KoShape::createHandlePainterHelperView(&painter, m_parameterShape, converter, handleRadius, decorationThickness);
176}
The KisHandlePainterHelper class is a special helper for painting handles around objects....
void setHandleStyle(const KisHandleStyle &style)
static KisHandleStyle & highlightedPrimaryHandles(KisHandlePalette palette=KisHandlePalette())
virtual KisHandlePalette handlePaletteForDisplayColorSpace() const =0
handlePaletteForDisplayColorSpace
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:977
rgba palette[MAX_PALETTE]
Definition palette.c:35

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

Member Data Documentation

◆ m_handleId

int ParameterHandle::m_handleId
protected

Definition at line 73 of file KoPathToolHandle.h.

◆ m_parameterShape

KoParameterShape* ParameterHandle::m_parameterShape
protected

Definition at line 72 of file KoPathToolHandle.h.


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