Subversion Repositories public

Rev

Rev 274 | Rev 276 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 274 Rev 275
Line 11... Line 11...
11
//
11
//
12
#ifndef _RENDER_H
12
#ifndef _RENDER_H
13
#define _RENDER_H
13
#define _RENDER_H
14
 
14
 
15
#include <mapnik/map.hpp>
15
#include <mapnik/map.hpp>
-
 
16
#include <mapnik/load_map.hpp>
-
 
17
#include <mapnik/save_map.hpp>
16
#include <mapnik/datasource_cache.hpp>
18
#include <mapnik/datasource_cache.hpp>
17
#include <mapnik/font_engine_freetype.hpp>
19
#include <mapnik/font_engine_freetype.hpp>
18
#include <mapnik/agg_renderer.hpp>
20
#include <mapnik/agg_renderer.hpp>
19
#include <mapnik/filter_factory.hpp>
21
#include <mapnik/filter_factory.hpp>
20
#include <mapnik/color_factory.hpp>
22
#include <mapnik/color_factory.hpp>
21
#include <mapnik/image_util.hpp>
23
#include <mapnik/image_util.hpp>
22
#include <mapnik/config_error.hpp>
24
#include <mapnik/config_error.hpp>
23
#include <mapnik/color.hpp>
25
#include <mapnik/color.hpp>
24
#include <mapnik/layer.hpp>
26
#include <mapnik/layer.hpp>
-
 
27
#include <mapnik/rule.hpp>
25
 
28
 
26
/* conversions */
29
/* conversions */
27
 
30
 
28
#define DEGREES      180.0
31
#define DEGREES      180.0
29
#define SEMICIRCLES  0x80000000
32
#define SEMICIRCLES  0x80000000
Line 68... Line 71...
68
	QString   face_name;
71
	QString   face_name;
69
	double    size;
72
	double    size;
70
	unsigned  fill;			// Color
73
	unsigned  fill;			// Color
71
	double    halo_radius;
74
	double    halo_radius;
72
	double    wrap_width;
75
	double    wrap_width;
-
 
76
	double    dx;
73
	double    dy;
77
	double    dy;
74
	double    mindistance;
78
	double    mindistance;		// min distance between labels
75
	double    maxdistance;
79
	double    maxdistance;		// not used!
76
	TEXTSYMBOLIZER *next;
80
	TEXTSYMBOLIZER *next;
77
}TEXTSYMBOLIZER;
81
}TEXTSYMBOLIZER;
78
 
82
 
79
typedef struct POINTSYMBOLIZER
83
typedef struct POINTSYMBOLIZER
80
{
84
{
Line 105... Line 109...
105
	QString   placement;
109
	QString   placement;
106
	QString   file;
110
	QString   file;
107
	TYPES     type;		// enum TYPES
111
	TYPES     type;		// enum TYPES
108
	double    width;
112
	double    width;
109
	double    height;
113
	double    height;
-
 
114
	double    dx;
110
	double    mindistance;
115
	double    dy;
-
 
116
	double    mindistance;	// min distance to next shield symbol
111
	double    maxdistance;
117
	double    maxdistance;	// not used!
112
	SHIELDSYMBOLIZER *next;
118
	SHIELDSYMBOLIZER *next;
113
}SHIELDSYMBOLIZER;
119
}SHIELDSYMBOLIZER;
114
 
120
 
115
typedef struct LINEPATTERNSYMBOLIZER
121
typedef struct LINEPATTERNSYMBOLIZER
116
{
122
{
Line 131... Line 137...
131
	TEXTSYMBOLIZER		 *TextSymbolizer;
137
	TEXTSYMBOLIZER		 *TextSymbolizer;
132
	POINTSYMBOLIZER		 *PointSymbolizer;
138
	POINTSYMBOLIZER		 *PointSymbolizer;
133
	POLYGONPATTERNSYMBOLIZER *PolygonPatternSymbolizer;
139
	POLYGONPATTERNSYMBOLIZER *PolygonPatternSymbolizer;
134
	SHIELDSYMBOLIZER	 *ShieldSymbolizer;
140
	SHIELDSYMBOLIZER	 *ShieldSymbolizer;
135
	LINEPATTERNSYMBOLIZER    *LinePatternSymbolizer;
141
	LINEPATTERNSYMBOLIZER    *LinePatternSymbolizer;
-
 
142
	mapnik::rule_type rl;		// the rule to be added to a style
136
	RULE *next;		// Pointer to next rule
143
	RULE *next;		// Pointer to next rule
137
}RULE;
144
}RULE;
138
 
145
 
139
typedef struct STYLE
146
typedef struct STYLE
140
{
147
{
Line 161... Line 168...
161
typedef struct LAYER
168
typedef struct LAYER
162
{
169
{
163
	QString    name;	// The unique name
170
	QString    name;	// The unique name
164
	bool       status;	// Is it active?
171
	bool       status;	// Is it active?
165
	QString    srs;		// Projection
172
	QString    srs;		// Projection
-
 
173
	double     minzoom;
-
 
174
	double     maxzoom;
166
	QStringList Styles;	// The names of the Styles
175
	QStringList Styles;	// The names of the Styles
167
	DATASOURCE Datasource;
176
	DATASOURCE Datasource;
168
	LAYER      *next;	// Pointer to next layer
177
	LAYER      *next;	// Pointer to next layer
169
}LAYER;
178
}LAYER;
170
 
179
 
Line 229... Line 238...
229
 
238
 
230
	   void setDrawArea(const QLabel &lb) { label = (QLabel *)&lb; };
239
	   void setDrawArea(const QLabel &lb) { label = (QLabel *)&lb; };
231
	   void setShapePath(const QString &str) { if (str.isNull()) return; shapePath = str; };
240
	   void setShapePath(const QString &str) { if (str.isNull()) return; shapePath = str; };
232
	   void setXmlPath(const QString &path) { if (path.isNull()) return; XmlPath = path; };
241
	   void setXmlPath(const QString &path) { if (path.isNull()) return; XmlPath = path; };
233
	   bool getMap(double lx, double ly, double rx, double ry);
242
	   bool getMap(double lx, double ly, double rx, double ry);
-
 
243
	   QString getOutBuf () { return OutBuf; };
234
 
244
 
235
	   // Functions to parse the XML file
245
	   // Functions to parse the XML file
236
	   bool startDocument ();
246
	   bool startDocument ();
237
	   bool startElement (const QString&, const QString&, const QString& , const QXmlAttributes&);
247
	   bool startElement (const QString&, const QString&, const QString& , const QXmlAttributes&);
238
	   bool endElement (const QString&, const QString&, const QString&);
248
	   bool endElement (const QString&, const QString&, const QString&);
239
	   bool characters (const QString&);
249
	   bool characters (const QString&);
240
 
250
 
-
 
251
	protected:
-
 
252
	   void setMaxExtent(double lx, double ly, double rx, double ry);
-
 
253
	   QString findIcon(QString ic);
-
 
254
 
241
	private:
255
	private:
242
	   QString getKey (int pos);
256
	   QString getKey (int pos);
243
	   TYPES getType(QString ty);
257
	   TYPES getType(QString ty);
244
	   char *getTypeText(TYPES type);
258
	   char *getTypeText(TYPES type);
245
	   bool getBool(QString b);
259
	   bool getBool(QString b);
Line 269... Line 283...
269
	   QLabel *label;
283
	   QLabel *label;
270
	   QString shapePath;
284
	   QString shapePath;
271
	   QString pluginPath;
285
	   QString pluginPath;
272
	   QString fontPath;
286
	   QString fontPath;
273
	   QString XmlPath;
287
	   QString XmlPath;
-
 
288
	   QString OutBuf;
274
	   CONTAINER Container;
289
	   CONTAINER Container;
275
	   bool ControlSet;
290
	   bool ControlSet;
276
	   int Field;
291
	   int Field;
-
 
292
	   int XmlLine;	// Line number of the current position in XML file
-
 
293
	   double _lx, _ly, _rx, _ry;
277
	   TYPES Types;
294
	   TYPES Types;
278
	   NAMES Names;
295
	   NAMES Names;
279
	   MAP MapPars;
296
	   MAP MapPars;
280
	   Map m;
297
	   Map m;
281
	   LAYER *Lay, *firstLayer, *lastLayer;
298
	   LAYER *Lay, *firstLayer, *lastLayer;