QGIS API Documentation 3.41.0-Master (d5b93354e9c)
Loading...
Searching...
No Matches
qgseffectstack.h
Go to the documentation of this file.
1/***************************************************************************
2 qgseffectstack.h
3 ----------------
4 begin : December 2014
5 copyright : (C) 2014 Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17#ifndef QGSEFFECTSTACK_H
18#define QGSEFFECTSTACK_H
19
20#include "qgis_core.h"
21#include "qgis_sip.h"
22#include "qgspainteffect.h"
23
44{
45
46 public:
47
54 static QgsPaintEffect *create( const QVariantMap &map ) SIP_FACTORY;
55
56 QgsEffectStack() = default;
57
58 QgsEffectStack( const QgsEffectStack &other );
59
64
70 explicit QgsEffectStack( const QgsPaintEffect &effect );
71
72 ~QgsEffectStack() override;
73
74 QString type() const override { return QStringLiteral( "effectStack" ); }
75 QgsEffectStack *clone() const override SIP_FACTORY;
76 bool saveProperties( QDomDocument &doc, QDomElement &element ) const override;
77 bool readProperties( const QDomElement &element ) override;
78
82 QVariantMap properties() const override;
83
87 void readProperties( const QVariantMap &props ) override;
88
95 void appendEffect( QgsPaintEffect *effect SIP_TRANSFER );
96
104 bool insertEffect( int index, QgsPaintEffect *effect SIP_TRANSFER );
105
112 bool changeEffect( int index, QgsPaintEffect *effect SIP_TRANSFER );
113
118 QgsPaintEffect *takeEffect( int index SIP_TRANSFERBACK );
119
125 QList< QgsPaintEffect * > *effectList();
126
131 int count() const { return mEffectList.count(); }
132
138 QgsPaintEffect *effect( int index ) const;
139
140 QgsEffectStack &operator=( const QgsEffectStack &rhs );
141
142 QgsEffectStack &operator=( QgsEffectStack &&other ) SIP_SKIP;
143
144
145 protected:
146
147 void draw( QgsRenderContext &context ) override;
148
149 private:
150
151 QList< QgsPaintEffect * > mEffectList;
152
153 void clearStack();
154};
155
156#endif // QGSEFFECTSTACK_H
157
A paint effect which consists of a stack of other chained paint effects.
QgsEffectStack()=default
QString type() const override
Returns the effect type.
Base class for visual effects which can be applied to QPicture drawings.
friend class QgsEffectStack
virtual QgsPaintEffect * clone() const =0
Duplicates an effect by creating a deep copy of the effect.
virtual void draw(QgsRenderContext &context)=0
Handles drawing of the effect's result on to the specified render context.
Contains information about the context of a rendering operation.
#define SIP_SKIP
Definition qgis_sip.h:126
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_TRANSFERBACK
Definition qgis_sip.h:48
#define SIP_FACTORY
Definition qgis_sip.h:76
#define SIP_NODEFAULTCTORS
Definition qgis_sip.h:101