Quantum GIS API Documentation  1.7.4
src/core/symbology-ng/qgssinglesymbolrendererv2.h
Go to the documentation of this file.
00001 #ifndef QGSSINGLESYMBOLRENDERERV2_H
00002 #define QGSSINGLESYMBOLRENDERERV2_H
00003 
00004 #include "qgsrendererv2.h"
00005 
00006 class CORE_EXPORT QgsSingleSymbolRendererV2 : public QgsFeatureRendererV2
00007 {
00008   public:
00009 
00010     QgsSingleSymbolRendererV2( QgsSymbolV2* symbol );
00011 
00012     virtual ~QgsSingleSymbolRendererV2();
00013 
00014     virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature );
00015 
00016     virtual void startRender( QgsRenderContext& context, const QgsVectorLayer *vlayer );
00017 
00018     virtual void stopRender( QgsRenderContext& context );
00019 
00020     virtual QList<QString> usedAttributes();
00021 
00022     QgsSymbolV2* symbol() const;
00023     void setSymbol( QgsSymbolV2* s );
00024 
00026     void setRotationField( QString fieldName ) { mRotationField = fieldName; }
00028     QString rotationField() const { return mRotationField; }
00029 
00031     void setSizeScaleField( QString fieldName ) { mSizeScaleField = fieldName; }
00033     QString sizeScaleField() const { return mSizeScaleField; }
00034 
00035     virtual QString dump();
00036 
00037     virtual QgsFeatureRendererV2* clone();
00038 
00039     virtual QgsSymbolV2List symbols();
00040 
00042     static QgsFeatureRendererV2* create( QDomElement& element );
00043 
00045     virtual QDomElement save( QDomDocument& doc );
00046 
00048     virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize );
00049 
00052     virtual QgsLegendSymbolList legendSymbolItems();
00053 
00054   protected:
00055     QgsSymbolV2* mSymbol;
00056     QString mRotationField;
00057     QString mSizeScaleField;
00058 
00059     // temporary stuff for rendering
00060     int mRotationFieldIdx, mSizeScaleFieldIdx;
00061     QgsSymbolV2* mTempSymbol;
00062     double mOrigSize;
00063 };
00064 
00065 
00066 #endif // QGSSINGLESYMBOLRENDERERV2_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines