2007-04-02 17:41:47 +00:00
|
|
|
class QgsUniqueValueRenderer : QgsRenderer
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgsuniquevaluerenderer.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
public:
|
2008-10-10 20:02:22 +00:00
|
|
|
QgsUniqueValueRenderer(QGis::GeometryType type);
|
2007-04-02 17:41:47 +00:00
|
|
|
QgsUniqueValueRenderer(const QgsUniqueValueRenderer& other);
|
|
|
|
virtual ~QgsUniqueValueRenderer();
|
|
|
|
/** Determines if a feature will be rendered or not
|
|
|
|
@param f a pointer to the feature to determine if rendering will happen*/
|
|
|
|
bool willRenderFeature(QgsFeature *f);
|
2009-07-23 10:59:59 +00:00
|
|
|
|
|
|
|
/* render feature
|
|
|
|
* added in 1.2 */
|
2009-08-05 16:43:33 +00:00
|
|
|
void renderFeature(QgsRenderContext &renderContext, QgsFeature& f, QImage* img, bool selected, double opacity = 1.0);
|
2009-07-23 10:59:59 +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);
|
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, const QgsVectorLayer& vl ) const;
|
2007-04-02 17:41:47 +00:00
|
|
|
/** Returns true, if attribute values are used by the renderer and false otherwise*/
|
|
|
|
bool needsAttributes() const;
|
|
|
|
/**Returns a list with indexes of classification attributes*/
|
|
|
|
QList<int> classificationAttributes() const;
|
|
|
|
/**Returns the renderers name*/
|
|
|
|
QString name() const;
|
|
|
|
/**Inserts an entry into mEntries. The render items have to be created with the new operator and are automatically destroyed if not needed anymore*/
|
2007-11-27 23:05:24 +00:00
|
|
|
void insertValue(QString name, QgsSymbol* symbol /Transfer/);
|
2007-04-02 17:41:47 +00:00
|
|
|
/**Removes all entries from mEntries*/
|
|
|
|
void clearValues();
|
|
|
|
/**Sets the Field index used for classification*/
|
|
|
|
void setClassificationField(int field);
|
|
|
|
/**Returns the index of the classification field*/
|
|
|
|
int classificationField();
|
|
|
|
/**Return symbology items*/
|
|
|
|
const QList<QgsSymbol*> symbols() const;
|
2009-12-03 17:14:04 +00:00
|
|
|
/**Return the classification map
|
|
|
|
@note added in 1.4 */
|
|
|
|
const QMap<QString, QgsSymbol*> symbolMap() const;
|
2007-11-27 23:05:24 +00:00
|
|
|
QgsRenderer* clone() const /Factory/;
|
2007-04-02 17:41:47 +00:00
|
|
|
};
|
|
|
|
|