17 #ifndef QGSSYMBOLLAYERV2UTILS_H
18 #define QGSSYMBOLLAYERV2UTILS_H
52 static QString encodeSldAlpha(
int alpha );
53 static int decodeSldAlpha(
QString str );
55 static QString encodeSldFontStyle( QFont::Style style );
56 static QFont::Style decodeSldFontStyle(
QString str );
58 static QString encodeSldFontWeight(
int weight );
59 static int decodeSldFontWeight(
QString str );
61 static QString encodePenStyle( Qt::PenStyle style );
62 static Qt::PenStyle decodePenStyle(
QString str );
64 static QString encodePenJoinStyle( Qt::PenJoinStyle style );
65 static Qt::PenJoinStyle decodePenJoinStyle(
QString str );
67 static QString encodePenCapStyle( Qt::PenCapStyle style );
68 static Qt::PenCapStyle decodePenCapStyle(
QString str );
70 static QString encodeSldLineJoinStyle( Qt::PenJoinStyle style );
71 static Qt::PenJoinStyle decodeSldLineJoinStyle(
QString str );
73 static QString encodeSldLineCapStyle( Qt::PenCapStyle style );
74 static Qt::PenCapStyle decodeSldLineCapStyle(
QString str );
76 static QString encodeBrushStyle( Qt::BrushStyle style );
77 static Qt::BrushStyle decodeBrushStyle(
QString str );
79 static QString encodeSldBrushStyle( Qt::BrushStyle style );
80 static Qt::BrushStyle decodeSldBrushStyle(
QString str );
103 static QPainter::CompositionMode decodeBlendMode(
const QString& s );
119 static void drawStippledBackground(
QPainter* painter,
QRect rect );
126 static double estimateMaxSymbolBleed(
QgsSymbolV2* symbol );
143 SymbolType* symbolCastToType =
dynamic_cast<SymbolType*
>( tmpSymbol );
145 if ( symbolCastToType )
147 return symbolCastToType;
167 static bool hasExternalGraphic(
QDomElement &element );
168 static bool hasWellKnownMark(
QDomElement &element );
170 static bool needFontMarker(
QDomElement &element );
172 static bool needEllipseMarker(
QDomElement &element );
173 static bool needMarkerLine(
QDomElement &element );
174 static bool needLinePatternFill(
QDomElement &element );
175 static bool needPointPatternFill(
QDomElement &element );
181 Qt::BrushStyle &brushStyle,
QColor &color );
185 Qt::PenStyle penStyle,
QColor color,
double width = -1,
186 const Qt::PenJoinStyle *penJoinStyle = 0,
const Qt::PenCapStyle *penCapStyle = 0,
187 const QVector<qreal> *customDashPattern = 0,
double dashOffset = 0.0 );
189 Qt::PenStyle &penStyle,
QColor &color,
double &width,
190 Qt::PenJoinStyle *penJoinStyle = 0, Qt::PenCapStyle *penCapStyle = 0,
195 QColor color,
double size = -1 );
196 static bool externalGraphicFromSld(
QDomElement &element,
198 QColor &color,
double &size );
203 double borderWidth = -1,
double size = -1 );
206 double borderWidth = -1,
double size = -1 );
208 Q_DECL_DEPRECATED
static bool wellKnownMarkerFromSld(
QDomElement &element,
210 double &borderWidth,
double &size );
211 static bool wellKnownMarkerFromSld(
QDomElement &element,
213 double &borderWidth,
double &size );
218 static bool externalMarkerFromSld(
QDomElement &element,
220 QColor &color,
double &size );
227 static QString ogrFeatureStylePen(
double width,
double mmScaleFactor,
double mapUnitsScaleFactor,
const QColor& c,
228 Qt::PenJoinStyle joinStyle = Qt::MiterJoin,
229 Qt::PenCapStyle capStyle = Qt::FlatCap,
234 static QString ogrFeatureStyleBrush(
const QColor& fillColr );
306 static QColor colorFromMimeData(
const QMimeData *data,
bool& hasAlpha );
353 static QColor parseColor(
QString colorStr,
bool strictEval =
false );
364 static QColor parseColorWithAlpha(
const QString colorStr,
bool &containsAlpha,
bool strictEval =
false );
374 static void multiplyImageOpacity(
QImage* image, qreal alpha );
377 static void blurImageInPlace(
QImage& image,
const QRect& rect,
int radius,
bool alphaOnly );
382 static void premultiplyColor(
QColor& rgb,
int alpha );
385 static void sortVariantList(
QList<QVariant>& list, Qt::SortOrder order );
387 static QPointF pointOnLineWithDistance(
const QPointF& startPoint,
const QPointF& directionPoint,
double distance );
411 static bool pointInPolygon(
const QPolygonF &points,
const QPointF &point );
434 static QList<double> prettyBreaks(
double minimum,
double maximum,
int classes );
Class for parsing and evaluation of expressions (formerly called "search strings").
QMap< QString, QgsSymbolV2 * > QgsSymbolV2Map
static QgsSymbolV2 * loadSymbol(const QDomElement &element)
Attempts to load a symbol from a DOM element.
QMap< QString, QString > QgsStringMap
Contains information about the context of a rendering operation.
QList< QPolygonF > offsetLine(QPolygonF polyline, double dist)
QList< QPair< QColor, QString > > QgsNamedColorList
static SymbolType * loadSymbol(const QDomElement &element)
Attempts to load a symbol from a DOM element and cast it to a particular symbol type.