Quantum GIS API Documentation  1.7.4
src/core/symbology/qgssymbologyutils.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002                          qgssymbologyutils.cpp  -  description
00003                              -------------------
00004     begin                : Oct 2003
00005     copyright            : (C) 2003 by Marco Hugentobler
00006     email                : mhugent@geo.unizh.ch
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 /* $Id$ */
00018 #include "qgssymbologyutils.h"
00019 #include "qgslogger.h"
00020 #include <QPixmap>
00021 
00022 static const char *solidLineData[] =
00023 {
00024   "60 26 4 1",
00025   "a c None",
00026   "# c None",
00027   ". c None",
00028   "b c #0000c5",
00029   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00030   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00031   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00032   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00033   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00034   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00035   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00036   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00037   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00038   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00039   "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
00040   "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
00041   "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
00042   "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
00043   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00044   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00045   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00046   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00047   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00048   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00049   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00050   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00051   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00052   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00053   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00054   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a."
00055 };
00056 
00057 static const char *dashLineData[] =
00058 {
00059   "60 26 4 1",
00060   "a c None",
00061   "# c None",
00062   ". c None",
00063   "b c #0000c5",
00064   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00065   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00066   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00067   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00068   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00069   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00070   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00071   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00072   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00073   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00074   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00075   "bbbbbbbbbbbba.a.abbbbbbbbbbbb.a.a.bbbbbbbbbbbba.a.abbbbbbbbb",
00076   "bbbbbbbbbbbb.#.#.bbbbbbbbbbbb#.#.#bbbbbbbbbbbb.#.#.bbbbbbbbb",
00077   "bbbbbbbbbbbba.a.abbbbbbbbbbbb.a.a.bbbbbbbbbbbba.a.abbbbbbbbb",
00078   "bbbbbbbbbbbb.#.#.bbbbbbbbbbbb#.#.#bbbbbbbbbbbb.#.#.bbbbbbbbb",
00079   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00080   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00081   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00082   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00083   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00084   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00085   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00086   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00087   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00088   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00089   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a."
00090 };
00091 
00092 static const char *dotLineData[] =
00093 {
00094   "60 26 4 1",
00095   "a c None",
00096   "# c None",
00097   ". c None",
00098   "b c #0000c5",
00099   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00100   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00101   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00102   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00103   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00104   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00105   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00106   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00107   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00108   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00109   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00110   "bbbba.a.bbbba.a.bbbba.a.bbbba.a.bbbba.a.bbbba.a.bbbba.a.bbbb",
00111   "bbbb.#.#bbbb.#.#bbbb.#.#bbbb.#.#bbbb.#.#bbbb.#.#bbbb.#.#bbbb",
00112   "bbbba.a.bbbba.a.bbbba.a.bbbba.a.bbbba.a.bbbba.a.bbbba.a.bbbb",
00113   "bbbb.#.#bbbb.#.#bbbb.#.#bbbb.#.#bbbb.#.#bbbb.#.#bbbb.#.#bbbb",
00114   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00115   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00116   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00117   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00118   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00119   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00120   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00121   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00122   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00123   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00124   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a."
00125 };
00126 
00127 static const char *dashDotLineData[] =
00128 {
00129   "60 26 4 1",
00130   "a c None",
00131   "# c None",
00132   ". c None",
00133   "b c #0000c5",
00134   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00135   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00136   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00137   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00138   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00139   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00140   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00141   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00142   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00143   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00144   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00145   "bbbbbbbbbbbba.a.bbbba.a.bbbbbbbbbbbba.a.bbbba.a.bbbbbbbbbbbb",
00146   "bbbbbbbbbbbb.#.#bbbb.#.#bbbbbbbbbbbb.#.#bbbb.#.#bbbbbbbbbbbb",
00147   "bbbbbbbbbbbba.a.bbbba.a.bbbbbbbbbbbba.a.bbbba.a.bbbbbbbbbbbb",
00148   "bbbbbbbbbbbb.#.#bbbb.#.#bbbbbbbbbbbb.#.#bbbb.#.#bbbbbbbbbbbb",
00149   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00150   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00151   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00152   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00153   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00154   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00155   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00156   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00157   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00158   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00159   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a."
00160 };
00161 
00162 static const char *dashDotDotLineData[] =
00163 {
00164   "60 26 5 1",
00165   "a c None",
00166   "# c None",
00167   ". c None",
00168   "c c #0000c5",
00169   "b c None",
00170   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00171   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00172   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00173   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00174   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00175   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00176   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00177   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00178   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00179   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00180   "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
00181   "cccccccccccca.a.cccca.a.cccca.a.cccccccccccca.a.cccca.a.cccc",
00182   "cccccccccccc.#.#cccc.#.#cccc.#.#cccccccccccc.#.#cccc.#.#cccc",
00183   "cccccccccccca.a.cccca.a.cccca.a.cccccccccccca.a.cccca.a.cccc",
00184   "cccccccccccc.#.#cccc.#.#cccc.#.#cccccccccccc.#.#cccc.#.#cccc",
00185   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00186   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00187   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00188   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00189   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00190   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00191   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00192   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00193   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00194   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00195   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a."
00196 };
00197 
00198 static const char *noPenLineData[] =
00199 {
00200   "60 26 3 1",
00201   "a c None",
00202   "# c None",
00203   ". c None",
00204   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00205   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00206   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00207   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00208   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00209   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00210   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00211   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00212   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00213   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00214   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00215   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00216   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00217   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00218   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00219   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00220   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00221   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00222   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00223   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00224   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00225   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00226   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00227   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
00228   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00229   "a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a."
00230 };
00231 
00232 static const char *solidData[] =
00233 {
00234   "50 20 1 1",
00235   ". c #3155c5",
00236   "..................................................",
00237   "..................................................",
00238   "..................................................",
00239   "..................................................",
00240   "..................................................",
00241   "..................................................",
00242   "..................................................",
00243   "..................................................",
00244   "..................................................",
00245   "..................................................",
00246   "..................................................",
00247   "..................................................",
00248   "..................................................",
00249   "..................................................",
00250   "..................................................",
00251   "..................................................",
00252   "..................................................",
00253   "..................................................",
00254   "..................................................",
00255   ".................................................."
00256 };
00257 
00258 static const char *fdiagData[] =
00259 {
00260   "50 20 2 1",
00261   "# c #3155c5",
00262   ". c #ffffff",
00263   ".......#.......#.......#.......#.......#.......#..",
00264   "#.......#.......#.......#.......#.......#.......#.",
00265   ".#.......#.......#.......#.......#.......#.......#",
00266   "..#.......#.......#.......#.......#.......#.......",
00267   "...#.......#.......#.......#.......#.......#......",
00268   "....#.......#.......#.......#.......#.......#.....",
00269   ".....#.......#.......#.......#.......#.......#....",
00270   "......#.......#.......#.......#.......#.......#...",
00271   ".......#.......#.......#.......#.......#.......#..",
00272   "#.......#.......#.......#.......#.......#.......#.",
00273   ".#.......#.......#.......#.......#.......#.......#",
00274   "..#.......#.......#.......#.......#.......#.......",
00275   "...#.......#.......#.......#.......#.......#......",
00276   "....#.......#.......#.......#.......#.......#.....",
00277   ".....#.......#.......#.......#.......#.......#....",
00278   "......#.......#.......#.......#.......#.......#...",
00279   ".......#.......#.......#.......#.......#.......#..",
00280   "#.......#.......#.......#.......#.......#.......#.",
00281   ".#.......#.......#.......#.......#.......#.......#",
00282   "..#.......#.......#.......#.......#.......#......."
00283 };
00284 
00285 static const char *dense4Data[] =
00286 {
00287   "50 20 2 1",
00288   "# c #3155c5",
00289   ". c #ffffff",
00290   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00291   "#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.",
00292   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00293   "#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.",
00294   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00295   "#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.",
00296   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00297   "#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.",
00298   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00299   "#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.",
00300   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00301   "#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.",
00302   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00303   "#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.",
00304   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00305   "#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.",
00306   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00307   "#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.",
00308   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00309   "#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#."
00310 };
00311 
00312 static const char *horizontalData[] =
00313 {
00314   "50 20 2 1",
00315   "# c #3155c5",
00316   ". c #ffffff",
00317   "..................................................",
00318   "..................................................",
00319   "##################################################",
00320   "..................................................",
00321   "..................................................",
00322   "..................................................",
00323   "..................................................",
00324   "..................................................",
00325   "##################################################",
00326   "..................................................",
00327   "..................................................",
00328   "..................................................",
00329   "..................................................",
00330   "..................................................",
00331   "##################################################",
00332   "..................................................",
00333   "..................................................",
00334   "..................................................",
00335   "..................................................",
00336   ".................................................."
00337 };
00338 
00339 static const char *dense5Data[] =
00340 {
00341   "50 20 2 1",
00342   ". c #3155c5",
00343   "# c #ffffff",
00344   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00345   "###.###.###.###.###.###.###.###.###.###.###.###.##",
00346   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00347   "#.###.###.###.###.###.###.###.###.###.###.###.###.",
00348   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00349   "###.###.###.###.###.###.###.###.###.###.###.###.##",
00350   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00351   "#.###.###.###.###.###.###.###.###.###.###.###.###.",
00352   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00353   "###.###.###.###.###.###.###.###.###.###.###.###.##",
00354   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00355   "#.###.###.###.###.###.###.###.###.###.###.###.###.",
00356   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00357   "###.###.###.###.###.###.###.###.###.###.###.###.##",
00358   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00359   "#.###.###.###.###.###.###.###.###.###.###.###.###.",
00360   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00361   "###.###.###.###.###.###.###.###.###.###.###.###.##",
00362   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00363   "#.###.###.###.###.###.###.###.###.###.###.###.###."
00364 };
00365 
00366 static const char *diagCrossData[] =
00367 {
00368   "50 20 2 1",
00369   "# c #3155c5",
00370   ". c #ffffff",
00371   "..#.#.....#.#.....#.#.....#.#.....#.#.....#.#.....",
00372   "...#.......#.......#.......#.......#.......#......",
00373   "..#.#.....#.#.....#.#.....#.#.....#.#.....#.#.....",
00374   ".#...#...#...#...#...#...#...#...#...#...#...#...#",
00375   "#.....#.#.....#.#.....#.#.....#.#.....#.#.....#.#.",
00376   ".......#.......#.......#.......#.......#.......#..",
00377   "#.....#.#.....#.#.....#.#.....#.#.....#.#.....#.#.",
00378   ".#...#...#...#...#...#...#...#...#...#...#...#...#",
00379   "..#.#.....#.#.....#.#.....#.#.....#.#.....#.#.....",
00380   "...#.......#.......#.......#.......#.......#......",
00381   "..#.#.....#.#.....#.#.....#.#.....#.#.....#.#.....",
00382   ".#...#...#...#...#...#...#...#...#...#...#...#...#",
00383   "#.....#.#.....#.#.....#.#.....#.#.....#.#.....#.#.",
00384   ".......#.......#.......#.......#.......#.......#..",
00385   "#.....#.#.....#.#.....#.#.....#.#.....#.#.....#.#.",
00386   ".#...#...#...#...#...#...#...#...#...#...#...#...#",
00387   "..#.#.....#.#.....#.#.....#.#.....#.#.....#.#.....",
00388   "...#.......#.......#.......#.......#.......#......",
00389   "..#.#.....#.#.....#.#.....#.#.....#.#.....#.#.....",
00390   ".#...#...#...#...#...#...#...#...#...#...#...#...#"
00391 };
00392 
00393 static const char *dense1Data[] =
00394 {
00395   "50 20 2 1",
00396   ". c #3155c5",
00397   "# c #ffffff",
00398   "..................................................",
00399   "..#...#...#...#...#...#...#...#...#...#...#...#...",
00400   "..................................................",
00401   "..................................................",
00402   "..................................................",
00403   "..#...#...#...#...#...#...#...#...#...#...#...#...",
00404   "..................................................",
00405   "..................................................",
00406   "..................................................",
00407   "..#...#...#...#...#...#...#...#...#...#...#...#...",
00408   "..................................................",
00409   "..................................................",
00410   "..................................................",
00411   "..#...#...#...#...#...#...#...#...#...#...#...#...",
00412   "..................................................",
00413   "..................................................",
00414   "..................................................",
00415   "..#...#...#...#...#...#...#...#...#...#...#...#...",
00416   "..................................................",
00417   ".................................................."
00418 };
00419 
00420 static const char *dense6Data[] =
00421 {
00422   "50 20 2 1",
00423   "# c #3155c5",
00424   ". c #ffffff",
00425   "..................................................",
00426   "#...#...#...#...#...#...#...#...#...#...#...#...#.",
00427   "..................................................",
00428   "..#...#...#...#...#...#...#...#...#...#...#...#...",
00429   "..................................................",
00430   "#...#...#...#...#...#...#...#...#...#...#...#...#.",
00431   "..................................................",
00432   "..#...#...#...#...#...#...#...#...#...#...#...#...",
00433   "..................................................",
00434   "#...#...#...#...#...#...#...#...#...#...#...#...#.",
00435   "..................................................",
00436   "..#...#...#...#...#...#...#...#...#...#...#...#...",
00437   "..................................................",
00438   "#...#...#...#...#...#...#...#...#...#...#...#...#.",
00439   "..................................................",
00440   "..#...#...#...#...#...#...#...#...#...#...#...#...",
00441   "..................................................",
00442   "#...#...#...#...#...#...#...#...#...#...#...#...#.",
00443   "..................................................",
00444   "..#...#...#...#...#...#...#...#...#...#...#...#..."
00445 };
00446 
00447 static const char *verticalData[] =
00448 {
00449   "50 20 2 1",
00450   "# c #3155c5",
00451   ". c #ffffff",
00452   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00453   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00454   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00455   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00456   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00457   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00458   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00459   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00460   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00461   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00462   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00463   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00464   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00465   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00466   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00467   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00468   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00469   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00470   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00471   ".....#.....#.....#.....#.....#.....#.....#.....#.."
00472 };
00473 
00474 static const char *dense7Data[] =
00475 {
00476   "50 20 2 1",
00477   ". c #3155c5",
00478   "# c #ffffff",
00479   "##################################################",
00480   "##################################################",
00481   ".###.###.###.###.###.###.###.###.###.###.###.###.#",
00482   "##################################################",
00483   "##################################################",
00484   "##################################################",
00485   ".###.###.###.###.###.###.###.###.###.###.###.###.#",
00486   "##################################################",
00487   "##################################################",
00488   "##################################################",
00489   ".###.###.###.###.###.###.###.###.###.###.###.###.#",
00490   "##################################################",
00491   "##################################################",
00492   "##################################################",
00493   ".###.###.###.###.###.###.###.###.###.###.###.###.#",
00494   "##################################################",
00495   "##################################################",
00496   "##################################################",
00497   ".###.###.###.###.###.###.###.###.###.###.###.###.#",
00498   "##################################################"
00499 };
00500 
00501 static const char *crossData[] =
00502 {
00503   "50 20 2 1",
00504   "# c #3155c5",
00505   ". c #ffffff",
00506   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00507   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00508   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00509   "##################################################",
00510   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00511   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00512   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00513   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00514   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00515   "##################################################",
00516   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00517   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00518   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00519   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00520   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00521   "##################################################",
00522   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00523   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00524   ".....#.....#.....#.....#.....#.....#.....#.....#..",
00525   ".....#.....#.....#.....#.....#.....#.....#.....#.."
00526 };
00527 
00528 static const char *dense2Data[] =
00529 {
00530   "50 20 2 1",
00531   ". c #3155c5",
00532   "# c #ffffff",
00533   "..................................................",
00534   "...#...#...#...#...#...#...#...#...#...#...#...#..",
00535   "..................................................",
00536   ".#...#...#...#...#...#...#...#...#...#...#...#...#",
00537   "..................................................",
00538   "...#...#...#...#...#...#...#...#...#...#...#...#..",
00539   "..................................................",
00540   ".#...#...#...#...#...#...#...#...#...#...#...#...#",
00541   "..................................................",
00542   "...#...#...#...#...#...#...#...#...#...#...#...#..",
00543   "..................................................",
00544   ".#...#...#...#...#...#...#...#...#...#...#...#...#",
00545   "..................................................",
00546   "...#...#...#...#...#...#...#...#...#...#...#...#..",
00547   "..................................................",
00548   ".#...#...#...#...#...#...#...#...#...#...#...#...#",
00549   "..................................................",
00550   "...#...#...#...#...#...#...#...#...#...#...#...#..",
00551   "..................................................",
00552   ".#...#...#...#...#...#...#...#...#...#...#...#...#"
00553 };
00554 
00555 static const char *bdiagData[] =
00556 {
00557   "50 20 2 1",
00558   "# c #3155c5",
00559   ". c #ffffff",
00560   ".#.......#.......#.......#.......#.......#.......#",
00561   "#.......#.......#.......#.......#.......#.......#.",
00562   ".......#.......#.......#.......#.......#.......#..",
00563   "......#.......#.......#.......#.......#.......#...",
00564   ".....#.......#.......#.......#.......#.......#....",
00565   "....#.......#.......#.......#.......#.......#.....",
00566   "...#.......#.......#.......#.......#.......#......",
00567   "..#.......#.......#.......#.......#.......#.......",
00568   ".#.......#.......#.......#.......#.......#.......#",
00569   "#.......#.......#.......#.......#.......#.......#.",
00570   ".......#.......#.......#.......#.......#.......#..",
00571   "......#.......#.......#.......#.......#.......#...",
00572   ".....#.......#.......#.......#.......#.......#....",
00573   "....#.......#.......#.......#.......#.......#.....",
00574   "...#.......#.......#.......#.......#.......#......",
00575   "..#.......#.......#.......#.......#.......#.......",
00576   ".#.......#.......#.......#.......#.......#.......#",
00577   "#.......#.......#.......#.......#.......#.......#.",
00578   ".......#.......#.......#.......#.......#.......#..",
00579   "......#.......#.......#.......#.......#.......#..."
00580 };
00581 
00582 static const char *dense3Data[] =
00583 {
00584   "50 20 2 1",
00585   "# c #3155c5",
00586   ". c #ffffff",
00587   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00588   "#.###.###.###.###.###.###.###.###.###.###.###.###.",
00589   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00590   "###.###.###.###.###.###.###.###.###.###.###.###.##",
00591   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00592   "#.###.###.###.###.###.###.###.###.###.###.###.###.",
00593   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00594   "###.###.###.###.###.###.###.###.###.###.###.###.##",
00595   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00596   "#.###.###.###.###.###.###.###.###.###.###.###.###.",
00597   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00598   "###.###.###.###.###.###.###.###.###.###.###.###.##",
00599   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00600   "#.###.###.###.###.###.###.###.###.###.###.###.###.",
00601   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00602   "###.###.###.###.###.###.###.###.###.###.###.###.##",
00603   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00604   "#.###.###.###.###.###.###.###.###.###.###.###.###.",
00605   ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
00606   "###.###.###.###.###.###.###.###.###.###.###.###.##"
00607 };
00608 
00609 static const char *nobrush[] =
00610 {
00611   "50 20 2 1",
00612   "# c None",
00613   ". c #3155c5",
00614   ".................................................."
00615   ".################################################.",
00616   ".################################################.",
00617   ".################################################.",
00618   ".################################################.",
00619   ".################################################.",
00620   ".################################################.",
00621   ".################################################.",
00622   ".################################################.",
00623   ".################################################.",
00624   ".################################################.",
00625   ".################################################.",
00626   ".################################################.",
00627   ".################################################.",
00628   ".################################################.",
00629   ".################################################.",
00630   ".################################################.",
00631   ".################################################.",
00632   ".################################################.",
00633   ".################################################.",
00634   ".................................................."
00635 };
00636 
00637 static const char *texturePatternData[] =
00638 {
00639   "50 20 2 1",
00640   "# c #3155c5",
00641   ". c #ffffff",
00642   "..................................................",
00643   "..................#########.......................",
00644   "...............##############.....................",
00645   "..............####........#####...................",
00646   "...........................####...................",
00647   "...........................####...................",
00648   "...........................####...................",
00649   "...........................####...................",
00650   "..........................####....................",
00651   "..........................####....................",
00652   "........................####......................",
00653   "......................####........................",
00654   "....................####..........................",
00655   "...................####...........................",
00656   "...................####...........................",
00657   "..................................................",
00658   "...................####...........................",
00659   "...................####...........................",
00660   "...................####...........................",
00661   ".................................................."
00662 };
00663 
00664 QString QgsSymbologyUtils::penStyle2QString( Qt::PenStyle penstyle )
00665 {
00666   if ( penstyle == Qt::NoPen )
00667   {
00668     return "NoPen";
00669   }
00670   else if ( penstyle == Qt::SolidLine )
00671   {
00672     return "SolidLine";
00673   }
00674   else if ( penstyle == Qt::DashLine )
00675   {
00676     return "DashLine";
00677   }
00678   else if ( penstyle == Qt::DotLine )
00679   {
00680     return "DotLine";
00681   }
00682   else if ( penstyle == Qt::DashDotLine )
00683   {
00684     return "DashDotLine";
00685   }
00686   else if ( penstyle == Qt::DashDotDotLine )
00687   {
00688     return "DashDotDotLine";
00689   }
00690   else if ( penstyle == Qt::MPenStyle )
00691   {
00692     return "MPenStyle";
00693   }
00694   else                        //return a null string
00695   {
00696     return QString();
00697   }
00698 }
00699 
00700 Qt::PenStyle QgsSymbologyUtils::qString2PenStyle( QString penString )
00701 {
00702   if ( penString == "NoPen" )
00703   {
00704     return Qt::NoPen;
00705   }
00706   else if ( penString == "SolidLine" )
00707   {
00708     return Qt::SolidLine;
00709   }
00710   else if ( penString == "DashLine" )
00711   {
00712     return Qt::DashLine;
00713   }
00714   else if ( penString == "DotLine" )
00715   {
00716     return Qt::DotLine;
00717   }
00718   else if ( penString == "DashDotLine" )
00719   {
00720     return Qt::DashDotLine;
00721   }
00722   else if ( penString == "DashDotDotLine" )
00723   {
00724     return Qt::DashDotDotLine;
00725   }
00726   else if ( penString == "MPenStyle" )
00727   {
00728     return Qt::MPenStyle;
00729   }
00730   else
00731   {
00732     return Qt::NoPen;
00733   }
00734 }
00735 
00736 QString QgsSymbologyUtils::brushStyle2QString( Qt::BrushStyle brushstyle )
00737 {
00738   if ( brushstyle == Qt::NoBrush )
00739   {
00740     return "NoBrush";
00741   }
00742   else if ( brushstyle == Qt::SolidPattern )
00743   {
00744     return "SolidPattern";
00745   }
00746   else if ( brushstyle == Qt::Dense1Pattern )
00747   {
00748     return "Dense1Pattern";
00749   }
00750   else if ( brushstyle == Qt::Dense2Pattern )
00751   {
00752     return "Dense2Pattern";
00753   }
00754   else if ( brushstyle == Qt::Dense3Pattern )
00755   {
00756     return "Dense3Pattern";
00757   }
00758   else if ( brushstyle == Qt::Dense4Pattern )
00759   {
00760     return "Dense4Pattern";
00761   }
00762   else if ( brushstyle == Qt::Dense5Pattern )
00763   {
00764     return "Dense5Pattern";
00765   }
00766   else if ( brushstyle == Qt::Dense6Pattern )
00767   {
00768     return "Dense6Pattern";
00769   }
00770   else if ( brushstyle == Qt::Dense7Pattern )
00771   {
00772     return "Dense7Pattern";
00773   }
00774   else if ( brushstyle == Qt::HorPattern )
00775   {
00776     return "HorPattern";
00777   }
00778   else if ( brushstyle == Qt::VerPattern )
00779   {
00780     return "VerPattern";
00781   }
00782   else if ( brushstyle == Qt::CrossPattern )
00783   {
00784     return "CrossPattern";
00785   }
00786   else if ( brushstyle == Qt::BDiagPattern )
00787   {
00788     return "BDiagPattern";
00789   }
00790   else if ( brushstyle == Qt::FDiagPattern )
00791   {
00792     return "FDiagPattern";
00793   }
00794   else if ( brushstyle == Qt::DiagCrossPattern )
00795   {
00796     return "DiagCrossPattern";
00797   }
00798   else if ( brushstyle == Qt::TexturePattern )
00799   {
00800     return "TexturePattern";
00801   }
00802   else                        //return a null string
00803   {
00804     QgsDebugMsg( "no matching pattern found" );
00805     return " ";
00806   }
00807 }
00808 
00809 Qt::BrushStyle QgsSymbologyUtils::qString2BrushStyle( QString brushString )
00810 {
00811   if ( brushString == "NoBrush" )
00812   {
00813     return Qt::NoBrush;
00814   }
00815   else if ( brushString == "SolidPattern" )
00816   {
00817     return Qt::SolidPattern;
00818   }
00819   else if ( brushString == "Dense1Pattern" )
00820   {
00821     return Qt::Dense1Pattern;
00822   }
00823   else if ( brushString == "Dense2Pattern" )
00824   {
00825     return Qt::Dense2Pattern;
00826   }
00827   else if ( brushString == "Dense3Pattern" )
00828   {
00829     return Qt::Dense3Pattern;
00830   }
00831   else if ( brushString == "Dense4Pattern" )
00832   {
00833     return Qt::Dense4Pattern;
00834   }
00835   else if ( brushString == "Dense5Pattern" )
00836   {
00837     return Qt::Dense5Pattern;
00838   }
00839   else if ( brushString == "Dense6Pattern" )
00840   {
00841     return Qt::Dense6Pattern;
00842   }
00843   else if ( brushString == "Dense7Pattern" )
00844   {
00845     return Qt::Dense7Pattern;
00846   }
00847   else if ( brushString == "HorPattern" )
00848   {
00849     return Qt::HorPattern;
00850   }
00851   else if ( brushString == "VerPattern" )
00852   {
00853     return Qt::VerPattern;
00854   }
00855   else if ( brushString == "CrossPattern" )
00856   {
00857     return Qt::CrossPattern;
00858   }
00859   else if ( brushString == "BDiagPattern" )
00860   {
00861     return Qt::BDiagPattern;
00862   }
00863   else if ( brushString == "FDiagPattern" )
00864   {
00865     return Qt::FDiagPattern;
00866   }
00867   else if ( brushString == "DiagCrossPattern" )
00868   {
00869     return Qt::DiagCrossPattern;
00870   }
00871   else if ( brushString == "TexturePattern" )
00872   {
00873     return Qt::TexturePattern;
00874   }
00875   else                        //return a null string
00876   {
00877     QgsDebugMsg( QString( "Brush style \"%1\" not found" ).arg( brushString ) );
00878     return Qt::NoBrush;
00879   }
00880 }
00881 
00882 QPixmap QgsSymbologyUtils::qString2LinePixmap( QString lineString )
00883 {
00884   if ( lineString == "SolidLine" )
00885   {
00886     return QPixmap( solidLineData );
00887   }
00888 
00889   if ( lineString == "DashLine" )
00890   {
00891     return QPixmap( dashLineData );
00892   }
00893 
00894   if ( lineString == "DotLine" )
00895   {
00896     return QPixmap( dotLineData );
00897   }
00898 
00899   if ( lineString == "DashDotLine" )
00900   {
00901     return QPixmap( dashDotLineData );
00902   }
00903 
00904   if ( lineString == "DashDotDotLine" )
00905   {
00906     return QPixmap( dashDotDotLineData );
00907   }
00908   if ( lineString == "NoPen" )
00909   {
00910     return QPixmap( noPenLineData );
00911   }
00912 
00913   return QPixmap();             // XXX I hope returning a blank one is ok
00914 }
00915 
00916 QPixmap QgsSymbologyUtils::qString2PatternPixmap( QString patternString )
00917 {
00918   if ( patternString == "SolidPattern" )
00919   {
00920     return QPixmap( solidData );
00921   }
00922   else if ( patternString == "Dense1Pattern" )
00923   {
00924     return QPixmap( dense1Data );
00925   }
00926   else if ( patternString == "Dense2Pattern" )
00927   {
00928     return QPixmap( dense2Data );
00929   }
00930   else if ( patternString == "Dense3Pattern" )
00931   {
00932     return QPixmap( dense3Data );
00933   }
00934   else if ( patternString == "Dense4Pattern" )
00935   {
00936     return QPixmap( dense4Data );
00937   }
00938   else if ( patternString == "Dense5Pattern" )
00939   {
00940     return QPixmap( dense5Data );
00941   }
00942   else if ( patternString == "Dense6Pattern" )
00943   {
00944     return QPixmap( dense6Data );
00945   }
00946   else if ( patternString == "Dense7Pattern" )
00947   {
00948     return QPixmap( dense7Data );
00949   }
00950   else if ( patternString == "HorPattern" )
00951   {
00952     return QPixmap( horizontalData );
00953   }
00954   else if ( patternString == "VerPattern" )
00955   {
00956     return QPixmap( verticalData );
00957   }
00958   else if ( patternString == "CrossPattern" )
00959   {
00960     return QPixmap( crossData );
00961   }
00962   else if ( patternString == "BDiagPattern" )
00963   {
00964     return QPixmap( bdiagData );
00965   }
00966   else if ( patternString == "FDiagPattern" )
00967   {
00968     return QPixmap( fdiagData );
00969   }
00970   else if ( patternString == "DiagCrossPattern" )
00971   {
00972     return QPixmap( diagCrossData );
00973   }
00974   else if ( patternString == "TexturePattern" )
00975   {
00976     return QPixmap( texturePatternData );
00977   }
00978   else if ( patternString == "NoBrush" )
00979   {
00980     return QPixmap( nobrush );
00981   }
00982   else                        //return a null patternString
00983   {
00984     QgsDebugMsg( "no matching pattern found" );
00985     return QPixmap();
00986   }
00987 }
00988 
00989 const char * QgsSymbologyUtils::penStyle2Char( Qt::PenStyle penstyle )
00990 {
00991   if ( penstyle == Qt::NoPen )
00992   {
00993     return "NoPen";
00994   }
00995   else if ( penstyle == Qt::SolidLine )
00996   {
00997     return "SolidLine";
00998   }
00999   else if ( penstyle == Qt::DashLine )
01000   {
01001     return "DashLine";
01002   }
01003   else if ( penstyle == Qt::DotLine )
01004   {
01005     return "DotLine";
01006   }
01007   else if ( penstyle == Qt::DashDotLine )
01008   {
01009     return "DashDotLine";
01010   }
01011   else if ( penstyle == Qt::DashDotDotLine )
01012   {
01013     return "DashDotDotLine";
01014   }
01015   else if ( penstyle == Qt::MPenStyle )
01016   {
01017     return "MPenStyle";
01018   }
01019   else                        //return an empty char*
01020   {
01021     return " ";
01022   }
01023 }
01024 
01025 const char *QgsSymbologyUtils::brushStyle2Char( Qt::BrushStyle brushstyle )
01026 {
01027   if ( brushstyle == Qt::NoBrush )
01028   {
01029     return "NoBrush";
01030   }
01031   else if ( brushstyle == Qt::SolidPattern )
01032   {
01033     return "SolidPattern";
01034   }
01035   else if ( brushstyle == Qt::Dense1Pattern )
01036   {
01037     return "Dense1Pattern";
01038   }
01039   else if ( brushstyle == Qt::Dense2Pattern )
01040   {
01041     return "Dense2Pattern";
01042   }
01043   else if ( brushstyle == Qt::Dense3Pattern )
01044   {
01045     return "Dense3Pattern";
01046   }
01047   else if ( brushstyle == Qt::Dense4Pattern )
01048   {
01049     return "Dense4Pattern";
01050   }
01051   else if ( brushstyle == Qt::Dense5Pattern )
01052   {
01053     return "Dense5Pattern";
01054   }
01055   else if ( brushstyle == Qt::Dense6Pattern )
01056   {
01057     return "Dense6Pattern";
01058   }
01059   else if ( brushstyle == Qt::Dense7Pattern )
01060   {
01061     return "Dense7Pattern";
01062   }
01063   else if ( brushstyle == Qt::HorPattern )
01064   {
01065     return "HorPattern";
01066   }
01067   else if ( brushstyle == Qt::VerPattern )
01068   {
01069     return "VerPattern";
01070   }
01071   else if ( brushstyle == Qt::CrossPattern )
01072   {
01073     return "CrossPattern";
01074   }
01075   else if ( brushstyle == Qt::BDiagPattern )
01076   {
01077     return "BDiagPattern";
01078   }
01079   else if ( brushstyle == Qt::FDiagPattern )
01080   {
01081     return "FDiagPattern";
01082   }
01083   else if ( brushstyle == Qt::DiagCrossPattern )
01084   {
01085     return "DiagCrossPattern";
01086   }
01087   else if ( brushstyle == Qt::TexturePattern )
01088   {
01089     return "TexturePattern";
01090   }
01091   else                        //return an empty char*
01092   {
01093     return " ";
01094   }
01095 }
01096 
01097 QPixmap QgsSymbologyUtils::char2LinePixmap( const char *c )
01098 {
01099   if ( strcmp( c, "SolidLine" ) == 0 )
01100   {
01101     return QPixmap( solidLineData );
01102   }
01103 
01104   else if ( strcmp( c, "DashLine" ) == 0 )
01105   {
01106     return QPixmap( dashLineData );
01107   }
01108 
01109   else if ( strcmp( c, "DotLine" ) == 0 )
01110   {
01111     return QPixmap( dotLineData );
01112   }
01113 
01114   else if ( strcmp( c, "DashDotLine" ) == 0 )
01115   {
01116     return QPixmap( dashDotLineData );
01117   }
01118 
01119   else if ( strcmp( c, "DashDotDotLine" ) == 0 )
01120   {
01121     return QPixmap( dashDotDotLineData );
01122   }
01123 
01124   else if ( strcmp( c, "NoPen" ) == 0 )
01125   {
01126     return QPixmap( noPenLineData );
01127   }
01128 
01129   else
01130   {
01131     QgsDebugMsg( "no matching style found" );
01132     return QPixmap();
01133   }
01134 }
01135 
01136 QPixmap QgsSymbologyUtils::char2PatternPixmap( const char *c )
01137 {
01138   if ( strcmp( c, "SolidPattern" ) == 0 )
01139   {
01140     return QPixmap( solidData );
01141   }
01142   else if ( strcmp( c, "Dense1Pattern" ) == 0 )
01143   {
01144     return QPixmap( dense1Data );
01145   }
01146   else if ( strcmp( c, "Dense2Pattern" ) == 0 )
01147   {
01148     return QPixmap( dense2Data );
01149   }
01150   else if ( strcmp( c, "Dense3Pattern" ) == 0 )
01151   {
01152     return QPixmap( dense3Data );
01153   }
01154   else if ( strcmp( c, "Dense4Pattern" ) == 0 )
01155   {
01156     return QPixmap( dense4Data );
01157   }
01158   else if ( strcmp( c, "Dense5Pattern" ) == 0 )
01159   {
01160     return QPixmap( dense5Data );
01161   }
01162   else if ( strcmp( c, "Dense6Pattern" ) == 0 )
01163   {
01164     return QPixmap( dense6Data );
01165   }
01166   else if ( strcmp( c, "Dense7Pattern" ) == 0 )
01167   {
01168     return QPixmap( dense7Data );
01169   }
01170   else if ( strcmp( c, "HorPattern" ) == 0 )
01171   {
01172     return QPixmap( horizontalData );
01173   }
01174   else if ( strcmp( c, "VerPattern" ) == 0 )
01175   {
01176     return QPixmap( verticalData );
01177   }
01178   else if ( strcmp( c, "CrossPattern" ) == 0 )
01179   {
01180     return QPixmap( crossData );
01181   }
01182   else if ( strcmp( c, "BDiagPattern" ) == 0 )
01183   {
01184     return QPixmap( bdiagData );
01185   }
01186   else if ( strcmp( c, "FDiagPattern" ) == 0 )
01187   {
01188     return QPixmap( fdiagData );
01189   }
01190   else if ( strcmp( c, "DiagCrossPattern" ) == 0 )
01191   {
01192     return QPixmap( diagCrossData );
01193   }
01194   else if ( strcmp( c, "TexturePattern" ) == 0 )
01195   {
01196     return QPixmap( texturePatternData );
01197   }
01198   else if ( strcmp( c, "NoBrush" ) == 0 )
01199   {
01200     return QPixmap( nobrush );
01201   }
01202   else
01203   {
01204     QgsDebugMsg( "no matching pattern found" );
01205     return QPixmap();
01206   }
01207 
01208 }
01209 
01210 Qt::PenStyle QgsSymbologyUtils::char2PenStyle( const char *c )
01211 {
01212   if ( strcmp( c, "NoPen" ) == 0 )
01213   {
01214     return Qt::NoPen;
01215   }
01216   else if ( strcmp( c, "SolidLine" ) == 0 )
01217   {
01218     return Qt::SolidLine;
01219   }
01220   else if ( strcmp( c, "DashLine" ) == 0 )
01221   {
01222     return Qt::DashLine;
01223   }
01224   else if ( strcmp( c, "DotLine" ) == 0 )
01225   {
01226     return Qt::DotLine;
01227   }
01228   else if ( strcmp( c, "DashDotLine" ) == 0 )
01229   {
01230     return Qt::DashDotLine;
01231   }
01232   else if ( strcmp( c, "DashDotDotLine" ) == 0 )
01233   {
01234     return Qt::DashDotDotLine;
01235   }
01236   else if ( strcmp( c, "MPenStyle" ) == 0 )
01237   {
01238     return Qt::MPenStyle;
01239   }
01240   else
01241   {
01242     QgsDebugMsg( "no matching pen style found" );
01243     return Qt::NoPen;
01244   }
01245 }
01246 
01247 Qt::BrushStyle QgsSymbologyUtils::char2BrushStyle( const char *c )
01248 {
01249   if ( strcmp( c, "SolidPattern" ) == 0 )
01250   {
01251     return Qt::SolidPattern;
01252   }
01253   else if ( strcmp( c, "Dense1Pattern" ) == 0 )
01254   {
01255     return Qt::Dense1Pattern;
01256   }
01257   else if ( strcmp( c, "Dense2Pattern" ) == 0 )
01258   {
01259     return Qt::Dense2Pattern;
01260   }
01261   else if ( strcmp( c, "Dense3Pattern" ) == 0 )
01262   {
01263     return Qt::Dense3Pattern;
01264   }
01265   else if ( strcmp( c, "Dense4Pattern" ) == 0 )
01266   {
01267     return Qt::Dense4Pattern;
01268   }
01269   else if ( strcmp( c, "Dense5Pattern" ) == 0 )
01270   {
01271     return Qt::Dense5Pattern;
01272   }
01273   else if ( strcmp( c, "Dense6Pattern" ) == 0 )
01274   {
01275     return Qt::Dense6Pattern;
01276   }
01277   else if ( strcmp( c, "Dense7Pattern" ) == 0 )
01278   {
01279     return Qt::Dense7Pattern;
01280   }
01281   else if ( strcmp( c, "HorPattern" ) == 0 )
01282   {
01283     return Qt::HorPattern;
01284   }
01285   else if ( strcmp( c, "VerPattern" ) == 0 )
01286   {
01287     return Qt::VerPattern;
01288   }
01289   else if ( strcmp( c, "CrossPattern" ) == 0 )
01290   {
01291     return Qt::CrossPattern;
01292   }
01293   else if ( strcmp( c, "BDiagPattern" ) == 0 )
01294   {
01295     return Qt::BDiagPattern;
01296   }
01297   else if ( strcmp( c, "FDiagPattern" ) == 0 )
01298   {
01299     return Qt::FDiagPattern;
01300   }
01301   else if ( strcmp( c, "DiagCrossPattern" ) == 0 )
01302   {
01303     return Qt::DiagCrossPattern;
01304   }
01305   else if ( strcmp( c, "TexturePattern" ) == 0 )
01306   {
01307     return Qt::TexturePattern;
01308   }
01309   else if ( strcmp( c, "NoBrush" ) == 0 )
01310   {
01311     return Qt::NoBrush;
01312   }
01313   else                        //return a null string
01314   {
01315     QgsDebugMsg( "no matching brush style found" );
01316     return Qt::NoBrush;
01317   }
01318 }
01319 
01320 QPixmap QgsSymbologyUtils::penStyle2Pixmap( Qt::PenStyle penstyle )
01321 {
01322   switch ( penstyle )
01323   {
01324     case( Qt::SolidLine ):
01325       return QPixmap( solidLineData );
01326       break;
01327     case( Qt::DashLine ):
01328       return QPixmap( dashLineData );
01329       break;
01330     case( Qt::DotLine ):
01331       return QPixmap( dotLineData );
01332       break;
01333     case( Qt::DashDotLine ):
01334       return QPixmap( dashDotLineData );
01335       break;
01336     case( Qt::DashDotDotLine ):
01337       return QPixmap( dashDotDotLineData );
01338       break;
01339     case( Qt::NoPen ):
01340       return QPixmap( noPenLineData );
01341       break;
01342     default:
01343       QgsDebugMsg( "no matching pen style found" );
01344       return QPixmap();
01345   }
01346 }
01347 
01348 QPixmap QgsSymbologyUtils::brushStyle2Pixmap( Qt::BrushStyle brushstyle )
01349 {
01350   switch ( brushstyle )
01351   {
01352     case( Qt::SolidPattern ):
01353       return QPixmap( solidData );
01354       break;
01355     case( Qt::Dense1Pattern ):
01356       return QPixmap( dense1Data );
01357       break;
01358     case( Qt::Dense2Pattern ):
01359       return QPixmap( dense2Data );
01360       break;
01361     case( Qt::Dense3Pattern ):
01362       return QPixmap( dense3Data );
01363       break;
01364     case( Qt::Dense4Pattern ):
01365       return QPixmap( dense4Data );
01366       break;
01367     case( Qt::Dense5Pattern ):
01368       return QPixmap( dense5Data );
01369       break;
01370     case( Qt::Dense6Pattern ):
01371       return QPixmap( dense6Data );
01372       break;
01373     case( Qt::Dense7Pattern ):
01374       return QPixmap( dense7Data );
01375       break;
01376     case( Qt::HorPattern ):
01377       return QPixmap( horizontalData );
01378       break;
01379     case( Qt::VerPattern ):
01380       return QPixmap( verticalData );
01381       break;
01382     case( Qt::CrossPattern ):
01383       return QPixmap( crossData );
01384       break;
01385     case( Qt::BDiagPattern ):
01386       return QPixmap( bdiagData );
01387       break;
01388     case( Qt::FDiagPattern ):
01389       return QPixmap( fdiagData );
01390       break;
01391     case( Qt::DiagCrossPattern ):
01392       return QPixmap( diagCrossData );
01393       break;
01394     case( Qt::TexturePattern ) :
01395       return QPixmap( texturePatternData );
01396       break;
01397     case( Qt::NoBrush ):
01398       return QPixmap( nobrush );
01399     default:
01400       QgsDebugMsg( "no matching pattern found" );
01401   }
01402 
01403   return QPixmap();             // XXX I hope returning a blank one is ok
01404 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines