QGIS API Documentation  2.7.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsSymbolV2 Class Referenceabstract

#include <qgssymbolv2.h>

Inheritance diagram for QgsSymbolV2:
Inheritance graph
[legend]

Public Types

enum  OutputUnit { MM = 0, MapUnit, Mixed, Pixel }
 
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...
 
virtual QgsSymbolV2clone () 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 QgsVectorLayerlayer () 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 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)
 
QgsSymbolLayerV2symbolLayer (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...
 
QgsSymbolLayerV2takeSymbolLayer (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 QgsSymbolV2defaultSymbol (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...
 
const QgsVectorLayermLayer
 
QgsSymbolLayerV2List mLayers
 
int mRenderHints
 
SymbolType mType
 

Detailed Description

Definition at line 43 of file qgssymbolv2.h.

Member Enumeration Documentation

Enumerator
MM 
MapUnit 
Mixed 
Pixel 

Definition at line 47 of file qgssymbolv2.h.

Enumerator
DataDefinedSizeScale 
DataDefinedRotation 

Definition at line 68 of file qgssymbolv2.h.

Enumerator
ScaleArea 
ScaleDiameter 

Definition at line 62 of file qgssymbolv2.h.

Enumerator
Marker 
Line 
Fill 

Definition at line 55 of file qgssymbolv2.h.

Constructor & Destructor Documentation

QgsSymbolV2::~QgsSymbolV2 ( )
virtual

Definition at line 56 of file qgssymbolv2.cpp.

QgsSymbolV2::QgsSymbolV2 ( SymbolType  type,
QgsSymbolLayerV2List  layers 
)
protected

Definition at line 36 of file qgssymbolv2.cpp.

Member Function Documentation

qreal QgsSymbolV2::alpha ( ) const
inline

Get alpha transparency 1 for opaque, 0 for invisible.

Definition at line 151 of file qgssymbolv2.h.

bool QgsSymbolV2::appendSymbolLayer ( QgsSymbolLayerV2 layer)

append symbol layer at the end of the list

Definition at line 204 of file qgssymbolv2.cpp.

QImage QgsSymbolV2::asImage ( QSize  size,
QgsRenderContext customContext = 0 
)

Definition at line 311 of file qgssymbolv2.cpp.

QImage QgsSymbolV2::bigSymbolPreviewImage ( )

Definition at line 325 of file qgssymbolv2.cpp.

bool QgsSymbolV2::changeSymbolLayer ( int  index,
QgsSymbolLayerV2 layer 
)

delete layer at specified index and set a new one

Definition at line 234 of file qgssymbolv2.cpp.

virtual QgsSymbolV2* QgsSymbolV2::clone ( ) const
pure virtual
QgsSymbolLayerV2List QgsSymbolV2::cloneLayers ( ) const
protected

Definition at line 398 of file qgssymbolv2.cpp.

QColor QgsSymbolV2::color ( void  ) const

Definition at line 275 of file qgssymbolv2.cpp.

QgsSymbolV2 * QgsSymbolV2::defaultSymbol ( QGis::GeometryType  geomType)
static

return new default symbol for specified geometry type

Definition at line 126 of file qgssymbolv2.cpp.

bool QgsSymbolV2::deleteSymbolLayer ( int  index)

delete symbol layer at specified index

Definition at line 214 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.

Note
customContext parameter added in 2.6

Definition at line 286 of file qgssymbolv2.cpp.

QString QgsSymbolV2::dump ( ) const

Definition at line 366 of file qgssymbolv2.cpp.

bool QgsSymbolV2::insertSymbolLayer ( int  index,
QgsSymbolLayerV2 layer 
)

insert symbol layer to specified index

Definition at line 192 of file qgssymbolv2.cpp.

bool QgsSymbolV2::isSymbolLayerCompatible ( SymbolType  t)
protected

check whether a symbol layer type can be used within the symbol (marker-marker, line-line, fill-fill/line)

Definition at line 182 of file qgssymbolv2.cpp.

const QgsVectorLayer* QgsSymbolV2::layer ( ) const
inline

Definition at line 161 of file qgssymbolv2.h.

QgsMapUnitScale QgsSymbolV2::mapUnitScale ( ) const

Definition at line 84 of file qgssymbolv2.cpp.

QgsSymbolV2::OutputUnit QgsSymbolV2::outputUnit ( ) const

Definition at line 63 of file qgssymbolv2.cpp.

int QgsSymbolV2::renderHints ( ) const
inline

Definition at line 156 of file qgssymbolv2.h.

void QgsSymbolV2::setAlpha ( qreal  alpha)
inline

Set alpha transparency 1 for opaque, 0 for invisible.

Definition at line 153 of file qgssymbolv2.h.

void QgsSymbolV2::setColor ( const QColor &  color)

Definition at line 266 of file qgssymbolv2.cpp.

void QgsSymbolV2::setLayer ( const QgsVectorLayer layer)
inline

Definition at line 160 of file qgssymbolv2.h.

void QgsSymbolV2::setMapUnitScale ( const QgsMapUnitScale scale)

Definition at line 117 of file qgssymbolv2.cpp.

void QgsSymbolV2::setOutputUnit ( QgsSymbolV2::OutputUnit  u)

Definition at line 108 of file qgssymbolv2.cpp.

void QgsSymbolV2::setRenderHints ( int  hints)
inline

Definition at line 155 of file qgssymbolv2.h.

void QgsSymbolV2::startRender ( QgsRenderContext context,
const QgsFields fields = 0 
)

Definition at line 247 of file qgssymbolv2.cpp.

void QgsSymbolV2::stopRender ( QgsRenderContext context)

Definition at line 256 of file qgssymbolv2.cpp.

QgsSymbolLayerV2 * QgsSymbolV2::symbolLayer ( int  layer)

Returns a specific symbol layers contained in the symbol.

Parameters
layerlayer number
Returns
corresponding symbol layer
Note
added in QGIS 2.7
See also
symbolLayers
symbolLayerCount

Definition at line 173 of file qgssymbolv2.cpp.

int QgsSymbolV2::symbolLayerCount ( )
inline

Returns total number of symbol layers contained in the symbol.

Returns
count of symbol layers
Note
added in QGIS 2.7
See also
symbolLayers
symbolLayer

Definition at line 106 of file qgssymbolv2.h.

QgsSymbolLayerV2List QgsSymbolV2::symbolLayers ( )
inline

Returns list of symbol layers contained in the symbol.

Returns
symbol layers list
Note
added in QGIS 2.7
See also
symbolLayer
symbolLayerCount

Definition at line 89 of file qgssymbolv2.h.

QgsSymbolLayerV2 * QgsSymbolV2::takeSymbolLayer ( int  index)

remove symbol layer from the list and return pointer to it

Definition at line 225 of file qgssymbolv2.cpp.

void QgsSymbolV2::toSld ( QDomDocument &  doc,
QDomElement &  element,
QgsStringMap  props 
) const

Definition at line 385 of file qgssymbolv2.cpp.

SymbolType QgsSymbolV2::type ( ) const
inline

Definition at line 79 of file qgssymbolv2.h.

QSet< QString > QgsSymbolV2::usedAttributes ( ) const

Definition at line 411 of file qgssymbolv2.cpp.

Member Data Documentation

qreal QgsSymbolV2::mAlpha
protected

Symbol opacity (in the range 0 - 1)

Definition at line 176 of file qgssymbolv2.h.

const QgsVectorLayer* QgsSymbolV2::mLayer
protected

Definition at line 180 of file qgssymbolv2.h.

QgsSymbolLayerV2List QgsSymbolV2::mLayers
protected

Definition at line 173 of file qgssymbolv2.h.

int QgsSymbolV2::mRenderHints
protected

Definition at line 178 of file qgssymbolv2.h.

SymbolType QgsSymbolV2::mType
protected

Definition at line 172 of file qgssymbolv2.h.


The documentation for this class was generated from the following files: