2007-04-02 17:41:47 +00:00
|
|
|
/**Render class to display all the features with a single QgsSymbol*/
|
|
|
|
class QgsSingleSymbolRenderer : QgsRenderer
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgssinglesymbolrenderer.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
public:
|
2012-09-24 02:28:15 +02:00
|
|
|
QgsSingleSymbolRenderer( QGis::GeometryType type );
|
|
|
|
QgsSingleSymbolRenderer( const QgsSingleSymbolRenderer& other );
|
2007-04-02 17:41:47 +00:00
|
|
|
virtual ~QgsSingleSymbolRenderer();
|
2009-07-23 10:59:59 +00:00
|
|
|
|
2007-04-02 17:41:47 +00:00
|
|
|
/**Replaces the current mSymbol by sy*/
|
2012-09-24 02:28:15 +02:00
|
|
|
void addSymbol( QgsSymbol* sy /Transfer/ );
|
2007-04-02 17:41:47 +00:00
|
|
|
/*Returns a pointer to mSymbol*/
|
|
|
|
const QgsSymbol* symbol() const;
|
2009-07-23 10:59:59 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
/**Renders a feature
|
|
|
|
* added in 1.2 */
|
|
|
|
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
|
2012-09-24 02:28:15 +02:00
|
|
|
@param rnode the Dom node to read
|
|
|
|
@param vl the vector layer which will be associated with the renderer
|
|
|
|
@return 0 in case of success, 1 if vector layer has no renderer, 2 if classification field not found
|
|
|
|
*/
|
|
|
|
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*/
|
|
|
|
/*virtual void writeXML(std::ostream& xml);*/
|
|
|
|
/**Writes the contents of the renderer to a configuration file
|
|
|
|
@ return true in case of success*/
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual bool writeXML( QDomNode & layer_node, QDomDocument & document, const QgsVectorLayer& vl ) const;
|
|
|
|
/**Returns true, attributes needed for single symbol*/
|
2007-04-02 17:41:47 +00:00
|
|
|
bool needsAttributes() const;
|
2012-09-24 02:28:15 +02:00
|
|
|
/**Returns a list of all needed attributes*/
|
2007-04-02 17:41:47 +00:00
|
|
|
QList<int> classificationAttributes() const;
|
2010-01-05 14:09:31 +00:00
|
|
|
void updateSymbolAttributes();
|
2007-04-02 17:41:47 +00:00
|
|
|
/**Returns the renderers name*/
|
|
|
|
virtual QString name() const;
|
|
|
|
/**Returns a list containing mSymbol*/
|
|
|
|
const QList<QgsSymbol*> symbols() const;
|
|
|
|
/**Returns a deep copy of this renderer*/
|
2007-11-27 23:05:24 +00:00
|
|
|
QgsRenderer* clone() const /Factory/;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
/**Returns renderer symbol for a feature
|
|
|
|
@note: this method was added in version 1.6*/
|
|
|
|
QgsSymbol* symbolForFeature( const QgsFeature* f );
|
2007-04-02 17:41:47 +00:00
|
|
|
};
|
|
|
|
|