|
QGIS API Documentation
master-59fd5e0
|
00001 /*************************************************************************** 00002 qgsellipsesymbollayerv2.h 00003 --------------------- 00004 begin : June 2011 00005 copyright : (C) 2011 by Marco Hugentobler 00006 email : marco dot hugentobler at sourcepole dot ch 00007 *************************************************************************** 00008 * * 00009 * This program is free software; you can redistribute it and/or modify * 00010 * it under the terms of the GNU General Public License as published by * 00011 * the Free Software Foundation; either version 2 of the License, or * 00012 * (at your option) any later version. * 00013 * * 00014 ***************************************************************************/ 00015 #ifndef QGSELLIPSESYMBOLLAYERV2_H 00016 #define QGSELLIPSESYMBOLLAYERV2_H 00017 00018 #include "qgsmarkersymbollayerv2.h" 00019 #include <QPainterPath> 00020 00021 class QgsExpression; 00022 00024 class CORE_EXPORT QgsEllipseSymbolLayerV2: public QgsMarkerSymbolLayerV2 00025 { 00026 public: 00027 QgsEllipseSymbolLayerV2(); 00028 ~QgsEllipseSymbolLayerV2(); 00029 00030 static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() ); 00031 static QgsSymbolLayerV2* createFromSld( QDomElement &element ); 00032 00033 void renderPoint( const QPointF& point, QgsSymbolV2RenderContext& context ); 00034 QString layerType() const; 00035 void startRender( QgsSymbolV2RenderContext& context ); 00036 void stopRender( QgsSymbolV2RenderContext& context ); 00037 QgsSymbolLayerV2* clone() const; 00038 QgsStringMap properties() const; 00039 00040 void toSld( QDomDocument& doc, QDomElement &element, QgsStringMap props ) const; 00041 void writeSldMarker( QDomDocument& doc, QDomElement &element, QgsStringMap props ) const; 00042 00043 void setSymbolName( const QString& name ) { mSymbolName = name; } 00044 QString symbolName() const { return mSymbolName; } 00045 00046 void setSymbolWidth( double w ) { mSymbolWidth = w; } 00047 double symbolWidth() const { return mSymbolWidth; } 00048 00049 void setSymbolHeight( double h ) { mSymbolHeight = h; } 00050 double symbolHeight() const { return mSymbolHeight; } 00051 00052 void setOutlineWidth( double w ) { mOutlineWidth = w; } 00053 double outlineWidth() const { return mOutlineWidth; } 00054 00055 void setFillColor( const QColor& c ) { mFillColor = c;} 00056 QColor fillColor() const { return mFillColor; } 00057 00058 void setOutlineColor( const QColor& c ) { mOutlineColor = c; } 00059 QColor outlineColor() const { return mOutlineColor; } 00060 00061 void setSymbolWidthUnit( QgsSymbolV2::OutputUnit unit ) { mSymbolWidthUnit = unit; } 00062 QgsSymbolV2::OutputUnit symbolWidthUnit() const { return mSymbolWidthUnit; } 00063 00064 void setSymbolHeightUnit( QgsSymbolV2::OutputUnit unit ) { mSymbolHeightUnit = unit; } 00065 QgsSymbolV2::OutputUnit symbolHeightUnit() const { return mSymbolHeightUnit; } 00066 00067 void setOutlineWidthUnit( QgsSymbolV2::OutputUnit unit ) { mOutlineWidthUnit = unit; } 00068 QgsSymbolV2::OutputUnit outlineWidthUnit() const { return mOutlineWidthUnit; } 00069 00070 void setOutputUnit( QgsSymbolV2::OutputUnit unit ); 00071 QgsSymbolV2::OutputUnit outputUnit() const; 00072 00073 private: 00074 QString mSymbolName; 00075 double mSymbolWidth; 00076 QgsSymbolV2::OutputUnit mSymbolWidthUnit; 00077 double mSymbolHeight; 00078 QgsSymbolV2::OutputUnit mSymbolHeightUnit; 00079 QColor mFillColor; 00080 QColor mOutlineColor; 00081 double mOutlineWidth; 00082 QgsSymbolV2::OutputUnit mOutlineWidthUnit; 00083 00084 QPainterPath mPainterPath; 00085 00086 QPen mPen; 00087 QBrush mBrush; 00088 00093 void preparePath( const QString& symbolName, QgsSymbolV2RenderContext& context, const QgsFeature* f = 0 ); 00094 00096 bool hasDataDefinedProperty() const; 00097 }; 00098 00099 #endif // QGSELLIPSESYMBOLLAYERV2_H