31 QMapIterator<QString, QgsExpression *> i( mExpressions );
42 if ( !mExpressions.contains( expression ) )
46 mExpressions[expression] = expr;
48 return mExpressions[expression];
72 const int pixelsize = s.
font.pointSizeF() /
c.mapToPixel().mapUnitsPerPixel();
73 f.setPixelSize( pixelsize > 0 ? pixelsize : 1 );
77 f.setPixelSize( s.
font.pointSizeF() * 0.376 *
c.scaleFactor() );
85 double scaledValue = value;
92 scaledValue = std::sqrt( scaledValue );
93 scaledLowerValue = std::sqrt( scaledLowerValue );
94 scaledUpperValue = std::sqrt( scaledUpperValue );
98 const double scaledRatio = ( scaledValue - scaledLowerValue ) / ( scaledUpperValue - scaledLowerValue );
100 QSizeF size = QSizeF( is.
upperSize.width() * scaledRatio + is.
lowerSize.width() * ( 1 - scaledRatio ), is.
upperSize.height() * scaledRatio + is.
lowerSize.height() * ( 1 - scaledRatio ) );
113 size.setWidth( size.height() );
Additional diagram settings for interpolated size rendering.
Stores the settings for rendering a single diagram.
Qgis::RenderUnit sizeType
Diagram size unit.
QgsMapUnitScale lineSizeScale
Line unit scale.
QgsMapUnitScale sizeScale
Diagram size unit scale.
Qgis::RenderUnit lineSizeUnit
Line unit index.
double minimumSize
Scale diagrams smaller than mMinimumSize to mMinimumSize.
void setPenWidth(QPen &pen, const QgsDiagramSettings &s, const QgsRenderContext &c)
Changes the pen width to match the current settings and rendering context.
QSizeF sizePainterUnits(QSizeF size, const QgsDiagramSettings &s, const QgsRenderContext &c)
Calculates a size to match the current settings and rendering context.
QgsExpression * getExpression(const QString &expression, const QgsExpressionContext &context)
Returns a prepared expression for the specified context.
QSizeF sizeForValue(double value, const QgsDiagramSettings &s, const QgsDiagramInterpolationSettings &interpolationSettings) const
Returns the scaled size of a diagram for a value, respecting the specified diagram interpolation sett...
QFont scaledFont(const QgsDiagramSettings &s, const QgsRenderContext &c)
Calculates a size to match the current settings and rendering context.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Handles parsing and evaluation of expressions (formerly called "search strings").
bool prepare(const QgsExpressionContext *context)
Gets the expression ready for evaluation - find out column indexes.
Contains information about the context of a rendering operation.
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
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference).