2007-04-02 17:41:47 +00:00
/**This class contains the information for graduate symbol rendering*/
class QgsGraduatedSymbolRenderer : QgsRenderer
{
%TypeHeaderCode
#include <qgsgraduatedsymbolrenderer.h>
%End
public:
2008-10-16 17:30:14 +00:00
enum Mode
{
EqualInterval,
Quantile,
Empty
};
2008-10-10 20:02:22 +00:00
QgsGraduatedSymbolRenderer(QGis::GeometryType type);
2008-10-16 17:30:14 +00:00
2007-04-02 17:41:47 +00:00
QgsGraduatedSymbolRenderer(const QgsGraduatedSymbolRenderer& other);
2008-10-16 17:30:14 +00:00
2007-04-02 17:41:47 +00:00
virtual ~QgsGraduatedSymbolRenderer();
2008-10-16 17:30:14 +00:00
/** Get the mode - which is only really used to be able to reinstate
* the graduated dialog properties properly, so we
* dont do anything else besides accessors and mutators in
* this class.
*/
const Mode mode() const;
/** Set the mode - which is only really used to be able to reinstate
* the graduated dialog properties properly, so we
* dont do anything else besides accessors and mutators in
* this class.
*/
void setMode( Mode theMode );
2007-04-02 17:41:47 +00:00
/**Adds a new item
\param sy a pointer to the QgsSymbol to be inserted. It has to be created using the new operator and is automatically destroyed when 'removeItems' is called or when this object is destroyed*/
2007-11-27 23:05:24 +00:00
void addSymbol(QgsSymbol* sy /Transfer/);
2008-10-16 17:30:14 +00:00
2007-04-02 17:41:47 +00:00
/**Returns the number of the classification field*/
int classificationField() const;
2008-10-16 17:30:14 +00:00
2007-04-02 17:41:47 +00:00
/**Removes all symbols*/
void removeSymbols();
2008-10-16 17:30:14 +00:00
2007-04-02 17:41:47 +00:00
/** Determines if a feature will be rendered or not
2008-10-16 17:30:14 +00:00
@param f a pointer to the feature to determine if rendering will happen*/
2007-04-02 17:41:47 +00:00
bool willRenderFeature(QgsFeature *f);
2008-10-16 17:30:14 +00:00
2007-04-02 17:41:47 +00:00
/**Renders an OGRFeature
\param p a painter (usually the one from the current map canvas)
\param f a pointer to a feature to render
\param t the transform object containing the information how to transform the map coordinates to screen coordinates*/
2008-05-15 08:13:05 +00:00
void renderFeature(QPainter* p, QgsFeature& f, QImage* img, bool selected, double widthScale = 1.0, double rasterScaleFactor = 1.0);
2008-10-16 17:30:14 +00:00
2007-04-02 17:41:47 +00:00
/**Sets the number of the classicifation field
\param field the number of the field to classify*/
void setClassificationField(int field);
2008-10-16 17:30:14 +00:00
2007-04-02 17:41:47 +00:00
/**Reads the renderer configuration from an XML file
2008-08-23 09:19:49 +00:00
@param rnode the Dom node to read
2007-04-02 17:41:47 +00:00
@param vl the vector layer which will be associated with the renderer*/
2008-10-06 13:00:45 +00:00
virtual int readXML(const QDomNode& rnode, QgsVectorLayer& vl);
2008-10-16 17:30:14 +00:00
2007-04-02 17:41:47 +00:00
/**Writes the contents of the renderer to a configuration file
@ return true in case of success*/
2008-10-06 13:00:45 +00:00
virtual bool writeXML( QDomNode & layer_node, QDomDocument & document, QgsVectorLayer& vl ) const;
2008-10-16 17:30:14 +00:00
2007-04-02 17:41:47 +00:00
/** Returns true*/
bool needsAttributes() const;
2008-10-16 17:30:14 +00:00
2007-04-02 17:41:47 +00:00
/**Returns a list with the index to the classification field*/
QList<int> classificationAttributes() const;
2008-10-16 17:30:14 +00:00
2007-04-02 17:41:47 +00:00
/**Returns the renderers name*/
QString name() const;
2008-10-16 17:30:14 +00:00
2007-04-02 17:41:47 +00:00
/**Returns the symbols of the items*/
const QList<QgsSymbol*> symbols() const;
2008-10-16 17:30:14 +00:00
2007-04-02 17:41:47 +00:00
/**Returns a copy of the renderer (a deep copy on the heap)*/
2007-11-27 23:05:24 +00:00
QgsRenderer* clone() const /Factory/;
2007-04-02 17:41:47 +00:00
};