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

#include <KoVectorPatternBackground.h>

+ Inheritance diagram for KoVectorPatternBackground:

Classes

class  Private
 

Public Member Functions

bool compareTo (const KoShapeBackground *other) const override
 
KoFlake::CoordinateSystem contentCoordinates () const
 
bool hasTransparency () const override
 Returns if the background has some transparency.
 
 KoVectorPatternBackground ()
 
void paint (QPainter &painter, const QPainterPath &fillPath) const override
 Paints the background using the given fill path.
 
QTransform patternTransform () const
 
KoFlake::CoordinateSystem referenceCoordinates () const
 
QRectF referenceRect () const
 
void setContentCoordinates (KoFlake::CoordinateSystem value)
 
void setPatternTransform (const QTransform &value)
 
void setReferenceCoordinates (KoFlake::CoordinateSystem value)
 
void setReferenceRect (const QRectF &value)
 
void setShapes (const QList< KoShape * > value)
 
QList< KoShape * > shapes () const
 
 ~KoVectorPatternBackground () override
 
- Public Member Functions inherited from KoShapeBackground
 KoShapeBackground ()
 
virtual operator bool () const
 
virtual ~KoShapeBackground ()
 

Private Attributes

QSharedDataPointer< Privated
 

Detailed Description

Definition at line 20 of file KoVectorPatternBackground.h.

Constructor & Destructor Documentation

◆ KoVectorPatternBackground()

KoVectorPatternBackground::KoVectorPatternBackground ( )

Definition at line 37 of file KoVectorPatternBackground.cpp.

◆ ~KoVectorPatternBackground()

KoVectorPatternBackground::~KoVectorPatternBackground ( )
override

Definition at line 43 of file KoVectorPatternBackground.cpp.

44{
45
46}

Member Function Documentation

◆ compareTo()

bool KoVectorPatternBackground::compareTo ( const KoShapeBackground * other) const
overridevirtual

Implements KoShapeBackground.

Definition at line 48 of file KoVectorPatternBackground.cpp.

49{
50 Q_UNUSED(other);
51 return false;
52}

◆ contentCoordinates()

KoFlake::CoordinateSystem KoVectorPatternBackground::contentCoordinates ( ) const

Definition at line 69 of file KoVectorPatternBackground.cpp.

70{
71 return d->contentCoordinates;
72}

References d.

◆ hasTransparency()

bool KoVectorPatternBackground::hasTransparency ( ) const
overridevirtual

Returns if the background has some transparency.

Reimplemented from KoShapeBackground.

Definition at line 133 of file KoVectorPatternBackground.cpp.

134{
135 return true;
136}

◆ paint()

void KoVectorPatternBackground::paint ( QPainter & painter,
const QPainterPath & fillPath ) const
overridevirtual

Paints the background using the given fill path.

Implements KoShapeBackground.

Definition at line 107 of file KoVectorPatternBackground.cpp.

108{
109 const QPainterPath dstShapeOutline = fillPath;
110 const QRectF dstShapeBoundingBox = dstShapeOutline.boundingRect();
111
112 KoBakedShapeRenderer renderer(dstShapeOutline, QTransform(),
113 QTransform(),
114 d->referenceRect,
115 d->contentCoordinates != KoFlake::UserSpaceOnUse,
116 dstShapeBoundingBox,
117 d->referenceCoordinates != KoFlake::UserSpaceOnUse,
118 d->patternTransform);
119
120 QPainter *patchPainter = renderer.bakeShapePainter();
121
123 p.setShapes(d->shapes);
124 p.paint(*patchPainter);
125
126 // uncomment for debug
127 // renderer.patchImage().save("dd_patch_image.png");
128
129 painter.setPen(Qt::NoPen);
130 renderer.renderShape(painter);
131}
const Params2D p
void setShapes(const QList< KoShape * > &shapes)

References KoBakedShapeRenderer::bakeShapePainter(), d, p, KoBakedShapeRenderer::renderShape(), KoShapePainter::setShapes(), and KoFlake::UserSpaceOnUse.

◆ patternTransform()

QTransform KoVectorPatternBackground::patternTransform ( ) const

Definition at line 89 of file KoVectorPatternBackground.cpp.

90{
91 return d->patternTransform;
92}

References d.

◆ referenceCoordinates()

KoFlake::CoordinateSystem KoVectorPatternBackground::referenceCoordinates ( ) const

Definition at line 59 of file KoVectorPatternBackground.cpp.

60{
61 return d->referenceCoordinates;
62}

References d.

◆ referenceRect()

QRectF KoVectorPatternBackground::referenceRect ( ) const

Definition at line 79 of file KoVectorPatternBackground.cpp.

80{
81 return d->referenceRect;
82}

References d.

◆ setContentCoordinates()

void KoVectorPatternBackground::setContentCoordinates ( KoFlake::CoordinateSystem value)

In ViewBox just use the same mode as for referenceCoordinates

Definition at line 64 of file KoVectorPatternBackground.cpp.

65{
66 d->contentCoordinates = value;
67}
float value(const T *src, size_t ch)

References d, and value().

◆ setPatternTransform()

void KoVectorPatternBackground::setPatternTransform ( const QTransform & value)

Definition at line 84 of file KoVectorPatternBackground.cpp.

85{
86 d->patternTransform = value;
87}

References d, and value().

◆ setReferenceCoordinates()

void KoVectorPatternBackground::setReferenceCoordinates ( KoFlake::CoordinateSystem value)

Definition at line 54 of file KoVectorPatternBackground.cpp.

55{
56 d->referenceCoordinates = value;
57}

References d, and value().

◆ setReferenceRect()

void KoVectorPatternBackground::setReferenceRect ( const QRectF & value)

Definition at line 74 of file KoVectorPatternBackground.cpp.

75{
76 d->referenceRect = value;
77}

References d, and value().

◆ setShapes()

void KoVectorPatternBackground::setShapes ( const QList< KoShape * > value)

Definition at line 94 of file KoVectorPatternBackground.cpp.

95{
96 qDeleteAll(d->shapes);
97 d->shapes.clear();
98
99 d->shapes = value;
100}

References d, and value().

◆ shapes()

QList< KoShape * > KoVectorPatternBackground::shapes ( ) const

Definition at line 102 of file KoVectorPatternBackground.cpp.

103{
104 return d->shapes;
105}

References d.

Member Data Documentation

◆ d

QSharedDataPointer<Private> KoVectorPatternBackground::d
private

Definition at line 50 of file KoVectorPatternBackground.h.


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