1
/***************************************************************************
2
qgsmarkersymbol.cpp - description
5
copyright : (C) 2004 by Marco Hugentobler
6
email : mhugent@geo.unizh.ch
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
***************************************************************************/
19
#include "qgsmarkersymbol.h"
21
#include "qgssymbologyutils.h"
23
void QgsMarkerSymbol::setPicture(const QString& svgpath)
28
bool QgsMarkerSymbol::writeXML( QDomNode & item, QDomDocument & document )
30
bool returnval = false;
31
returnval = true; // remove this if anyone ever adds checking here
32
QDomElement markersymbol=document.createElement("markersymbol");
33
item.appendChild(markersymbol);
34
QDomElement svgpath=document.createElement("svgpath");
35
QDomText svgpathtxt=document.createTextNode(mSvgPath);
36
svgpath.appendChild(svgpathtxt);
37
markersymbol.appendChild(svgpath);
38
QDomElement scalefactor=document.createElement("scalefactor");
39
QDomText scalefactortxt=document.createTextNode(QString::number(mScaleFactor,'f',2));
40
scalefactor.appendChild(scalefactortxt);
41
markersymbol.appendChild(scalefactor);
42
markersymbol.appendChild(scalefactor);
43
QDomElement outlinecolor=document.createElement("outlinecolor");
44
outlinecolor.setAttribute("red",QString::number(mPen.color().red()));
45
outlinecolor.setAttribute("green",QString::number(mPen.color().green()));
46
outlinecolor.setAttribute("blue",QString::number(mPen.color().blue()));
47
markersymbol.appendChild(outlinecolor);
48
QDomElement outlinestyle=document.createElement("outlinestyle");
49
QDomText outlinestyletxt=document.createTextNode(QgsSymbologyUtils::penStyle2QString(mPen.style()));
50
outlinestyle.appendChild(outlinestyletxt);
51
markersymbol.appendChild(outlinestyle);
52
QDomElement outlinewidth=document.createElement("outlinewidth");
53
QDomText outlinewidthtxt=document.createTextNode(QString::number(mPen.width()));
54
outlinewidth.appendChild(outlinewidthtxt);
55
markersymbol.appendChild(outlinewidth);
56
QDomElement fillcolor=document.createElement("fillcolor");
57
fillcolor.setAttribute("red",QString::number(mBrush.color().red()));
58
fillcolor.setAttribute("green",QString::number(mBrush.color().green()));
59
fillcolor.setAttribute("blue",QString::number(mBrush.color().blue()));
60
markersymbol.appendChild(fillcolor);
61
QDomElement fillpattern=document.createElement("fillpattern");
62
QDomText fillpatterntxt=document.createTextNode(QgsSymbologyUtils::brushStyle2QString(mBrush.style()));
63
fillpattern.appendChild(fillpatterntxt);
64
markersymbol.appendChild(fillpattern);
65
fillpattern.appendChild(fillpatterntxt);