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 156 of file KoPathShape.cpp.

157{
158 KoSubpathList::const_iterator pathIt(subpaths.constBegin());
159 for (; pathIt != subpaths.constEnd(); ++pathIt) {
160 KoSubpath::const_iterator it((*pathIt)->constBegin());
161 for (; it != (*pathIt)->constEnd(); ++it) {
162 debugFlake << "p:" << (*pathIt) << "," << *it << "," << (*it)->point() << "," << (*it)->properties();
163 }
164 }
165}
#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 53 of file KoPathShape.cpp.

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

References p.

◆ map()

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

Definition at line 493 of file KoPathShape.cpp.

494{
495 KoSubpathList::const_iterator pathIt(subpaths.constBegin());
496 for (; pathIt != subpaths.constEnd(); ++pathIt) {
497 KoSubpath::const_iterator it((*pathIt)->constBegin());
498 for (; it != (*pathIt)->constEnd(); ++it) {
499 // It's possible there are null points in the map...
500 if (*it) {
501 (*it)->map(matrix);
502 }
503 }
504 }
505}

References KoPathShape::subpaths().

◆ paintDebug()

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

Definition at line 122 of file KoPathShape.cpp.

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

1058{
1059 if (subpathIndex < 0 || subpathIndex >= subpaths.size())
1060 return 0;
1061
1062 return subpaths.at(subpathIndex);
1063}

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: