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