QGIS API Documentation
2.0.1-Dufour
|
#include <qgssymbolv2.h>
Public Types | |
enum | OutputUnit { MM = 0, MapUnit, Mixed } |
enum | SymbolType { Marker, Line, Fill } |
enum | ScaleMethod { ScaleArea, ScaleDiameter } |
enum | RenderHint { DataDefinedSizeScale = 1, DataDefinedRotation = 2 } |
Public Member Functions | |
virtual | ~QgsSymbolV2 () |
SymbolType | type () const |
QgsSymbolLayerV2 * | symbolLayer (int layer) |
int | symbolLayerCount () |
bool | insertSymbolLayer (int index, QgsSymbolLayerV2 *layer) |
insert symbol layer to specified index | |
bool | appendSymbolLayer (QgsSymbolLayerV2 *layer) |
append symbol layer at the end of the list | |
bool | deleteSymbolLayer (int index) |
delete symbol layer at specified index | |
QgsSymbolLayerV2 * | takeSymbolLayer (int index) |
remove symbol layer from the list and return pointer to it | |
bool | changeSymbolLayer (int index, QgsSymbolLayerV2 *layer) |
delete layer at specified index and set a new one | |
void | startRender (QgsRenderContext &context, const QgsVectorLayer *layer=0) |
void | stopRender (QgsRenderContext &context) |
void | setColor (const QColor &color) |
QColor | color () const |
void | drawPreviewIcon (QPainter *painter, QSize size) |
QImage | bigSymbolPreviewImage () |
QString | dump () const |
virtual QgsSymbolV2 * | clone () const =0 |
void | toSld (QDomDocument &doc, QDomElement &element, QgsStringMap props) const |
QgsSymbolV2::OutputUnit | outputUnit () const |
void | setOutputUnit (QgsSymbolV2::OutputUnit u) |
qreal | alpha () const |
Get alpha transparency 1 for opaque, 0 for invisible. | |
void | setAlpha (qreal alpha) |
Set alpha transparency 1 for opaque, 0 for invisible. | |
void | setRenderHints (int hints) |
int | renderHints () const |
QSet< QString > | usedAttributes () const |
Static Public Member Functions | |
static QgsSymbolV2 * | defaultSymbol (QGis::GeometryType geomType) |
return new default symbol for specified geometry type |
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) |
Protected Attributes | |
SymbolType | mType |
QgsSymbolLayerV2List | mLayers |
qreal | mAlpha |
Symbol opacity (in the range 0 - 1) | |
int | mRenderHints |
Definition at line 41 of file qgssymbolv2.h.
Definition at line 45 of file qgssymbolv2.h.
Definition at line 66 of file qgssymbolv2.h.
Definition at line 59 of file qgssymbolv2.h.
Definition at line 52 of file qgssymbolv2.h.
|
virtual |
Definition at line 56 of file qgssymbolv2.cpp.
References mLayers.
|
protected |
Definition at line 36 of file qgssymbolv2.cpp.
References isSymbolLayerCompatible(), mLayers, and type().
|
inline |
Get alpha transparency 1 for opaque, 0 for invisible.
Definition at line 120 of file qgssymbolv2.h.
Referenced by QgsSymbolLayerV2Utils::saveSymbol(), and toSld().
bool QgsSymbolV2::appendSymbolLayer | ( | QgsSymbolLayerV2 * | layer | ) |
append symbol layer at the end of the list
Definition at line 173 of file qgssymbolv2.cpp.
References isSymbolLayerCompatible(), mLayers, and QgsSymbolLayerV2::type().
QImage QgsSymbolV2::bigSymbolPreviewImage | ( | ) |
Definition at line 275 of file qgssymbolv2.cpp.
References QgsSymbolLayerV2Utils::createRenderContext(), Fill, Line, Marker, mType, startRender(), and stopRender().
bool QgsSymbolV2::changeSymbolLayer | ( | int | index, |
QgsSymbolLayerV2 * | layer | ||
) |
delete layer at specified index and set a new one
Definition at line 203 of file qgssymbolv2.cpp.
References isSymbolLayerCompatible(), mLayers, and QgsSymbolLayerV2::type().
|
pure virtual |
Implemented in QgsFillSymbolV2, QgsLineSymbolV2, and QgsMarkerSymbolV2.
Referenced by QgsGraduatedSymbolRendererV2::addClass(), QgsSingleSymbolRendererV2::clone(), QgsGraduatedSymbolRendererV2::clone(), QgsCategorizedSymbolRendererV2::clone(), QgsComposerSymbolV2Item::clone(), QgsRuleBasedRendererV2::Rule::clone(), QgsGraduatedSymbolRendererV2::createRenderer(), QgsRendererRangeV2::operator=(), QgsRendererCategoryV2::operator=(), QgsRendererCategoryV2::QgsRendererCategoryV2(), QgsRendererRangeV2::QgsRendererRangeV2(), QgsRuleBasedRendererV2::refineRuleCategories(), QgsRuleBasedRendererV2::refineRuleRanges(), QgsRuleBasedRendererV2::refineRuleScales(), QgsSingleSymbolRendererV2::startRender(), QgsGraduatedSymbolRendererV2::startRender(), QgsCategorizedSymbolRendererV2::startRender(), QgsStyleV2::symbol(), QgsGraduatedSymbolRendererV2::updateColorRamp(), QgsCategorizedSymbolRendererV2::updateSymbols(), and QgsGraduatedSymbolRendererV2::updateSymbols().
|
protected |
Definition at line 348 of file qgssymbolv2.cpp.
References QgsSymbolLayerV2::clone(), mLayers, QgsSymbolLayerV2::setLocked(), and QgsSymbolLayerV2::setRenderingPass().
Referenced by QgsMarkerSymbolV2::clone(), QgsLineSymbolV2::clone(), and QgsFillSymbolV2::clone().
QColor QgsSymbolV2::color | ( | void | ) | const |
Definition at line 240 of file qgssymbolv2.cpp.
References mLayers.
Referenced by dump(), QgsComposerMap::gridPen(), QgsMarkerLineSymbolLayerV2::setSubSymbol(), QgsCentroidFillSymbolLayerV2::setSubSymbol(), QgsCategorizedSymbolRendererV2::updateSymbols(), and QgsGraduatedSymbolRendererV2::updateSymbols().
|
static |
return new default symbol for specified geometry type
Definition at line 95 of file qgssymbolv2.cpp.
References QgsStyleV2::defaultStyle(), QgsProject::instance(), QGis::Line, QGis::Point, QGis::Polygon, QgsDebugMsg, QgsProject::readEntry(), setAlpha(), setColor(), and QgsStyleV2::symbol().
Referenced by QgsFeatureRendererV2::defaultRenderer(), and QgsVectorLayer::drawRendererV2Levels().
bool QgsSymbolV2::deleteSymbolLayer | ( | int | index | ) |
delete symbol layer at specified index
Definition at line 183 of file qgssymbolv2.cpp.
References mLayers.
void QgsSymbolV2::drawPreviewIcon | ( | QPainter * | painter, |
QSize | size | ||
) |
Definition at line 251 of file qgssymbolv2.cpp.
References QgsSymbolLayerV2Utils::createRenderContext(), Fill, Line, mAlpha, mLayers, mRenderHints, mType, outputUnit(), QgsLineSymbolLayerV2::renderPolygonOutline(), QgsSymbolLayerV2::startRender(), and QgsSymbolLayerV2::stopRender().
Referenced by QgsVectorFieldSymbolLayer::drawPreviewIcon(), QgsComposerLegend::drawSymbolV2(), and QgsSymbolLayerV2Utils::symbolPreviewPixmap().
QString QgsSymbolV2::dump | ( | ) | const |
Definition at line 316 of file qgssymbolv2.cpp.
References color(), QgsSymbolLayerV2Utils::encodeColor(), Fill, Line, Marker, mLayers, and type().
Referenced by QgsRendererRangeV2::dump(), QgsRendererCategoryV2::dump(), and QgsSingleSymbolRendererV2::dump().
bool QgsSymbolV2::insertSymbolLayer | ( | int | index, |
QgsSymbolLayerV2 * | layer | ||
) |
insert symbol layer to specified index
Definition at line 161 of file qgssymbolv2.cpp.
References isSymbolLayerCompatible(), mLayers, and QgsSymbolLayerV2::type().
|
protected |
check whether a symbol layer type can be used within the symbol (marker-marker, line-line, fill-fill/line)
Definition at line 151 of file qgssymbolv2.cpp.
References Fill, Line, and mType.
Referenced by appendSymbolLayer(), changeSymbolLayer(), insertSymbolLayer(), and QgsSymbolV2().
QgsSymbolV2::OutputUnit QgsSymbolV2::outputUnit | ( | ) | const |
Definition at line 63 of file qgssymbolv2.cpp.
References Mixed, and mLayers.
Referenced by drawPreviewIcon(), QgsComposerLegend::drawSymbolV2(), QgsCentroidFillSymbolLayerV2::outputUnit(), QgsMarkerSymbolV2::renderPoint(), QgsFillSymbolV2::renderPolygon(), QgsLineSymbolV2::renderPolyline(), startRender(), stopRender(), and toSld().
|
inline |
Definition at line 127 of file qgssymbolv2.h.
|
inline |
Set alpha transparency 1 for opaque, 0 for invisible.
Definition at line 122 of file qgssymbolv2.h.
Referenced by QgsMarkerSymbolV2::clone(), QgsLineSymbolV2::clone(), QgsFillSymbolV2::clone(), QgsComposerMap::createDefaultOverviewFrameSymbol(), defaultSymbol(), QgsSymbolLayerV2Utils::loadSymbol(), QgsMarkerLineSymbolLayerV2::startRender(), and QgsCentroidFillSymbolLayerV2::startRender().
void QgsSymbolV2::setColor | ( | const QColor & | color | ) |
Definition at line 231 of file qgssymbolv2.cpp.
References mLayers.
Referenced by QgsGraduatedSymbolRendererV2::createRenderer(), defaultSymbol(), QgsVectorLayer::drawRendererV2Levels(), QgsComposerMap::readXML(), QgsMarkerLineSymbolLayerV2::setColor(), QgsCentroidFillSymbolLayerV2::setColor(), QgsComposerMap::setGridPenColor(), QgsGraduatedSymbolRendererV2::updateColorRamp(), QgsCategorizedSymbolRendererV2::updateSymbols(), and QgsGraduatedSymbolRendererV2::updateSymbols().
void QgsSymbolV2::setOutputUnit | ( | QgsSymbolV2::OutputUnit | u | ) |
Definition at line 86 of file qgssymbolv2.cpp.
References mLayers.
Referenced by QgsComposerLegend::drawSymbolV2(), and QgsSymbolLayerV2Utils::loadSymbol().
|
inline |
Definition at line 125 of file qgssymbolv2.h.
Referenced by QgsSingleSymbolRendererV2::startRender(), QgsGraduatedSymbolRendererV2::startRender(), QgsCategorizedSymbolRendererV2::startRender(), and QgsMarkerLineSymbolLayerV2::startRender().
void QgsSymbolV2::startRender | ( | QgsRenderContext & | context, |
const QgsVectorLayer * | layer = 0 |
||
) |
Definition at line 216 of file qgssymbolv2.cpp.
References mAlpha, mLayers, mRenderHints, outputUnit(), and QgsSymbolV2RenderContext::setLayer().
Referenced by QgsPointPatternFillSymbolLayer::applyPattern(), bigSymbolPreviewImage(), QgsComposerMap::drawGridLine(), QgsAnnotationItem::drawMarkerSymbol(), QgsComposerMap::drawOverviewMapExtent(), QgsSingleSymbolRendererV2::startRender(), QgsPointDisplacementRenderer::startRender(), QgsVectorFieldSymbolLayer::startRender(), QgsGraduatedSymbolRendererV2::startRender(), QgsCategorizedSymbolRendererV2::startRender(), QgsMarkerLineSymbolLayerV2::startRender(), QgsSVGFillSymbolLayer::startRender(), QgsLinePatternFillSymbolLayer::startRender(), QgsPointPatternFillSymbolLayer::startRender(), and QgsCentroidFillSymbolLayerV2::startRender().
void QgsSymbolV2::stopRender | ( | QgsRenderContext & | context | ) |
Definition at line 224 of file qgssymbolv2.cpp.
References mAlpha, mLayers, mRenderHints, and outputUnit().
Referenced by QgsPointPatternFillSymbolLayer::applyPattern(), bigSymbolPreviewImage(), QgsComposerMap::drawGridLine(), QgsAnnotationItem::drawMarkerSymbol(), QgsComposerMap::drawOverviewMapExtent(), QgsSingleSymbolRendererV2::stopRender(), QgsPointDisplacementRenderer::stopRender(), QgsVectorFieldSymbolLayer::stopRender(), QgsMarkerLineSymbolLayerV2::stopRender(), QgsSVGFillSymbolLayer::stopRender(), QgsPointPatternFillSymbolLayer::stopRender(), and QgsCentroidFillSymbolLayerV2::stopRender().
QgsSymbolLayerV2 * QgsSymbolV2::symbolLayer | ( | int | layer | ) |
Definition at line 142 of file qgssymbolv2.cpp.
References mLayers.
Referenced by QgsVectorLayer::drawRendererV2Levels(), QgsVectorFileWriter::exportFeaturesSymbolLevels(), QgsSymbolLayerV2Utils::loadSymbols(), QgsSymbolLayerV2Utils::saveSymbol(), QgsRuleBasedRendererV2::stopRender(), QgsMarkerLineSymbolLayerV2::toSld(), and QgsPointPatternFillSymbolLayer::toSld().
|
inline |
Definition at line 83 of file qgssymbolv2.h.
Referenced by QgsVectorLayer::drawRendererV2Levels(), QgsVectorFileWriter::exportFeaturesSymbolLevels(), QgsSymbolLayerV2Utils::loadSymbols(), QgsSymbolLayerV2Utils::saveSymbol(), QgsRuleBasedRendererV2::stopRender(), QgsMarkerLineSymbolLayerV2::toSld(), and QgsPointPatternFillSymbolLayer::toSld().
QgsSymbolLayerV2 * QgsSymbolV2::takeSymbolLayer | ( | int | index | ) |
remove symbol layer from the list and return pointer to it
Definition at line 194 of file qgssymbolv2.cpp.
References mLayers.
void QgsSymbolV2::toSld | ( | QDomDocument & | doc, |
QDomElement & | element, | ||
QgsStringMap | props | ||
) | const |
Definition at line 335 of file qgssymbolv2.cpp.
References alpha(), QgsSymbolLayerV2Utils::encodeSldUom(), mLayers, and outputUnit().
Referenced by QgsRendererRangeV2::toSld(), QgsRendererCategoryV2::toSld(), QgsSingleSymbolRendererV2::toSld(), QgsVectorFieldSymbolLayer::toSld(), QgsSVGFillSymbolLayer::toSld(), QgsLinePatternFillSymbolLayer::toSld(), and QgsCentroidFillSymbolLayerV2::toSld().
|
inline |
Definition at line 77 of file qgssymbolv2.h.
Referenced by dump(), QgsSymbolV2(), QgsFeatureRendererV2::renderFeatureWithSymbol(), QgsSymbolLayerV2Utils::saveSymbol(), QgsFeatureRendererV2::setScaleMethodToSymbol(), QgsVectorFieldSymbolLayer::setSubSymbol(), QgsImageFillSymbolLayer::setSubSymbol(), QgsMarkerLineSymbolLayerV2::setSubSymbol(), QgsPointPatternFillSymbolLayer::setSubSymbol(), QgsCentroidFillSymbolLayerV2::setSubSymbol(), QgsSingleSymbolRendererV2::startRender(), QgsSingleSymbolRendererV2::symbolForFeature(), QgsGraduatedSymbolRendererV2::symbolForFeature(), and QgsCategorizedSymbolRendererV2::symbolForFeature().
QSet< QString > QgsSymbolV2::usedAttributes | ( | ) | const |
Definition at line 361 of file qgssymbolv2.cpp.
References mLayers.
Referenced by QgsSingleSymbolRendererV2::usedAttributes(), QgsGraduatedSymbolRendererV2::usedAttributes(), QgsCategorizedSymbolRendererV2::usedAttributes(), and QgsCentroidFillSymbolLayerV2::usedAttributes().
|
protected |
Symbol opacity (in the range 0 - 1)
Definition at line 145 of file qgssymbolv2.h.
Referenced by QgsMarkerSymbolV2::clone(), QgsLineSymbolV2::clone(), QgsFillSymbolV2::clone(), drawPreviewIcon(), QgsMarkerSymbolV2::renderPoint(), QgsFillSymbolV2::renderPolygon(), QgsLineSymbolV2::renderPolyline(), startRender(), and stopRender().
|
protected |
Definition at line 142 of file qgssymbolv2.h.
Referenced by QgsMarkerSymbolV2::angle(), appendSymbolLayer(), changeSymbolLayer(), cloneLayers(), color(), deleteSymbolLayer(), drawPreviewIcon(), dump(), insertSymbolLayer(), outputUnit(), QgsFillSymbolV2::QgsFillSymbolV2(), QgsLineSymbolV2::QgsLineSymbolV2(), QgsMarkerSymbolV2::QgsMarkerSymbolV2(), QgsSymbolV2(), QgsMarkerSymbolV2::renderPoint(), QgsFillSymbolV2::renderPolygon(), QgsLineSymbolV2::renderPolyline(), QgsMarkerSymbolV2::scaleMethod(), QgsMarkerSymbolV2::setAngle(), QgsFillSymbolV2::setAngle(), setColor(), setOutputUnit(), QgsMarkerSymbolV2::setScaleMethod(), QgsMarkerSymbolV2::setSize(), QgsLineSymbolV2::setWidth(), QgsMarkerSymbolV2::size(), startRender(), stopRender(), symbolLayer(), takeSymbolLayer(), toSld(), usedAttributes(), QgsLineSymbolV2::width(), and ~QgsSymbolV2().
|
protected |
Definition at line 147 of file qgssymbolv2.h.
Referenced by drawPreviewIcon(), QgsMarkerSymbolV2::renderPoint(), QgsFillSymbolV2::renderPolygon(), QgsLineSymbolV2::renderPolyline(), startRender(), and stopRender().
|
protected |
Definition at line 141 of file qgssymbolv2.h.
Referenced by bigSymbolPreviewImage(), drawPreviewIcon(), and isSymbolLayerCompatible().