1
/***************************************************************************
2
qgsrenderer.h - description
5
copyright : (C) 2003 by Gary E.Sherman
6
email : sherman at mrcc.com
7
***************************************************************************/
9
/***************************************************************************
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
16
***************************************************************************/
17
/* $Id: qgsrenderer.h,v 1.18 2004/10/21 17:27:38 mcoletti Exp $ */
22
class QgsCoordinateTransform;
25
class QgsDlgVectorLayerProperties;
34
/**Abstract base class for renderers. A renderer holds all the information necessary to draw the contents of a vector layer to a map canvas. The vector layer then passes each feature to paint to the renderer*/
38
/**Sets the initial symbology configuration for a layer. Besides of applying default symbology settings, an instance of the corresponding renderer dialog is created and associated with the layer (or with the property dialog, if pr is not 0). Finally, a pixmap for the legend is drawn (or, if pr is not 0, it is stored in the property dialog, until the settings are applied).
39
@param layer the vector layer associated with the renderer
40
@param pr the property dialog. This is only needed if the renderer is created from the property dialog and not yet associated with the vector layer, otherwise 0*/
41
virtual void initializeSymbology(QgsVectorLayer* layer, QgsDlgVectorLayerProperties* pr=0)=0;
42
/**A vector layer passes features to a renderer object to change the brush and pen of the qpainter
43
@param p the painter storing brush and pen
44
@param f a pointer to the feature to be rendered
45
@param pic pointer to a marker from SVG (is only used by marker renderers)
46
@param scalefactor pointer to the scale factor for the marker image*/
47
virtual void renderFeature(QPainter* p, QgsFeature* f,QPicture* pic, double* scalefactor, bool selected)=0;
48
/**Reads the renderer configuration from an XML file
49
@param rnode the DOM node to read
50
@param vl the vector layer which will be associated with the renderer*/
51
virtual void readXML(const QDomNode& rnode, QgsVectorLayer& vl)=0;
52
/**Writes the contents of the renderer to a configuration file*/
53
virtual void writeXML(std::ostream& xml)=0;
54
/** Returns true, if attribute values are used by the renderer and false otherwise*/
55
virtual bool needsAttributes()=0;
56
/**Returns a list with indexes of classification attributes*/
57
virtual std::list<int> classificationAttributes()=0;
58
/**Returns the renderers name*/
59
virtual QString name()=0;
62
#endif // QGSRENDERER_H