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;
130 virtual Qt::PenStyle dxfPenStyle()
const;
132 virtual Qt::BrushStyle dxfBrushStyle()
const;
136 : mType( type ), mLocked( locked ), mRenderingPass( 0 ) {}
146 static const bool selectionIsOpaque =
true;
147 static const bool selectFillBorder =
false;
148 static const bool selectFillStyle =
false;
150 virtual void prepareExpressions(
const QgsFields* fields,
double scale = -1.0 );
151 virtual QgsExpression* expression(
const QString& property )
const;
153 void saveDataDefinedProperties(
QgsStringMap& stringMap )
const;
185 double angle()
const {
return mAngle; }
188 double size()
const {
return mSize; }
196 virtual void toSld( QDomDocument &doc, QDomElement &element,
QgsStringMap props )
const;
198 virtual void writeSldMarker( QDomDocument &doc, QDomElement &element,
QgsStringMap props )
const
199 { Q_UNUSED( props ); element.appendChild( doc.createComment( QString(
"QgsMarkerSymbolLayerV2 %1 not implemented yet" ).arg(
layerType() ) ) ); }
231 void markerOffset(
const QgsSymbolV2RenderContext& context,
double width,
double height,
double& offsetX,
double& offsetY )
const;
236 double& offsetX,
double& offsetY,
239 static QPointF _rotatedOffset(
const QPointF& offset,
double angle );
266 virtual void renderPolygonOutline(
const QPolygonF& points, QList<QPolygonF>* rings,
QgsSymbolV2RenderContext& context );
268 virtual void setWidth(
double width ) { mWidth = width; }
269 virtual double width()
const {
return mWidth; }
298 virtual void renderPolygon(
const QPolygonF& points, QList<QPolygonF>* rings,
QgsSymbolV2RenderContext& context ) = 0;
303 double angle()
const {
return mAngle; }
308 void _renderPolygon( QPainter* p,
const QPolygonF& points,
const QList<QPolygonF>* rings,
QgsSymbolV2RenderContext& context );