28 QSet< QString > layers;
35 if ( layer->
blendMode() != QPainter::CompositionMode_SourceOver )
37 layers << layer->
name();
41 if ( currentVectorLayer )
45 layers << layer->
name();
47 if ( currentVectorLayer->
featureBlendMode() != QPainter::CompositionMode_SourceOver )
49 layers << layer->
name();
58 layers << layer->
name();
65 return layers.toList();
73 double alpha = rotation / 180 * M_PI;
95 r[0] = std::cos( alpha );
96 r[1] = -std::sin( alpha );
97 r[2] = xCenter * ( 1 - std::cos( alpha ) ) + yCenter * std::sin( alpha );
98 r[3] = std::sin( alpha );
99 r[4] = std::cos( alpha );
100 r[5] = - xCenter * std::sin( alpha ) + yCenter * ( 1 - std::cos( alpha ) );
103 double a = r[0] * s[0] + r[1] * s[3];
104 double b = r[0] * s[1] + r[1] * s[4];
105 double c = r[0] * s[2] + r[1] * s[5] + r[2];
106 double d = r[3] * s[0] + r[4] * s[3];
109 double e = r[3] * s[1] + r[4] * s[4];
110 double f = r[3] * s[2] + r[4] * s[5] + r[5];
Base class for all map layer types.
double rotation() const
Returns the rotation of the resulting map image, in degrees clockwise.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
static const QStringList containsAdvancedEffects(const QgsMapSettings &mapSettings)
Checks whether any of the layers attached to a map settings object contain advanced effects...
QList< QgsMapLayer * > layers() const
Gets list of layers for map rendering The layers are stored in the reverse order of how they are rend...
QgsRectangle visibleExtent() const
Returns the actual extent derived from requested extent that takes takes output image size into accou...
static QString worldFileContent(const QgsMapSettings &mapSettings)
Creates the content of a world file.
The QgsMapSettings class contains configuration for rendering of the map.
static bool staticWillUseLayer(QgsVectorLayer *layer)
called to find out whether the layer is used for labeling
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
QString qgsDoubleToString(double a, int precision=17)
Returns a string representation of a double.
double mapUnitsPerPixel() const
Returns the distance in geographical coordinates that equals to one pixel in the map.
QPainter::CompositionMode featureBlendMode() const
Returns the current blending mode for features.
void setRotation(double rotation)
Sets the rotation of the resulting map image, in degrees clockwise.
double xMinimum() const
Returns the x minimum value (left side of rectangle).
double yMaximum() const
Returns the y maximum value (top side of rectangle).
QgsPointXY center() const
Returns the center point of the rectangle.
Container for all settings relating to text rendering.
Represents a vector layer which manages a vector based data sets.
bool containsAdvancedEffects() const
Returns true if any component of the font format requires advanced effects such as blend modes...
QPainter::CompositionMode blendMode() const
Returns the current blending mode for a layer.
void readFromLayer(QgsVectorLayer *layer)
Reads settings from a layer's custom properties (for QGIS 2.x projects).