Krita Source Code Documentation
Loading...
Searching...
No Matches
KoPathShape::Private Class Reference

#include <KoPathShape_p.h>

Public Member Functions

void debugPath () const
 print debug information about a the points of the path
 
QRectF handleRect (const QPointF &p, qreal radius) const
 
void map (const QTransform &matrix)
 
void paintDebug (QPainter &painter)
 
 Private ()
 
 Private (const Private &rhs)
 
KoSubpathsubPath (int subpathIndex) const
 Returns subpath at given index.
 

Public Attributes

bool autoFillMarkers
 
Qt::FillRule fillRule
 
QMap< KoFlake::MarkerPosition, QExplicitlySharedDataPointer< KoMarker > > markersNew
 
KoSubpathList subpaths
 

Detailed Description

Definition at line 14 of file KoPathShape_p.h.

Constructor & Destructor Documentation

◆ Private() [1/2]

KoPathShape::Private::Private ( )
explicit

Definition at line 16 of file KoParameterShape.cpp.

17 : QSharedData()
18 , parametric(true)
19{
20}

◆ Private() [2/2]

KoPathShape::Private::Private ( const Private & rhs)
explicit

Definition at line 22 of file KoParameterShape.cpp.

23 : QSharedData()
24 , parametric(rhs.parametric)
25 , handles(rhs.handles)
26{
27}

Member Function Documentation

◆ debugPath()

void KoPathShape::Private::debugPath ( ) const

print debug information about a the points of the path

Definition at line 157 of file KoPathShape.cpp.

158{
159 KoSubpathList::const_iterator pathIt(subpaths.constBegin());
160 for (; pathIt != subpaths.constEnd(); ++pathIt) {
161 KoSubpath::const_iterator it((*pathIt)->constBegin());
162 for (; it != (*pathIt)->constEnd(); ++it) {
163 debugFlake << "p:" << (*pathIt) << "," << *it << "," << (*it)->point() << "," << (*it)->properties();
164 }
165 }
166}
#define debugFlake
Definition FlakeDebug.h:15
KoSubpathList subpaths

References debugFlake, and KoPathShape::subpaths().

◆ handleRect()

QRectF KoPathShape::Private::handleRect ( const QPointF & p,
qreal radius ) const

Definition at line 54 of file KoPathShape.cpp.

55{
56 return QRectF(p.x() - radius, p.y() - radius, 2*radius, 2*radius);
57}
const Params2D p

References p.

◆ map()

void KoPathShape::Private::map ( const QTransform & matrix)

Definition at line 505 of file KoPathShape.cpp.

506{
507 KoSubpathList::const_iterator pathIt(subpaths.constBegin());
508 for (; pathIt != subpaths.constEnd(); ++pathIt) {
509 KoSubpath::const_iterator it((*pathIt)->constBegin());
510 for (; it != (*pathIt)->constEnd(); ++it) {
511 // It's possible there are null points in the map...
512 if (*it) {
513 (*it)->map(matrix);
514 }
515 }
516 }
517}

References KoPathShape::subpaths().

◆ paintDebug()

void KoPathShape::Private::paintDebug ( QPainter & painter)

Definition at line 123 of file KoPathShape.cpp.

124{
125 KoSubpathList::const_iterator pathIt(subpaths.constBegin());
126 int i = 0;
127
128 QPen pen(Qt::black, 0);
129 painter.save();
130 painter.setPen(pen);
131 for (; pathIt != subpaths.constEnd(); ++pathIt) {
132 KoSubpath::const_iterator it((*pathIt)->constBegin());
133 for (; it != (*pathIt)->constEnd(); ++it) {
134 ++i;
135 KoPathPoint *point = (*it);
136 QRectF r(point->point(), QSizeF(5, 5));
137 r.translate(-2.5, -2.5);
138 QPen pen(Qt::black, 0);
139 painter.setPen(pen);
140 if (point->activeControlPoint1() && point->activeControlPoint2()) {
141 QBrush b(Qt::red);
142 painter.setBrush(b);
143 } else if (point->activeControlPoint1()) {
144 QBrush b(Qt::yellow);
145 painter.setBrush(b);
146 } else if (point->activeControlPoint2()) {
147 QBrush b(Qt::darkYellow);
148 painter.setBrush(b);
149 }
150 painter.drawEllipse(r);
151 }
152 }
153 painter.restore();
154 debugFlake << "nop =" << i;
155}
A KoPathPoint represents a point in a path.
QPointF point
bool activeControlPoint1
bool activeControlPoint2

References KoPathPoint::activeControlPoint1, KoPathPoint::activeControlPoint2, debugFlake, KoPathPoint::point, and subpaths.

◆ subPath()

KoSubpath * KoPathShape::Private::subPath ( int subpathIndex) const

Returns subpath at given index.

Parameters
subpathIndexthe index of the subpath to return
Returns
subPath on success, or 0 when subpathIndex is out of bounds

Definition at line 1069 of file KoPathShape.cpp.

1070{
1071 if (subpathIndex < 0 || subpathIndex >= subpaths.size())
1072 return 0;
1073
1074 return subpaths.at(subpathIndex);
1075}

References KoPathShape::subpaths().

Member Data Documentation

◆ autoFillMarkers

bool KoPathShape::Private::autoFillMarkers

Definition at line 44 of file KoPathShape_p.h.

◆ fillRule

Qt::FillRule KoPathShape::Private::fillRule

Definition at line 39 of file KoPathShape_p.h.

◆ markersNew

QMap<KoFlake::MarkerPosition, QExplicitlySharedDataPointer<KoMarker> > KoPathShape::Private::markersNew

Definition at line 43 of file KoPathShape_p.h.

◆ subpaths

KoSubpathList KoPathShape::Private::subpaths

Definition at line 41 of file KoPathShape_p.h.


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