QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
17 #ifndef QGSSHADOWEFFECT_H
18 #define QGSSHADOWEFFECT_H
20 #include "qgis_core.h"
181 void setColor(
const QColor &color ) { mColor = color; }
188 QColor
color()
const {
return mColor; }
196 void setOpacity(
const double opacity ) { mOpacity = opacity; }
212 void setBlendMode(
const QPainter::CompositionMode mode ) { mBlendMode = mode; }
220 QPainter::CompositionMode
blendMode()
const {
return mBlendMode; }
233 virtual bool exteriorShadow()
const = 0;
235 double mBlurLevel = 2.645;
238 int mOffsetAngle = 135;
239 double mOffsetDist = 2.0;
242 double mOpacity = 1.0;
244 QPainter::CompositionMode mBlendMode = QPainter::CompositionMode_Multiply;
270 QString
type()
const override;
301 QString
type()
const override;
310 #endif // QGSSHADOWEFFECT_H
void setBlurUnit(const QgsUnitTypes::RenderUnit unit)
Sets the units used for the shadow blur level (radius).
RenderUnit
Rendering size units.
A paint effect which draws an offset and optionally blurred drop shadow within a picture.
void setColor(const QColor &color)
Sets the color for the shadow.
QColor color() const
Returns the color used for the shadow.
Contains information about the context of a rendering operation.
@ RenderMillimeters
Millimeters.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale used for the shadow offset distance.
double offsetDistance() const
Returns the distance used for offsetting the shadow.
double opacity() const
Returns the opacity for the effect.
void setOpacity(const double opacity)
Sets the opacity for the effect.
QgsMapUnitScale mOffsetMapUnitScale
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.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units used for the shadow offset distance.
void setOffsetUnit(const QgsUnitTypes::RenderUnit unit)
Sets the units used for the shadow offset distance.
virtual QgsPaintEffect * clone() const =0
Duplicates an effect by creating a deep copy of the effect.
virtual QRectF boundingRect(const QRectF &rect, const QgsRenderContext &context) const
Returns the bounding rect required for drawing the effect.
virtual void readProperties(const QVariantMap &props)=0
Reads a string map of an effect's properties and restores the effect to the state described by the pr...
virtual bool exteriorShadow() const =0
Specifies whether the shadow is drawn outside the picture or within the picture.
Struct for storing maximum and minimum scales for measurements in map units.
double blurLevel() const
Returns the blur level (radius) for the shadow.
int offsetAngle() const
Returns the angle used for offsetting the shadow.
#define SIP_NODEFAULTCTORS
void setBlendMode(const QPainter::CompositionMode mode)
Sets the blend mode for the effect.
void setBlurLevel(const double level)
Sets blur level (radius) for the shadow.
Base class for visual effects which can be applied to QPicture drawings.
QgsMapUnitScale mBlurMapUnitScale
QgsUnitTypes::RenderUnit blurUnit() const
Returns the units used for the shadow blur level (radius).
void setOffsetAngle(const int angle)
Sets the angle for offsetting the shadow.
QPainter::CompositionMode blendMode() const
Returns the blend mode for the effect.
virtual QVariantMap properties() const =0
Returns the properties describing the paint effect encoded in a string format.
virtual QString type() const =0
Returns the effect type.
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)
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for the shadow offset distance.
void setBlurMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for the shadow blur strength (radius).
Base class for paint effects which offset, blurred shadows.
void setOffsetDistance(const double distance)
Sets the distance for offsetting the shadow.
virtual void draw(QgsRenderContext &context)=0
Handles drawing of the effect's result on to the specified render context.