16
class QgsSymbolLayerV2;
17
class QgsRenderContext;
19
typedef QList<QgsSymbolLayerV2*> QgsSymbolLayerV2List;
21
class CORE_EXPORT QgsSymbolV2
32
virtual ~QgsSymbolV2();
34
//! return new default symbol for specified geometry type
35
static QgsSymbolV2* defaultSymbol( QGis::GeometryType geomType );
37
SymbolType type() const { return mType; }
39
// symbol layers handling
41
QgsSymbolLayerV2* symbolLayer( int layer );
43
int symbolLayerCount() { return mLayers.count(); }
45
//! insert symbol layer to specified index
46
bool insertSymbolLayer( int index, QgsSymbolLayerV2* layer );
48
//! append symbol layer at the end of the list
49
bool appendSymbolLayer( QgsSymbolLayerV2* layer );
51
//! delete symbol layer at specified index
52
bool deleteSymbolLayer( int index );
54
//! remove symbol layer from the list and return pointer to it
55
QgsSymbolLayerV2* takeSymbolLayer( int index );
57
//! delete layer at specified index and set a new one
58
bool changeSymbolLayer( int index, QgsSymbolLayerV2* layer );
61
void startRender( QgsRenderContext& context );
62
void stopRender( QgsRenderContext& context );
64
void setColor( const QColor& color );
67
void drawPreviewIcon( QPainter* painter, QSize size );
69
QImage bigSymbolPreviewImage();
73
virtual QgsSymbolV2* clone() const = 0;
76
QgsSymbolV2( SymbolType type, QgsSymbolLayerV2List layers ); // can't be instantiated
78
QgsSymbolLayerV2List cloneLayers() const;
81
QgsSymbolLayerV2List mLayers;
86
//////////////////////
90
class CORE_EXPORT QgsMarkerSymbolV2 : public QgsSymbolV2
93
QgsMarkerSymbolV2( QgsSymbolLayerV2List layers = QgsSymbolLayerV2List() );
95
void setAngle( double angle );
98
void setSize( double size );
101
void renderPoint( const QPointF& point, QgsRenderContext& context, int layer = -1 );
103
virtual QgsSymbolV2* clone() const;
108
class CORE_EXPORT QgsLineSymbolV2 : public QgsSymbolV2
111
QgsLineSymbolV2( QgsSymbolLayerV2List layers = QgsSymbolLayerV2List() );
113
void setWidth( double width );
116
void renderPolyline( const QPolygonF& points, QgsRenderContext& context, int layer = -1 );
118
virtual QgsSymbolV2* clone() const;
123
class CORE_EXPORT QgsFillSymbolV2 : public QgsSymbolV2
126
QgsFillSymbolV2( QgsSymbolLayerV2List layers = QgsSymbolLayerV2List() );
128
void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsRenderContext& context, int layer = -1 );
130
virtual QgsSymbolV2* clone() const;
138
QgsSymbolV2* ps = new QgsPointSymbol();
142
sl = QgsSymbolLayerV2Registry::instance()->createSymbolLayer("SimpleLine", { "color", "..." })
146
sl = QgsSymbolLayerV2Registry::defaultSymbolLayer(QgsSymbolV2::Line)
150
QgsSymbolLayerV2* sl = new QgsSimpleLineSymbolLayer(x,y,z);
151
QgsLineSymbol* s = new LineSymbol( [ sl ] );
155
rend = QgsSingleSymbolRenderer( new LineSymbol() );