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

Public Member Functions

void copyPath (KoPathShape *destination, KoPathShape *source)
 
void initialize ()
 
 ~KoParameterToPathCommandPrivate ()
 

Public Attributes

QList< KoPathShape * > copies
 
QList< KoParameterShape * > shapes
 

Detailed Description

Definition at line 13 of file KoParameterToPathCommand.cpp.

Constructor & Destructor Documentation

◆ ~KoParameterToPathCommandPrivate()

KoParameterToPathCommandPrivate::~KoParameterToPathCommandPrivate ( )
inline

Definition at line 16 of file KoParameterToPathCommand.cpp.

16 {
17 qDeleteAll(copies);
18 }

References copies.

Member Function Documentation

◆ copyPath()

void KoParameterToPathCommandPrivate::copyPath ( KoPathShape * destination,
KoPathShape * source )

Definition at line 80 of file KoParameterToPathCommand.cpp.

81{
82 destination->clear();
83
84 int subpathCount = source->subpathCount();
85 for (int subpathIndex = 0; subpathIndex < subpathCount; ++subpathIndex) {
86 int pointCount = source->subpathPointCount(subpathIndex);
87 if (! pointCount)
88 continue;
89
90 KoSubpath * subpath = new KoSubpath;
91 for (int pointIndex = 0; pointIndex < pointCount; ++pointIndex) {
92 KoPathPoint * p = source->pointByIndex(KoPathPointIndex(subpathIndex, pointIndex));
93 KoPathPoint * c = new KoPathPoint(*p, destination);
94 subpath->append(c);
95 }
96 destination->addSubpath(subpath, subpathIndex);
97 }
98 destination->setTransformation(source->transformation());
99}
const Params2D p
KisMagneticGraph::vertex_descriptor source(typename KisMagneticGraph::edge_descriptor e, KisMagneticGraph g)
QList< KoPathPoint * > KoSubpath
a KoSubpath contains a path from a moveTo until a close or a new moveTo
Definition KoPathShape.h:31
QPair< int, int > KoPathPointIndex
Definition KoPathShape.h:28
A KoPathPoint represents a point in a path.
bool addSubpath(KoSubpath *subpath, int subpathIndex)
Adds a subpath at the given index to the path.
void clear()
Removes all subpaths and their points from the path.
void setTransformation(const QTransform &matrix)
Definition KoShape.cpp:417

References KoPathShape::addSubpath(), KoPathShape::clear(), p, KoShape::setTransformation(), and source().

◆ initialize()

void KoParameterToPathCommandPrivate::initialize ( )

Definition at line 71 of file KoParameterToPathCommand.cpp.

72{
73 Q_FOREACH (KoParameterShape *shape, shapes) {
74 KoPathShape *p = new KoPathShape();
75 copyPath(p, shape);
76 copies.append(p);
77 }
78}
void copyPath(KoPathShape *destination, KoPathShape *source)
The position of a path point within a path shape.
Definition KoPathShape.h:63

References copies, copyPath(), p, and shapes.

Member Data Documentation

◆ copies

QList<KoPathShape*> KoParameterToPathCommandPrivate::copies

Definition at line 22 of file KoParameterToPathCommand.cpp.

◆ shapes

QList<KoParameterShape*> KoParameterToPathCommandPrivate::shapes

Definition at line 21 of file KoParameterToPathCommand.cpp.


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