15 #ifndef QGSSYMBOLLAYERV2_H
16 #define QGSSYMBOLLAYERV2_H
20 #define M_PI 3.14159265358979323846
23 #define DEG2RAD(x) ((x)*M_PI/180)
24 #define DEFAULT_SCALE_METHOD QgsSymbolV2::ScaleArea
30 #include <QDomDocument>
31 #include <QDomElement>
50 virtual QColor
color()
const {
return mColor; }
51 virtual void setColor(
const QColor& color ) { mColor = color; }
60 virtual void setFillColor(
const QColor& color ) { Q_UNUSED( color ); }
63 virtual QColor
fillColor()
const {
return QColor(); }
67 virtual QString layerType()
const = 0;
74 virtual void toSld( QDomDocument &doc, QDomElement &element,
QgsStringMap props )
const
75 { Q_UNUSED( props ); element.appendChild( doc.createComment( QString(
"SymbolLayerV2 %1 not implemented yet" ).arg( layerType() ) ) ); }
77 virtual QString
ogrFeatureStyle(
double mmScaleFactor,
double mapUnitScaleFactor )
const { Q_UNUSED( mmScaleFactor ); Q_UNUSED( mapUnitScaleFactor );
return QString(); }
109 virtual QSet<QString> usedAttributes()
const;
111 virtual const QgsExpression* dataDefinedProperty(
const QString& property )
const;
112 virtual QString dataDefinedPropertyString(
const QString& property )
const;
113 virtual void setDataDefinedProperty(
const QString& property,
const QString& expressionString );
114 virtual void removeDataDefinedProperty(
const QString& property );
115 virtual void removeDataDefinedProperties();
119 double mmMapUnitScaleFactor,
120 const QString& layerName,
123 const QPointF& shift = QPointF( 0.0, 0.0 ) )
const;
131 virtual Qt::PenStyle dxfPenStyle()
const;
133 virtual Qt::BrushStyle dxfBrushStyle()
const;
137 : mType( type ), mLocked( locked ), mRenderingPass( 0 ) {}
147 static const bool selectionIsOpaque =
true;
148 static const bool selectFillBorder =
false;
149 static const bool selectFillStyle =
false;
151 virtual void prepareExpressions(
const QgsFields* fields,
double scale = -1.0 );
152 virtual QgsExpression* expression(
const QString& property )
const;
154 void saveDataDefinedProperties(
QgsStringMap& stringMap )
const;
186 double angle()
const {
return mAngle; }
189 double size()
const {
return mSize; }
197 virtual void toSld( QDomDocument &doc, QDomElement &element,
QgsStringMap props )
const override;
199 virtual void writeSldMarker( QDomDocument &doc, QDomElement &element,
QgsStringMap props )
const
200 { Q_UNUSED( props ); element.appendChild( doc.createComment( QString(
"QgsMarkerSymbolLayerV2 %1 not implemented yet" ).arg(
layerType() ) ) ); }
232 void markerOffset(
const QgsSymbolV2RenderContext& context,
double width,
double height,
double& offsetX,
double& offsetY )
const;
237 double& offsetX,
double& offsetY,
240 static QPointF _rotatedOffset(
const QPointF& offset,
double angle );
267 virtual void renderPolygonOutline(
const QPolygonF& points, QList<QPolygonF>* rings,
QgsSymbolV2RenderContext& context );
269 virtual void setWidth(
double width ) { mWidth = width; }
270 virtual double width()
const {
return mWidth; }
272 double offset()
const {
return mOffset; }
311 virtual void renderPolygon(
const QPolygonF& points, QList<QPolygonF>* rings,
QgsSymbolV2RenderContext& context ) = 0;
316 double angle()
const {
return mAngle; }
321 void _renderPolygon( QPainter* p,
const QPolygonF& points,
const QList<QPolygonF>* rings,
QgsSymbolV2RenderContext& context );