17 #ifndef QGSSHADOWEFFECT_H 18 #define QGSSHADOWEFFECT_H 20 #include "qgis_core.h" 179 void setColor(
const QColor &color ) { mColor = color; }
186 QColor
color()
const {
return mColor; }
194 void setOpacity(
const double opacity ) { mOpacity = opacity; }
210 void setBlendMode(
const QPainter::CompositionMode mode ) { mBlendMode = mode; }
218 QPainter::CompositionMode
blendMode()
const {
return mBlendMode; }
231 virtual bool exteriorShadow()
const = 0;
233 double mBlurLevel = 2.645;
236 int mOffsetAngle = 135;
237 double mOffsetDist = 2.0;
240 double mOpacity = 1.0;
242 QPainter::CompositionMode mBlendMode = QPainter::CompositionMode_Multiply;
268 QString
type()
const override;
299 QString
type()
const override;
308 #endif // QGSSHADOWEFFECT_H void setOffsetDistance(const double distance)
Sets the distance for offsetting the shadow.
virtual QgsStringMap properties() const =0
Returns the properties describing the paint effect encoded in a string format.
void setOffsetAngle(const int angle)
Sets the angle for offsetting the shadow.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale used for the shadow offset distance.
virtual QRectF boundingRect(const QRectF &rect, const QgsRenderContext &context) const
Returns the bounding rect required for drawing the effect.
void setOpacity(const double opacity)
Sets the opacity for the effect.
void setBlurMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for the shadow blur strength (radius).
Base class for visual effects which can be applied to QPicture drawings.
QgsMapUnitScale mBlurMapUnitScale
QMap< QString, QString > QgsStringMap
virtual bool exteriorShadow() const =0
Specifies whether the shadow is drawn outside the picture or within the picture.
double ANALYSIS_EXPORT angle(QgsPoint *p1, QgsPoint *p2, QgsPoint *p3, QgsPoint *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
virtual QgsPaintEffect * clone() const =0
Duplicates an effect by creating a deep copy of the effect.
void setBlurLevel(const double level)
Sets blur level (radius) for the shadow.
QgsMapUnitScale mOffsetMapUnitScale
virtual QString type() const =0
Returns the effect type.
QgsUnitTypes::RenderUnit blurUnit() const
Returns the units used for the shadow blur level (radius).
const QgsMapUnitScale & blurMapUnitScale() const
Returns the map unit scale used for the shadow blur strength (radius).
A paint effect which draws an offset and optionally blurred drop shadow.
virtual void readProperties(const QgsStringMap &props)=0
Reads a string map of an effect's properties and restores the effect to the state described by the pr...
A paint effect which draws an offset and optionally blurred drop shadow within a picture.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for the shadow offset distance.
Contains information about the context of a rendering operation.
void setBlurUnit(const QgsUnitTypes::RenderUnit unit)
Sets the units used for the shadow blur level (radius).
double blurLevel() const
Returns the blur level (radius) for the shadow.
Struct for storing maximum and minimum scales for measurements in map units.
void setBlendMode(const QPainter::CompositionMode mode)
Sets the blend mode for the effect.
void setOffsetUnit(const QgsUnitTypes::RenderUnit unit)
Sets the units used for the shadow offset distance.
Base class for paint effects which offset, blurred shadows.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units used for the shadow offset distance.
QPainter::CompositionMode blendMode() const
Returns the blend mode for the effect.
double opacity() const
Returns the opacity for the effect.
virtual void draw(QgsRenderContext &context)=0
Handles drawing of the effect's result on to the specified render context.
void setColor(const QColor &color)
Sets the color for the shadow.
int offsetAngle() const
Returns the angle used for offsetting the shadow.
double offsetDistance() const
Returns the distance used for offsetting the shadow.
RenderUnit
Rendering size units.
QColor color() const
Returns the color used for the shadow.