QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
29 QSet< QString > layers;
32 const auto constLayers = mapSettings.
layers();
35 if ( layer && layer->isInScaleRange( mapSettings.
scale() ) )
37 bool layerHasAdvancedBlendMode =
false;
38 if ( layer->blendMode() != QPainter::CompositionMode_SourceOver )
46 layerHasAdvancedBlendMode =
true;
50 if ( layerHasAdvancedBlendMode )
52 layers << layer->name();
55 if (
QgsVectorLayer *currentVectorLayer = qobject_cast<QgsVectorLayer *>( layer ) )
57 #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
61 layers << layer->name();
64 if ( currentVectorLayer->featureBlendMode() != QPainter::CompositionMode_SourceOver )
66 layers << layer->name();
75 layers << layer->name();
82 return qgis::setToList( layers );
89 const double rotation = ms.
rotation();
90 const double alpha = rotation / 180 * M_PI;
112 r[0] = std::cos( alpha );
113 r[1] = -std::sin( alpha );
114 r[2] = xCenter * ( 1 - std::cos( alpha ) ) + yCenter * std::sin( alpha );
115 r[3] = std::sin( alpha );
116 r[4] = std::cos( alpha );
117 r[5] = - xCenter * std::sin( alpha ) + yCenter * ( 1 - std::cos( alpha ) );
120 a = r[0] * s[0] + r[1] * s[3];
121 b = r[0] * s[1] + r[1] * s[4];
122 c = r[0] * s[2] + r[1] * s[5] + r[2];
123 d = r[3] * s[0] + r[4] * s[3];
126 e = r[3] * s[1] + r[4] * s[4];
127 f = r[3] * s[2] + r[4] * s[5] + r[5];
132 double a, b,
c, d, e, f;
static bool staticWillUseLayer(const QgsMapLayer *layer)
Called to find out whether a specified layer is used for labeling.
void setRotation(double rotation)
Sets the rotation of the resulting map image, in degrees clockwise.
QgsPointXY center() const SIP_HOLDGIL
Returns the center point of the rectangle.
double mapUnitsPerPixel() const
Returns the distance in geographical coordinates that equals to one pixel in the map.
QString qgsDoubleToString(double a, int precision=17)
Returns a string representation of a double.
Container for all settings relating to text rendering.
double rotation() const
Returns the rotation of the resulting map image, in degrees clockwise.
@ IgnoreGeoPdfSupportedEffects
Ignore advanced effects which are supported in GeoPDF exports.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
static QStringList containsAdvancedEffects(const QgsMapSettings &mapSettings, EffectsCheckFlags flags=QgsMapSettingsUtils::EffectsCheckFlags())
Checks whether any of the layers attached to a map settings object contain advanced effects.
double scale() const
Returns the calculated map scale.
double xMinimum() const SIP_HOLDGIL
Returns the x minimum value (left side of rectangle).
static QString worldFileContent(const QgsMapSettings &mapSettings)
Creates the content of a world file.
static void worldFileParameters(const QgsMapSettings &mapSettings, double &a, double &b, double &c, double &d, double &e, double &f)
Computes the six parameters of a world file.
void readFromLayer(QgsVectorLayer *layer)
Reads settings from a layer's custom properties (for QGIS 2.x projects).
double yMaximum() const SIP_HOLDGIL
Returns the y maximum value (top side of rectangle).
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c
Represents a vector layer which manages a vector based data sets.
Base class for all map layer types. This is the base class for all map layer types (vector,...
The QgsMapSettings class contains configuration for rendering of the map. The rendering itself is don...
QgsRectangle visibleExtent() const
Returns the actual extent derived from requested extent that takes output image size into account.
QList< QgsMapLayer * > layers(bool expandGroupLayers=false) const
Returns the list of layers which will be rendered in the map.
bool containsAdvancedEffects() const
Returns true if any component of the font format requires advanced effects such as blend modes,...
static bool compositionModeSupported(QPainter::CompositionMode mode)
Returns true if the specified composition mode is supported for layers during GeoPDF exports.