00001 00002 00003 00004 00005
00006 #ifndef __GTK_FMAPS_H__
00007 #define __GTK_FMAPS_H__
00008
00009 #include <gdk/gdk.h>
00010 #include <gtk/gtkadjustment.h>
00011 #include <gtk/gtkwidget.h>
00012 #include <gtkgl/gtkglarea.h>
00013 #include <GL/gl.h>
00014
00015 #ifndef LIBPQ_H
00016 # include "libpq-fe.h"
00017 # define LIBPQ_H
00018 #endif
00019
00020 #ifdef __cpluplus
00021 extern "C" {
00022 #endif
00023
00024 #define GTK_TYPE_FMAPS (gtk_fmaps_get_type())
00025 #define GTK_FMAPS(obj) GTK_CHECK_CAST (obj, GTK_TYPE_FMAPS, GtkFMaps)
00026 #define GTK_FMAPS_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, GTK_TYPE_FMAPS, GtkFMapsClass)
00027 #define GTK_IS_FMAPS(obj) GTK_CHECK_TYPE (obj, GTK_TYPE_FMAPS)
00028 #define GTK_IS_FMAPS_CLASS(klass) GTK_CHECK_CLASS_TYPE ((klass),GTK_TYPE_FMAPS)
00029
00030
00031 #define ACTION_NONE 0
00032 #define ACTION_ZOOM 1
00033
00034 #define FM_POINT 0
00035 #define FM_PLINE 1
00036
00037
00038
00039 typedef enum
00040 {
00041 DAT_NONE = 0,
00042 DAT_MOLENDENSKY = 1,
00043 DAT_BURSA_WOLFE = 2
00044 } GtkFMapsDatumType;
00045
00046
00047
00048 typedef enum
00049 {
00050 UNIT_DEGREE = 0,
00051 UNIT_M = 1,
00052 UNIT_CM =2,
00053 UNIT_CHAINS = 3,
00054 UNIT_FEET = 4,
00055 UNIT_INCHES = 5,
00056 UNIT_KM = 6,
00057 UNIT_LINKS = 7,
00058 UNIT_MILES = 8,
00059 UNIT_MM = 9,
00060 UNIT_NAUTICALMILES = 10,
00061 UNIT_RODS = 11,
00062 UNIT_USSURVEYFEET = 12,
00063 UNIT_YARDS = 13,
00064 UNIT_FATHOM = 14
00065 } GtkFMapsUnitType;
00066
00067
00068
00069 typedef enum
00070 {
00071 PROJ_NONE = 0,
00072 PROJ_LONLAT = 1,
00073 PROJ_MERCATOR = 2
00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095
00096
00097 } GtkFMapsProjectionType;
00098
00099
00100 typedef struct _GtkFMaps GtkFMaps;
00101 typedef struct _GtkFMapsClass GtkFMapsClass;
00102 typedef struct _GtkFMapsTable GtkFMapsTable;
00103 typedef struct _GtkFMapsTableList GtkFMapsTableList;
00104 typedef struct _GtkFMapsProjDatum GtkFMapsProjDatum;
00105
00106 struct _GtkFMaps
00107 {
00108 GtkGLArea glarea;
00109
00110
00111
00112
00113
00114 gfloat old_value;
00115 gfloat old_lower;
00116 gfloat old_upper;
00117
00118 GtkAdjustment *adjustment;
00119
00120
00121
00122 gdouble zoom;
00123 gdouble centerx;
00124 gdouble centery;
00125 gdouble width;
00126 gdouble height;
00127
00128 gint actionstatus;
00129
00130 gint nbtables;
00131 GtkFMapsTable **table;
00132
00133 PGconn *conn;
00134
00135 GtkFMapsProjDatum *projdatum;
00136
00137 };
00138
00139 struct _GtkFMapsClass
00140 {
00141 GtkGLAreaClass parent_class;
00142
00143
00144
00145 };
00146
00147
00148
00149 struct _GtkFMapsTable
00150 {
00151
00152 gchar *name;
00153 gint oid;
00154 gboolean visible;
00155 gboolean text;
00156 gboolean vector;
00157 gboolean raster;
00158 gboolean image;
00159
00160 GtkFMapsProjDatum *projdatum;
00161 };
00162
00163
00164
00165 struct _GtkFMapsProjDatum
00166 {
00167
00168 GtkFMapsDatumType datumtransform;
00169
00170
00171 gdouble dx,dy,dz;
00172 gdouble ex,ey,ez;
00173 gdouble m;
00174 gdouble pm;
00175
00176 gdouble e,a,f;
00177
00178
00179 gdouble r11,r12,r13;
00180 gdouble r21,r22,r23;
00181 gdouble r31,r32,r33;
00182
00183
00184 GtkFMapsProjectionType projection;
00185
00186
00187 gdouble par1,par2,par3,par4,par5,par6,par7,par8,par9,par10;
00188 };
00189
00190 struct _GtkFMapsTableList
00191 {
00192 gint nbtables;
00193 GtkFMapsTable **table;
00194 };
00195
00196
00197
00198 typedef struct _Point Point;
00199 typedef struct _LinearRing LinearRing;
00200 typedef struct _WKBPoint WKBPoint;
00201 typedef struct _WKBLineString WKBLineString;
00202 typedef struct _WKBPolygon WKBPolygon;
00203 typedef struct _WKBMultiPoint WKBMultiPoint;
00204 typedef struct _WKBMultiLineString WKBMultiLineString;
00205 typedef struct _WKBMultiPolygon WKBMultiPolygon;
00206 typedef struct _WKBGeometry WKBGeometry;
00207 typedef struct _WKBGeometryCollection WKBGeometryCollection;
00208
00209
00210 struct _Point
00211 {
00212 gdouble x;
00213 gdouble y;
00214 gdouble z;
00215 };
00216
00217 struct _LinearRing
00218 {
00219 guint32 numPoints;
00220 Point *points;
00221 };
00222
00223 typedef enum
00224 {
00225 POINT = 1,
00226 LINESTRING = 2,
00227 POLYGON = 3,
00228 MULTIPOINT = 4,
00229 MULTILINESTRING = 5,
00230 MULTIPOLYGON = 6,
00231 GEOMETRYCOLLECTION = 7
00232 } wkbGeometryType;
00233
00234 typedef enum
00235 {
00236 XDR = 0,
00237 NDR = 1
00238 } wkbByteOrder;
00239
00240 struct _WKBPoint {
00241 wkbByteOrder byteOrder;
00242 wkbGeometryType wkbType;
00243 Point point;
00244 };
00245
00246 struct _WKBLineString {
00247 wkbByteOrder byteOrder;
00248 wkbGeometryType wkbType;
00249 guint32 numPoints;
00250 Point *points;
00251 };
00252
00253 struct _WKBPolygon {
00254 wkbByteOrder byteOrder;
00255 wkbGeometryType wkbType;
00256 guint32 numRings;
00257 LinearRing *rings;
00258 };
00259
00260 struct _WKBMultiPoint {
00261 wkbByteOrder byteOrder;
00262 wkbGeometryType wkbType;
00263 guint32 num_wkbPoints;
00264 WKBPoint *WKBPoints;
00265 };
00266
00267 struct _WKBMultiLineString {
00268 wkbByteOrder byteOrder;
00269 wkbGeometryType wkbType;
00270 guint32 num_wkbLineStrings;
00271 WKBLineString *WKBLineStrings;
00272 };
00273
00274 struct _WKBMultiPolygon {
00275 wkbByteOrder byteOrder;
00276 wkbGeometryType wkbType;
00277 guint32 num_wkbPolygons;
00278 WKBPolygon *wkbPolygons;
00279 };
00280
00281 struct _WKBGeometryCollection {
00282 wkbByteOrder byte_order;
00283 wkbGeometryType wkbType;
00284 guint32 num_wkbGeometries;
00285 WKBGeometry *wkbGeometries;
00286 };
00287
00288 struct _WKBGeometry {
00289 union {
00290 WKBPoint point;
00291 WKBLineString linestring;
00292 WKBPolygon polygon;
00293 WKBGeometryCollection collection;
00294 WKBMultiPoint mpoint;
00295 WKBMultiLineString mlinestring;
00296 WKBMultiPolygon mpolygon;
00297 } object;
00298 };
00299
00300
00301
00302
00303
00304
00305
00306 GtkWidget* gtk_fmaps_new (GtkAdjustment *adjustment, PGconn *conn);
00307 guint gtk_fmaps_get_type (void);
00308 GtkAdjustment* gtk_fmaps_get_adjustment (GtkFMaps *fmaps);
00309 void gtk_fmaps_set_adjustment (GtkFMaps *fmaps,
00310 GtkAdjustment *adjustment);
00311 void gtk_fmaps_add_table (GtkFMaps *fmaps, gchar *name, gboolean visible);
00312
00313 #ifdef __cpluplus
00314 }
00315 #endif
00316
00317 #endif