QGIS API Documentation
2.10.1-Pisa
|
#include <qgssymbolv2.h>
Public Types | |
enum | OutputUnit { MM = 0, MapUnit, Mixed, Pixel } |
typedef QList< OutputUnit > | OutputUnitList |
enum | RenderHint { DataDefinedSizeScale = 1, DataDefinedRotation = 2 } |
enum | ScaleMethod { ScaleArea, ScaleDiameter } |
enum | SymbolType { Marker, Line, Fill } |
Public Member Functions | |
virtual | ~QgsSymbolV2 () |
qreal | alpha () const |
Get alpha transparency 1 for opaque, 0 for invisible. More... | |
bool | appendSymbolLayer (QgsSymbolLayerV2 *layer) |
append symbol layer at the end of the list More... | |
QImage | asImage (QSize size, QgsRenderContext *customContext=0) |
QImage | bigSymbolPreviewImage () |
bool | changeSymbolLayer (int index, QgsSymbolLayerV2 *layer) |
delete layer at specified index and set a new one More... | |
double | clipFeaturesToExtent () const |
Returns whether features drawn by the symbol will be clipped to the render context's extent. More... | |
virtual QgsSymbolV2 * | clone () const =0 |
QColor | color () const |
bool | deleteSymbolLayer (int index) |
delete symbol layer at specified index More... | |
void | drawPreviewIcon (QPainter *painter, QSize size, QgsRenderContext *customContext=0) |
Draw icon of the symbol that occupyies area given by size using the painter. More... | |
QString | dump () const |
bool | insertSymbolLayer (int index, QgsSymbolLayerV2 *layer) |
insert symbol layer to specified index More... | |
const QgsVectorLayer * | layer () const |
QgsMapUnitScale | mapUnitScale () const |
QgsSymbolV2::OutputUnit | outputUnit () const |
int | renderHints () const |
void | setAlpha (qreal alpha) |
Set alpha transparency 1 for opaque, 0 for invisible. More... | |
void | setClipFeaturesToExtent (bool clipFeaturesToExtent) |
Sets whether features drawn by the symbol should be clipped to the render context's extent. More... | |
void | setColor (const QColor &color) |
void | setLayer (const QgsVectorLayer *layer) |
void | setMapUnitScale (const QgsMapUnitScale &scale) |
void | setOutputUnit (QgsSymbolV2::OutputUnit u) |
void | setRenderHints (int hints) |
void | startRender (QgsRenderContext &context, const QgsFields *fields=0) |
void | stopRender (QgsRenderContext &context) |
QgsSymbolLayerV2 * | symbolLayer (int layer) |
Returns a specific symbol layers contained in the symbol. More... | |
int | symbolLayerCount () |
Returns total number of symbol layers contained in the symbol. More... | |
QgsSymbolLayerV2List | symbolLayers () |
Returns list of symbol layers contained in the symbol. More... | |
QgsSymbolLayerV2 * | takeSymbolLayer (int index) |
remove symbol layer from the list and return pointer to it More... | |
void | toSld (QDomDocument &doc, QDomElement &element, QgsStringMap props) const |
SymbolType | type () const |
QSet< QString > | usedAttributes () const |
Static Public Member Functions | |
static QgsSymbolV2 * | defaultSymbol (QGis::GeometryType geomType) |
return new default symbol for specified geometry type More... | |
Protected Member Functions | |
QgsSymbolV2 (SymbolType type, QgsSymbolLayerV2List layers) | |
QgsSymbolLayerV2List | cloneLayers () const |
bool | isSymbolLayerCompatible (SymbolType t) |
check whether a symbol layer type can be used within the symbol (marker-marker, line-line, fill-fill/line) More... | |
Protected Attributes | |
qreal | mAlpha |
Symbol opacity (in the range 0 - 1) More... | |
bool | mClipFeaturesToExtent |
const QgsVectorLayer * | mLayer |
QgsSymbolLayerV2List | mLayers |
int | mRenderHints |
SymbolType | mType |
Definition at line 48 of file qgssymbolv2.h.
typedef QList<OutputUnit> QgsSymbolV2::OutputUnitList |
Definition at line 60 of file qgssymbolv2.h.
Enumerator | |
---|---|
MM | |
MapUnit | |
Mixed | |
Pixel |
Definition at line 52 of file qgssymbolv2.h.
Enumerator | |
---|---|
DataDefinedSizeScale | |
DataDefinedRotation |
Definition at line 75 of file qgssymbolv2.h.
Enumerator | |
---|---|
ScaleArea | |
ScaleDiameter |
Definition at line 69 of file qgssymbolv2.h.
Enumerator | |
---|---|
Marker | |
Line | |
Fill |
Definition at line 62 of file qgssymbolv2.h.
|
virtual |
Definition at line 100 of file qgssymbolv2.cpp.
|
protected |
Definition at line 76 of file qgssymbolv2.cpp.
|
inline |
Get alpha transparency 1 for opaque, 0 for invisible.
Definition at line 158 of file qgssymbolv2.h.
bool QgsSymbolV2::appendSymbolLayer | ( | QgsSymbolLayerV2 * | layer | ) |
append symbol layer at the end of the list
Definition at line 248 of file qgssymbolv2.cpp.
QImage QgsSymbolV2::asImage | ( | QSize | size, |
QgsRenderContext * | customContext = 0 |
||
) |
Definition at line 355 of file qgssymbolv2.cpp.
QImage QgsSymbolV2::bigSymbolPreviewImage | ( | ) |
Definition at line 369 of file qgssymbolv2.cpp.
bool QgsSymbolV2::changeSymbolLayer | ( | int | index, |
QgsSymbolLayerV2 * | layer | ||
) |
delete layer at specified index and set a new one
Definition at line 278 of file qgssymbolv2.cpp.
|
inline |
Returns whether features drawn by the symbol will be clipped to the render context's extent.
If this option is enabled then features which are partially outside the extent will be clipped. This speeds up rendering of the feature, but may have undesirable side effects for certain symbol types.
Definition at line 183 of file qgssymbolv2.h.
|
pure virtual |
Implemented in QgsFillSymbolV2, QgsLineSymbolV2, and QgsMarkerSymbolV2.
|
protected |
Definition at line 442 of file qgssymbolv2.cpp.
QColor QgsSymbolV2::color | ( | void | ) | const |
Definition at line 319 of file qgssymbolv2.cpp.
|
static |
return new default symbol for specified geometry type
Definition at line 170 of file qgssymbolv2.cpp.
bool QgsSymbolV2::deleteSymbolLayer | ( | int | index | ) |
delete symbol layer at specified index
Definition at line 258 of file qgssymbolv2.cpp.
void QgsSymbolV2::drawPreviewIcon | ( | QPainter * | painter, |
QSize | size, | ||
QgsRenderContext * | customContext = 0 |
||
) |
Draw icon of the symbol that occupyies area given by size using the painter.
Optionally custom context may be given in order to get rendering of symbols that use map units right.
Definition at line 330 of file qgssymbolv2.cpp.
QString QgsSymbolV2::dump | ( | ) | const |
Definition at line 410 of file qgssymbolv2.cpp.
bool QgsSymbolV2::insertSymbolLayer | ( | int | index, |
QgsSymbolLayerV2 * | layer | ||
) |
insert symbol layer to specified index
Definition at line 236 of file qgssymbolv2.cpp.
|
protected |
check whether a symbol layer type can be used within the symbol (marker-marker, line-line, fill-fill/line)
Definition at line 226 of file qgssymbolv2.cpp.
|
inline |
Definition at line 189 of file qgssymbolv2.h.
QgsMapUnitScale QgsSymbolV2::mapUnitScale | ( | ) | const |
Definition at line 128 of file qgssymbolv2.cpp.
QgsSymbolV2::OutputUnit QgsSymbolV2::outputUnit | ( | ) | const |
Definition at line 107 of file qgssymbolv2.cpp.
|
inline |
Definition at line 163 of file qgssymbolv2.h.
|
inline |
Set alpha transparency 1 for opaque, 0 for invisible.
Definition at line 160 of file qgssymbolv2.h.
|
inline |
Sets whether features drawn by the symbol should be clipped to the render context's extent.
If this option is enabled then features which are partially outside the extent will be clipped. This speeds up rendering of the feature, but may have undesirable side effects for certain symbol types.
clipFeaturesToExtent | set to true to enable clipping (defaults to true) |
Definition at line 173 of file qgssymbolv2.h.
void QgsSymbolV2::setColor | ( | const QColor & | color | ) |
Definition at line 310 of file qgssymbolv2.cpp.
|
inline |
Definition at line 188 of file qgssymbolv2.h.
void QgsSymbolV2::setMapUnitScale | ( | const QgsMapUnitScale & | scale | ) |
Definition at line 161 of file qgssymbolv2.cpp.
void QgsSymbolV2::setOutputUnit | ( | QgsSymbolV2::OutputUnit | u | ) |
Definition at line 152 of file qgssymbolv2.cpp.
|
inline |
Definition at line 162 of file qgssymbolv2.h.
void QgsSymbolV2::startRender | ( | QgsRenderContext & | context, |
const QgsFields * | fields = 0 |
||
) |
Definition at line 291 of file qgssymbolv2.cpp.
void QgsSymbolV2::stopRender | ( | QgsRenderContext & | context | ) |
Definition at line 300 of file qgssymbolv2.cpp.
QgsSymbolLayerV2 * QgsSymbolV2::symbolLayer | ( | int | layer | ) |
Returns a specific symbol layers contained in the symbol.
layer | layer number |
Definition at line 217 of file qgssymbolv2.cpp.
|
inline |
Returns total number of symbol layers contained in the symbol.
Definition at line 113 of file qgssymbolv2.h.
|
inline |
Returns list of symbol layers contained in the symbol.
Definition at line 96 of file qgssymbolv2.h.
QgsSymbolLayerV2 * QgsSymbolV2::takeSymbolLayer | ( | int | index | ) |
remove symbol layer from the list and return pointer to it
Definition at line 269 of file qgssymbolv2.cpp.
void QgsSymbolV2::toSld | ( | QDomDocument & | doc, |
QDomElement & | element, | ||
QgsStringMap | props | ||
) | const |
Definition at line 429 of file qgssymbolv2.cpp.
|
inline |
Definition at line 86 of file qgssymbolv2.h.
Definition at line 455 of file qgssymbolv2.cpp.
|
protected |
Symbol opacity (in the range 0 - 1)
Definition at line 204 of file qgssymbolv2.h.
|
protected |
Definition at line 207 of file qgssymbolv2.h.
|
protected |
Definition at line 209 of file qgssymbolv2.h.
|
protected |
Definition at line 201 of file qgssymbolv2.h.
|
protected |
Definition at line 206 of file qgssymbolv2.h.
|
protected |
Definition at line 200 of file qgssymbolv2.h.