~ubuntu-branches/ubuntu/hardy/qgis/hardy

« back to all changes in this revision

Viewing changes to src/core/qgsmarkersymbol.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
                          qgsmarkersymbol.h  -  description
 
3
                             -------------------
 
4
    begin                : March 2004
 
5
    copyright            : (C) 2004 by Marco Hugentobler
 
6
    email                : mhugent@geo.unizh.ch
 
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: qgsmarkersymbol.h 4502 2006-01-08 01:18:20Z timlinux $ */
 
18
 
 
19
#ifndef QGSMARKERSYMBOL_H
 
20
#define QGSMARKERSYMBOL_H
 
21
 
 
22
#include "qgssymbol.h"
 
23
#include <q3picture.h>
 
24
 
 
25
/**Representation of a marker symbol*/
 
26
class QgsMarkerSymbol : public QgsSymbol
 
27
{
 
28
 public:
 
29
    /**Constructor*/
 
30
    QgsMarkerSymbol();
 
31
    /**Destructor*/
 
32
    virtual ~QgsMarkerSymbol();
 
33
    /**Loads the QPainter commands from an svg file
 
34
       @param svgpath the pathe to the svg file which stores the picture*/
 
35
    void setPicture(const QString& svgpath);
 
36
    /**Sets the scale factor*/
 
37
    void setScaleFactor(double factor);
 
38
    /**Returns the path of the picture object*/
 
39
    const QString& picture() const;
 
40
    /**Returns the scale factor*/
 
41
    double scaleFactor();
 
42
    /**Writes the contents of the symbol to a configuration file
 
43
     @ return true in case of success*/
 
44
    virtual bool writeXML( QDomNode & item, QDomDocument & document );
 
45
 protected:
 
46
    /**Path to the SVG image*/
 
47
    QString mSvgPath;
 
48
    /**Scale factor. 1 keeps the size as it is, 2 doubles the size, etc.*/
 
49
    double mScaleFactor;
 
50
};
 
51
 
 
52
inline QgsMarkerSymbol::QgsMarkerSymbol()
 
53
    : QgsSymbol(), mSvgPath(""), mScaleFactor(1)
 
54
{}
 
55
 
 
56
inline QgsMarkerSymbol::~QgsMarkerSymbol()
 
57
{}
 
58
 
 
59
inline void QgsMarkerSymbol::setScaleFactor(double factor)
 
60
{
 
61
    mScaleFactor=factor;
 
62
}
 
63
 
 
64
inline const QString& QgsMarkerSymbol::picture() const
 
65
{
 
66
    return mSvgPath;
 
67
}
 
68
 
 
69
inline double QgsMarkerSymbol::scaleFactor()
 
70
{
 
71
    return mScaleFactor;
 
72
}
 
73
 
 
74
#endif