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

« back to all changes in this revision

Viewing changes to src/qgssimarenderer.h

  • Committer: Bazaar Package Importer
  • Author(s): William Grant
  • Date: 2007-05-06 13:42:32 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070506134232-pyli6t388w5asd8x
Tags: 0.8.0-3ubuntu1
* Merge from Debian unstable. Remaining Ubuntu changes:
  - debian/rules, debian/qgis.install, debian/qgis.dirs debian/qgis.desktop:
    Add and install .desktop.
* debian/qgis.desktop: Remove Applications category; it's not real.
* Modify Maintainer value to match Debian-Maintainer-Field Spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
                               qgssimarenderer.h 
3
 
                             Single marker renderer
4
 
                             -------------------
5
 
    begin                : March 2004
6
 
    copyright            : (C) 2004 by Marco Hugentobler
7
 
    email                : mhugent@geo.unizh.ch
8
 
***************************************************************************/
9
 
 
10
 
/***************************************************************************
11
 
 *                                                                         *
12
 
 *   This program is free software; you can redistribute it and/or modify  *
13
 
 *   it under the terms of the GNU General Public License as published by  *
14
 
 *   the Free Software Foundation; either version 2 of the License, or     *
15
 
 *   (at your option) any later version.                                   *
16
 
 *                                                                         *
17
 
 ***************************************************************************/
18
 
 /* $Id: qgssimarenderer.h,v 1.19 2005/04/02 09:42:53 rabla Exp $ */
19
 
 
20
 
#ifndef QGSSIMARENDERER_H
21
 
#define QGSSIMARENDERER_H
22
 
 
23
 
#include "qgsrenderer.h"
24
 
#include "qgsrenderitem.h"
25
 
#include "qgsmarkersymbol.h"
26
 
 
27
 
class QgsSiMaRenderer: public QgsRenderer
28
 
{
29
 
 public:
30
 
    QgsSiMaRenderer();
31
 
    virtual ~QgsSiMaRenderer();
32
 
    /**Replaces the current mItem by ri*/
33
 
    void addItem(QgsRenderItem* ri);
34
 
    void initializeSymbology(QgsVectorLayer* layer, QgsDlgVectorLayerProperties* pr=0);
35
 
    void renderFeature(QPainter* p, QgsFeature* f, QPicture* pic, double* scalefactor, bool selected, int oversampling = 1, double widthScale = 1.);
36
 
    /**Reads the renderer configuration from an XML file
37
 
     @param rnode the DOM node to read 
38
 
     @param vl the vector layer which will be associated with the renderer*/
39
 
    virtual void readXML(const QDomNode& rnode, QgsVectorLayer& vl);
40
 
    /**Writes the contents of the renderer to a configuration file*/
41
 
    virtual void writeXML(std::ostream& xml);
42
 
    /**Writes the contents of the renderer to a configuration file
43
 
     @ return true in case of success*/
44
 
    virtual bool writeXML( QDomNode & layer_node, QDomDocument & document );
45
 
    bool needsAttributes();
46
 
    /**Returns an empty list, since no classification attributes are used*/
47
 
    virtual std::list<int> classificationAttributes();
48
 
    QgsRenderItem* item();
49
 
    /**Returns the renderers name*/
50
 
    QString name();
51
 
    /**Return symbology items*/
52
 
    const std::list<QgsRenderItem*> items() const;
53
 
 protected:
54
 
    QgsRenderItem* mItem;
55
 
};
56
 
 
57
 
inline QgsSiMaRenderer::QgsSiMaRenderer()
58
 
{
59
 
  //call superclass method to set up selection colour
60
 
  initialiseSelectionColor();
61
 
 
62
 
  mItem=new QgsRenderItem(new QgsMarkerSymbol(),"","");
63
 
}
64
 
 
65
 
inline QgsSiMaRenderer::~QgsSiMaRenderer()
66
 
{
67
 
    delete mItem;
68
 
}
69
 
 
70
 
inline bool QgsSiMaRenderer::needsAttributes()
71
 
{
72
 
    return false;
73
 
}
74
 
 
75
 
inline void QgsSiMaRenderer::addItem(QgsRenderItem* ri)
76
 
{
77
 
    delete mItem;
78
 
    mItem=ri;
79
 
}
80
 
 
81
 
inline QgsRenderItem* QgsSiMaRenderer::item()
82
 
{
83
 
    return mItem;
84
 
}
85
 
 
86
 
#endif