~ubuntu-branches/ubuntu/quantal/qgis/quantal

« back to all changes in this revision

Viewing changes to src/qgsrenderer.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve Halasz
  • Date: 2004-12-21 09:46:27 UTC
  • Revision ID: james.westby@ubuntu.com-20041221094627-r9lb6mlz2o3yp8gn
Tags: upstream-0.6.0
ImportĀ upstreamĀ versionĀ 0.6.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
                         qgsrenderer.h  -  description
 
3
                             -------------------
 
4
    begin                : Sat Jan 4 2003
 
5
    copyright            : (C) 2003 by Gary E.Sherman
 
6
    email                : sherman at mrcc.com
 
7
 ***************************************************************************/
 
8
 
 
9
/***************************************************************************
 
10
 *                                                                         *
 
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.                                   *
 
15
 *                                                                         *
 
16
 ***************************************************************************/
 
17
/* $Id: qgsrenderer.h,v 1.18 2004/10/21 17:27:38 mcoletti Exp $ */
 
18
#ifndef QGSRENDERER_H
 
19
#define QGSRENDERER_H
 
20
 
 
21
class QgsFeature;
 
22
class QgsCoordinateTransform;
 
23
class QgsVectorLayer;
 
24
class QPainter;
 
25
class QgsDlgVectorLayerProperties;
 
26
class QPicture;
 
27
class QDomNode;
 
28
class QColor;
 
29
 
 
30
#include <fstream>
 
31
#include <list>
 
32
#include <qstring.h>
 
33
 
 
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*/
 
35
class QgsRenderer
 
36
{
 
37
 public:
 
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;
 
60
};
 
61
 
 
62
#endif // QGSRENDERER_H