Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Difference From 164c9d435f4d167b To 028b99927b4cfbb3
2018-07-29
| ||
17:00 | updating the internal HTML documentation check-in: a5c0047ccc user: sandro tags: trunk | |
15:35 | VirtualPG integration - aligning to recent changes in rasterlite2 check-in: 028b99927b user: sandro tags: trunk | |
2017-08-24
| ||
16:04 | implementing dynamic styles check-in: 161086f290 user: sandro tags: trunk | |
2017-08-05
| ||
16:08 | implementing HtmlHep.cpp and helpgen.c check-in: 7943b510a1 user: sandro tags: trunk | |
2017-08-02
| ||
16:27 | Map Panel: several enhancements check-in: 164c9d435f user: sandro tags: trunk | |
2017-07-16
| ||
16:24 | implementing Raster Pixel Identify check-in: 15e5b8f5f9 user: sandro tags: trunk | |
Changes to BlobExplorer.cpp.
1 1 /* 2 2 / BlobExplorer.cpp 3 3 / a dialog to explore a BLOB value 4 4 / 5 5 / version 1.7, 2013 May 8 6 6 / 7 -/ Author: Sandro Furieri a-furieri@lqt.it 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 8 / 9 9 / Copyright (C) 2008-2013 Alessandro Furieri 10 10 / 11 11 / This program is free software: you can redistribute it and/or modify 12 12 / it under the terms of the GNU General Public License as published by 13 13 / the Free Software Foundation, either version 3 of the License, or 14 14 / (at your option) any later version. ................................................................................ 72 72 unsigned int width; 73 73 unsigned int height; 74 74 unsigned char sample_type; 75 75 unsigned char pixel_type; 76 76 unsigned char num_bands; 77 77 78 78 if (BlobType == GAIA_GEOMETRY_BLOB) 79 + Geometry = gaiaFromSpatiaLiteBlobWkb(Blob, BlobSize); 80 + else if (BlobType == GAIA_TINYPOINT_BLOB) 79 81 Geometry = gaiaFromSpatiaLiteBlobWkb(Blob, BlobSize); 80 82 else if (BlobType == GAIA_GPB_BLOB) 81 83 Geometry = gaiaFromGeoPackageGeometryBlob(Blob, BlobSize); 82 84 else if (BlobType == GAIA_XML_BLOB) 83 85 { 84 86 #ifdef ENABLE_LIBXML2 // only if LIBXML2 is enabled 85 87 ................................................................................ 312 314 if (wxPropertySheetDialog::Create(parent, wxID_ANY, wxT("BLOB explorer")) == 313 315 false) 314 316 return false; 315 317 wxBookCtrlBase *book = GetBookCtrl(); 316 318 // creates individual panels 317 319 wxPanel *hexadecimal = CreateHexadecimalPage(book); 318 320 book->AddPage(hexadecimal, wxT("Hexadecimal dump"), true); 319 - if (BlobType == GAIA_GEOMETRY_BLOB || BlobType == GAIA_GPB_BLOB) 321 + if (BlobType == GAIA_GEOMETRY_BLOB || BlobType == GAIA_TINYPOINT_BLOB 322 + || BlobType == GAIA_GPB_BLOB) 320 323 { 321 324 wxPanel *geometry = CreateGeometryPage(book); 322 325 book->AddPage(geometry, wxT("Geometry explorer"), false); 323 326 wxPanel *wkt = CreateWKTPage(book); 324 327 book->AddPage(wkt, wxT("WKT"), false); 325 328 wxPanel *ewkt = CreateEWKTPage(book); 326 329 book->AddPage(ewkt, wxT("EWKT"), false); ................................................................................ 1079 1082 // 1080 1083 switch (event.GetSelection()) 1081 1084 { 1082 1085 case 0: 1083 1086 UpdateHexadecimalPage(); 1084 1087 break; 1085 1088 case 1: 1086 - if (BlobType == GAIA_GEOMETRY_BLOB || BlobType == GAIA_GPB_BLOB) 1089 + if (BlobType == GAIA_GEOMETRY_BLOB || BlobType == GAIA_TINYPOINT_BLOB 1090 + || BlobType == GAIA_GPB_BLOB) 1087 1091 UpdateGeometryPage(); 1088 1092 else if (BlobType == GAIA_XML_BLOB) 1089 1093 UpdateXmlDocumentPage(); 1090 1094 else 1091 1095 UpdateImagePage(); 1092 1096 break; 1093 1097 case 2:
Changes to Classdef.h.
1 1 /* 2 2 / Classdef.h 3 3 / class definitions for spatialite_gui - a SQLite /SpatiaLite GUI tool 4 4 / 5 5 / version 1.7, 2013 May 8 6 6 / 7 -/ Author: Sandro Furieri a-furieri@lqt.it 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 8 / 9 9 / Copyright (C) 2008-2013 Alessandro Furieri 10 10 / 11 11 / This program is free software: you can redistribute it and/or modify 12 12 / it under the terms of the GNU General Public License as published by 13 13 / the Free Software Foundation, either version 3 of the License, or 14 14 / (at your option) any later version. ................................................................................ 29 29 #include "wx/grid.h" 30 30 #include "wx/listctrl.h" 31 31 #include "wx/textctrl.h" 32 32 #include "wx/propdlg.h" 33 33 #include "wx/generic/propdlg.h" 34 34 #include "wx/timer.h" 35 35 #include "wx/string.h" 36 +#include "wx/dynlib.h" 36 37 37 38 #include "config.h" 38 39 39 40 #ifdef SPATIALITE_AMALGAMATION 40 41 #include <spatialite/sqlite3.h> 41 42 #else 42 43 #include <sqlite3.h> ................................................................................ 46 47 #include <spatialite/gaiaexif.h> 47 48 #include <spatialite/gaiageo.h> 48 49 #include <spatialite.h> 49 50 #include <spatialite/gg_wfs.h> 50 51 #include <spatialite/geopackage.h> 51 52 52 53 #include <freexl.h> 54 +#include <virtualpg.h> 53 55 54 56 #include <rasterlite2/rasterlite2.h> 55 57 #include <rasterlite2/rl2wms.h> 56 58 #include "rasterlite2/rl2graphics.h" 57 59 58 -// 59 -// functions for QSORT / BSEARCH 60 -// 61 -int cmp_prenodes_code(const void *p1, const void *p2); 62 -int cmp_prenodes_id(const void *p1, const void *p2); 63 -int cmp_nodes2_code(const void *p1, const void *p2); 64 -int cmp_nodes2_id(const void *p1, const void *p2); 65 -int cmp_nodes1_code(const void *p1, const void *p2); 66 -int cmp_nodes1_id(const void *p1, const void *p2); 67 - 68 60 // 69 61 // functions for threaded queries 70 62 // 71 63 int SqlProgressCallback(void *arg); 72 64 #if defined(__WIN32) && !defined(__MINGW32__) 73 65 DWORD WINAPI DoExecuteSqlThread(void *arg); 74 66 #else ................................................................................ 149 141 ID_Exif, 150 142 ID_GpsPics, 151 143 ID_LoadXml, 152 144 ID_Srids, 153 145 ID_Charset, 154 146 ID_Help, 155 147 ID_Attach, 148 + ID_Postgres, 156 149 ID_SqlLog, 157 150 ID_DbStatus, 158 151 ID_CheckGeom, 159 152 ID_SaneGeom, 160 153 ID_WFS, 161 154 ID_DXF, 162 155 ID_AddLayer, ................................................................................ 272 265 Tree_MapRemoveAll, 273 266 Tree_MapShowAll, 274 267 Tree_MapHideAll, 275 268 Tree_MapConfigure, 276 269 Tree_MapVisible, 277 270 Tree_MapFullExtent, 278 271 Tree_MapLayerFullExtent, 272 + Tree_SqlSample, 273 + Tree_UrlSample, 279 274 Tree_MapLayerConfigure, 280 275 Tree_MapLayerInfo, 281 276 Tree_QuickStyleEdit, 282 277 Tree_MapRemoveLayer, 283 278 Tree_MapDeleteItem, 279 + Tree_CreatePostgreSqlConn, 280 + Tree_CloseAllPostgreSqlConns, 281 + Tree_ClosePostgreSqlConn, 282 + Tree_PostgreSqlDropOrphans, 283 + Tree_PostgreSqlInfos, 284 284 Grid_Clear, 285 285 Grid_All, 286 286 Grid_Column, 287 287 Grid_Row, 288 288 Grid_Copy, 289 289 Grid_Blob, 290 290 Grid_Delete, ................................................................................ 438 438 ID_NET_FROM_TO, 439 439 ID_NET_TO_FROM, 440 440 ID_NET_NAME_ENABLE, 441 441 ID_NET_NAME, 442 442 ID_NET_A_STAR, 443 443 ID_NET_DATA, 444 444 ID_NET_VIRTUAL, 445 + ID_NET_OVERWRITE, 445 446 ID_EXIF_PATH, 446 447 ID_EXIF_FOLDER, 447 448 ID_EXIF_METADATA, 448 449 ID_EXIF_GPS_ONLY, 449 450 ID_GPS_PICS_PATH, 450 451 ID_GPS_PICS_FOLDER, 451 452 ID_GPS_PICS_TABLE, ................................................................................ 759 760 ID_RASTER_KEYWORD_REMOVE, 760 761 ID_RASTER_KEYWORD, 761 762 ID_RASTER_KEYWORD_GRID, 762 763 ID_SYMBOLIZER_NAME, 763 764 ID_SYMBOLIZER_TITLE, 764 765 ID_SYMBOLIZER_ABSTRACT, 765 766 ID_SYMBOLIZER_OPACITY, 767 + ID_SYMBOLIZER_BAND_MODE, 766 768 ID_SYMBOLIZER_RED, 767 769 ID_SYMBOLIZER_GREEN, 768 770 ID_SYMBOLIZER_BLUE, 769 771 ID_SYMBOLIZER_GRAY, 770 772 ID_SYMBOLIZER_CONTRAST, 771 773 ID_SYMBOLIZER_GAMMA, 772 774 ID_SYMBOLIZER_MAP, ................................................................................ 989 991 ID_SYMBOLIZER_FACE_SEED_ANCHOR_Y, 990 992 ID_SYMBOLIZER_FACE_SEED_FILL_COLOR, 991 993 ID_SYMBOLIZER_FACE_SEED_FILL_PICKER_HEX, 992 994 ID_SYMBOLIZER_FACE_SEED_FILL_PICKER_BTN, 993 995 ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR, 994 996 ID_SYMBOLIZER_FACE_SEED_STROKE_PICKER_HEX, 995 997 ID_SYMBOLIZER_FACE_SEED_STROKE_PICKER_BTN, 998 + ID_SYMBOLIZER_COLOR_MAP_MODE, 999 + ID_SYMBOLIZER_MIN_COLOR, 1000 + ID_SYMBOLIZER_MIN_PICKER_HEX, 1001 + ID_SYMBOLIZER_MIN_PICKER_BTN, 1002 + ID_SYMBOLIZER_MAX_COLOR, 1003 + ID_SYMBOLIZER_MAX_PICKER_HEX, 1004 + ID_SYMBOLIZER_MAX_PICKER_BTN, 996 1005 ID_WMS_URL, 997 1006 ID_WMS_CATALOG, 998 1007 ID_WMS_RESET, 999 1008 ID_WMS_SERVER, 1000 1009 ID_WMS_VERSION, 1001 1010 ID_WMS_CRS, 1002 1011 ID_WMS_STYLE, ................................................................................ 1024 1033 ID_RASTER_STYLE, 1025 1034 ID_RASTER_OK, 1026 1035 ID_VECTOR_LAYER, 1027 1036 ID_VECTOR_TYPE, 1028 1037 ID_VECTOR_UUID, 1029 1038 ID_VECTOR_STYLE, 1030 1039 ID_VECTOR_OK, 1040 + ID_VECTOR_COPY, 1041 + ID_MIME_TYPE, 1042 + ID_IMAGE_QUALITY, 1043 + ID_SQL_SAMPLE, 1031 1044 ID_TOPOGEO_LAYER, 1032 1045 ID_TOPOGEO_SRID, 1033 1046 ID_TOPOGEO_STYLE, 1034 1047 ID_TOPOGEO_FACE, 1035 1048 ID_TOPOGEO_EDGE, 1036 1049 ID_TOPOGEO_NODE, 1037 1050 ID_TOPOGEO_FACE_SEED, ................................................................................ 1092 1105 ID_QUICK_STYLE_APPLY, 1093 1106 ID_QUICK_STYLE_EXPORT, 1094 1107 ID_QUICK_STYLE_COPY, 1095 1108 ID_PANE_POINT, 1096 1109 ID_PANE_LINE, 1097 1110 ID_PANE_POLYGON, 1098 1111 ID_PANE_TEXT, 1112 + ID_PANE_CONTRAST_ENHANCEMENT, 1113 + ID_PANE_CHANNEL_SELECTION, 1114 + ID_PANE_COLOR_MAP, 1099 1115 ID_PAINT_MAP_STEP, 1100 - ID_PAINT_MAP_THREAD_FINISHED 1116 + ID_PAINT_MAP_THREAD_FINISHED, 1117 + ID_POSTGRES_HOST, 1118 + ID_POSTGRES_HOSTADDR, 1119 + ID_POSTGRES_PORT, 1120 + ID_POSTGRES_DBNAME, 1121 + ID_POSTGRES_USER, 1122 + ID_POSTGRES_PASSWORD, 1123 + ID_POSTGRES_RDONLY, 1124 + ID_POSTGRES_TEXTDATES 1101 1125 }; 1102 1126 1103 1127 enum 1104 1128 { 1105 1129 // tree item data types 1106 1130 MY_ROOT_NODE = 0, 1107 1131 MY_ROOT_USERDATA, 1108 1132 MY_ROOT_ISOMETADATA, 1109 1133 MY_ROOT_TOPOLOGIES, 1110 1134 MY_ROOT_NETWORKS, 1111 1135 MY_ROOT_RASTER, 1112 1136 MY_ROOT_VECTOR, 1113 1137 MY_ROOT_WMS, 1138 + MY_ROOT_POSTGRESQL, 1114 1139 MY_ROOT_STYLING, 1115 1140 MY_ROOT_METADATA, 1116 1141 MY_ROOT_INTERNAL, 1117 1142 MY_ROOT_RTREE, 1118 1143 MY_TABLE, 1119 1144 MY_VTABLE, 1120 1145 MY_VIEW, ................................................................................ 1154 1179 MY_FOREIGN_KEY, 1155 1180 MY_FOREIGN_KEY_FLD, 1156 1181 MY_INT_VARIANT, 1157 1182 MY_DBL_VARIANT, 1158 1183 MY_TXT_VARIANT, 1159 1184 MY_BLOB_VARIANT, 1160 1185 MY_NULL_VARIANT, 1161 - MY_UNDEFINED 1186 + MY_UNDEFINED, 1187 + MY_POSTGRES_CONN, 1188 + MY_POSTGRES_SCHEMA, 1189 + MY_POSTGRES_TABLE, 1190 + MY_POSTGRES_VIEW, 1191 + MY_POSTGIS_VIEW, 1192 + MY_POSTGRES_COLUMN, 1193 + MY_POSTGIS_GEOMETRY 1162 1194 }; 1163 1195 1164 1196 enum 1165 1197 { 1166 1198 // control IDs for timers 1167 1199 ID_AUTO_SAVE_TIMER = 20000, 1168 1200 ID_DB_STATUS_TIMER, ................................................................................ 1364 1396 int Type; // the object type 1365 1397 int SubType; // the object sub-type 1366 1398 wxString DbAlias; // the DB alias [Attached DB] 1367 1399 wxString MainName; // the object name [usually: table name] 1368 1400 wxString ColName; // the column name [optional] 1369 1401 wxString PathOrURL; // the Path or request URL [optional] 1370 1402 bool Restricted; // not editable 1403 +// PostgreSQL specific 1404 + wxString Host; 1405 + wxString HostAddr; 1406 + int Port; 1407 + wxString DbName; 1408 + wxString User; 1409 + wxString Schema; 1410 + wxString Name; 1411 + wxString Column; 1412 + wxString VirtName; 1413 + bool ReadOnly; 1414 + bool PK; 1415 + bool Select; 1416 + bool InsertUpdateDelete; 1371 1417 public: 1372 1418 MyObject(int type); 1373 1419 MyObject(int type, wxString & dbAlias); 1374 1420 MyObject(int type, wxString & dbAlias, wxString & name, bool restricted = 1375 1421 false); 1376 1422 MyObject(int type, wxString & dbAlias, wxString & name, wxString & column); 1377 1423 MyObject(int type, wxString & dbAlias, wxString & name, wxString & column, 1378 1424 wxString & path_or_url); 1425 + MyObject(int type, wxString & host, wxString & hostaddr, int port, 1426 + wxString & dbname, wxString & user, bool readOnly); 1427 + MyObject(int type, wxString & host, wxString & hostaddr, int port, 1428 + wxString & dbname, wxString & user, wxString & schema); 1429 + MyObject(int type, wxString & host, wxString & hostaddr, int port, 1430 + wxString & dbname, wxString & user, wxString & schema, 1431 + wxString & name, wxString & virtname, bool readOnly, bool pk, 1432 + bool select, bool insertUpdateDelete); 1433 + MyObject(int type, wxString & host, wxString & hostaddr, int port, 1434 + wxString & dbname, wxString & user, wxString & schema, 1435 + wxString & name, wxString & column, wxString & virtname); 1379 1436 virtual ~ MyObject() 1380 1437 {; 1381 1438 } 1382 1439 int GetType() 1383 1440 { 1384 1441 return Type; 1385 1442 } ................................................................................ 1399 1456 { 1400 1457 return ColName; 1401 1458 } 1402 1459 wxString & GetPathOrURL() 1403 1460 { 1404 1461 return PathOrURL; 1405 1462 } 1463 + wxString & GetHost() 1464 + { 1465 + return Host; 1466 + } 1467 + wxString & GetHostAddr() 1468 + { 1469 + return HostAddr; 1470 + } 1471 + int GetPort() 1472 + { 1473 + return Port; 1474 + } 1475 + wxString & GetDbName() 1476 + { 1477 + return DbName; 1478 + } 1479 + wxString & GetUser() 1480 + { 1481 + return User; 1482 + } 1483 + wxString & GetSchema() 1484 + { 1485 + return Schema; 1486 + } 1487 + wxString & GetName() 1488 + { 1489 + return Name; 1490 + } 1491 + wxString & GetColumn() 1492 + { 1493 + return Column; 1494 + } 1495 + wxString & GetVirtName() 1496 + { 1497 + return VirtName; 1498 + } 1499 + bool IsReadOnly() 1500 + { 1501 + return ReadOnly; 1502 + } 1503 + bool HasPK() 1504 + { 1505 + return PK; 1506 + } 1507 + bool CanSelect() 1508 + { 1509 + return Select; 1510 + } 1511 + bool CanInsertUpdateDelete() 1512 + { 1513 + return InsertUpdateDelete; 1514 + } 1406 1515 bool IsTable(); 1407 1516 bool IsView(); 1408 1517 bool IsTemporary(); 1409 1518 bool IsEditable(); 1410 1519 bool IsAttachedDB(); 1411 1520 bool IsRootAttached(); 1412 1521 bool IsAttached(); ................................................................................ 1424 1533 bool IsIndex(); 1425 1534 bool IsIndexColumn(); 1426 1535 bool IsTrigger(); 1427 1536 bool IsPrimaryKey(); 1428 1537 bool IsPrimaryKeyColumn(); 1429 1538 bool IsForeignKey(); 1430 1539 bool IsForeignKeyColumn(); 1540 + bool IsPostgreSQL(); 1431 1541 }; 1432 1542 1433 1543 class MyColumnInfo 1434 1544 { 1435 1545 // 1436 1546 // a class to store a DB column 1437 1547 // ................................................................................ 2479 2589 wxTreeItemId RootTopologies; 2480 2590 wxTreeItemId RootNetworks; 2481 2591 wxTreeItemId RootRasterCoverages; 2482 2592 wxTreeItemId RootVectorCoverages; 2483 2593 wxTreeItemId RootStyling; 2484 2594 wxTreeItemId RootWMS; 2485 2595 wxTreeItemId RootIsoMetadata; 2596 + wxTreeItemId RootPostgreSQL; 2486 2597 TopoGeoList Topologies; 2487 2598 TopoNetList Networks; 2488 2599 RasterCoverageList RasterCoverages; 2489 2600 VectorCoverageList VectorCoverages; 2490 2601 WmsLayerList WmsLayers; 2491 2602 TopoGeoList AltTopologies; 2492 2603 TopoNetList AltNetworks; ................................................................................ 2502 2613 wxString CurrentVectorCoverageName; 2503 2614 wxString CurrentWmsLayerURL; 2504 2615 wxString CurrentWmsLayerName; 2505 2616 void ExpandTable(wxTreeItemId & item); 2506 2617 void ExpandView(wxTreeItemId & item); 2507 2618 void ExpandAttachedTable(wxTreeItemId & item); 2508 2619 void ExpandAttachedView(wxTreeItemId & item); 2620 + void ExpandPostgresTable(wxTreeItemId & item); 2621 + void ExpandPostGisView(wxTreeItemId & item); 2509 2622 // context menus 2510 2623 void DoRootRasterCoveragesContextMenu(wxPoint & pt); 2511 2624 void DoRootVectorCoveragesContextMenu(wxPoint & pt); 2512 2625 void DoRootWmsLayersContextMenu(wxPoint & pt); 2513 2626 void DoRootTopoGeoContextMenu(wxPoint & pt); 2514 2627 void DoRootTopoNetContextMenu(wxPoint & pt); 2515 2628 void DoRootStylingContextMenu(wxPoint & pt); 2629 + void DoRootPostgreSqlContextMenu(wxPoint & pt); 2516 2630 void DoRootOthersContextMenu(wxPoint & pt, MyObject * obj); 2517 2631 void DoAttachedDbContextMenu(wxPoint & pt, MyObject * obj); 2518 2632 void DoRootAttachedContextMenu(wxPoint & pt, MyObject * obj); 2519 2633 void DoGenericAttachedContextMenu(wxPoint & pt, wxString & title); 2520 2634 void DoTopoGeoContextMenu(wxPoint & pt, wxString & name); 2521 2635 void DoTopoNetContextMenu(wxPoint & pt, wxString & name); 2522 2636 void DoRasterCoverageContextMenu(wxPoint & pt, wxString & name); ................................................................................ 2545 2659 void DoAttachedPrimaryKeyContextMenu(wxPoint & pt, MyObject * obj); 2546 2660 void DoMainPrimaryKeyColumnContextMenu(wxPoint & pt, MyObject * obj); 2547 2661 void DoAttachedPrimaryKeyColumnContextMenu(wxPoint & pt, MyObject * obj); 2548 2662 void DoMainForeignKeyContextMenu(wxPoint & pt, MyObject * obj); 2549 2663 void DoAttachedForeignKeyContextMenu(wxPoint & pt, MyObject * obj); 2550 2664 void DoMainForeignKeyColumnContextMenu(wxPoint & pt, MyObject * obj); 2551 2665 void DoAttachedForeignKeyColumnContextMenu(wxPoint & pt, MyObject * obj); 2666 + void DoPostgreSqlContextMenu(wxPoint & pt, MyObject * obj); 2667 + void DoPostgresConnContextMenu(wxPoint & pt, MyObject * obj); 2668 + void DoPostgresSchemaContextMenu(wxPoint & pt, MyObject * obj); 2669 + void DoPostgresTableContextMenu(wxPoint & pt, MyObject * obj); 2670 + void DoPostgresViewContextMenu(wxPoint & pt, MyObject * obj); 2671 + void DoPostGisViewContextMenu(wxPoint & pt, MyObject * obj); 2672 + void DoPostgresColumnContextMenu(wxPoint & pt, MyObject * obj); 2673 + void DoPostGisGeometryContextMenu(wxPoint & pt, MyObject * obj); 2552 2674 public: 2553 2675 MyTableTree() 2554 2676 {; 2555 2677 } 2556 2678 MyTableTree(MyFrame * parent, wxWindowID id = wxID_ANY); 2557 2679 virtual ~ MyTableTree(); 2558 2680 void SetPath(wxString & path) ................................................................................ 2579 2701 wxTreeItemId & GetRootNode(wxString & tableName, bool * restricted, 2580 2702 bool * tile_data); 2581 2703 wxTreeItemId & GetAltRootNode(wxString & tableName, RootNodes * nodes, 2582 2704 bool * tile_data); 2583 2705 void AddTable(wxString & tableName, bool virtualTable, bool geometry); 2584 2706 void AddTable(wxString & dbAlias, wxString & tableName, bool virtualTable, 2585 2707 bool geometry); 2708 + void AddTmpMetadata(wxString & tableName); 2586 2709 void AddGeoPackageTable(wxString & tableName); 2587 2710 void AddGeoPackageTable(wxString & dbAlias, wxString & tableName, 2588 2711 RootNodes * nodes); 2589 2712 void AddGeoPackageVirtualTable(wxString & tableName); 2590 2713 void AddGeoPackageVirtualTable(wxString & dbAlias, wxString & tableName, 2591 2714 RootNodes * nodes); 2592 2715 void AddFdoOgrTable(wxString & tableName); ................................................................................ 2598 2721 wxTreeItemId & AddAttached(wxString & dbAlias, wxString & path); 2599 2722 void AddTable(wxString & dbAlias, wxString & tableName, 2600 2723 bool virtualTable, bool geometry, RootNodes * list); 2601 2724 void AddView(wxString & viewName, bool geometry); 2602 2725 void AddView(wxString & dbAlias, wxString & viewName, bool geometry); 2603 2726 void AddView(wxString & dbAlias, wxString & viewName, bool geometry, 2604 2727 RootNodes * list); 2728 + void AddPostgresTable(class MyPostgres * list, wxString & virtName); 2605 2729 void ExpandRoot() 2606 2730 { 2607 2731 Expand(Root); 2608 2732 Expand(RootUserData); 2609 2733 CollapseAllChildren(RootTopologies); 2610 2734 CollapseAllChildren(RootNetworks); 2611 2735 CollapseAllChildren(RootRasterCoverages); 2612 2736 CollapseAllChildren(RootVectorCoverages); 2613 2737 CollapseAllChildren(RootStyling); 2614 2738 CollapseAllChildren(RootWMS); 2739 + CollapseAllChildren(RootPostgreSQL); 2615 2740 CollapseAllChildren(RootIsoMetadata); 2616 2741 Collapse(RootMetadata); 2617 2742 Collapse(RootInternal); 2618 2743 Collapse(RootSpatialIndex); 2619 2744 } 2620 2745 void AddTopology(TopoGeoSet * topology) 2621 2746 { ................................................................................ 2692 2817 { 2693 2818 AltRasterCoverages.Flush(); 2694 2819 } 2695 2820 void DeleteAltVectorCoverages(void) 2696 2821 { 2697 2822 AltVectorCoverages.Flush(); 2698 2823 } 2824 + void AddPostgresConnection(int num, class MyPostgresConn * conn, 2825 + wxTreeItemId & itemId); 2826 + void AddPostgresSchema(wxTreeItemId & parent, MyPostgresConn * conn, 2827 + wxString & schema, wxTreeItemId & itemId); 2828 + void AddPostgresTable(wxTreeItemId & parent, MyPostgresConn * conn, 2829 + wxString & schema, wxString & table, 2830 + wxString & virtName); 2831 + void AddPostgresView(wxTreeItemId & parent, MyPostgresConn * conn, 2832 + wxString & schema, wxString & view, wxString & virtName); 2833 + void AddPostGisView(wxTreeItemId & parent, MyPostgresConn * conn, 2834 + wxString & schema, wxString & table, wxString & geometry, 2835 + wxString & virtName); 2699 2836 sqlite3 *GetSQLiteHandle(); 2700 2837 void OnSelChanged(wxTreeEvent & event); 2701 2838 void OnRightClick(wxTreeEvent & event); 2702 2839 void OnCmdQueryViewComposer(wxCommandEvent & event); 2703 2840 void OnCmdCloneTable(wxCommandEvent & event); 2704 2841 void OnCmdNewTable(wxCommandEvent & event); 2705 2842 void OnCmdNewView(wxCommandEvent & event); ................................................................................ 2781 2918 void OnCmdDumpCsv(wxCommandEvent & event); 2782 2919 void OnCmdDumpHtml(wxCommandEvent & event); 2783 2920 void OnCmdDumpDif(wxCommandEvent & event); 2784 2921 void OnCmdDumpSylk(wxCommandEvent & event); 2785 2922 void OnCmdDumpDbf(wxCommandEvent & event); 2786 2923 void OnCmdDumpPostGIS(wxCommandEvent & event); 2787 2924 void OnCmdEdit(wxCommandEvent & event); 2925 + void OnCmdCreatePostgreSqlConn(wxCommandEvent & event); 2926 + void OnCmdCloseAllPostgreSqlConns(wxCommandEvent & event); 2927 + void OnCmdClosePostgreSqlConn(wxCommandEvent & event); 2928 + void OnCmdPostgreSqlDropOrphans(wxCommandEvent & event); 2929 + void OnCmdPostgreSqlInfos(wxCommandEvent & event); 2788 2930 bool DropRenameAux1(MyObject * obj, class GeomColsList * geometries, 2789 2931 bool * autoincrement); 2790 2932 void DropRenameAux2(MyObject * obj, GeomColsList * geometries, 2791 2933 wxString & aliasTable, wxString & new_column, 2792 2934 wxString & renameSql, wxString & dropSql, 2793 2935 wxString & disableSpatialIdxSql, 2794 2936 wxString & dropSpatialIdxSql, ................................................................................ 3280 3422 void AddEntity(sqlite3_int64 rowid, int severity, bool CanFix, 3281 3423 wxString & error, wxString & geosMsg); 3282 3424 MalformedGeom *GetFirst() 3283 3425 { 3284 3426 return First; 3285 3427 } 3286 3428 }; 3429 + 3430 +class PostgresConnectionDialog:public wxDialog 3431 +{ 3432 +// 3433 +// a dialog for connecting to a PosgreSQL DBMS 3434 +// 3435 +private: 3436 + MyFrame * MainFrame; 3437 + char *host; 3438 + char *hostaddr; 3439 + unsigned int port; 3440 + char *dbname; 3441 + char *user; 3442 + char *password; 3443 + bool ReadOnly; 3444 + bool TextDates; 3445 +public: 3446 + PostgresConnectionDialog() 3447 + { 3448 + host = NULL; 3449 + hostaddr = NULL; 3450 + port = 5432; 3451 + dbname = NULL; 3452 + user = NULL; 3453 + password = NULL; 3454 + ReadOnly = true; 3455 + TextDates = true; 3456 + } 3457 + virtual ~ PostgresConnectionDialog() 3458 + { 3459 + if (host != NULL) 3460 + free(host); 3461 + if (hostaddr != NULL) 3462 + free(hostaddr); 3463 + if (dbname != NULL) 3464 + free(dbname); 3465 + if (user != NULL) 3466 + free(user); 3467 + if (password != NULL) 3468 + free(password); 3469 + } 3470 + bool Create(MyFrame * parent); 3471 + void CreateControls(); 3472 + const char *GetHost() 3473 + { 3474 + return host; 3475 + } 3476 + const char *GetHostAddr() 3477 + { 3478 + return hostaddr; 3479 + } 3480 + int GetPort() 3481 + { 3482 + return port; 3483 + } 3484 + const char *GetDbName() 3485 + { 3486 + return dbname; 3487 + } 3488 + const char *GetUser() 3489 + { 3490 + return user; 3491 + } 3492 + const char *GetPassword() 3493 + { 3494 + return password; 3495 + } 3496 + bool IsReadOnly() 3497 + { 3498 + return ReadOnly; 3499 + } 3500 + bool IsTextDates() 3501 + { 3502 + return TextDates; 3503 + } 3504 + void OnOk(wxCommandEvent & event); 3505 +}; 3287 3506 3288 3507 class SanitizeAllGeometriesDialog:public wxDialog 3289 3508 { 3290 3509 // 3291 3510 // a dialog supporting Sanitize All Geometries 3292 3511 // 3293 3512 private: ................................................................................ 3752 3971 3753 3972 class TableViewItem 3754 3973 { 3755 3974 // 3756 3975 // an ancillary class wrapping Tables and Views 3757 3976 // 3758 3977 private: 3978 + wxString DbName; 3759 3979 wxString Name; 3760 3980 bool View; 3761 3981 bool Virtual; 3762 3982 bool Geometry; 3763 3983 bool GeoPackageGeometry; 3764 3984 bool GeoPackageVirtualGeometry; 3765 3985 bool FdoOgrGeometry; 3766 3986 bool FdoOgrVirtualGeometry; 3767 3987 TableViewItem *Next; 3768 3988 public: 3989 + TableViewItem(wxString & db, wxString & name); 3769 3990 TableViewItem(wxString & name, bool is_view, bool is_virtual); 3770 3991 ~TableViewItem() 3771 3992 {; 3993 + } 3994 + wxString & GetDbName() 3995 + { 3996 + return DbName; 3772 3997 } 3773 3998 wxString & GetName() 3774 3999 { 3775 4000 return Name; 3776 4001 } 3777 4002 bool IsView() 3778 4003 { ................................................................................ 3818 4043 { 3819 4044 FdoOgrVirtualGeometry = true; 3820 4045 } 3821 4046 bool IsFdoOgrVirtualGeometry() 3822 4047 { 3823 4048 return FdoOgrVirtualGeometry; 3824 4049 } 4050 + bool IsPostgresTable(class MyPostgres * list); 4051 + bool IsTmpMetadata(); 3825 4052 void SetNext(TableViewItem * next) 3826 4053 { 3827 4054 Next = next; 3828 4055 } 3829 4056 TableViewItem *GetNext() 3830 4057 { 3831 4058 return Next; ................................................................................ 3841 4068 TableViewItem * First; 3842 4069 TableViewItem *Last; 3843 4070 int Count; 3844 4071 TableViewItem **Sorted; 3845 4072 public: 3846 4073 TableViewList(); 3847 4074 ~TableViewList(); 4075 + void Add(wxString & db, wxString & name); 3848 4076 void Add(wxString & name, bool isView, bool isVirtual); 3849 4077 void PrepareSorted(); 3850 4078 void SetGeometry(wxString & name); 3851 4079 void SetGeoPackageGeometry(wxString & name); 3852 4080 void SetGeoPackageVirtualGeometry(wxString & name); 3853 4081 void SetFdoOgrGeometry(wxString & name); 3854 4082 void SetFdoOgrVirtualGeometry(wxString & name); ................................................................................ 4239 4467 void AddGeoTable(wxString & db_prefix, wxString & table_name, int type); 4240 4468 MyAttachedTable *FindGeoTable(wxString & db_prefix, wxString & name); 4241 4469 MyAttachedDB *GetFirst() 4242 4470 { 4243 4471 return First; 4244 4472 } 4245 4473 }; 4474 + 4475 +class MyPostgresCol 4476 +{ 4477 +// 4478 +// a PostgreSQL Column 4479 +// 4480 +private: 4481 + wxString Name; 4482 + bool PK; 4483 + MyPostgresCol *Next; 4484 +public: 4485 + MyPostgresCol(wxString & name) 4486 + { 4487 + Name = name; 4488 + PK = false; 4489 + Next = NULL; 4490 + } 4491 + ~MyPostgresCol() 4492 + {; 4493 + } 4494 + wxString & GetName() 4495 + { 4496 + return Name; 4497 + } 4498 + void SetPK() 4499 + { 4500 + PK = true; 4501 + } 4502 + bool IsPK() 4503 + { 4504 + return PK; 4505 + } 4506 + void SetNext(MyPostgresCol * next) 4507 + { 4508 + Next = next; 4509 + } 4510 + MyPostgresCol *GetNext() 4511 + { 4512 + return Next; 4513 + } 4514 +}; 4515 + 4516 +class MyPostgresColumns 4517 +{ 4518 +// 4519 +// a list of PostgreSQL Columns 4520 +// 4521 +private: 4522 + MyPostgresCol * First; 4523 + MyPostgresCol *Last; 4524 +public: 4525 + MyPostgresColumns() 4526 + { 4527 + First = NULL; 4528 + Last = NULL; 4529 + } 4530 + ~MyPostgresColumns(); 4531 + void Add(wxString & name); 4532 + void SetPK(wxString & name); 4533 + MyPostgresCol *GetFirst() 4534 + { 4535 + return First; 4536 + } 4537 + char *BuildWhere(); 4538 +}; 4539 + 4540 +class MyPostGisGeometry 4541 +{ 4542 +// 4543 +// a PostGIS Geometry column 4544 +// 4545 +private: 4546 + wxString Name; 4547 + wxString GeomType; 4548 + bool MultiType; 4549 + int Srid; 4550 + int Dims; 4551 + MyPostGisGeometry *Next; 4552 +public: 4553 + MyPostGisGeometry(wxString & name, wxString & type, int srid, int dims); 4554 + ~MyPostGisGeometry() 4555 + {; 4556 + } 4557 + wxString & GetName() 4558 + { 4559 + return Name; 4560 + } 4561 + wxString & GetGeomType() 4562 + { 4563 + return GeomType; 4564 + } 4565 + bool IsMultiType() 4566 + { 4567 + return MultiType; 4568 + } 4569 + int GetSrid() 4570 + { 4571 + return Srid; 4572 + } 4573 + int GetDims() 4574 + { 4575 + return Dims; 4576 + } 4577 + void SetNext(MyPostGisGeometry * next) 4578 + { 4579 + Next = next; 4580 + } 4581 + MyPostGisGeometry *GetNext() 4582 + { 4583 + return Next; 4584 + } 4585 +}; 4586 + 4587 +class MyPostgresPK 4588 +{ 4589 +// 4590 +// a ProgresSQL PK column 4591 +// 4592 +private: 4593 + wxString Name; 4594 + MyPostgresPK *Next; 4595 +public: 4596 + MyPostgresPK(wxString & name) 4597 + { 4598 + Name = name; 4599 + Next = NULL; 4600 + } 4601 + ~MyPostgresPK() 4602 + {; 4603 + } 4604 + wxString & GetName() 4605 + { 4606 + return Name; 4607 + } 4608 + void SetNext(MyPostgresPK * next) 4609 + { 4610 + Next = next; 4611 + } 4612 + MyPostgresPK *GetNext() 4613 + { 4614 + return Next; 4615 + } 4616 +}; 4617 + 4618 +class MyPostgresTable 4619 +{ 4620 +// 4621 +// a PostgreSQL Table 4622 +// 4623 +private: 4624 + wxString Name; 4625 + wxString VirtName; 4626 + wxString PostGisName; 4627 + bool PkChecked; 4628 + bool GrantSelect; 4629 + bool GrantInsertUpdateDelete; 4630 + MyPostgresPK *FirstPK; 4631 + MyPostgresPK *LastPK; 4632 + MyPostGisGeometry *First; 4633 + MyPostGisGeometry *Last; 4634 + MyPostgresTable *Next; 4635 +public: 4636 + MyPostgresTable(wxString & name); 4637 + ~MyPostgresTable(); 4638 + wxString & GetName() 4639 + { 4640 + return Name; 4641 + } 4642 + void SetVirtName(wxString & name) 4643 + { 4644 + VirtName = name; 4645 + } 4646 + wxString & GetVirtName() 4647 + { 4648 + return VirtName; 4649 + } 4650 + void SetPostGisName(wxString & name) 4651 + { 4652 + PostGisName = name; 4653 + } 4654 + wxString & GetPostGisName() 4655 + { 4656 + return PostGisName; 4657 + } 4658 + void Add(wxString & geometry, wxString & type, int srid, int dims); 4659 + void AddPK(wxString & column); 4660 + MyPostGisGeometry *Find(wxString & column); 4661 + bool IsPkColumn(wxString & column); 4662 + bool HasPK(); 4663 + void SetGrants(bool grantSelect, bool granInsertUpdateDelete) 4664 + { 4665 + GrantSelect = grantSelect; 4666 + GrantInsertUpdateDelete = granInsertUpdateDelete; 4667 + } 4668 + bool CanSelect() 4669 + { 4670 + return GrantSelect; 4671 + } 4672 + bool CanInsertUpdateDelete() 4673 + { 4674 + return GrantInsertUpdateDelete; 4675 + } 4676 + bool IsPkAlreadyChecked() 4677 + { 4678 + return PkChecked; 4679 + } 4680 + void SetPkChecked() 4681 + { 4682 + PkChecked = true; 4683 + } 4684 + MyPostgresPK *GetFirstPK() 4685 + { 4686 + return FirstPK; 4687 + } 4688 + MyPostGisGeometry *GetFirst() 4689 + { 4690 + return First; 4691 + } 4692 + void SetNext(MyPostgresTable * next) 4693 + { 4694 + Next = next; 4695 + } 4696 + MyPostgresTable *GetNext() 4697 + { 4698 + return Next; 4699 + } 4700 +}; 4701 + 4702 +class MyPostgresView 4703 +{ 4704 +// 4705 +// a PostgreSQL View 4706 +// 4707 +private: 4708 + wxString Name; 4709 + wxString VirtName; 4710 + bool GrantSelect; 4711 + bool GrantInsertUpdateDelete; 4712 + MyPostgresView *Next; 4713 +public: 4714 + MyPostgresView(wxString & name); 4715 + ~MyPostgresView() 4716 + {; 4717 + } 4718 + wxString & GetName() 4719 + { 4720 + return Name; 4721 + } 4722 + void SetVirtName(wxString & name) 4723 + { 4724 + VirtName = name; 4725 + } 4726 + wxString & GetVirtName() 4727 + { 4728 + return VirtName; 4729 + } 4730 + void SetGrants(bool grantSelect, bool granInsertUpdateDelete) 4731 + { 4732 + GrantSelect = grantSelect; 4733 + GrantInsertUpdateDelete = granInsertUpdateDelete; 4734 + } 4735 + bool CanSelect() 4736 + { 4737 + return GrantSelect; 4738 + } 4739 + bool CanInsertUpdateDelete() 4740 + { 4741 + return GrantInsertUpdateDelete; 4742 + } 4743 + void SetNext(MyPostgresView * next) 4744 + { 4745 + Next = next; 4746 + } 4747 + MyPostgresView *GetNext() 4748 + { 4749 + return Next; 4750 + } 4751 +}; 4752 + 4753 +class MyPostgresSchema 4754 +{ 4755 +// 4756 +// a PostgreSQL Schema 4757 +// 4758 +private: 4759 + wxString Name; 4760 + wxTreeItemId TreeNode; 4761 + MyPostgresTable *FirstTable; 4762 + MyPostgresTable *LastTable; 4763 + MyPostgresTable *CurrentTable; 4764 + MyPostgresView *FirstView; 4765 + MyPostgresView *LastView; 4766 + MyPostgresSchema *Next; 4767 +public: 4768 + MyPostgresSchema(wxString & name); 4769 + ~MyPostgresSchema(); 4770 + wxString & GetName() 4771 + { 4772 + return Name; 4773 + } 4774 + void Add(wxString & name, wxString & geometry, wxString & type, int srid, 4775 + int dims); 4776 + void Add(wxString & name); 4777 + void SetTreeNode(wxTreeItemId & node) 4778 + { 4779 + TreeNode = node; 4780 + } 4781 + wxTreeItemId & GetTreeNode() 4782 + { 4783 + return TreeNode; 4784 + } 4785 + MyPostgresTable *GetFirstTable() 4786 + { 4787 + return FirstTable; 4788 + } 4789 + MyPostgresView *GetFirstView() 4790 + { 4791 + return FirstView; 4792 + } 4793 + void SetNext(MyPostgresSchema * next) 4794 + { 4795 + Next = next; 4796 + } 4797 + MyPostgresSchema *GetNext() 4798 + { 4799 + return Next; 4800 + } 4801 +}; 4802 + 4803 +class MyPostgresConn 4804 +{ 4805 +// 4806 +// a connection to some PosgreSQL DBMS 4807 +// 4808 +private: 4809 + wxString Host; 4810 + wxString HostAddr; 4811 + int Port; 4812 + wxString DbName; 4813 + wxString User; 4814 + bool ReadOnly; 4815 + bool TextDates; 4816 + wxString ConnectionString; 4817 + MyPostgresSchema *First; 4818 + MyPostgresSchema *Last; 4819 + MyPostgresSchema *Current; 4820 + MyPostgresConn *Prev; 4821 + MyPostgresConn *Next; 4822 +public: 4823 + MyPostgresConn(wxString & host, wxString & hostaddr, int port, 4824 + wxString & dbname, wxString & user, bool readOnly, 4825 + bool textDates); 4826 + ~MyPostgresConn(); 4827 + wxString & GetHost() 4828 + { 4829 + return Host; 4830 + } 4831 + wxString & GetHostAddr() 4832 + { 4833 + return HostAddr; 4834 + } 4835 + int GetPort() 4836 + { 4837 + return Port; 4838 + } 4839 + wxString & GetDbName() 4840 + { 4841 + return DbName; 4842 + } 4843 + wxString & GetUser() 4844 + { 4845 + return User; 4846 + } 4847 + bool IsReadOnly() 4848 + { 4849 + return ReadOnly; 4850 + } 4851 + bool IsTextDates() 4852 + { 4853 + return TextDates; 4854 + } 4855 + void SetConnectionString(const char *connection_string) 4856 + { 4857 + ConnectionString = wxString::FromUTF8(connection_string); 4858 + } 4859 + wxString & GetConnectionString() 4860 + { 4861 + return ConnectionString; 4862 + } 4863 + MyPostgresSchema *Add(wxString & schema); 4864 + void Add(wxString & schema, wxString & table, wxString & geometry, 4865 + wxString & type, int srid, int dims); 4866 + void Add(wxString & schema, wxString & view); 4867 + MyPostgresSchema *GetFirst() 4868 + { 4869 + return First; 4870 + } 4871 + void SetPrev(MyPostgresConn * conn) 4872 + { 4873 + Prev = conn; 4874 + } 4875 + MyPostgresConn *GetPrev() 4876 + { 4877 + return Prev; 4878 + } 4879 + void SetNext(MyPostgresConn * conn) 4880 + { 4881 + Next = conn; 4882 + } 4883 + MyPostgresConn *GetNext() 4884 + { 4885 + return Next; 4886 + } 4887 +}; 4888 + 4889 +class MyPostgres 4890 +{ 4891 +// 4892 +// general container for all PostgreSQL connections 4893 +// 4894 +private: 4895 + MyPostgresConn * First; 4896 + MyPostgresConn *Last; 4897 + MyPostgresConn *Current; 4898 +public: 4899 + MyPostgres() 4900 + { 4901 + First = NULL; 4902 + Last = NULL; 4903 + Current = NULL; 4904 + } 4905 + ~MyPostgres() 4906 + { 4907 + Clear(); 4908 + } 4909 + void Clear(); 4910 + MyPostgresConn *Insert(wxString & host, wxString & hostaddr, int port, 4911 + wxString & dbname, wxString & user, bool readOnly, 4912 + bool textDates); 4913 + MyPostgresConn *Find(wxString & host, wxString & hostaddr, int port, 4914 + wxString & dbname, wxString & user); 4915 + MyPostgresTable *FindTable(class MyFrame * parent, wxString & virtName); 4916 + MyPostgresTable *FindPostGisView(class MyFrame * parent, wxString & virtName); 4917 + void Remove(MyPostgresConn * conn); 4918 + bool CheckUniqueVirtName(wxString & virtName); 4919 + void MakeUniqueVirtName(wxString & baseName, wxString & uniqueName); 4920 + MyPostgresConn *GetFirst() 4921 + { 4922 + return First; 4923 + } 4924 +}; 4246 4925 4247 4926 class MyFrame:public wxFrame 4248 4927 { 4249 4928 // 4250 4929 // the main GUI frame 4251 4930 // 4252 4931 private: ................................................................................ 4322 5001 wxBitmap *BtnSqlLog; // button icon for SQL LOG 4323 5002 wxBitmap *BtnDbStatus; // button icon for DB STATUS 4324 5003 wxBitmap *BtnCheckGeom; // button icon for CheckGeom 4325 5004 wxBitmap *BtnSaneGeom; // button icon for SaneGeom 4326 5005 wxBitmap *BtnWFS; // button icon for WFS 4327 5006 wxBitmap *BtnDXF; // button icon for DXF 4328 5007 wxBitmap *BtnMap; // button icon for Map Panel 5008 + wxBitmap *BtnPostgres; // button icon for PostgreSQL 4329 5009 rl2WmsCachePtr WmsCache; // internal WMS Cache 4330 5010 bool ReadOnlyConnection; 4331 5011 // AutoSave timer 4332 5012 int AutoSaveInterval; 4333 5013 int LastTotalChanges; 4334 5014 wxTimer *TimerAutoSave; 4335 5015 gaiaGeomCollPtr GeomFromPoint(gaiaPointPtr pt, int srid); ................................................................................ 4349 5029 rl2PixelPtr ParseNoData(wxString & NoData, int SampleType, int PixelType, 4350 5030 int NumBands); 4351 5031 char *GetNum(const char *start, const char *end); 4352 5032 bool IsValidSqliteFile(wxString & path); 4353 5033 void DoUpdateRL2MaxThreads(); 4354 5034 void DoAutoDetachDatabases(); 4355 5035 CurrentSqlFilters SqlFilters; 5036 + MyPostgres PostgresList; 5037 + virtualPQ VirtualPQapi; 5038 + wxDynamicLibrary DynamicLibPQ; 5039 + wxString PathLibPQ; 5040 + bool VirtualPQapiOK; 5041 + void DoInitVirtualPQapi(); 5042 + void DoLocateLibPQ(wxString & path); 5043 + void DoLoadLibPQ(wxString & path); 5044 + bool DoCheckPostgres(wxString & host, wxString & hostaddr, int port, 5045 + wxString & dbname, wxString & user); 5046 + bool DoInitPostgres(wxString & host, wxString & hostaddr, int port, 5047 + wxString & dbname, wxString & user, bool readOnly, 5048 + bool textDates, const char *conninfo); 5049 + void DoSetUniqueVirtNames(); 5050 + void DoCreatePostgresTables(); 5051 + void DoDropPostgresTables(); 5052 + char *DoCreatePostGisSpatialView(MyPostgresTable * table, char *sql); 5053 + void DoCreatePostGisSpatialViewTriggers(MyPostgresConn * conn, 5054 + MyPostgresSchema * schema, 5055 + MyPostgresTable * table); 5056 + void GetPQlibVersion(wxString & ver); 5057 + void DoCreatePostgreSqlNodes(); 5058 + MyPostgresColumns *DoGetPostgresColumns(MyPostgresTable * table); 5059 + void DoCheckGrantPermissions(void *pg_conn, wxString & user, 5060 + MyPostgresSchema * schema, 5061 + MyPostgresTable * table); 5062 + void DoCheckGrantPermissions(void *pg_conn, wxString & user, 5063 + MyPostgresSchema * schema, 5064 + MyPostgresView * view); 4356 5065 public: 4357 5066 MyFrame(const wxString & title, const wxPoint & pos, const wxSize & size); 4358 5067 virtual ~ MyFrame(); 4359 5068 enum VectorTypes 4360 5069 { 4361 5070 VECTOR_UNKNOWN = 0, 4362 5071 VECTOR_GEOTABLE, ................................................................................ 4495 5204 bool CreateDB(); 4496 5205 void CloseDB(); 4497 5206 void InitializeSpatialMetadata(); 4498 5207 void AutoFDOStart(); 4499 5208 void AutoFDOStop(); 4500 5209 void AutoGPKGStart(); 4501 5210 void AutoGPKGStop(); 5211 + void AutoPostgresStop(); 5212 + bool DoClosePostgreSqlConn(wxString & host, wxString & hostaddr, int port, 5213 + wxString & dbname, wxString & user); 5214 + char *DropPostgreSqlOrphans(); 5215 + void DoInitVirtualPG(); 4502 5216 void InitTableTree(); 4503 5217 void LoadHistory(); 4504 5218 bool HasHistory(); 4505 5219 void ListAttached(); 4506 5220 void AutoFDOStart(wxString & dbAlias, MyAttachedDB * db); 4507 5221 void AutoFDOStop(wxString & dbAlias); 4508 5222 void AutoGPKGStart(wxString & dbAlias, MyAttachedDB * db); ................................................................................ 4667 5381 wxString & charset, char decimal_point, 4668 5382 bool date_time); 4669 5383 void ExportResultSetAsSylk(wxString & path, wxString & sql, 4670 5384 wxString & charset, bool date_time); 4671 5385 void ExportResultSetAsDbf(wxString & path, wxString & sql, 4672 5386 wxString & charset); 4673 5387 void GetHelp(wxString & html); 5388 + void FeedZipHtml(unsigned char *zip, int offset, const char *data); 4674 5389 wxString *GetColumnNames(wxString & table, int *columns); 4675 5390 void SetLastDirectory(wxString & path) 4676 5391 { 4677 5392 LastDirectory = path; 4678 5393 } 4679 5394 wxString & GetLastDirectory() 4680 5395 { ................................................................................ 4722 5437 MyResultSetView *GetRsView() 4723 5438 { 4724 5439 return RsView; 4725 5440 } 4726 5441 wxString *GetTables(int *cnt); 4727 5442 wxString *GetTableColumns(wxString & dbPrefix, wxString & table, int *cnt); 4728 5443 wxString *GetTableGeometries(wxString & dbPrefix, wxString & table, int *cnt); 4729 - void BuildNetwork(wxString & table, wxString & from, wxString & to, 4730 - bool isNoGeometry, wxString & geometry, wxString & name, 4731 - bool cost_length, wxString & cost, bool bidirectional, 4732 - bool one_way, wxString & one_way_from_to, 4733 - wxString & one_way_to_from, bool aStarSupported, 4734 - wxString & dataTableName, wxString & virtualTableName); 4735 - void BuildNetwork(wxString & table, wxString & from, wxString & to, 4736 - wxString & name, wxString & cost, bool bidirectional, 4737 - bool one_way, wxString & one_way_from_to, 4738 - wxString & one_way_to_from, wxString & dataTableName, 4739 - wxString & virtualTableName); 4740 - bool CreateNetwork(class Network * net, wxString & table, wxString & from, 4741 - wxString & to, wxString & geometry, wxString & name, 4742 - bool aStarSupported, double aStarCoeff, 4743 - wxString & dataTableName, wxString & virtualTableName); 4744 - bool CreateNetwork(class Network * net, wxString & table, wxString & from, 4745 - wxString & to, wxString & name, wxString & dataTableName, 4746 - wxString & virtualTableName); 4747 5444 void ImportExifPhotos(wxString & path, bool folder, bool metadata, 4748 5445 bool gps_only); 4749 5446 void ImportGpsPhotos(wxString & path, bool folder, wxString & table, 4750 5447 wxString & geometry, bool update_statistics, 4751 5448 bool spatial_index); 4752 5449 void ImportXmlDocuments(wxString & path, bool folder, wxString & suffix, 4753 5450 wxString & table, wxString & pkName, ................................................................................ 4754 5451 wxString & xmlColumn, wxString & inPathColumn, 4755 5452 wxString & schemaColumn, wxString & parseErrColumn, 4756 5453 wxString & validateErrColumn, int compressed, 4757 5454 const char *schemaURI, bool isInternaleSchemaUri); 4758 5455 void ImportDXFfiles(wxString & path, bool folder, wxString & prefix, 4759 5456 wxString & layer, int srid, bool force2d, bool force3d, 4760 5457 bool mixed, bool linked, bool unlinked, bool append); 4761 - void OutputNetNode(unsigned char *auxbuf, int *size, int ind, bool node_code, 4762 - int max_node_length, class NetNode * pN, int endian_arch, 4763 - bool aStarSupported); 4764 5458 bool CheckExifTables(); 4765 5459 int ExifLoadDir(wxString & path, bool gps_only, bool metadata); 4766 5460 int ExifLoadFile(wxString & path, bool gps_only, bool metadata); 4767 5461 bool UpdateExifTables(unsigned char *blob, int sz, 4768 5462 gaiaExifTagListPtr tag_list, bool metadata, 4769 5463 wxString & path); 4770 5464 bool CheckGpsPicsTable(wxString & table, wxString & geometry, bool rtree); ................................................................................ 4974 5668 double *miny, double *maxx, double *maxy); 4975 5669 void DoRegisterWMS(); 4976 5670 void DoCreateTopoGeo(); 4977 5671 void DoCreateTopoNet(); 4978 5672 4979 5673 void MapPanelClosing(); 4980 5674 5675 + void CreateNetwork(wxString & table, wxString & from, wxString & to, 5676 + bool isNoGeometry, wxString & geom, bool isNameEnabled, 5677 + wxString & name, bool isGeomLength, wxString & cost, 5678 + bool isBidirectional, bool isOneWays, 5679 + wxString & oneWayFromTo, wxString & oneWayToFrom, 5680 + bool aStarSupported, wxString & dataTableName, 5681 + wxString & virtualTableName, bool overwrite); 5682 + void GetLastRoutingError(wxString & errCause); 5683 + 5684 + bool HasPostgreSqlConnections(); 5685 + void DoPostgreSqlConnection(); 5686 + bool DoCheckPostGisGeometry(wxString & virtName, wxString & columnName); 5687 + MyPostgresTable *FindPostgresTable(wxString & virtName) 5688 + { 5689 + return PostgresList.FindTable(this, virtName); 5690 + } 5691 + MyPostgresTable *FindPostGisView(wxString & virtName) 5692 + { 5693 + return PostgresList.FindPostGisView(this, virtName); 5694 + } 5695 + void InitPostgresPkColumns(MyPostgresConn * conn, MyPostgresSchema * schema, 5696 + MyPostgresTable * table); 5697 + void InitPostgresPks(void *conn, MyPostgresSchema * schema, 5698 + MyPostgresTable * table); 5699 + 4981 5700 void OnQuit(wxCommandEvent & event); 4982 5701 void OnClose(wxCloseEvent & event); 4983 5702 void OnAbout(wxCommandEvent & event); 4984 5703 void OnConnect(wxCommandEvent & event); 4985 5704 void OnConnectReadOnly(wxCommandEvent & event); 4986 5705 void OnCreateNew(wxCommandEvent & event); 4987 5706 void OnDisconnect(wxCommandEvent & event); 4988 5707 void OnMemoryDbLoad(wxCommandEvent & event); 4989 5708 void OnMemoryDbNew(wxCommandEvent & event); 4990 5709 void OnMemoryDbClock(wxCommandEvent & event); 4991 5710 void OnMemoryDbSave(wxCommandEvent & event); 4992 5711 void OnVacuum(wxCommandEvent & event); 5712 + void OnPostgreSQL(wxCommandEvent & event) 5713 + { 5714 + DoPostgreSqlConnection(); 5715 + } 4993 5716 void OnMapPanel(wxCommandEvent & event); 4994 5717 void OnSqlScript(wxCommandEvent & event); 4995 5718 void OnQueryViewComposer(wxCommandEvent & event); 4996 5719 void OnCharset(wxCommandEvent & event); 4997 5720 void OnLoadShp(wxCommandEvent & event); 4998 5721 void OnLoadTxt(wxCommandEvent & event); 4999 5722 void OnLoadDbf(wxCommandEvent & event); ................................................................................ 5055 5778 wxString dbPrefix; 5056 5779 wxString inTable; 5057 5780 public: 5058 5781 CloneTableDialog() 5059 5782 { 5060 5783 MainFrame = NULL; 5061 5784 } 5062 - CloneTableDialog(MyFrame * parent, wxString & dbPrefx, wxString & inTable) 5785 + CloneTableDialog(MyFrame * parent, wxString & dbPrefix, wxString & inTable) 5063 5786 { 5064 5787 Create(parent, dbPrefix, inTable); 5065 5788 } 5066 5789 bool Create(MyFrame * parent, wxString & dbPrefix, wxString & inTable); 5067 5790 virtual ~ CloneTableDialog() 5068 5791 {; 5069 5792 } ................................................................................ 5995 6718 public: 5996 6719 LoadXLDialog() 5997 6720 {; 5998 6721 } 5999 6722 LoadXLDialog(MyFrame * parent, wxString & path, wxString & table); 6000 6723 bool Create(MyFrame * parent, wxString & path, wxString & table); 6001 6724 virtual ~ LoadXLDialog() 6002 - {; 6725 + { 6726 + if (Worksheets != NULL) 6727 + delete[]Worksheets; 6003 6728 } 6004 6729 void CreateControls(); 6005 6730 wxString & GetTable() 6006 6731 { 6007 6732 return Table; 6008 6733 } 6009 6734 int GetWorksheetIndex() ................................................................................ 6220 6945 wxString OneWayToFrom; // the OneWay To-From column 6221 6946 wxString OneWayFromTo; // the OneWay From-To column 6222 6947 bool NameEnabled; // Name column supported 6223 6948 wxString NameColumn; // the Name column name 6224 6949 bool AStarSupported; // A* algorithm supported 6225 6950 wxString DataTable; // name of the binary data table 6226 6951 wxString VirtualTable; // name of the VirtualNetwork table 6952 + bool Overwrite; // enabled to overwrite existing tables 6953 + void SetCurrentTable(); 6227 6954 public: 6228 6955 NetworkDialog() 6229 6956 {; 6230 6957 } 6231 6958 NetworkDialog(MyFrame * parent); 6232 6959 bool Create(MyFrame * parent); 6233 6960 virtual ~ NetworkDialog() ................................................................................ 6293 7020 wxString & GetDataTable() 6294 7021 { 6295 7022 return DataTable; 6296 7023 } 6297 7024 wxString & GetVirtualTable() 6298 7025 { 6299 7026 return VirtualTable; 7027 + } 7028 + bool IsOverwriteEnabled() 7029 + { 7030 + return Overwrite; 6300 7031 } 6301 7032 void OnTable(wxCommandEvent & event); 6302 7033 void OnDirection(wxCommandEvent & event); 6303 7034 void OnCost(wxCommandEvent & event); 6304 7035 void OnOneWay(wxCommandEvent & event); 6305 7036 void OnNameEnabled(wxCommandEvent & event); 6306 7037 void OnNoGeometry(wxCommandEvent & event); 7038 + void OnOverwrite(wxCommandEvent & event); 6307 7039 void OnOk(wxCommandEvent & event); 6308 7040 }; 6309 7041 6310 7042 class ExifDialog:public wxDialog 6311 7043 { 6312 7044 // 6313 7045 // a dialog preparing an IMPORT EXIF PHOTOS ................................................................................ 7013 7745 int blob_size, wxWindow * panel, wxWindowID id, 7014 7746 const wxPoint & pos = wxDefaultPosition, const wxSize & size = 7015 7747 wxDefaultSize, long style = 0); 7016 7748 virtual ~ MyHexList(); 7017 7749 virtual wxString OnGetItemText(long item, long column) const; 7018 7750 }; 7019 7751 7020 -class NetNodePre 7021 -{ 7022 -// 7023 -// a class to store a temporary node for Network 7024 -// 7025 -private: 7026 - sqlite3_int64 Id; 7027 - wxString Code; 7028 - NetNodePre *Next; 7029 -public: 7030 - NetNodePre(sqlite3_int64 id); 7031 - NetNodePre(const char *code); 7032 - ~NetNodePre() 7033 - {; 7034 - } 7035 - sqlite3_int64 GetId() 7036 - { 7037 - return Id; 7038 - } 7039 - wxString & GetCode() 7040 - { 7041 - return Code; 7042 - } 7043 - void SetNext(NetNodePre * next) 7044 - { 7045 - Next = next; 7046 - } 7047 - NetNodePre *GetNext() 7048 - { 7049 - return Next; 7050 - } 7051 -}; 7052 - 7053 -class NetNode 7054 -{ 7055 -// 7056 -// a class to store a final node for Network 7057 -// 7058 -private: 7059 - int InternalIndex; 7060 - sqlite3_int64 Id; 7061 - wxString Code; 7062 - double X; 7063 - double Y; 7064 - class NetArcRef *First; 7065 - class NetArcRef *Last; 7066 - NetNode *Next; 7067 -public: 7068 - NetNode(sqlite3_int64 id); 7069 - NetNode(wxString & code); 7070 - ~NetNode(); 7071 - int GetInternalIndex() 7072 - { 7073 - return InternalIndex; 7074 - } 7075 - void SetInternalIndex(int idx) 7076 - { 7077 - InternalIndex = idx; 7078 - } 7079 - sqlite3_int64 GetId() 7080 - { 7081 - return Id; 7082 - } 7083 - wxString & GetCode() 7084 - { 7085 - return Code; 7086 - } 7087 - double GetX() 7088 - { 7089 - return X; 7090 - } 7091 - void SetX(double x) 7092 - { 7093 - X = x; 7094 - } 7095 - double GetY() 7096 - { 7097 - return Y; 7098 - } 7099 - void SetY(double y) 7100 - { 7101 - Y = y; 7102 - } 7103 - void AddOutcoming(class NetArc * pA); 7104 - NetArcRef *GetFirst() 7105 - { 7106 - return First; 7107 - } 7108 - NetArc **PrepareOutcomings(int *count); 7109 - void SetNext(NetNode * next) 7110 - { 7111 - Next = next; 7112 - } 7113 - NetNode *GetNext() 7114 - { 7115 - return Next; 7116 - } 7117 -}; 7118 - 7119 -class NetArc 7120 -{ 7121 -// 7122 -// a class to store an arc for Network 7123 -// 7124 -private: 7125 - sqlite3_int64 RowId; 7126 - NetNode *From; 7127 - NetNode *To; 7128 - double Cost; 7129 - NetArc *Next; 7130 -public: 7131 - NetArc(sqlite3_int64 rowid, NetNode * from, NetNode * to, double cost); 7132 - ~NetArc() 7133 - {; 7134 - } 7135 - sqlite3_int64 GetRowId() 7136 - { 7137 - return RowId; 7138 - } 7139 - NetNode *GetFrom() 7140 - { 7141 - return From; 7142 - } 7143 - NetNode *GetTo() 7144 - { 7145 - return To; 7146 - } 7147 - double GetCost() 7148 - { 7149 - return Cost; 7150 - } 7151 - void SetNext(NetArc * next) 7152 - { 7153 - Next = next; 7154 - } 7155 - NetArc *GetNext() 7156 - { 7157 - return Next; 7158 - } 7159 -}; 7160 - 7161 -class NetArcRef 7162 -{ 7163 -// 7164 -// a class to store a reference to an arc for Network 7165 -// 7166 -private: 7167 - NetArc * Reference; 7168 - NetArcRef *Next; 7169 -public: 7170 - NetArcRef(NetArc * arc) 7171 - { 7172 - Reference = arc; 7173 - Next = NULL; 7174 - } 7175 - ~NetArcRef() 7176 - {; 7177 - } 7178 - NetArc *GetReference() 7179 - { 7180 - return Reference; 7181 - } 7182 - void SetNext(NetArcRef * next) 7183 - { 7184 - Next = next; 7185 - } 7186 - NetArcRef *GetNext() 7187 - { 7188 - return Next; 7189 - } 7190 -}; 7191 - 7192 -class Network 7193 -{ 7194 -// 7195 -// a class representing a Network 7196 -// 7197 -private: 7198 - NetNodePre * FirstPre; 7199 - NetNodePre *LastPre; 7200 - int NumPreNodes; 7201 - NetNodePre **SortedPreNodes; 7202 - NetArc *FirstArc; 7203 - NetArc *LastArc; 7204 - NetNode *FirstNode; 7205 - NetNode *LastNode; 7206 - int NumNodes; 7207 - NetNode **SortedNodes; 7208 - bool Error; 7209 - bool NodeCode; 7210 - int MaxCodeLength; 7211 -public: 7212 - Network(); 7213 - ~Network(); 7214 - void CleanPreNodes(); 7215 - void InsertNode(sqlite3_int64 id); 7216 - void InsertNode(const char *code); 7217 - void AddNode(sqlite3_int64 id); 7218 - void AddNode(wxString & code); 7219 - NetNode *ProcessNode(sqlite3_int64 id, double x, double y, NetNode ** pOther); 7220 - NetNode *ProcessNode(wxString & code, double x, double y, NetNode ** pOther); 7221 - NetNode *ProcessNode(sqlite3_int64 id, NetNode ** pOther); 7222 - NetNode *ProcessNode(wxString & code, NetNode ** pOther); 7223 - void Sort(); 7224 - NetNode *Find(sqlite3_int64 id); 7225 - NetNode *Find(wxString & code); 7226 - NetNode *GetSortedNode(sqlite3_int64 x); 7227 - void AddArc(sqlite3_int64 rowid, sqlite3_int64 id_from, sqlite3_int64 id_to, 7228 - double node_from_x, double node_from_y, double node_to_x, 7229 - double node_to_y, double cost); 7230 - void AddArc(sqlite3_int64 rowid, const char *code_from, const char *code_to, 7231 - double node_from_x, double node_from_y, double node_to_x, 7232 - double node_to_y, double cost); 7233 - void AddArc(sqlite3_int64 rowid, sqlite3_int64 id_from, sqlite3_int64 id_to, 7234 - double cost); 7235 - void AddArc(sqlite3_int64 rowid, const char *code_from, const char *code_to, 7236 - double cost); 7237 - void InitNodes(); 7238 - void SetError() 7239 - { 7240 - Error = true; 7241 - } 7242 - bool IsError() 7243 - { 7244 - return Error; 7245 - } 7246 - void SetNodeCode(bool mode) 7247 - { 7248 - NodeCode = mode; 7249 - } 7250 - bool IsNodeCode() 7251 - { 7252 - return NodeCode; 7253 - } 7254 - int GetNumNodes() 7255 - { 7256 - return NumNodes; 7257 - } 7258 - int GetMaxCodeLength() 7259 - { 7260 - return MaxCodeLength; 7261 - } 7262 -}; 7263 - 7264 7752 class AutoFDOTable 7265 7753 { 7266 7754 private: 7267 7755 char *Name; 7268 7756 AutoFDOTable *Next; 7269 7757 public: 7270 7758 AutoFDOTable(const char *name, const int len) ................................................................................ 11503 11991 {; 11504 11992 } 11505 11993 virtual ~ WmsServersDialog() 11506 11994 { 11507 11995 if (List != NULL) 11508 11996 delete[]List; 11509 11997 } 11510 - bool Create(WmsDialog * parent, MyFrame * grandparent); 11998 + bool Create(MyFrame * grandparent); 11511 11999 void CreateControls(); 11512 12000 wxString & GetURL() 11513 12001 { 11514 12002 return URL; 11515 12003 } 11516 12004 void OnUrlSelected(wxCommandEvent & event); 11517 12005 void OnOk(wxCommandEvent & event); ................................................................................ 11656 12144 unsigned char ParseHex(const char *byte); 11657 12145 void DoConfigureWmsLayer(); 11658 12146 void DoConfigureMapLayer(); 11659 12147 public: 11660 12148 WmsLayerConfigDialog() 11661 12149 {; 11662 12150 } 11663 - virtual ~ WmsLayerConfigDialog() 11664 - { 11665 - if (Version != NULL) 11666 - free(Version); 11667 - if (MaxVersion != NULL) 11668 - free(MaxVersion); 11669 - if (RefSys != NULL) 11670 - free(RefSys); 11671 - if (Style != NULL) 11672 - free(Style); 11673 - if (ImageFormat != NULL) 11674 - free(ImageFormat); 11675 - if (BgColor != NULL) 11676 - free(BgColor); 11677 - } 12151 + virtual ~ WmsLayerConfigDialog(); 11678 12152 bool Create(MyFrame * parent, wxString url, wxString layer); 11679 12153 bool Create(MyMapPanel * parent, MapLayer * layer); 11680 12154 void CreateControls(); 11681 12155 void LoadData(); 11682 12156 void InitData(); 11683 12157 void FindMaxVersion(); 11684 12158 void PopulateRefSys(wxComboBox * crsList); ................................................................................ 11787 12261 bool ConfigChanged() 11788 12262 { 11789 12263 return IsConfigChanged; 11790 12264 } 11791 12265 void OnOk(wxCommandEvent & event); 11792 12266 void OnQuit(wxCommandEvent & event); 11793 12267 }; 12268 + 12269 +class VectorSqlSampleDialog:public wxDialog 12270 +{ 12271 +// 12272 +// a dialog for configuring an SQL Map Request 12273 +// based on some Vector Layer 12274 +// 12275 +private: 12276 + MyFrame * MainFrame; 12277 + MyMapPanel *MapPanel; 12278 + MapLayer *Layer; 12279 + wxString DbPrefix; 12280 + wxString LayerName; 12281 + char *Style; 12282 + wxColour BgColor; 12283 + wxString Sql; 12284 + void GetButtonBitmap(wxColour & bgcolor, wxBitmap & bmp); 12285 + void DoUpdateSql(); 12286 +public: 12287 + VectorSqlSampleDialog() 12288 + {; 12289 + } 12290 + virtual ~ VectorSqlSampleDialog() 12291 + { 12292 + if (Style != NULL) 12293 + free(Style); 12294 + } 12295 + bool Create(MyMapPanel * parent, MapLayer * layer); 12296 + void CreateControls(); 12297 + void InitData(); 12298 + void PopulateStyles(wxComboBox * stlList); 12299 + void OnStyleChanged(wxCommandEvent & event); 12300 + void OnMimeTypeChanged(wxCommandEvent & event); 12301 + void OnQualityChanged(wxCommandEvent & event); 12302 + void OnTransparentChanged(wxCommandEvent & event); 12303 + void OnBackgroundChanged(wxCommandEvent & event); 12304 + void OnCopy(wxCommandEvent & event); 12305 + void OnQuit(wxCommandEvent & event); 12306 +}; 12307 + 12308 +class RasterSqlSampleDialog:public wxDialog 12309 +{ 12310 +// 12311 +// a dialog for configuring an SQL Map Request 12312 +// based on some Raster Layer 12313 +// 12314 +private: 12315 + MyFrame * MainFrame; 12316 + MyMapPanel *MapPanel; 12317 + MapLayer *Layer; 12318 + wxString DbPrefix; 12319 + wxString LayerName; 12320 + char *Style; 12321 + wxColour BgColor; 12322 + wxString Sql; 12323 + void GetButtonBitmap(wxColour & bgcolor, wxBitmap & bmp); 12324 + void DoUpdateSql(); 12325 +public: 12326 + RasterSqlSampleDialog() 12327 + {; 12328 + } 12329 + virtual ~ RasterSqlSampleDialog() 12330 + { 12331 + if (Style != NULL) 12332 + free(Style); 12333 + } 12334 + bool Create(MyMapPanel * parent, MapLayer * layer); 12335 + void CreateControls(); 12336 + void InitData(); 12337 + void PopulateStyles(wxComboBox * stlList); 12338 + void OnStyleChanged(wxCommandEvent & event); 12339 + void OnMimeTypeChanged(wxCommandEvent & event); 12340 + void OnQualityChanged(wxCommandEvent & event); 12341 + void OnTransparentChanged(wxCommandEvent & event); 12342 + void OnBackgroundChanged(wxCommandEvent & event); 12343 + void OnCopy(wxCommandEvent & event); 12344 + void OnQuit(wxCommandEvent & event); 12345 +}; 12346 + 12347 +class WmsSqlSampleDialog:public wxDialog 12348 +{ 12349 +// 12350 +// a dialog for configuring an SQL Map Request 12351 +// based on some WMS Layer 12352 +// 12353 +private: 12354 + MyFrame * MainFrame; 12355 + MyMapPanel *MapPanel; 12356 + MapLayer *Layer; 12357 + bool RequestURL; 12358 + wxString Url; 12359 + wxString DbPrefix; 12360 + wxString LayerName; 12361 + char *Version; 12362 + char *MaxVersion; 12363 + char *Style; 12364 + char *ImageFormat; 12365 + char *BgColor; 12366 + int Transparent; 12367 + wxString Sql; 12368 + void GetButtonBitmap(const char *color, wxBitmap & bmp); 12369 + void ParseBgColor(const char *color, unsigned char *red, unsigned char *green, 12370 + unsigned char *blue); 12371 + unsigned char ParseHex(const char *byte); 12372 + void DoUpdateSql(); 12373 + void DoUpdateUrl(); 12374 + int CheckMarker(wxString & url); 12375 + int DoQueryWmsCoverage(const char *db_prefix, const char *cvg_name, int srid, 12376 + char **url, int *swap_axes); 12377 +public: 12378 + WmsSqlSampleDialog() 12379 + {; 12380 + } 12381 + virtual ~ WmsSqlSampleDialog(); 12382 + bool Create(MyMapPanel * parent, MapLayer * layer, bool request_url = false); 12383 + void CreateControls(); 12384 + void InitData(); 12385 + void FindMaxVersion(); 12386 + void PopulateImageFormats(wxComboBox * fmtList); 12387 + void PopulateStyles(wxComboBox * stlList); 12388 + void OnStyleChanged(wxCommandEvent & event); 12389 + void OnMimeTypeChanged(wxCommandEvent & event); 12390 + void OnVersionChanged(wxCommandEvent & event); 12391 + void OnTransparentChanged(wxCommandEvent & event); 12392 + void OnBgColorChanged(wxCommandEvent & event); 12393 + void OnCopy(wxCommandEvent & event); 12394 + void OnQuit(wxCommandEvent & event); 12395 +}; 11794 12396 11795 12397 class TopologyLayerConfigDialog:public wxDialog 11796 12398 { 11797 12399 // 11798 12400 // a dialog for configuring a TopoGeo Layer 11799 12401 // 11800 12402 private: ................................................................................ 12864 13466 void UpdateXmlStyle(); 12865 13467 const char *GetXmlStyle() 12866 13468 { 12867 13469 return XmlStyle; 12868 13470 } 12869 13471 const unsigned char *CloneXmlStyle(); 12870 13472 }; 13473 + 13474 +class QuickStyleRasterObj 13475 +{ 13476 +// 13477 +// a class wrapping a Quick Style - Raster 13478 +// 13479 +private: 13480 + char UUID[64]; 13481 + bool MinScaleEnabled; 13482 + bool MaxScaleEnabled; 13483 + double ScaleMin; 13484 + double ScaleMax; 13485 + double Opacity; 13486 + bool Normalize; 13487 + bool Histogram; 13488 + bool Gamma; 13489 + double GammaValue; 13490 + bool TripleBand; 13491 + bool SingleBand; 13492 + unsigned char RedBand; 13493 + unsigned char GreenBand; 13494 + unsigned char BlueBand; 13495 + unsigned char GrayBand; 13496 + bool SrtmColorMap; 13497 + bool TerrainColorMap; 13498 + bool NdviColorMap; 13499 + bool ColorRamp; 13500 + double MinValue; 13501 + char MinValueColor[8]; 13502 + double MaxValue; 13503 + char MaxValueColor[8]; 13504 + bool ShadedRelief; 13505 + double ShadedReliefFactor; 13506 + char *XmlStyle; 13507 + char *DoCreateRasterXML(); 13508 + char *DoCreatePredefinedSrtmStyle(char *base_xml); 13509 + char *DoCreatePredefinedTerrainStyle(char *base_xml); 13510 + char *DoCreatePredefinedNdviStyle(char *base_xml); 13511 +public: 13512 + QuickStyleRasterObj(); 13513 + ~QuickStyleRasterObj() 13514 + { 13515 + if (XmlStyle) 13516 + sqlite3_free(XmlStyle); 13517 + } 13518 + QuickStyleRasterObj *Clone(); 13519 + bool Compare(QuickStyleRasterObj * style); 13520 + const char *GetUUID() 13521 + { 13522 + return UUID; 13523 + } 13524 + void EnableMinScale(bool mode) 13525 + { 13526 + MinScaleEnabled = mode; 13527 + } 13528 + bool IsMinScaleEnabled() 13529 + { 13530 + return MinScaleEnabled; 13531 + } 13532 + void EnableMaxScale(bool mode) 13533 + { 13534 + MaxScaleEnabled = mode; 13535 + } 13536 + bool IsMaxScaleEnabled() 13537 + { 13538 + return MaxScaleEnabled; 13539 + } 13540 + void SetScaleMin(double x) 13541 + { 13542 + ScaleMin = x; 13543 + } 13544 + double GetScaleMin() 13545 + { 13546 + return ScaleMin; 13547 + } 13548 + void SetScaleMax(double x) 13549 + { 13550 + ScaleMax = x; 13551 + } 13552 + double GetScaleMax() 13553 + { 13554 + return ScaleMax; 13555 + } 13556 + void SetOpacity(double x) 13557 + { 13558 + Opacity = x; 13559 + } 13560 + double GetOpacity() 13561 + { 13562 + return Opacity; 13563 + } 13564 + void SetNormalize(bool mode) 13565 + { 13566 + Normalize = mode; 13567 + } 13568 + bool IsNormalize() 13569 + { 13570 + return Normalize; 13571 + } 13572 + void SetHistogram(bool mode) 13573 + { 13574 + Histogram = mode; 13575 + } 13576 + bool IsHistogram() 13577 + { 13578 + return Histogram; 13579 + } 13580 + void SetGamma(bool mode) 13581 + { 13582 + Gamma = mode; 13583 + } 13584 + bool IsGamma() 13585 + { 13586 + return Gamma; 13587 + } 13588 + void SetGammaValue(double value) 13589 + { 13590 + GammaValue = value; 13591 + } 13592 + double GetGammaValue() 13593 + { 13594 + return GammaValue; 13595 + } 13596 + void SetTripleBand(bool mode) 13597 + { 13598 + TripleBand = mode; 13599 + } 13600 + bool IsTripleBand() 13601 + { 13602 + return TripleBand; 13603 + } 13604 + void SetSingleBand(bool mode) 13605 + { 13606 + SingleBand = mode; 13607 + } 13608 + bool IsSingleBand() 13609 + { 13610 + return SingleBand; 13611 + } 13612 + void SetRedBand(unsigned char red) 13613 + { 13614 + RedBand = red; 13615 + } 13616 + unsigned char GetRedBand() 13617 + { 13618 + return RedBand; 13619 + } 13620 + void SetGreenBand(unsigned char green) 13621 + { 13622 + GreenBand = green; 13623 + } 13624 + unsigned char GetGreenBand() 13625 + { 13626 + return GreenBand; 13627 + } 13628 + void SetBlueBand(unsigned char blue) 13629 + { 13630 + BlueBand = blue; 13631 + } 13632 + unsigned char GetBlueBand() 13633 + { 13634 + return BlueBand; 13635 + } 13636 + void SetGrayBand(unsigned char gray) 13637 + { 13638 + GrayBand = gray; 13639 + } 13640 + unsigned char GetGrayBand() 13641 + { 13642 + return GrayBand; 13643 + } 13644 + void SetSrtmColorMap(bool mode) 13645 + { 13646 + SrtmColorMap = mode; 13647 + } 13648 + bool IsSrtmColorMap() 13649 + { 13650 + return SrtmColorMap; 13651 + } 13652 + void SetTerrainColorMap(bool mode) 13653 + { 13654 + TerrainColorMap = mode; 13655 + } 13656 + bool IsTerrainColorMap() 13657 + { 13658 + return TerrainColorMap; 13659 + } 13660 + void SetNdviColorMap(bool mode) 13661 + { 13662 + NdviColorMap = mode; 13663 + } 13664 + bool IsNdviColorMap() 13665 + { 13666 + return NdviColorMap; 13667 + } 13668 + void SetColorRamp(bool mode) 13669 + { 13670 + ColorRamp = mode; 13671 + } 13672 + bool IsColorRamp() 13673 + { 13674 + return ColorRamp; 13675 + } 13676 + void SetMinValue(double x) 13677 + { 13678 + MinValue = x; 13679 + } 13680 + double GetMinValue() 13681 + { 13682 + return MinValue; 13683 + } 13684 + void SetMinValueColor(const char *x) 13685 + { 13686 + strcpy(MinValueColor, x); 13687 + } 13688 + const char *GetMinValueColor() 13689 + { 13690 + return MinValueColor; 13691 + } 13692 + void SetMaxValue(double x) 13693 + { 13694 + MaxValue = x; 13695 + } 13696 + double GetMaxValue() 13697 + { 13698 + return MaxValue; 13699 + } 13700 + void SetMaxValueColor(const char *x) 13701 + { 13702 + strcpy(MaxValueColor, x); 13703 + } 13704 + const char *GetMaxValueColor() 13705 + { 13706 + return MaxValueColor; 13707 + } 13708 + void SetShadedRelief(bool mode) 13709 + { 13710 + ShadedRelief = mode; 13711 + } 13712 + bool IsShadedRelief() 13713 + { 13714 + return ShadedRelief; 13715 + } 13716 + void SetShadedReliefFactor(double x) 13717 + { 13718 + ShadedReliefFactor = x; 13719 + } 13720 + double GetShadedReliefFactor() 13721 + { 13722 + return ShadedReliefFactor; 13723 + } 13724 + char *CreateXmlStyle(); 13725 + void UpdateXmlStyle(); 13726 + const char *GetXmlStyle() 13727 + { 13728 + return XmlStyle; 13729 + } 13730 + unsigned char *CloneXmlStyle(); 13731 +}; 12871 13732 12872 13733 class QuickStyleVectorDialog:public wxPropertySheetDialog 12873 13734 { 12874 13735 // 12875 13736 // a dialog for configuring a Quick Style (Vector) 12876 13737 // 12877 13738 private: ................................................................................ 12961 13822 void OnCmdColorHalo2Picker(wxCommandEvent & event); 12962 13823 void OnCmdIsRepeatedChanged(wxCommandEvent & event); 12963 13824 void OnCmdIsAlignedChanged(wxCommandEvent & event); 12964 13825 void OnCmdGeneralizeLineChanged(wxCommandEvent & event); 12965 13826 void OnFont1Changed(wxCommandEvent & event); 12966 13827 void OnFont2Changed(wxCommandEvent & event); 12967 13828 }; 13829 + 13830 +class QuickStyleRasterDialog:public wxPropertySheetDialog 13831 +{ 13832 +// 13833 +// a dialog for configuring a Quick Style (Raster) 13834 +// 13835 +private: 13836 + MyFrame * MainFrame; 13837 + MyMapPanel *MapPanel; 13838 + MapLayer *Layer; 13839 + wxString DbPrefix; 13840 + wxString LayerName; 13841 + bool CanApplyContrastEnhancement; 13842 + bool IsMultiband; 13843 + unsigned char NumBands; 13844 + unsigned char RedBand; 13845 + unsigned char GreenBand; 13846 + unsigned char BlueBand; 13847 + unsigned char GrayBand; 13848 + bool CanApplyColorMap; 13849 + bool CanApplyNDVI; 13850 + double MinPixelValue; 13851 + double MaxPixelValue; 13852 + bool CanApplyShadedRelief; 13853 + QuickStyleRasterObj *Style; 13854 + bool IsConfigChanged; 13855 + int PageContrastEnhancementIndex; 13856 + int PageChannelSelectionIndex; 13857 + int PageColorMapIndex; 13858 + wxPanel *CreateMainPage(wxWindow * book); 13859 + wxPanel *CreateContrastEnhancementPage(wxWindow * book); 13860 + wxPanel *CreateChannelSelectionPage(wxWindow * book); 13861 + wxPanel *CreateColorMapPage(wxWindow * book); 13862 + bool RetrieveMainPage(); 13863 + bool RetrieveContrastEnhancementPage(bool check = true); 13864 + bool RetrieveChannelSelectionPage(bool check = true); 13865 + bool RetrieveColorMapPage(bool check = true); 13866 + void UpdateMainPage(); 13867 + void UpdateContrastEnhancementPage(); 13868 + void UpdateChannelSelectionPage(); 13869 + void UpdateColorMapPage(); 13870 + void GetCoverageInfos(); 13871 + bool UpdateStyle(); 13872 +public: 13873 + QuickStyleRasterDialog() 13874 + {; 13875 + } 13876 + virtual ~ QuickStyleRasterDialog() 13877 + { 13878 + if (Style != NULL) 13879 + delete Style; 13880 + } 13881 + bool Create(MyMapPanel * parent, MapLayer * layer); 13882 + void CreateButtons(); 13883 + bool ConfigChanged() 13884 + { 13885 + return IsConfigChanged; 13886 + } 13887 + void OnQuit(wxCommandEvent & event); 13888 + void OnOk(wxCommandEvent & event); 13889 + void OnApply(wxCommandEvent & event); 13890 + void OnExport(wxCommandEvent & event); 13891 + void OnCopy(wxCommandEvent & event); 13892 + void OnPageChanging(wxNotebookEvent & event); 13893 + void OnPageChanged(wxNotebookEvent & event); 13894 + void OnCmdScaleChanged(wxCommandEvent & event); 13895 + void OnCmdContrastChanged(wxCommandEvent & event); 13896 + void OnCmdBandModeChanged(wxCommandEvent & event); 13897 + void OnCmdColorMapModeChanged(wxCommandEvent & event); 13898 + void OnCmdColorMinChanged(wxCommandEvent & event); 13899 + void OnCmdMinColorPicker(wxCommandEvent & event); 13900 + void OnCmdColorMaxChanged(wxCommandEvent & event); 13901 + void OnCmdMaxColorPicker(wxCommandEvent & event); 13902 + void OnShadedChanged(wxCommandEvent & event); 13903 +}; 12968 13904 12969 13905 class QuickStyleTopologyDialog:public wxPropertySheetDialog 12970 13906 { 12971 13907 // 12972 13908 // a dialog for configuring a Quick Style (Topology) 12973 13909 // 12974 13910 private: ................................................................................ 15414 16350 CachedFrame *CachedLinks; 15415 16351 CachedFrame *CachedFaces; 15416 16352 CachedFrame *CachedEdgeSeeds; 15417 16353 CachedFrame *CachedLinkSeeds; 15418 16354 CachedFrame *CachedFaceSeeds; 15419 16355 QuickStyleObj *QuickStyle; 15420 16356 QuickStyleTopologyObj *QuickStyleTopology; 16357 + QuickStyleRasterObj *QuickStyleRaster; 15421 16358 MapLayer *Prev; 15422 16359 MapLayer *Next; 15423 16360 public: 15424 16361 MapLayer(LayerListItem * layer); 15425 16362 ~MapLayer(); 15426 16363 int GetType() 15427 16364 { ................................................................................ 15430 16367 QuickStyleObj *GetQuickStyle() 15431 16368 { 15432 16369 return QuickStyle; 15433 16370 } 15434 16371 QuickStyleTopologyObj *GetQuickStyleTopology() 15435 16372 { 15436 16373 return QuickStyleTopology; 16374 + } 16375 + QuickStyleRasterObj *GetQuickStyleRaster() 16376 + { 16377 + return QuickStyleRaster; 15437 16378 } 15438 16379 QuickStyleObj *CloneQuickStyle() 15439 16380 { 15440 16381 return QuickStyle->Clone(); 15441 16382 } 15442 16383 QuickStyleTopologyObj *CloneQuickStyleTopology() 15443 16384 { 15444 16385 return QuickStyleTopology->Clone(); 16386 + } 16387 + QuickStyleRasterObj *CloneQuickStyleRaster() 16388 + { 16389 + return QuickStyleRaster->Clone(); 15445 16390 } 15446 16391 bool UpdateQuickStyle(QuickStyleObj * style); 15447 16392 bool UpdateQuickStyle(QuickStyleTopologyObj * style); 16393 + bool UpdateQuickStyle(QuickStyleRasterObj * style); 15448 16394 WmsLayerSettings *GetWmsConfig() 15449 16395 { 15450 16396 return WmsConfig; 15451 16397 } 15452 16398 RasterLayerConfig *GetRasterConfig() 15453 16399 { 15454 16400 return RasterConfig; ................................................................................ 15673 16619 private: 15674 16620 MyMapPanel * MapPanel; 15675 16621 bool Changed; 15676 16622 wxTreeItemId Root; // the root node 15677 16623 wxImageList *Images; // the images list 15678 16624 wxTreeItemId CurrentItem; // the tree item holding the current context menu 15679 16625 wxTreeItemId DraggedItem; // the tree item to be moved 16626 + void DoWmsSqlSample(MapLayer * lyr); 16627 + void DoWmsUrlSample(MapLayer * lyr); 16628 + void DoVectorSqlSample(MapLayer * lyr); 16629 + void DoRasterSqlSample(MapLayer * lyr); 15680 16630 public: 15681 16631 MyLayerTree() 15682 16632 {; 15683 16633 } 15684 16634 MyLayerTree(MyMapPanel * parent, wxWindowID id = wxID_ANY); 15685 16635 virtual ~ MyLayerTree(); 15686 16636 void FlushAll() ................................................................................ 15705 16655 void OnCmdRemoveAll(wxCommandEvent & event); 15706 16656 void OnCmdShowAll(wxCommandEvent & event); 15707 16657 void OnCmdHideAll(wxCommandEvent & event); 15708 16658 void OnCmdMapConfigure(wxCommandEvent & event); 15709 16659 void OnCmdVisible(wxCommandEvent & event); 15710 16660 void OnCmdMapFullExtent(wxCommandEvent & event); 15711 16661 void OnCmdMapLayerFullExtent(wxCommandEvent & event); 16662 + void OnCmdMapSqlSample(wxCommandEvent & event); 16663 + void OnCmdMapUrlSample(wxCommandEvent & event); 15712 16664 void OnCmdRemoveLayer(wxCommandEvent & event); 15713 16665 void OnCmdDeleteItem(wxCommandEvent & event); 15714 16666 void OnCmdLayerInfo(wxCommandEvent & event); 15715 16667 void OnCmdMapLayerConfigure(wxCommandEvent & event); 15716 16668 void OnCmdQuickStyleEdit(wxCommandEvent & event); 15717 16669 void OnDragStart(wxTreeEvent & event); 15718 16670 void OnDragEnd(wxTreeEvent & event); ................................................................................ 15833 16785 if (UnusedThreads != NULL) 15834 16786 delete[]UnusedThreads; 15835 16787 UnusedThreads = NULL; 15836 16788 NumThreads = 0; 15837 16789 } 15838 16790 void PrepareThreadsPool(int count); 15839 16791 int FindUnusedThread(); 15840 - void ReleaseThread(int index, SingleLayerPainter * lyr); 16792 + void ReleaseThread(int index); 15841 16793 }; 15842 16794 15843 16795 class MyMapView:public wxPanel 15844 16796 { 15845 16797 // 15846 16798 // a panel used to show the Map 15847 16799 // ................................................................................ 15924 16876 { 15925 16877 return MapSRID; 15926 16878 } 15927 16879 void EnableMultiThreading(bool mode) 15928 16880 { 15929 16881 MultiThreadingEnabled = mode; 15930 16882 } 16883 + int GetImageWidth(); 16884 + int GetImageHeight(); 15931 16885 double GetMapMinX() 15932 16886 { 15933 16887 return MapMinX; 15934 16888 } 15935 16889 double GetMapMinY() 15936 16890 { 15937 16891 return MapMinY; ................................................................................ 15956 16910 { 15957 16911 return GeoMaxX; 15958 16912 } 15959 16913 double GetGeoMaxY() 15960 16914 { 15961 16915 return GeoMaxY; 15962 16916 } 16917 + void DoPrepareBBox(wxString & bbox); 16918 + void GetBBox(int *srid, double *minx, double *miny, double *maxx, double *maxy); 15963 16919 MapLayer *GetFirstLayer() 15964 16920 { 15965 16921 return FirstLayer; 15966 16922 } 15967 16923 bool IsMultiThreadingEnabled() 15968 16924 { 15969 16925 return MultiThreadingEnabled; ................................................................................ 16219 17175 { 16220 17176 Parent->InitializeSqlFilters(db_prefix, table, read_only, geom_column); 16221 17177 } 16222 17178 void UpdateMapViewPoint(int fromSrid, int toSrid) 16223 17179 { 16224 17180 MapView->UpdateMapViewPoint(fromSrid, toSrid); 16225 17181 } 17182 + int GetImageWidth() 17183 + { 17184 + return MapView->GetImageWidth(); 17185 + } 17186 + int GetImageHeight() 17187 + { 17188 + return MapView->GetImageHeight(); 17189 + } 17190 + void DoPrepareBBox(wxString & bbox) 17191 + { 17192 + MapView->DoPrepareBBox(bbox); 17193 + } 17194 + void GetBBox(int *srid, double *minx, double *miny, double *maxx, double *maxy) 17195 + { 17196 + MapView->GetBBox(srid, minx, miny, maxx, maxy); 17197 + } 16226 17198 double GetMapMinX() 16227 17199 { 16228 17200 return MapView->GetMapMinX(); 16229 17201 } 16230 17202 double GetMapMinY() 16231 17203 { 16232 17204 return MapView->GetMapMinY();
Changes to Dialogs.cpp.
1 1 /* 2 2 / Dialogs.cpp 3 3 / various dialog classes 4 4 / 5 5 / version 1.7, 2013 May 8 6 6 / 7 -/ Author: Sandro Furieri a-furieri@lqt.it 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 8 / 9 9 / Copyright (C) 2008-2013 Alessandro Furieri 10 10 / 11 11 / This program is free software: you can redistribute it and/or modify 12 12 / it under the terms of the GNU General Public License as published by 13 13 / the Free Software Foundation, either version 3 of the License, or 14 14 / (at your option) any later version. ................................................................................ 4221 4221 sql += wxT(", '::with-foreign-keys::'"); 4222 4222 if (WithTriggers->GetValue() == true) 4223 4223 sql += wxT(", '::with-triggers::'"); 4224 4224 if (Resequence->GetValue() == true) 4225 4225 sql += wxT(", '::resequence::'"); 4226 4226 if (Append->GetValue() == true) 4227 4227 sql += wxT(", '::append::'"); 4228 - for (int i = 1; i < ignoreCtrl->GetCount(); i++) 4228 + for (unsigned int i = 1; i < ignoreCtrl->GetCount(); i++) 4229 4229 { 4230 4230 if (ignoreCtrl->IsSelected(i) == true) 4231 4231 { 4232 4232 wxString str = ignoreCtrl->GetString(i); 4233 4233 xname = (char *) malloc((str.Len() * 4) + 1); 4234 4234 strcpy(xname, str.ToUTF8()); 4235 4235 xname2 = gaiaSingleQuotedSql(xname); 4236 4236 free(xname); 4237 4237 sql += wxT(", '::ignore::") + wxString::FromUTF8(xname2) + wxT("'"); 4238 4238 free(xname2); 4239 4239 } 4240 4240 } 4241 - for (int i = 1; i < castCtrl->GetCount(); i++) 4241 + for (unsigned int i = 1; i < castCtrl->GetCount(); i++) 4242 4242 { 4243 4243 if (castCtrl->IsSelected(i) == true) 4244 4244 { 4245 4245 wxString str = castCtrl->GetString(i); 4246 4246 xname = (char *) malloc((str.Len() * 4) + 1); 4247 4247 strcpy(xname, str.ToUTF8()); 4248 4248 xname2 = gaiaSingleQuotedSql(xname); ................................................................................ 4305 4305 NameEnabled = false; 4306 4306 AStarSupported = true; 4307 4307 OneWayFromTo = wxT(""); 4308 4308 OneWayToFrom = wxT(""); 4309 4309 NameColumn = wxT(""); 4310 4310 DataTable = wxT(""); 4311 4311 VirtualTable = wxT(""); 4312 - if (wxDialog::Create(parent, wxID_ANY, wxT("Build Network")) == false) 4312 + Overwrite = false; 4313 + if (wxDialog::Create(parent, wxID_ANY, wxT("Create Network")) == false) 4313 4314 return false; 4314 4315 // populates individual controls 4315 4316 CreateControls(); 4316 4317 // sets dialog sizer 4317 4318 GetSizer()->Fit(this); 4318 4319 GetSizer()->SetSizeHints(this); 4319 4320 // centers the dialog window 4320 4321 Centre(); 4322 + wxString table; 4323 + if (MainFrame->GetCurrentlySelectedTable(table) == true) 4324 + { 4325 + // automatically selecting the current table 4326 + wxListBox *tableCtrl = (wxListBox *) FindWindow(ID_NET_TABLE); 4327 + int sel = tableCtrl->FindString(table); 4328 + if (sel != wxNOT_FOUND) 4329 + tableCtrl->SetSelection(sel); 4330 + TableName = table; 4331 + SetCurrentTable(); 4332 + } 4321 4333 return true; 4322 4334 } 4323 4335 4324 4336 void NetworkDialog::CreateControls() 4325 4337 { 4326 4338 // 4327 4339 // creating individual control and setting initial values ................................................................................ 4347 4359 wxListBox *tableCtrl = new wxListBox(); 4348 4360 tableCtrl->Create(this, ID_NET_TABLE, wxDefaultPosition, size, nTables, 4349 4361 tables, wxLB_SINGLE | wxLB_HSCROLL); 4350 4362 delete[]tables; 4351 4363 tableNameSizer->Add(tableCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 4352 4364 size = wxSize(140, 80); 4353 4365 wxSize size2 = wxSize(140, 60); 4354 - wxString table; 4355 - if (MainFrame->GetCurrentlySelectedTable(table) == true) 4356 - { 4357 - // automatically selecting the current table 4358 - int sel = tableCtrl->FindString(table); 4359 - if (sel != wxNOT_FOUND) 4360 - tableCtrl->SetSelection(sel); 4361 - } 4362 4366 // the NodeFrom COLUMN 4363 4367 wxBoxSizer *netSizer = new wxBoxSizer(wxHORIZONTAL); 4364 4368 row0Sizer->Add(netSizer, 0, wxALIGN_RIGHT | wxALL, 0); 4365 4369 wxStaticBox *netBox = new wxStaticBox(this, wxID_STATIC, 4366 4370 wxT("Network configuration"), 4367 4371 wxDefaultPosition, 4368 4372 wxDefaultSize); ................................................................................ 4542 4546 // output tables 4543 4547 wxBoxSizer *outSizer = new wxBoxSizer(wxHORIZONTAL); 4544 4548 boxSizer->Add(outSizer, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 0); 4545 4549 wxStaticBox *outTablesBox = new wxStaticBox(this, wxID_STATIC, 4546 4550 wxT("Output Tables"), 4547 4551 wxDefaultPosition, 4548 4552 wxDefaultSize); 4549 - wxBoxSizer *outTablesSizer = new wxStaticBoxSizer(outTablesBox, wxHORIZONTAL); 4553 + wxBoxSizer *outTablesSizer = new wxStaticBoxSizer(outTablesBox, wxVERTICAL); 4550 4554 outSizer->Add(outTablesSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 4555 + wxBoxSizer *out1Sizer = new wxBoxSizer(wxHORIZONTAL); 4556 + outTablesSizer->Add(out1Sizer, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 0); 4551 4557 wxStaticText *dataTableLabel = 4552 4558 new wxStaticText(this, wxID_STATIC, wxT("&binary data Table:")); 4553 - outTablesSizer->Add(dataTableLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 1); 4559 + out1Sizer->Add(dataTableLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 1); 4554 4560 wxTextCtrl *dataTableCtrl = new wxTextCtrl(this, ID_NET_DATA, wxT(""), 4555 4561 wxDefaultPosition, wxSize(150, 4556 4562 22)); 4557 - outTablesSizer->Add(dataTableCtrl, 0, wxALIGN_RIGHT | wxALL, 5); 4558 - outTablesSizer->AddSpacer(15); 4563 + out1Sizer->Add(dataTableCtrl, 0, wxALIGN_RIGHT | wxALL, 5); 4564 + out1Sizer->AddSpacer(15); 4559 4565 wxStaticText *virtualTableLabel = 4560 4566 new wxStaticText(this, wxID_STATIC, wxT("&VirtualNetwork Table:")); 4561 - outTablesSizer->Add(virtualTableLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 1); 4567 + out1Sizer->Add(virtualTableLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 1); 4562 4568 wxTextCtrl *virtualTableCtrl = new wxTextCtrl(this, ID_NET_VIRTUAL, wxT(""), 4563 4569 wxDefaultPosition, wxSize(150, 4564 4570 22)); 4565 - outTablesSizer->Add(virtualTableCtrl, 0, wxALIGN_RIGHT | wxALL, 5); 4571 + out1Sizer->Add(virtualTableCtrl, 0, wxALIGN_RIGHT | wxALL, 5); 4572 +// Overwrite existing output tables 4573 + wxBoxSizer *out2Sizer = new wxBoxSizer(wxHORIZONTAL); 4574 + outTablesSizer->Add(out2Sizer, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 0); 4575 + wxCheckBox *overwrite = new wxCheckBox(this, ID_NET_OVERWRITE, 4576 + wxT 4577 + ("&Overwrite existing output tables")); 4578 + out2Sizer->Add(overwrite, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 1); 4566 4579 // OK - CANCEL buttons 4567 4580 wxBoxSizer *okCancelBox = new wxBoxSizer(wxHORIZONTAL); 4568 4581 boxSizer->Add(okCancelBox, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 4569 4582 wxButton *ok = new wxButton(this, wxID_OK, wxT("&OK")); 4570 4583 okCancelBox->Add(ok, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4571 4584 wxButton *cancel = new wxButton(this, wxID_CANCEL, wxT("&Cancel")); 4572 4585 okCancelBox->Add(cancel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); ................................................................................ 4582 4595 (wxObjectEventFunction) & NetworkDialog::OnCost); 4583 4596 Connect(ID_NET_ONEWAY, wxEVT_COMMAND_CHECKBOX_CLICKED, 4584 4597 (wxObjectEventFunction) & NetworkDialog::OnOneWay); 4585 4598 Connect(ID_NET_NAME_ENABLE, wxEVT_COMMAND_CHECKBOX_CLICKED, 4586 4599 (wxObjectEventFunction) & NetworkDialog::OnNameEnabled); 4587 4600 Connect(ID_NET_NO_GEOM, wxEVT_COMMAND_CHECKBOX_CLICKED, 4588 4601 (wxObjectEventFunction) & NetworkDialog::OnNoGeometry); 4602 + Connect(ID_NET_OVERWRITE, wxEVT_COMMAND_CHECKBOX_CLICKED, 4603 + (wxObjectEventFunction) & NetworkDialog::OnOverwrite); 4589 4604 } 4590 4605 4591 4606 void NetworkDialog::OnTable(wxCommandEvent & WXUNUSED(event)) 4592 4607 { 4593 4608 // 4594 4609 // TABLE selection changed 4595 4610 // 4596 4611 wxListBox *tableCtrl = (wxListBox *) FindWindow(ID_NET_TABLE); 4597 4612 TableName = tableCtrl->GetStringSelection(); 4613 + SetCurrentTable(); 4614 +} 4615 + 4616 +void NetworkDialog::SetCurrentTable() 4617 +{ 4618 +// 4619 +// The currently selected Table changed 4620 +// 4598 4621 wxTextCtrl *dataTableCtrl = (wxTextCtrl *) FindWindow(ID_NET_DATA); 4599 4622 wxString data_table = TableName + wxT("_net_data"); 4600 4623 dataTableCtrl->SetValue(data_table); 4601 4624 wxTextCtrl *virtualTableCtrl = (wxTextCtrl *) FindWindow(ID_NET_VIRTUAL); 4602 4625 wxString net_table = TableName + wxT("_net"); 4603 4626 virtualTableCtrl->SetValue(net_table); 4604 4627 int n_cols; ................................................................................ 4775 4798 aStarSel->Enable(false); 4776 4799 costSel->Enable(false); 4777 4800 GeomLength = false; 4778 4801 costSel->SetSelection(1); 4779 4802 costCtrl->Enable(true); 4780 4803 } 4781 4804 } 4805 + 4806 +void NetworkDialog::OnOverwrite(wxCommandEvent & WXUNUSED(event)) 4807 +{ 4808 +// 4809 +// Overwrite check box 4810 +// 4811 + if (Overwrite == true) 4812 + Overwrite = false; 4813 + else 4814 + Overwrite = true; 4815 +} 4782 4816 4783 4817 void NetworkDialog::OnOk(wxCommandEvent & WXUNUSED(event)) 4784 4818 { 4785 4819 // 4786 4820 // all done: 4787 4821 // 4788 4822 wxListBox *tableCtrl = (wxListBox *) FindWindow(ID_NET_TABLE); ................................................................................ 6680 6714 int i; 6681 6715 char **results; 6682 6716 int rows; 6683 6717 int columns; 6684 6718 char *value; 6685 6719 wxSpinCtrl *sridNewCtrl = (wxSpinCtrl *) FindWindow(ID_ADDALL_SRID_NEW); 6686 6720 wxSpinCtrl *sridOldCtrl = (wxSpinCtrl *) FindWindow(ID_ADDALL_SRID_OLD); 6687 - wxButton *ok = (wxButton *) FindWindow(wxID_OK); 6688 6721 int newSrid = sridNewCtrl->GetValue(); 6689 6722 int oldSrid = sridOldCtrl->GetValue(); 6690 6723 int inserted = 0; 6691 6724 6692 6725 char *sql = 6693 6726 sqlite3_mprintf 6694 6727 ("SELECT SE_RegisterRasterCoverageSrid( z.coverage_name, %d) FROM " ................................................................................ 6935 6968 int i; 6936 6969 char **results; 6937 6970 int rows; 6938 6971 int columns; 6939 6972 char *value; 6940 6973 wxSpinCtrl *sridNewCtrl = (wxSpinCtrl *) FindWindow(ID_ADDALL_SRID_NEW); 6941 6974 wxSpinCtrl *sridOldCtrl = (wxSpinCtrl *) FindWindow(ID_ADDALL_SRID_OLD); 6942 - wxButton *ok = (wxButton *) FindWindow(wxID_OK); 6943 6975 int newSrid = sridNewCtrl->GetValue(); 6944 6976 int oldSrid = sridOldCtrl->GetValue(); 6945 6977 int inserted = 0; 6946 6978 6947 6979 char *sql = 6948 6980 sqlite3_mprintf 6949 6981 ("SELECT SE_RegisterVectorCoverageSrid( z.coverage_name, %d) FROM "
Changes to DialogsGraph.cpp.
1 1 /* 2 2 / DialogsGraph.cpp 3 3 / graphics dialog classes 4 4 / 5 5 / version 1.7, 2013 May 8 6 6 / 7 -/ Author: Sandro Furieri a-furieri@lqt.it 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 8 / 9 9 / Copyright (C) 2010-2013 Alessandro Furieri 10 10 / 11 11 / This program is free software: you can redistribute it and/or modify 12 12 / it under the terms of the GNU General Public License as published by 13 13 / the Free Software Foundation, either version 3 of the License, or 14 14 / (at your option) any later version.
Changes to Exif.cpp.
1 1 /* 2 2 / Exif.cpp 3 3 / methods related to EXIF import and XmlBLOB import/export 4 4 / 5 5 / version 1.7, 2013 May 8 6 6 / 7 -/ Author: Sandro Furieri a-furieri@lqt.it 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 8 / 9 9 / Copyright (C) 2008-2013 Alessandro Furieri 10 10 / 11 11 / This program is free software: you can redistribute it and/or modify 12 12 / it under the terms of the GNU General Public License as published by 13 13 / the Free Software Foundation, either version 3 of the License, or 14 14 / (at your option) any later version. ................................................................................ 2329 2329 goto create_new; 2330 2330 else 2331 2331 { 2332 2332 for (i = 1; i <= rows; i++) 2333 2333 { 2334 2334 const char *name; 2335 2335 bool ok_id = false; 2336 - bool ok_name = false; 2337 2336 bool ok_photo = false; 2338 2337 bool ok_width = false; 2339 2338 bool ok_height = false; 2340 2339 bool ok_timestamp = false; 2341 2340 bool pKey = false; 2342 - bool ok_pk = false; 2343 2341 bool err_pk = false; 2344 2342 name = results[(i * columns) + 1]; 2345 2343 if (atoi(results[(i * columns) + 5]) == 0) 2346 2344 pKey = false; 2347 2345 else 2348 2346 pKey = true; 2349 2347 if (strcasecmp(name, "id") == 0) 2350 2348 ok_id = true; 2351 - if (strcasecmp(name, "name") == 0) 2352 - ok_name = true; 2353 2349 if (strcasecmp(name, "photo") == 0) 2354 2350 ok_photo = true; 2355 2351 if (strcasecmp(name, "width") == 0) 2356 2352 ok_width = true; 2357 2353 if (strcasecmp(name, "heigth") == 0) 2358 2354 ok_height = true; 2359 2355 if (strcasecmp(name, "timestamp") == 0) 2360 2356 ok_timestamp = true; 2361 2357 if (pKey == true) 2362 2358 { 2363 - if (strcasecmp(name, "id") == 0) 2364 - ok_pk = true; 2365 - else 2359 + if (strcasecmp(name, "id") != 0) 2366 2360 err_pk = true; 2367 2361 } 2368 2362 if (ok_id == true && pKey != true) 2369 2363 err_pk = true; 2370 2364 if (err_pk == true) 2371 2365 { 2372 2366 err = true; ................................................................................ 2590 2584 { 2591 2585 // 2592 2586 // importing a single EXIF-GPS image into the DB Table 2593 2587 // 2594 2588 sqlite3_int64 val64; 2595 2589 int ret; 2596 2590 wxString timestamp; 2597 - char *errMsg = NULL; 2598 2591 double longitude; 2599 2592 double latitude; 2600 2593 gaiaGeomCollPtr geom; 2601 2594 bool ok; 2602 2595 unsigned char *geoblob; 2603 2596 int geosize; 2604 2597
Added HtmlHelp.cpp.
1 +/* 2 +/ HtmlHelp.cpp 3 +/ spatialite_gui HTML Help generator 4 +/ 5 +/ This code was autogenerated by "helpgen" on xxxxx 6 +/ 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 +/ 9 +/ Copyright (C) 2017 Alessandro Furieri 10 +/ 11 +/ This program is free software: you can redistribute it and/or modify 12 +/ it under the terms of the GNU General Public License as published by 13 +/ the Free Software Foundation, either version 3 of the License, or 14 +/ (at your option) any later version. 15 +/ 16 +/ This program is distributed in the hope that it will be useful, 17 +/ but WITHOUT ANY WARRANTY; without even the implied warranty of 18 +/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 +/ GNU General Public License for more details. 20 +/ 21 +/ You should have received a copy of the GNU General Public License 22 +/ along with this program. If not, see <http://www.gnu.org/licenses/>. 23 +/ 24 +*/ 25 + 26 +#include "Classdef.h" 27 + 28 +#include <zlib.h> 29 + 30 +void MyFrame::GetHelp(wxString & html_text) 31 +{ 32 +// 33 +// return the HTML Help Page from the ZIP compressed data 34 +// 35 + unsigned char *zip_buf = NULL; 36 + int uncompressed_len = 595001; 37 + int compressed_len = 67145; 38 + uLong inLen = compressed_len; 39 + uLong outLen = uncompressed_len; 40 + const Bytef *in; 41 + Bytef *out; 42 + char *html = NULL; 43 + 44 +// allocating the ZIP compressed buffer 45 + zip_buf = (unsigned char *) malloc(uncompressed_len); 46 + if (zip_buf == NULL) 47 + goto error; 48 + 49 +// feeding the ZIP compressed buffer 50 + FeedZipHtml(zip_buf, 0, "789cecbd6977e338b228f8b9ea5770f29ed725bff6927666f7"); 51 + FeedZipHtml(zip_buf, 25, 52 + "adcec5ef386da7cb5ddeaeadaccae5e4f1a12448622545aa49"); 53 + FeedZipHtml(zip_buf, 50, 54 + "ca4bcdbcff3eb100204882142553b25de99a797dd302080462"); 55 + FeedZipHtml(zip_buf, 75, 56 + "4320108878f3ffec9deeb63f9ded3bbfb48f8f9cb30fef8e0e"); 57 + FeedZipHtml(zip_buf, 100, 58 + "779d676b1b1bbfbfd8ddd8d86bef71c3cbf5e79b4e3b7283d8"); 59 + FeedZipHtml(zip_buf, 125, 60 + "4bbc3070fd8d8dfd9367db3fbe1926237ffbcd50b8bded1f7f"); 61 + FeedZipHtml(zip_buf, 150, 62 + "f8e1cd4824aed30d834404c9db6789b84936b0c76ba73b74a3"); 63 + FeedZipHtml(zip_buf, 175, 64 + "58246f3fb4dfaffdfccc1926c9784dfc67e25dbd7d26bbaf25"); 65 + FeedZipHtml(zip_buf, 200, 66 + "b763f18c4649bcc417db176337f1dc232f11cec5ff1c39fd49"); 67 + FeedZipHtml(zip_buf, 225, 68 + "d0c5b96327127d1189a02b1cdf8b93371bdc1d3f8c935b5f38"); 69 + FeedZipHtml(zip_buf, 250, 70 + "38909cbc1bc734e40fc32de7ffed867e18bd0adcabdbd70eb6"); 71 + FeedZipHtml(zip_buf, 275, 72 + "aeb9be37085e75617211bdfebf0ef57ba1fa75fc89903f76f4"); 73 + FeedZipHtml(zip_buf, 300, 74 + "6f51781dbcfebff89b97190f7f7ab341d3c3746f3608216f3a"); 75 + FeedZipHtml(zip_buf, 325, 76 + "61efd6e90ca8dfdb67ffd5c7ff9e13d636b7db6e07400dfbce"); 77 + FeedZipHtml(zip_buf, 350, 78 + "2e2f3f868f36a169e2c3fff8def61bd719c242e1b398f0e003"); 79 + FeedZipHtml(zip_buf, 375, 80 + "1e2ee3fff8cf4af1f266c3dd7eb3019fe6be8fdc18d687df6f"); 81 + FeedZipHtml(zip_buf, 400, 82 + "f100e7f4030eb0553ac206c0f1a61301692384770bc70bdc11"); 83 + FeedZipHtml(zip_buf, 425, 84 + "e0b5029c97ebff587fbed61357c2ff5bd089c7afe7fbdf6a6a"); 85 + FeedZipHtml(zip_buf, 450, 86 + "2388000f221c7105a4c82ef74a44317c0880c130bff11fce61"); 87 + FeedZipHtml(zip_buf, 475, 88 + "d00f9d2f6ed0733a13cfef39e198074f449c78c1e0ab0d0785"); 89 + FeedZipHtml(zip_buf, 500, 90 + "9107221091d77db67dc0ff20e44d120f70715b6f003fecb880"); 91 + FeedZipHtml(zip_buf, 525, 92 + "b203fabf0ec8034e1e3b6311a1d0048246a8182006914154f0"); 93 + FeedZipHtml(zip_buf, 550, 94 + "e2521c8ddcc01b4f7c1787732e64a72a48466e32e441f05fb5"); 95 + FeedZipHtml(zip_buf, 575, 96 + "8017511446f98923310e239af560fff4c2d970cedbedd3b353"); 97 + FeedZipHtml(zip_buf, 600, 98 + "873ac70e22fcda8d025c65c5d0be0806c9f0b27b95f0f8fcf7"); 99 + FeedZipHtml(zip_buf, 625, 100 + "460fe8ed22e1278197ac018224696b81db1bc5e980b66f9d7e"); 101 + FeedZipHtml(zip_buf, 650, 102 + "148e9cbdbd8dbde30b270813977f6df96130f092494f6c203e"); 103 + FeedZipHtml(zip_buf, 675, 104 + "f11f2b15d37480943c4781119c7e1839ef8e4edf3961e70f20"); 105 + FeedZipHtml(zip_buf, 700, 106 + "6d15b4e3e765837c09c2600df1d073a3de571a732042d0b3c8"); 107 + FeedZipHtml(zip_buf, 725, 108 + "803506decc930c47007cc44934e912e5dcc280cec0bb1281e3"); 109 + FeedZipHtml(zip_buf, 750, 110 + "25b1f3bbf0fdb56f01a83da70d2ad33917e348c4a0afdc29ac"); 111 + FeedZipHtml(zip_buf, 775, 112 + "3ade6a6ce2775ee046b7334cfdc23675d8495c0f39d14986a2"); 113 + FeedZipHtml(zip_buf, 800, 114 + "b0ae8da913a2ae2e425c09c6c88bbb7950e2c958898cb80913"); 115 + FeedZipHtml(zip_buf, 825, 116 + "18281d12c00471ac24e7cbfc780018ee77ce018f725bf13108"); 117 + FeedZipHtml(zip_buf, 850, 118 + "abeb1544d84d12311a134049e8701fd00a3e02237a6a5caf52"); 119 + FeedZipHtml(zip_buf, 875, 120 + "9d74c311a22ae6b115286beae7ba32db858d293704ad0d7f47"); 121 + FeedZipHtml(zip_buf, 900, 122 + "f86ac9bd378ad7d2816077ea8a35f85104312d7796b1c6ff28"); 123 + FeedZipHtml(zip_buf, 925, 124 + "c3f659e80595b4ff67d997bb93e84a385f8ebc00b69e082101"); 125 + FeedZipHtml(zip_buf, 950, 126 + "de3cc73da86ab8ff2e1b0ec7b9a071aa3effb9ecf38b49d407"); 127 + FeedZipHtml(zip_buf, 975, 128 + "04395fce42ff76804c5e03987f95638506a95447cfab187837"); 129 + FeedZipHtml(zip_buf, 1000, 130 + "f4fda99be078b3a0d392a19bd05eeeb8e37114de782046c291"); 131 + FeedZipHtml(zip_buf, 1025, 132 + "960af0b4cfca7de88d63e7ca739de377e7d54ab3a0bcd219ac"); 133 + FeedZipHtml(zip_buf, 1050, 134 + "a3560e6655477a73ab3f4e41f609286f34f605b0770a5908f6"); 135 + FeedZipHtml(zip_buf, 1075, 136 + "849bc0fe5b3d5a67d6e19c2fb4c9c763d1f5faa8ae849b4c40"); 137 + FeedZipHtml(zip_buf, 1100, 138 + "be2b9965f3654105d69cc7ed5d21827a75e7e9cd3e8fb456ea"); 139 + FeedZipHtml(zip_buf, 1125, 140 + "4d505006bca185510fb60b60b7048f47acc2a7e995cd7f8cfd"); 141 + FeedZipHtml(zip_buf, 1150, 142 + "495cb135ecf4fb20d87ce24a87247bea200a27f07ff0d81085"); 143 + FeedZipHtml(zip_buf, 1175, 144 + "3e6ba2eac90aba080167b3dd5f3b8613db9e0ba7361c5bfd78"); 145 + FeedZipHtml(zip_buf, 1200, 146 + "18f4c48d33849ffc299a65f39f78e4ebc2007e38a85810eeb9"); 147 + FeedZipHtml(zip_buf, 1225, 148 + "38d52ef7a4d988f381be17b8c18256ee4e59061daf2ae6b838"); 149 + FeedZipHtml(zip_buf, 1250, 150 + "dadbb8d887e1a05bcf39726fc51411f8a717e336e3568c7978"); 151 + FeedZipHtml(zip_buf, 1275, 152 + "714a70f700eeeab1fabd303f8ee63d1ce9fddee9c6e9c1b983"); 153 + FeedZipHtml(zip_buf, 1300, 154 + "9b22acb743865ef59083f1b7024e33639e1eeca2de3c73bbdf"); 155 + FeedZipHtml(zip_buf, 1325, 156 + "dc819861e8c27e822c71dc8976ddee50ac75dc181008a78829"); 157 + FeedZipHtml(zip_buf, 1350, 158 + "dbfe78b3b0b1e038e7ffbb1d89dc284e4b6de9ceaeebfb1d80"); 159 + FeedZipHtml(zip_buf, 1375, 160 + "38aeb2ab6f46fe3b6d5a5b29f3117a80715d755a8abc824e30"); 161 + FeedZipHtml(zip_buf, 1400, 162 + "d9e5fc70cff102546753769c241cc3117e705b31585b7659ab"); 163 + FeedZipHtml(zip_buf, 1425, 164 + "61870522b90ea36f75463be1ae15835d8faaf4c8ef70b641d6"); 165 + FeedZipHtml(zip_buf, 1450, 166 + "8dc349547d22c45ebe5765ae929638f2ba6049558ea4f4f6b3"); 167 + FeedZipHtml(zip_buf, 1475, 168 + "6db47fc1aa7603114ee2549f97f81c8af4fb8f0f9bb904e90c"); 169 + FeedZipHtml(zip_buf, 1500, 170 + "fe257aa8a55741c2c308c6497f62e5c5bffee6461efa56e254"); 171 + FeedZipHtml(zip_buf, 1525, 172 + "bf94cd475e0e7238913326f5d4882de18aad674e0794bb801f"); 173 + FeedZipHtml(zip_buf, 1550, 174 + "369f39b890b1db035d3f78fb6c8bff861da5abfebef67ac910"); 175 + FeedZipHtml(zip_buf, 1575, 176 + "7a3e7ffebfd8e3f42641f7cff69b2482ffd703d9c4eec1db67"); 177 + FeedZipHtml(zip_buf, 1600, 178 + "ff78e690dfe9ed33763c3d333d44cfc5f3ee73fefe8737c317"); 179 + FeedZipHtml(zip_buf, 1625, 180 + "a9d7a511af060eb891f4f07f22092302373420e83dc7ffefd9"); 181 + FeedZipHtml(zip_buf, 1650, 182 + "f67bf925741d4a70acfd2e6ee1787493eda597fae299ed8bc9"); 183 + FeedZipHtml(zip_buf, 1675, 184 + "68e4a27cc0273940d065b66df897e4a2df6c74186e3943cfd2"); 185 + FeedZipHtml(zip_buf, 1700, 186 + "a7e55c855ecf59715e396fbc6d65117bd9ef4cc8b623017b3e"); 187 + FeedZipHtml(zip_buf, 1725, 188 + "5909a03827518426024c9fbab3705a47b90d5ce031721a3ab1"); 189 + FeedZipHtml(zip_buf, 1750, 190 + "1cbb88c73cf8891b0d4472d91d4f2a5790765bd422da3483b3"); 191 + FeedZipHtml(zip_buf, 1775, 192 + "7bf6a1fe3afaa0c26ffc721264db1b83fc3d0cfbf1a81af51d"); 193 + FeedZipHtml(zip_buf, 1800, 194 + "06f6871f60af39f97074e4787d87bf73bc580de6df3a93406a"); 195 + FeedZipHtml(zip_buf, 1825, 196 + "2fd12b5d2628983f5e96af32d3dcd822cfce4fffbdfe72f645"); 197 + FeedZipHtml(zip_buf, 1850, 198 + "f277b32f7220c2b87c8d666b634b440b7ef60592dd3ff3f2a2"); 199 + FeedZipHtml(zip_buf, 1875, 200 + "0437e8f20566db1b5b221f1e665fa43c74ccbc4cdfeb8055b4"); 201 + FeedZipHtml(zip_buf, 1900, 202 + "55bece5c87c6167ae4753e1e1f6dcdbe52f9e1ec4bfdc58d0f"); 203 + FeedZipHtml(zip_buf, 1925, 204 + "d1675b5ca36ac92eee5d18fac20daa57d73effb08f50e1eae0"); 205 + FeedZipHtml(zip_buf, 1950, 206 + "042522ff16cd1ac05a84debe6b58126ea38923023007b00920"); 207 + FeedZipHtml(zip_buf, 1975, 208 + "39dc3d3df94d835102ebb19b0c615fb6422bdb9605eff14efb"); 209 + FeedZipHtml(zip_buf, 2000, 210 + "1713941288c14ad566b8156cb3c3b26007e9dfdd393a7ab7b3"); 211 + FeedZipHtml(zip_buf, 2025, 212 + "fbebc5b40580edf78715706c5816c0a88f6b60ba14c3cbc4ec"); 213 + FeedZipHtml(zip_buf, 2050, 214 + "548c223c3bd2442f0558755826e03b7bbfed9ceceeefd55940"); 215 + FeedZipHtml(zip_buf, 2075, 216 + "3b9a04df4aa1a7d665820e1f9efc5a07ee7301ca3172d1a75c"); 217 + FeedZipHtml(zip_buf, 2100, 218 + "02bbeeb14cf8cff7f74fdae73b27ed3a6b380dfcdbe9ebc8f4"); 219 + FeedZipHtml(zip_buf, 2125, 220 + "5ae65a4e4f8e3ed55ecf79824770eb22b8695990a7464615b8"); 221 + FeedZipHtml(zip_buf, 2150, 222 + "c60e5d8057b62d0be03c282510ef8fe381155c6c5816acfb67"); 223 + FeedZipHtml(zip_buf, 2175, 224 + "1707d3004d0f240550b96959c0be07e6fd58676397dec03209"); 225 + FeedZipHtml(zip_buf, 2200, 226 + "94cd4b13bd0c40ca9fe4b4b0e9ec5742ff4ae58276cfec2bd9"); 227 + FeedZipHtml(zip_buf, 2225, 228 + "3d2b5fc2501aa30efc877dc9652e3de6ec307796b67ebbbb3e"); 229 + FeedZipHtml(zip_buf, 2250, 230 + "8f8a83b3a998504e412b3a54e3b2966502e3b4584bada82559"); 231 + FeedZipHtml(zip_buf, 2275, 232 + "5771570f9835fae6313ab876dd18b6904358f940444562669a"); 233 + FeedZipHtml(zip_buf, 2300, 234 + "819cae3f11484bb96ca4a522af1ea3eea10e786f3c49e498e3"); 235 + FeedZipHtml(zip_buf, 2325, 236 + "308ebd0e9cc8f04a5cf4f0f61ffbc841c96d4cd7efaff4792e"); 237 + FeedZipHtml(zip_buf, 2350, 238 + "08cd481a38d5c921c47a29dff26af6c209f42a5b2bb7562f95"); 239 + FeedZipHtml(zip_buf, 2375, 240 + "fb38e348743d3efd36b966397a934bc6a892b205635bf572f9"); 241 + FeedZipHtml(zip_buf, 2400, 242 + "6b43934dfd70d5f95344e1e5d8ede538a330646358a3c099d9"); 243 + FeedZipHtml(zip_buf, 2425, 244 + "70a6bc04877dc70da4bfdaf51d371a4c46d2dba096419a053f"); 245 + FeedZipHtml(zip_buf, 2450, 246 + "7663bc47422f370396c205ad613fc3b461a4688920ad625b40"); 247 + FeedZipHtml(zip_buf, 2475, 248 + "1d786d308e0cbab8f67cdfe9c0d2dc5e0f7e9dc41490143ba3"); 249 + FeedZipHtml(zip_buf, 2500, 250 + "49778837b91e29bacffbe7a7b11387b86211c49348c8c1fe33"); 251 + FeedZipHtml(zip_buf, 2525, 252 + "f1f0ae8103d5a6b1025e6495b102b655b3027f2d59c199f2df"); 253 + FeedZipHtml(zip_buf, 2550, 254 + "d441579da1b8b96424663788c27c8df109c5c0a57c32751172"); 255 + FeedZipHtml(zip_buf, 2575, 256 + "2fb27287865eb1472c129c07b724d8c7e8d73c9b285a8b1bbc"); 257 + FeedZipHtml(zip_buf, 2600, 258 + "ea63b8ba611489781c06f417f0e22fe2c6dd03e532c2c04ce2"); 259 + FeedZipHtml(zip_buf, 2625, 260 + "915547ac0fd671e4e79b6ee7e77fedbfc7d15f33783033f0e5"); 261 + FeedZipHtml(zip_buf, 2650, 262 + "6444303a7de09798998d8440cda8b86ebd16f1eea073de8751"); 263 + FeedZipHtml(zip_buf, 2675, 264 + "57ecc42713df2f729ad1485cb159640af8752bf7ab6407e397"); 265 + FeedZipHtml(zip_buf, 2700, 266 + "728e00a001081c9a0880b2ca7fb3d3d005b9019101ccb6b009"); 267 + FeedZipHtml(zip_buf, 2725, 268 + "30dd454fa094dd18b6f7943d56ec187c4d81d83f84f04174ed"); 269 + FeedZipHtml(zip_buf, 2750, 270 + "c522335fbeb3e376e2d09f2482dc8d4908322d35489c60570a"); 271 + FeedZipHtml(zip_buf, 2775, 272 + "eb8bae50c231d4308cbc81078c66405121d2917013f1e1c3e1"); 273 + FeedZipHtml(zip_buf, 2800, 274 + "9e45a4755bd60cabaf7a5d7db7f7d269c109b9178e561c1c10"); 275 + FeedZipHtml(zip_buf, 2825, 276 + "ac44752f8ab1f3af363644b07eed7df3c6a2e7b9eb6134d8c0"); 277 + FeedZipHtml(zip_buf, 2850, 278 + "bf363e041e328eebfbb79793c0fbcf445c7a3d8c16e87b6068"); 279 + FeedZipHtml(zip_buf, 2875, 280 + "6d1bcd0e373b6933da502be52b3fdefbc7ee5074bf01d71797"); 281 + FeedZipHtml(zip_buf, 2900, 282 + "6e34b658e0ff3fa7bdffb13ddfee536fad30e7339cd8e96ab0"); 283 + FeedZipHtml(zip_buf, 2925, 284 + "dc6d43b26548634e1dd026f43bb201cf889c842c479c84e10b"); 285 + FeedZipHtml(zip_buf, 2950, 286 + "1870cb61bbfc6f5a060d50899b7698b87e2582323dee8825d7"); 287 + FeedZipHtml(zip_buf, 2975, 288 + "e94e4614f17d251c1307b43c80e8cd64db1d0c2231c0d0a4be"); 289 + FeedZipHtml(zip_buf, 3000, 290 + "367627db9527c8fda01bf6c48773cb815737b59c49e49bd096"); 291 + FeedZipHtml(zip_buf, 3025, 292 + "1a2d3f547cb3aa9e84548ed420b79c89088f1b6b026102d678"); 293 + FeedZipHtml(zip_buf, 3050, 294 + "b63de65f1cfa0514042dbb090ef202e807e2cf4cc3a8508f15"); 295 + FeedZipHtml(zip_buf, 3075, 296 + "7ee02807827bb2cda3d2c413dace5cffdabd957b0bef54a0d7"); 297 + FeedZipHtml(zip_buf, 3100, 298 + "5c9a829ecef0c991f6a7751d36911d339c24e6a04a39f29682"); 299 + FeedZipHtml(zip_buf, 3125, 300 + "db1fecd9bc264501851215da077d3ab78cdaceb6ec241539ef"); 301 + FeedZipHtml(zip_buf, 3150, 302 + "c4a92107ffd18e9518df666055d3ab15c1c03dd177277e62c2"); 303 + FeedZipHtml(zip_buf, 3175, 304 + "cfef4dcab812f6e532aed44d337065f9370d31a5eb8c7dd70b"); 305 + FeedZipHtml(zip_buf, 3200, 306 + "9004fcca0077992c5765788f88d9184f95d05f7256ba47c633"); 307 + FeedZipHtml(zip_buf, 3225, 308 + "f25596578b6c452b7d546ce54527607bbc07b8cfdc646861ae"); 309 + FeedZipHtml(zip_buf, 3250, 310 + "6c87d61d7634180a6ccf30ba757044c6952b637f4183038195"); 311 + FeedZipHtml(zip_buf, 3275, 312 + "cde2e054e8f2988d25d09ac21fdde0d689294810ce36c9d0f1"); 313 + FeedZipHtml(zip_buf, 3300, 314 + "ddee377e6ca141a83023c1447ceff9a21a2db65e77c10d8ee7"); 315 + FeedZipHtml(zip_buf, 3325, 316 + "e0808c9b961774fd09310e30a8b802c640d3913aecdf241cc8"); 317 + FeedZipHtml(zip_buf, 3350, 318 + "bfb2601422eed885982250835881c0e9c86b127129cec4cda3"); 319 + FeedZipHtml(zip_buf, 3375, 320 + "c619c0588d32a3c39d31a611729ff8c0b9aef1c008a7bd1420"); 321 + FeedZipHtml(zip_buf, 3400, 322 + "3cecf19ba3727c0998ae8824fcb5e57c2494007a68e3fa0256"); 323 + FeedZipHtml(zip_buf, 3425, 324 + "d6a7cc2fb591b68f960e45b50ff99929c57a78b4fa8f38fbba"); 325 + FeedZipHtml(zip_buf, 3450, 326 + "e39c333ed8231283ea8d57a523453a59a0ef2756f08cfd588c"); 327 + FeedZipHtml(zip_buf, 3475, 328 + "5d0abdcf3882742f74e78cbc04f6121c0774bb8383f9f490a3"); 329 + FeedZipHtml(zip_buf, 3500, 330 + "cbdb0a1c1c45643f4defdf8c7dafebe1c1523eaca4394570e5"); 331 + FeedZipHtml(zip_buf, 3525, 332 + "456140fe832b191a4a2172673bedc39da3c3f6fee5c5feee87"); 333 + FeedZipHtml(zip_buf, 3550, 334 + "f3c3f6a7b7c80737427b9e8c53a4f6f878f844a62722f208f5"); 335 + FeedZipHtml(zip_buf, 3575, 336 + "fb183a7c851dc8372ed831a0ac6d938426a44d39c467784dfa"); 337 + FeedZipHtml(zip_buf, 3600, 338 + "281ce3fb84c383f1b7c131d867b61388d9de4246c653b6c9d8"); 339 + FeedZipHtml(zip_buf, 3625, 340 + "eaef0ac60e3838589a2107221ccbe8f9919a54f1269c920d44"); 341 + FeedZipHtml(zip_buf, 3650, 342 + "c6407b0f633691c112374ac8e6f062792782e3e185160db3ca"); 343 + FeedZipHtml(zip_buf, 3675, 344 + "6f4f86ae36e8d99017298f32c3f4480780be8e80c506c462a9"); 345 + FeedZipHtml(zip_buf, 3700, 346 + "6cecabfb163d2e71a5a3e3a7a48bcc090318507acdd2402b09"); 347 + FeedZipHtml(zip_buf, 3725, 348 + "3a74db7bb7d6f7d87b8eaa05c7a0217df736ac3ad5eed1ea2a"); 349 + FeedZipHtml(zip_buf, 3750, 350 + "2892eb302749e42895342903f14024e5e0198d56d03a75aec7"); 351 + FeedZipHtml(zip_buf, 3775, 352 + "cee5f6617a1825aeedb066c3dd249d579d8cebeafdced1c5fe"); 353 + FeedZipHtml(zip_buf, 3800, 354 + "9493b8c2ecce683cf43a5e3889a78945b667e302e2eae11b90"); 355 + FeedZipHtml(zip_buf, 3825, 356 + "95dc60cd480c9c524e420c7a9e6cb3f352090ea180dc92f2c7"); 357 + FeedZipHtml(zip_buf, 3850, 358 + "c25a3c76538e266838e16c6850c5641470547d2d319946abd2"); 359 + FeedZipHtml(zip_buf, 3875, 360 + "aecd8b8e8d5a53a4681af4d66e4b902ccb529a11b20b91489f"); 361 + FeedZipHtml(zip_buf, 3900, 362 + "ff597ab1985fb5a513add92bdeb1d590ae8c95c2740b26a30e"); 363 + FeedZipHtml(zip_buf, 3925, 364 + "de5df5e108cb17103d6f802e83160c99b9f15c915201a23406"); 365 + FeedZipHtml(zip_buf, 3950, 366 + "e5cde75e5c47fb7227a6cbc1156d961a2f13c96b15bf621b4c"); 367 + FeedZipHtml(zip_buf, 3975, 368 + "a61250c7656d2c7944887fd2f7593852f93a83e3369f3168da"); 369 + FeedZipHtml(zip_buf, 4000, 370 + "00bd8b2022f48d0694cfe6ee2409f1d96297a409361e7c9d23"); 371 + FeedZipHtml(zip_buf, 4025, 372 + "3d69a41af200a4b3b499018c271220e77cb3036cc5c30fc300"); 373 + FeedZipHtml(zip_buf, 4050, 374 + "d648e6965a0099ddd0d4f7434e8431c6580bb9f802e242365c"); 375 + FeedZipHtml(zip_buf, 4075, 376 + "e36e2444502edb077538c4d2c92a155e9dfbfaf3621036330b"); 377 + FeedZipHtml(zip_buf, 4100, 378 + "e24411666c0293626ea7822adacfcf4317b0bf88988dca7c25"); 379 + FeedZipHtml(zip_buf, 4125, 380 + "a13d5fc9a33055d5c22e03103aeb792cdfc36901aaff738978"); 381 + FeedZipHtml(zip_buf, 4150, 382 + "b139176b8572c81774c4cca81f706879c749c73439a5ba2b0f"); 383 + FeedZipHtml(zip_buf, 4175, 384 + "1cf3e89bbaaed9375676a4f5fa24de94c1c509bbc482bd7201"); 385 + FeedZipHtml(zip_buf, 4200, 386 + "d1ebc48ed598903d9ac0446161b031c4092ca7cbe2c2c93eb4"); 387 + FeedZipHtml(zip_buf, 4225, 388 + "7ecc13c3509319c46919e10fbd6d052841530775f587235b87"); 389 + FeedZipHtml(zip_buf, 4250, 390 + "0d990ea8203cf14237013055f84af4427c379ec277b28763d5"); 391 + FeedZipHtml(zip_buf, 4275, 392 + "44cb43722dac9593288724dc4d66411368b76a2c718732965c"); 393 + FeedZipHtml(zip_buf, 4300, 394 + "4d83282c1135b590a87779fda0c6dba64169a4691cd8315846"); 395 + FeedZipHtml(zip_buf, 4325, 396 + "c71e18dd7ba188839f12e716dded371e50c74b52d73c5d47e3"); 397 + FeedZipHtml(zip_buf, 4350, 398 + "56b7061fadf5fddb32f1374182ad229e7441cbe0c578865032"); 399 + FeedZipHtml(zip_buf, 4375, 400 + "d06192c13c8ed5e08e519d98ea51ec0d3b1dcb830ff8b1e5dc"); 401 + FeedZipHtml(zip_buf, 4400, 402 + "9445b2dd3dca4dbb2d99614392a99b4ae377a76b7b9982bf2e"); 403 + FeedZipHtml(zip_buf, 4425, 404 + "16d2a80b6d31a6b730a094e73f2f5e35d4cdf5308c85eaccf6"); 405 + FeedZipHtml(zip_buf, 4450, 406 + "e94d46a7a87155e48cea809df1f2c893de49378053c4da26ee"); 407 + FeedZipHtml(zip_buf, 4475, 408 + "9b9be5f880692cf8805f178e8f19b0b1245c24ae0d17f0ebc2"); 409 + FeedZipHtml(zip_buf, 4500, 410 + "719120804152131daab78991aa4559de48d0cf2de7b67459ab"); 411 + FeedZipHtml(zip_buf, 4525, 412 + "8b5cf238f282ae37863d484bae1d13b71b929c60d6b93dcf0d"); 413 + FeedZipHtml(zip_buf, 4550, 414 + "b4b79dce31a069753464721db25346deab92c1d813a08447c8"); 415 + FeedZipHtml(zip_buf, 4575, 416 + "3dd8e53f13b7872f70d427ecc05f77f0ecc59b820eb13419e7"); 417 + FeedZipHtml(zip_buf, 4600, 418 + "0b00b236f69828f06ffee7d78a7029e1f9c8a2f87fe9fd6921"); 419 + FeedZipHtml(zip_buf, 4625, 420 + "660a1ae6e5291d1ccb832f9435e3119a1eb8c1ca5053c60f4a"); 421 + FeedZipHtml(zip_buf, 4650, 422 + "968f7b257068309d05776d2a7777c11ad7a66daf872212191d"); 423 + FeedZipHtml(zip_buf, 4675, 424 + "2153ef0578d52f198cc3854a97628b6f0e93052fc5aa1eeebe"); 425 + FeedZipHtml(zip_buf, 4700, 426 + "9a3d318884b01047362c58eda501ae7245b9b00ab904966309"); 427 + FeedZipHtml(zip_buf, 4725, 428 + "6999e3f8666cf111df8c17ba02d3ea8081f8bc444f43b01533"); 429 + FeedZipHtml(zip_buf, 4750, 430 + "0161638069b640d3f9e1c08dbc64388a5760655e9c860a8fc3"); 431 + FeedZipHtml(zip_buf, 4775, 432 + "6bf68469495232ce9e230c5e943ad2b86893daff281cc85343"); 433 + FeedZipHtml(zip_buf, 4800, 434 + "4bc673ab0b448d60bc29599176ed51204f28a517d37e185a1e"); 435 + FeedZipHtml(zip_buf, 4825, 436 + "68d0cf0bc5a68ff93aacaa6640267d5453db1c05ca4260ec14"); 437 + FeedZipHtml(zip_buf, 4850, 438 + "d77234f77eaee882485f242e0a3c6372c7ebac61807cb696e7"); 439 + FeedZipHtml(zip_buf, 4875, 440 + "40eb87b9fb67ad3652550e3cc221cbc099cf578dd86e2f8da1"); 441 + FeedZipHtml(zip_buf, 4900, 442 + "2a47bc15d788a9cefd5819562428a123f1841f3b7361062320"); 443 + FeedZipHtml(zip_buf, 4925, 444 + "fafaf3f2ae9b6548549c2425b803886029c65e9423dcf55176"); 445 + FeedZipHtml(zip_buf, 4950, 446 + "39ca1fbbc8f60df577a75a8ea18bc5ecc35f17cab9c48d5b25"); 447 + FeedZipHtml(zip_buf, 4975, 448 + "fc975df4566bd6256f4d5df2e673eb9a379f2f7ed19bcf6bad"); 449 + FeedZipHtml(zip_buf, 5000, 450 + "1a409975d99bcfabd77d76585cf4d961361abf995dce98c90a"); 451 + FeedZipHtml(zip_buf, 5025, 452 + "48786de8de33dcd62c9085d755c458ad3893d451cd34eb2226"); 453 + FeedZipHtml(zip_buf, 5050, 454 + "981959ac45cab7fadb4a5c9e2bfb2d8f3fd970cfb69934c828"); 455 + FeedZipHtml(zip_buf, 5075, 456 + "7bb282b4ecbe114e69960b46f875b1671798203d58caf5b8b1"); 457 + FeedZipHtml(zip_buf, 5100, 458 + "b3063a993538fc8346e989b1e00065bcc71b0abc4ecd7a12e4"); 459 + FeedZipHtml(zip_buf, 5125, 460 + "e5123f37a46fc7211685b812eb4ec5baadcb5ef4aa9b3ff45c"); 461 + FeedZipHtml(zip_buf, 5150, 462 + "fc27b29c7af0d7c52e053651803c0ac384d390e3bb14450a75"); 463 + FeedZipHtml(zip_buf, 5175, 464 + "7f3cd51cbc487a3d7175390e2d0784b46da10b81f1279ceed8"); 465 + FeedZipHtml(zip_buf, 5200, 466 + "bc88bef27486f5dc538bf84eaf59e4a2627754be626c5c2ced"); 467 + FeedZipHtml(zip_buf, 5225, 468 + "5c0ac65ec272db369f5d7bc12ebb059dc77f73233ba3ca8665"); 469 + FeedZipHtml(zip_buf, 5250, 470 + "7129858ce24d8b8558149f2145533657f2374570a4b14af392"); 471 + FeedZipHtml(zip_buf, 5275, 472 + "1931606769d5b20c7e9e1131a552d00052ee7ae7d44c659347"); 473 + FeedZipHtml(zip_buf, 5300, 474 + "7137856bb93c10c9911b27bf33f8c7b6443cf67ed6abe4b2c4"); 475 + FeedZipHtml(zip_buf, 5325, 476 + "821584605839299995e5b69e6522ee91818cab678578670407"); 477 + FeedZipHtml(zip_buf, 5350, 478 + "4d8c0fd36f9a3ab74cad160731acac9b270e7d8f59782eccb7"); 479 + FeedZipHtml(zip_buf, 5375, 480 + "aa91e0ab1247994034949cab2242c840d53e32c75484aa5e0f"); 481 + FeedZipHtml(zip_buf, 5400, 482 + "059d1ceab10c64d24cf550b933b9a9874da3e3c34468cb9ddc"); 483 + FeedZipHtml(zip_buf, 5425, 484 + "78be0762b9b250e49af3d444f42e1cd131428fb212e1fb9a4a"); 485 + FeedZipHtml(zip_buf, 5450, 486 + "6cdb7a5b512eaba31847d1ea212813bb3dc6221daa71e2b554"); 487 + FeedZipHtml(zip_buf, 5475, 488 + "ba0a4516b0ab693a5d7dc61137093d39311e37624af1589178"); 489 + FeedZipHtml(zip_buf, 5500, 490 + "43a9079aa54c821aa0ad1c5a79dbcc7812b39dcf70322604eb"); 491 + FeedZipHtml(zip_buf, 5525, 492 + "eae12b54d7e94aacf3f2cad982b7b83afb4359cfe624100be5"); 493 + FeedZipHtml(zip_buf, 5550, 494 + "a9e4774def11722b6f46f6e46053f7892ccaca759bbddfc341"); 495 + FeedZipHtml(zip_buf, 5575, 496 + "6cf96eb108b45628b2bb9a7d77ac3af728ecbd5f3d1f559935"); 497 + FeedZipHtml(zip_buf, 5600, 498 + "cfd855d20e7f1dddf5fee707180715f9fc23959e3a007e823d"); 499 + FeedZipHtml(zip_buf, 5625, 500 + "4e7dc0dfd47ae2ca23124563572c7bafb165cf3fd22ccbeea9"); 501 + FeedZipHtml(zip_buf, 5650, 502 + "f5542f7b176307abd6bddbd8bae71f69967577f582aa177e0c"); 503 + FeedZipHtml(zip_buf, 5675, 504 + "4aa572e1c78d2d7cfe916659f8482fa87ae1683145812b1365"); 505 + FeedZipHtml(zip_buf, 5700, 506 + "9db813dee7011fb66c7b2cf15e73223ff750b3e0c2cbac3150"); 507 + FeedZipHtml(zip_buf, 5725, 508 + "6b04148959907318742d6fcb09278777be055728997fa4f931"); 509 + FeedZipHtml(zip_buf, 5750, 510 + "e2c1c266c2c4fbd01aba8398783fb71f3b8f89f9479a1f137d"); 511 + FeedZipHtml(zip_buf, 5775, 512 + "219219f0f0c98d2c99ce090f9f7a4de161fe91e6c7c32d2c6c"); 513 + FeedZipHtml(zip_buf, 5800, 514 + "1686c0026c183b5ca1368e1bd31af38f343f4262b9c05975c6"); 515 + FeedZipHtml(zip_buf, 5825, 516 + "7b37198696645e2c2b948ba22169b9c3587790175ade2c08d9"); 517 + FeedZipHtml(zip_buf, 5850, 518 + "1dbab6ab3c362e1ac3c6fc23cd8f8b2eae6c16541c79b64a03"); 519 + FeedZipHtml(zip_buf, 5875, 520 + "84096c6a0a1777196b7e6cf8306b35323eac5fac57eda91fe2"); 521 + FeedZipHtml(zip_buf, 5900, 522 + "e676d5bb8c350b0e684d35b653ea57b18b7e889bdb47ef32d6"); 523 + FeedZipHtml(zip_buf, 5925, 524 + "cc6b9fba8152af8a7df343dcdcce7997b1665ef9f42d93bad5"); 525 + FeedZipHtml(zip_buf, 5950, 526 + "d8293fc4cded9577196b6614d4df24a97bd556f0216e6e33b8"); 527 + FeedZipHtml(zip_buf, 5975, 528 + "cb5833e3a0d62e80b7d755e20f3d9a93ff3b0d36db0640ebaa"); 529 + FeedZipHtml(zip_buf, 6000, 530 + "614353bf0a25003d9ad302771a6c8ef5d7b19da96315ff4397"); 531 + FeedZipHtml(zip_buf, 6025, 532 + "e604e04e83cd818129327057b76b6f14a73e579b7b95ef5af6"); 533 + FeedZipHtml(zip_buf, 6050, 534 + "f636f68e2f30e85dd6be6ef96130f092494f6c608405fe63e5"); 535 + FeedZipHtml(zip_buf, 6075, 536 + "117962f7f630401096648bca0d06472eba258f2f5a8e5e6645"); 537 + FeedZipHtml(zip_buf, 6100, 538 + "d8a642c03496a853f4efdaf0f5bb08a0caded6924f5f5661b7"); 539 + FeedZipHtml(zip_buf, 6125, 540 + "0b606390557605d0ac17af705e1fcabbc1e4c2fe9c9c427eb7"); 541 + FeedZipHtml(zip_buf, 6150, 542 + "226342d2442471ad34e895b705f8d8239309d58a6b580422db"); 543 + FeedZipHtml(zip_buf, 6175, 544 + "92a2fb4861979cb7886fe4477103e88b890d33589b2aa7d3d6"); 545 + FeedZipHtml(zip_buf, 6200, 546 + "82ff1d4962dd7dc65a34a46ca37b26d69942d75e32f41489d3"); 547 + FeedZipHtml(zip_buf, 6225, 548 + "e9974092bb6a8c8e2e043e49a8b479aede3827ebeefc21bac9"); 549 + FeedZipHtml(zip_buf, 6250, 550 + "63ba9b398c3f7b637b6d08ddd4a25b5c993680cb9dcf987fa0"); 551 + FeedZipHtml(zip_buf, 6275, 552 + "ad8b5f50490cbc6593dfad124b50fa4be3c167d8773609ab98"); 553 + FeedZipHtml(zip_buf, 6300, 554 + "9269d5794effa64c4aab24ff7ffbaf9fb736375f739f0f27bf"); 555 + FeedZipHtml(zip_buf, 6325, 556 + "9e9cfe7ec2db55216db66b3cd00aaec2ae8c7a944f4028bb7a"); 557 + FeedZipHtml(zip_buf, 6350, 558 + "c299d6d304c07af34bab1201c406858d3cca314fc2acf7f9f0"); 559 + FeedZipHtml(zip_buf, 6375, 560 + "6cad1b8e88adf1be9e0cf4b21d3c3eebf5cb302f9b9e305f17"); 561 + FeedZipHtml(zip_buf, 6400, 562 + "f3677bef9d5ed8a5612a507ee095a25c36b51cd83e06e209e1"); 563 + FeedZipHtml(zip_buf, 6425, 564 + "53107e70f89e3155c5e0c1a094c1b9e909db35d9fbe4602ab6"); 565 + FeedZipHtml(zip_buf, 6450, 566 + "db5ebf94b955db13beebe1bb7df87e3a7bff7b2c4af95bb53d"); 567 + FeedZipHtml(zip_buf, 6475, 568 + "21bc1ec2ff7db63f9dc3f76fcad5b76a7b42783d84ef7fd40a"); 569 + FeedZipHtml(zip_buf, 6500, 570 + "5ca7637a33d93ef3053ec48599c42b2ab18069d8f25f700660"); 571 + FeedZipHtml(zip_buf, 6525, 572 + "83706eec5c0bacfa5449ba83715c453dd9fc44c0fa045c3b38"); 573 + FeedZipHtml(zip_buf, 6550, 574 + "bb989d88e957262189bcb8e09a14fd5d744a0f0eaaed8996f5"); 575 + FeedZipHtml(zip_buf, 6575, 576 + "6809f83a9bbedd9c6d95ee36dcf484eeba9bcd96f30577e8ad"); 577 + FeedZipHtml(zip_buf, 6600, 578 + "e7cf9f7f9d82f803911c7b23d1068458a2d2d3c69633766ffd"); 579 + FeedZipHtml(zip_buf, 6625, 580 + "904b5fe6d15fc70766c13ee600645476c3898f2907012588f7"); 581 + FeedZipHtml(zip_buf, 6650, 582 + "57e42a45b837065e9fdfbbe95fc69ce26855ea03f5f31fb0e0"); 583 + FeedZipHtml(zip_buf, 6675, 584 + "5ccf3fc65bb95f123014733fc55783bfdf8c7cfdab3bc6ecc1"); 585 + FeedZipHtml(zip_buf, 6700, 586 + "44a00df5bb9eca6cfcd3a3e761abf9dfc73d9ac2c8034844d6"); 587 + FeedZipHtml(zip_buf, 6725, 588 + "4bd44e1dae61a11d3b690295485628e4df474081358532cc30"); 589 + FeedZipHtml(zip_buf, 6750, 590 + "85c1f2e531d0282914ee60bd3e335b5b7482a70a3656ff98a2"); 591 + FeedZipHtml(zip_buf, 6775, 592 + "72394d317f85b7ad46a16f733c19872321d73196c53e56759d"); 593 + FeedZipHtml(zip_buf, 6800, 594 + "d1ac98e030527c002b5877a82bf384bb942a912b4344025850"); 595 + FeedZipHtml(zip_buf, 6825, 596 + "6533978547af87a12fe87bed5028962b84ad80472709ca676a"); 597 + FeedZipHtml(zip_buf, 6850, 598 + "3dd549ad4b8a4b566e4017ff73e42569a64855753a9d29763a"); 599 + FeedZipHtml(zip_buf, 6875, 600 + "de60a092ca4077ac8971bcf3f1f268ffe4a0fd0b26d3a1a5ae"); 601 + FeedZipHtml(zip_buf, 6900, 602 + "82c63978b752af96a5f61c6620921b1b66672785613eb973c2"); 603 + FeedZipHtml(zip_buf, 6925, 604 + "b144592fc4177640a01155510911691e55b8e84e2274ff7971"); 605 + FeedZipHtml(zip_buf, 6950, 606 + "3c41bf34d36a121b85d380e49c673e53130aa9cf68aa0bf7c3"); 607 + FeedZipHtml(zip_buf, 6975, 608 + "ae265294aa76582e53dc665792ab53e4acd6e6c5a22687a7af"); 609 + FeedZipHtml(zip_buf, 7000, 610 + "d3cabc38d31a17e3457279f34825e726f8a1c5b28695501173"); 611 + FeedZipHtml(zip_buf, 7025, 612 + "d7c00b6283939c92d4ad18625714df7c5ad48df00aa42ac27a"); 613 + FeedZipHtml(zip_buf, 7050, 614 + "330197f855fb233f9ba134f49955198236f7762d53abaa1d5b"); 615 + FeedZipHtml(zip_buf, 7075, 616 + "e7537d92a9872553bbe124483e04b1db17ed88d4a335715fa1"); 617 + FeedZipHtml(zip_buf, 7100, 618 + "536b46ab2f4f302ee3595dcc857479fabccba427f41cb98864"); 619 + FeedZipHtml(zip_buf, 7125, 620 + "ac9520617aad36ae48f427d883e660ec7b344ecf93453bf048"); 621 + FeedZipHtml(zip_buf, 7150, 622 + "32f2029d621e63ad0128b370725a4910c447262aa66cccbaea"); 623 + FeedZipHtml(zip_buf, 7175, 624 + "186d8a80745753b80631517e4db3b254be9c56826554d164e1"); 625 + FeedZipHtml(zip_buf, 7200, 626 + "ac03f12496d0291aacbc06e91a09ca9787e9c12a30190f95e5"); 627 + FeedZipHtml(zip_buf, 7225, 628 + "033fc71eb04db67a3092f66eaf8ffa25975ae3e765575a5f80"); 629 + FeedZipHtml(zip_buf, 7250, 630 + "7b30bf877a2b8f2cf495b4c580df257add7bb9ed2af63a3dd8"); 631 + FeedZipHtml(zip_buf, 7275, 632 + "4505000ac1e36c6895bd9584e22740ee095dd0544331ed353b"); 633 + FeedZipHtml(zip_buf, 7300, 634 + "e0030dc64a0f87a553c5614d3dfd2cc86d4e8a4b298e0fec10"); 635 + FeedZipHtml(zip_buf, 7325, 636 + "764c84951dc075ce4e0f4fdae9ebd2821d18893157684a0b4a"); 637 + FeedZipHtml(zip_buf, 7350, 638 + "5d503c00463c2881c70a387c95ab1d0a00378ce862f56a849b"); 639 + FeedZipHtml(zip_buf, 7375, 640 + "665499c5c9cee36396922eab15892a4715ae830d32c6d360f2"); 641 + FeedZipHtml(zip_buf, 7400, 642 + "13a70e56f5c749fe271e080c6c63b8c7d1824a75e845fb523e"); 643 + FeedZipHtml(zip_buf, 7425, 644 + "df2de45e912df326a75a02b5a886e62d9e81e063375e233ba4"); 645 + FeedZipHtml(zip_buf, 7450, 646 + "cf99238fdd6f82e1cfa6b8cf6ecc6a4fa6e2a9f8c499fd41ea"); 647 + FeedZipHtml(zip_buf, 7475, 648 + "24e5a9c4f669392fccf83e4991b3529921450351446f0adf9c"); 649 + FeedZipHtml(zip_buf, 7500, 650 + "f8e54325960fb43ccdfeba145999414a58aca41642246296e2"); 651 + FeedZipHtml(zip_buf, 7525, 652 + "1b87928a7dcd849f4cc5e5e70a647e9e1b9bce9f7f294c7fb6"); 653 + FeedZipHtml(zip_buf, 7550, 654 + "e0daf9730e6c1f5760fb787e6c8ffe52d83eb6617b340f6f57"); 655 + FeedZipHtml(zip_buf, 7575, 656 + "a1fbf31df03d8dbbcbe9f1b828f1d94a8a3f6725c6118c60a7"); 657 + FeedZipHtml(zip_buf, 7600, 658 + "04b6c0313dd9c4b513594c0400aec6c996bd49e20b07e0e8bd"); 659 + FeedZipHtml(zip_buf, 7625, 660 + "85622e9d661624c662401b9f2a13c8056261b57400e09c9fb0"); 661 + FeedZipHtml(zip_buf, 7650, 662 + "4042cd5453252d5184a943033a0da0f17e27cca37dfd68f06b"); 663 + FeedZipHtml(zip_buf, 7675, 664 + "a011ab9ea539b808fad8416f0931e400cc182c18458daaf0cd"); 665 + FeedZipHtml(zip_buf, 7700, 666 + "0c29b7ee9716c7133ff16cb2d0a372e63280f25d5a6ff02f48"); 667 + FeedZipHtml(zip_buf, 7725, 668 + "abd7940340adf7adae6be8a08d8a05dd30a99e90b9d1d1f781"); 669 + FeedZipHtml(zip_buf, 7750, 670 + "b45baf344bc1bcf57c37d2c958e1736f824e833010ab60e427"); 671 + FeedZipHtml(zip_buf, 7775, 672 + "ec1c08b9d808a57246dd068b6be18940b3cb8ae697d7701e48"); 673 + FeedZipHtml(zip_buf, 7800, 674 + "892597903a91940f61bd117e2a758d65996cd78bba36af68da"); 675 + FeedZipHtml(zip_buf, 7825, 676 + "d672ba55db5e779a8d8cb90c27f1ac1b1cfd3ed56f1627625c"); 677 + FeedZipHtml(zip_buf, 7850, 678 + "3af2576719bb643638bceb8778d3717478b27fd13e3f3c3970"); 679 + FeedZipHtml(zip_buf, 7875, 680 + "dcf1380a6fbc51eaeb61b49a1b25e671b8415412cb5211d6ce"); 681 + FeedZipHtml(zip_buf, 7900, 682 + "36e32dbd8b9a860b7408712156d7cfe4e44524b12cf41d7404"); 683 + FeedZipHtml(zip_buf, 7925, 684 + "b14b8aa78f9d6178ad3c9e24688adde8b52355204c4b417601"); 685 + FeedZipHtml(zip_buf, 7950, 686 + "f2c9a80f9c063287dcccf523d52758811165ec3633ab4cfe5b"); 687 + FeedZipHtml(zip_buf, 7975, 688 + "7f1124b25d2f29d4df2c5c98f2f472cac936e6f39e1813ce2c"); 689 + FeedZipHtml(zip_buf, 8000, 690 + "0cfbbeef8de31269908d7715879b4bf7c62b1707b023ab3b7c"); 691 + FeedZipHtml(zip_buf, 8025, 692 + "7ff222113f556018b30a810f4a70042fe12f28323b51d72e2e"); 693 + FeedZipHtml(zip_buf, 8050, 694 + "d0b0e09da316bf6365edf201e2242c9787bf96a44ddd922668"); 695 + FeedZipHtml(zip_buf, 8075, 696 + "ec00d566d8985eab425c3fc59408508cbc048d2dc5ddd99188"); 697 + FeedZipHtml(zip_buf, 8100, 698 + "188c7339dc00eb72cb87367c2f3533e73fed7877dff112af5b"); 699 + FeedZipHtml(zip_buf, 8125, 700 + "2ac64687fbdef99ee4bd31795754ad25efc57df5af2ff77fdd"); 701 + FeedZipHtml(zip_buf, 8150, 702 + "0d5ba9fa0b386bda6a7715fb3c6de30f48accf4e8f3e1d9c9e"); 703 + FeedZipHtml(zip_buf, 8175, 704 + "54ede14cb5a76dfc3bdcc6ab843adbe76933af9cf9d148bdde"); 705 + FeedZipHtml(zip_buf, 8200, 706 + "c96b4afdd366fe57927bbd512791677b0150ecd3cc667eb959"); 707 + FeedZipHtml(zip_buf, 8225, 708 + "3186ecb2f524fb4bdbf189b4c047be07c2cbb29a5c8728d4b1"); 709 + FeedZipHtml(zip_buf, 8250, 710 + "130fdd485f3062880ee6408e04ddce766ff4c30956135fa7e2"); 711 + FeedZipHtml(zip_buf, 8275, 712 + "072f3e86ee158ed8f3fab4a52644728f4654fca1c755dc40a3"); 713 + FeedZipHtml(zip_buf, 8300, 714 + "fff575cda3b534b2f78f17549ae820f22c19acd2b6f40e7227"); 715 + FeedZipHtml(zip_buf, 8325, 716 + "12ae9fbb7e8cbd3fcbd3efa02c62446b5e4657a1258cbc8117"); 717 + FeedZipHtml(zip_buf, 8350, 718 + "d8af99cb24b06e74f845fbf241c23f8f0629ade4b1ad95c700"); 719 + FeedZipHtml(zip_buf, 8375, 720 + "564921c05c6aaa0b5b61ecb4a4fcd2ded81b0899d79f0a9479"); 721 + FeedZipHtml(zip_buf, 8400, 722 + "dbb86c046945ae585044308632cb4ff8de52415f9f69a56075"); 723 + FeedZipHtml(zip_buf, 8425, 724 + "1d7c908693e91b4d7d2dccc1d64914fa32925ec64623a65905"); 725 + FeedZipHtml(zip_buf, 8450, 726 + "24a0ea3a98838f5e0dbc9a9e9767e2cb8069c28def6da320e3"); 727 + FeedZipHtml(zip_buf, 8475, 728 + "ab05599391a8c24f104848bbee24061545418c7857cbb7d71e"); 729 + FeedZipHtml(zip_buf, 8500, 730 + "bf5a93e1dde9bba20ddfcb0d0f4363dd471ab6a5c493c65fb1"); 731 + FeedZipHtml(zip_buf, 8525, 732 + "4f7016fab78330a839bc845e55369c06bd0e7fb40f3d157b1b"); 733 + FeedZipHtml(zip_buf, 8550, 734 + "88be69bd0e39145f6b56989c458049a6f46c2b1f24cf77fb2b"); 735 + FeedZipHtml(zip_buf, 8575, 736 + "5cd6223114af7ea3d27abefa7c4532310b9552a46e1cc3a8e6"); 737 + FeedZipHtml(zip_buf, 8600, 738 + "6b8b3b5c9b97ebc13696701be0266bd785d9f607a44f66d087"); 739 + FeedZipHtml(zip_buf, 8625, 740 + "0f760d0bd689895ef7935e7cd28b4f7a7116bdf88bb87107b8"); 741 + FeedZipHtml(zip_buf, 8650, 742 + "28bb5acc343f208d3283567ca84b58b0521caa653fe9c4279d"); 743 + FeedZipHtml(zip_buf, 8675, 744 + "f8a41367d189eff0ddd771c7e27e572d2de7a6ca71765bd1c8"); 745 + FeedZipHtml(zip_buf, 8700, 746 + "4ef72a9fda6d79e33d3e22a037009bb0347e01805e68fa690b"); 747 + FeedZipHtml(zip_buf, 8725, 748 + "e0953f45298598d832e4d7eb61687cff966282b1de820e907f"); 749 + FeedZipHtml(zip_buf, 8750, 750 + "fd23517da6070ac7efce1d7ef107f43407aba627076b965355"); 751 + FeedZipHtml(zip_buf, 8775, 752 + "b7dfed21d97c41b24b23a07a2986c1ca195291cb8b464325ed"); 753 + FeedZipHtml(zip_buf, 8800, 754 + "92fbcb2785cde5ccb3f78c77255b57062b97106cff2611b6c7"); 755 + FeedZipHtml(zip_buf, 8825, 756 + "7efc7bba87dbde2d2c1083e91e9b7b9c5c5c6d07b40ca563e8"); 757 + FeedZipHtml(zip_buf, 8850, 758 + "8437fc321b340f8648e2b373f41d0262cd32e2772f95de0e0f"); 759 + FeedZipHtml(zip_buf, 8875, 760 + "76ce2d19b7f9f76a9c95e40dba3bc6002e9c57e53030f7028d"); 761 + FeedZipHtml(zip_buf, 8900, 762 + "32f5b6d6c87a4eda4527fe361e1badbc9eba2f153362bc719d"); 763 + FeedZipHtml(zip_buf, 8925, 764 + "6124fa6f9f0d93641cbfdad8b8bebe5e1fb89ebb36f0e2752f"); 765 + FeedZipHtml(zip_buf, 8950, 766 + "d9e8e39b5f1ff6c64e3c7631b50026dbb8f6be79ff87deaf23"); 767 + FeedZipHtml(zip_buf, 8975, 768 + "fec0e422ecbab8b50917b69f1890c1e9a3ba68141633d5d431"); 769 + FeedZipHtml(zip_buf, 9000, 770 + "511bdcb4103eab76930d2d86f38d2df3c90265062f24941d97"); 771 + FeedZipHtml(zip_buf, 9025, 772 + "553a2603c864af00a91dbdaf7f9c53d7e479414fb174fa0009"); 773 + FeedZipHtml(zip_buf, 9050, 774 + "8ebde0a3e56a8f1bec125aa77802020ae79cf90659888644bc"); 775 + FeedZipHtml(zip_buf, 9075, 776 + "dfaca572cb8fc93da90b80ef80403fd1531e5ff413aab88b09"); 777 + FeedZipHtml(zip_buf, 9100, 778 + "29f8d1386ac85e0e5427988c3a22ba23d14c083cca10a5394f"); 779 + FeedZipHtml(zip_buf, 9125, 780 + "9f6baac9f7a98c7c9f9a20df1c832c8c7cb7f5c8175e8be8d1"); 781 + FeedZipHtml(zip_buf, 9150, 782 + "d0cfbd29113f68b83bfde61ae49ec50f8e57c3c7237fee4d89"); 783 + FeedZipHtml(zip_buf, 9175, 784 + "fc414313f47b7cf237198f1f8bfc798125e104ebbdcf0f08ef"); 785 + FeedZipHtml(zip_buf, 9200, 786 + "94126a32723e9bf8675f4b9e0af78a69999dd2ec3874a9aafc"); 787 + FeedZipHtml(zip_buf, 9225, 788 + "67a7e7c17138aeccf905dc5e420e687848e4706fbe0b727881"); 789 + FeedZipHtml(zip_buf, 9250, 790 + "2563054bc7f1432287948ee3474b8ee39ad251420e687848e4"); 791 + FeedZipHtml(zip_buf, 9275, 792 + "90d2f11726c79d73cf6d72eeb96c1925cc8097441399a6a0e8"); 793 + FeedZipHtml(zip_buf, 9300, 794 + "cf619f9797c4ceefc2f7d7be05e1754069929d7375d674d92b"); 795 + FeedZipHtml(zip_buf, 9325, 796 + "f394942e0a478899f26c74d8da72aebf2539e7c34cbe509d2e"); 797 + FeedZipHtml(zip_buf, 9350, 798 + "11a4b0d1816713c78f77165fcd7ab5f92eb1f15d89e602ecfc"); 799 + FeedZipHtml(zip_buf, 9375, 800 + "fe6bbb1d02cb5b15986ab4a16d29ce20987be39894ab8325ac"); 801 + FeedZipHtml(zip_buf, 9400, 802 + "7ccf0d124ad12133d0010094848ec497c09289e87274d7e95a"); 803 + FeedZipHtml(zip_buf, 9425, 804 + "a6a92df59f2d33080e0b7cf2f6b9764f71020fe9a52adf20e8"); 805 + FeedZipHtml(zip_buf, 9450, 806 + "62a39cf333cd846a4e14321b9bca6bbc1cf3373df67df2bf84"); 807 + FeedZipHtml(zip_buf, 9475, 808 + "a204c978099bc131e82df933afb49c00e6a784a3f4a3191195"); 809 + FeedZipHtml(zip_buf, 9500, 810 + "e6bc295062f1931497bad0c52c70aafbe43213945279f66f2d"); 811 + FeedZipHtml(zip_buf, 9525, 812 + "ac266fe9ab043dfd4eca227d31b334ca688082ac2f6ef8dcda"); 813 + FeedZipHtml(zip_buf, 9550, 814 + "16047df333dcafbe9270949d1b8afb0233521a9651ce4bc745"); 815 + FeedZipHtml(zip_buf, 9575, 816 + "cd6ee4989a0d616618488e2acb98a6b8dcc52d67b153dd27b7"); 817 + FeedZipHtml(zip_buf, 9600, 818 + "99a094315cc91ea98398a66d94c7854d2cf7e93ce8abd86696"); 819 + FeedZipHtml(zip_buf, 9625, 820 + "3a5f091696b1cca5ce7cef4c5a63873d2ed962cd68b84add98"); 821 + FeedZipHtml(zip_buf, 9650, 822 + "db09cdefe61371fba6b5a4996ccb5eecba9631e1bd33e2b40d"); 823 + FeedZipHtml(zip_buf, 9675, 824 + "1a4f90bba1ef5b18511d7bb199934f567b36cc610891c501e6"); 825 + FeedZipHtml(zip_buf, 9700, 826 + "744ba403583d1fcb9fb81c354b5df83d80709f0c6d03a984ad"); 827 + FeedZipHtml(zip_buf, 9725, 828 + "dff50ada351be0d8b36b353f4de8da8cc9bfd08916438cf290"); 829 + FeedZipHtml(zip_buf, 9750, 830 + "fadda2e52f1d74582921ea7849844962bb29cf857d9507315d"); 831 + FeedZipHtml(zip_buf, 9775, 832 + "70ccaef7fcae4f4ebd28e3d45b97deeb08c3c96381c567620a"); 833 + FeedZipHtml(zip_buf, 9800, 834 + "2927471505a9e2a385d68a7e922da1f2fe14fc63058314f7df"); 835 + FeedZipHtml(zip_buf, 9825, 836 + "1c87946c7c7353ae72375ac274f7c92d993df511b2cc9d2f5d"); 837 + FeedZipHtml(zip_buf, 9850, 838 + "b61abb7479c799989fae5d2cd72ebffffaaefcd6051a51ac3a"); 839 + FeedZipHtml(zip_buf, 9875, 840 + "fa0e0e388491d9cce54b93e33ffc3b988e9d0dab6e61de55dd"); 841 + FeedZipHtml(zip_buf, 9900, 842 + "c2bcd3b73065087c34b7318a0befff32c62a0f662be15b7b85"); 843 + FeedZipHtml(zip_buf, 9925, 844 + "66e0d6295731cd0cfdf06f6214826d173156e41b1f1282b26e"); 845 + FeedZipHtml(zip_buf, 9950, 846 + "8f19b054e31a666173d8fd380b5bcb02a77a24b7305936339c"); 847 + FeedZipHtml(zip_buf, 9975, 848 + "162502aebf9242a87d19338961f515cc0246cf2e6c41b0373e"); 849 + FeedZipHtml(zip_buf, 10000, 850 + "c1e3b87fc9b250f692c0ca45c705659ebd4298015bb52e5f16"); 851 + FeedZipHtml(zip_buf, 10025, 852 + "364b61ad4d4e5372edd2f4621e801fb1d6ad8b85cb6a6c8ac7"); 853 + FeedZipHtml(zip_buf, 10050, 854 + "f91dcb7223302beeea5cb92c613a3b0a96b1c8654e7cefec39"); 855 + FeedZipHtml(zip_buf, 10075, 856 + "cb7d8b551356efa8c7f94d2f7f4730bb644fb96c59e8449635"); 857 + FeedZipHtml(zip_buf, 10100, 858 + "2f76554b98efde5970969b962c0bda5df9a5be0c6390cc7139"); 859 + FeedZipHtml(zip_buf, 10125, 860 + "ebea9fc3f350f39a6569f396e265a9cb5e3e048fee8ec5caaa"); 861 + FeedZipHtml(zip_buf, 10150, 862 + "99e654dcb3feec066cfa45cef397ba60911ebbfbb862296110"); 863 + FeedZipHtml(zip_buf, 10175, 864 + "fb6e3737e5ea5eb02c68b6bfdefdca3239e6ce372c2f6c372c"); 865 + FeedZipHtml(zip_buf, 10200, 866 + "612771bd406541c83f5dd9987aafc2a95ff21ef1effcb66527"); 867 + FeedZipHtml(zip_buf, 10225, 868 + "b65f99f2efb513ab98d239e3a7cbde21f971576c65a2a8de0d"); 869 + FeedZipHtml(zip_buf, 10250, 870 + "c84efcfbaf6d1bcee0e79275a3064a5fa665d5509a426f61a9"); 871 + FeedZipHtml(zip_buf, 10275, 872 + "6a6658349052de4dc8b778a856ba09a5cc0b400e476e90385b"); 873 + FeedZipHtml(zip_buf, 10300, 874 + "7b0ea1a014414af91671c42dd5ec91aaee1c67cdf8f103e1ad"); 875 + FeedZipHtml(zip_buf, 10325, 876 + "7736ddbb20cd39f2e26e5e7bc693f1388ce8665adc84588623"); 877 + FeedZipHtml(zip_buf, 10350, 878 + "d58244d124feeed5e0c56f07366e859f2b243a123ee52ccc0b"); 879 + FeedZipHtml(zip_buf, 10375, 880 + "f414695faebcc3129c2f3859d7f55d7c21fb1bd7603988dcf1"); 881 + FeedZipHtml(zip_buf, 10400, 882 + "d0ebc66c09d5567dbf8e7c1ba2e0e7a6549fca16260745cece"); 883 + FeedZipHtml(zip_buf, 10425, 884 + "f658c5144addc81b1763e156ef55fd22419e6d9f9d9ffe7bfd"); 885 + FeedZipHtml(zip_buf, 10450, 886 + "6539417e3d3e2282fc2a6e8721d0e3d88dbe4dc6ce11a67976"); 887 + FeedZipHtml(zip_buf, 10475, 888 + "07c24a0f8513cc3adaf7a23821c1e517cbf2467b200211e11b"); 889 + FeedZipHtml(zip_buf, 10500, 890 + "699c63a0eedd852f307de02b2eac214087f78c4ff5372e5f91"); 891 + FeedZipHtml(zip_buf, 10525, 892 + "8b84c1c37453c96da5ff03ad6f2b2f188d2d07fec70c0158ea"); 893 + FeedZipHtml(zip_buf, 10550, 894 + "83cc9a8110b8deb2d0871f0aec7f6067ff8345b03f0d8ad5e0"); 895 + FeedZipHtml(zip_buf, 10575, 896 + "8b5fde2f9fd7513b0792cb01be016a9adb99f8fc901ed4abb5"); 897 + FeedZipHtml(zip_buf, 10600, 898 + "bf755ed00a92219c8470e017eb371844a1d8b7b7ea84306774"); 899 + FeedZipHtml(zip_buf, 10625, 900 + "edc5ccfee124c1f483bcb9e977fdf8e5d6facd54b6867ee56c"); 901 + FeedZipHtml(zip_buf, 10650, 902 + "0d8d40e987cfd607b3b1b508ff7d717a62656d6e9a87bdb191"); 903 + FeedZipHtml(zip_buf, 10675, 904 + "73e8c6f7bd0bca55645812d0f66ff7cabda0adc439650c9e84"); 905 + FeedZipHtml(zip_buf, 10700, 906 + "0a5b16f654d6280c22d7458be9e2019d227968ae3e9cd0c36b"); 907 + FeedZipHtml(zip_buf, 10725, 908 + "34b738ffe52bfe46e76da6a4ca9d6d8e050a428d22844da6fe"); 909 + FeedZipHtml(zip_buf, 10750, 910 + "a5d98d64c9f213ca4fabd7f24ee6e17c17de14bb6e65baee9e"); 911 + FeedZipHtml(zip_buf, 10775, 912 + "5fd0f0f1100c41a5534a2679415f1a833b7f77f8bb5dcc1299"); 913 + FeedZipHtml(zip_buf, 10800, 914 + "effed23a11a6bb9c32cf3f2cf3d06799692861f374912de3df"); 915 + FeedZipHtml(zip_buf, 10825, 916 + "5c07e262fcc783175f89cffa22bc6ff5ccf1eff79421d51440"); 917 + FeedZipHtml(zip_buf, 10850, 918 + "04833883f2dcf6448f4e48ceafc609c926724eeb2c8c9383c3"); 919 + FeedZipHtml(zip_buf, 10875, 920 + "0b3250e0a78ee78369b2329523ece8305b5b8ec845283e4446"); 921 + FeedZipHtml(zip_buf, 10900, 922 + "20bccdc40556d7c47eb96f62c95cd02ee502764535cb031664"); 923 + FeedZipHtml(zip_buf, 10925, 924 + "98adc403c923e081f60c3cf0fee0bd8d05e0e7120e58c54445"); 925 + FeedZipHtml(zip_buf, 10950, 926 + "852dbada9fd22c5f006cc416eff74ed3c44ad26ff29eacb869"); 927 + FeedZipHtml(zip_buf, 10975, 928 + "fb31ae20bf19870125f99e794ffef829cddc54b6097ffcf4b9"); 929 + FeedZipHtml(zip_buf, 11000, 930 + "aad396ec745cd5e9851ac9daabdece6725b6d1d872fa837ed3"); 931 + FeedZipHtml(zip_buf, 11025, 932 + "71ec4be37ce48bd9c2d377e276c946d89eba11628fb58e1f76"); 933 + FeedZipHtml(zip_buf, 11050, 934 + "32ae478ce9aefcdab0802f6f6e73c85ce0d099d63f4bc477f9"); 935 + FeedZipHtml(zip_buf, 11075, 936 + "139b8da3c701d52a9c1193e1a52a91f3a801964d1d4cce5f67"); 937 + FeedZipHtml(zip_buf, 11100, 938 + "2df3c8755fbabacedbedd3b3d372b5de56465fdb0b6e6734f8"); 939 + FeedZipHtml(zip_buf, 11125, 940 + "368edd71e07dcbedf916b59da9d4a26ab3c4785b69e25e5f61"); 941 + FeedZipHtml(zip_buf, 11150, 942 + "1a28374b4e1bc896455eb8742a192949286bb9dca665567bf0"); 943 + FeedZipHtml(zip_buf, 11175, 944 + "f70866ec79030f73d40ec389df433703ad26ba123d06d19eab"); 945 + FeedZipHtml(zip_buf, 11200, 946 + "ddc869d8c2e39288e3cc88b080b778f502e72111110eb09aac"); 947 + FeedZipHtml(zip_buf, 11225, 948 + "3c4cadac63859a42851927539c47bd3289a98aebe7fdf3535a"); 949 + FeedZipHtml(zip_buf, 11250, 950 + "570b0e9cb9895c50c2bebfb29edba0caf1aa79cf44a0e63a8d"); 951 + FeedZipHtml(zip_buf, 11275, 952 + "3eb9f5e2557218fac2951581b056520b8b3a9c7fd8a75ff8d5"); 953 + FeedZipHtml(zip_buf, 11300, 954 + "cdfb9da30bfa7b8546445ce135f715576ba2124a9867114664"); 955 + FeedZipHtml(zip_buf, 11325, 956 + "1089b7b49f53a2df0bba3e96558021113d5436c80474031ae8"); 957 + FeedZipHtml(zip_buf, 11350, 958 + "c777ef4e295ff62c98bc8d3370aecfba55db3726b3b5e524f9"); 959 + FeedZipHtml(zip_buf, 11375, 960 + "475347a7efaaf7ea46eb6f950975cdedba5df7b072e78bae97"); 961 + FeedZipHtml(zip_buf, 11400, 962 + "f94b2eac6c8c9c95a2e1bbbed1da4bedc93cc3e9a66a63c860"); 963 + FeedZipHtml(zip_buf, 11425, 964 + "b2cc2dec1c9fdfe73dac36ac953acab32fec9743af3b442127"); 965 + FeedZipHtml(zip_buf, 11450, 966 + "2d4c4e6650134012d07ba0f9b3a3301ee4588616076eee9617"); 967 + FeedZipHtml(zip_buf, 11475, 968 + "fdd9c58e1534c9b63f80837aba60ac54e73b93382d5f575000"); 969 + FeedZipHtml(zip_buf, 11500, 970 + "6efc4a7bee7ff80996fb9172d9ffb4eaf01f9f337fd193cc9f"); 971 + FeedZipHtml(zip_buf, 11525, 972 + "10c5b2957f28c5ddc91e1ded2c4f4da9653e366c165b9c6a18"); 973 + FeedZipHtml(zip_buf, 11550, 974 + "394ce32d9e0165eabc48f6c90b634f7c5919957718bfd8b3e2"); 975 + FeedZipHtml(zip_buf, 11575, 976 + "051bee0b2dbb43d1fd16db3222231e3209c3eb9459c4fff0d2"); 977 + FeedZipHtml(zip_buf, 11600, 978 + "53258646150f922ae1675b17f624d9ccdb3590619342c6d0c2"); 979 + FeedZipHtml(zip_buf, 11625, 980 + "58759ed3bf69db5e756a4d88f6c71a0ff1e1e4d793d3df4f72"); 981 + FeedZipHtml(zip_buf, 11650, 982 + "d61b15ad577b0f181d576157c698d15f941f5a5b4ce58f7b0f"); 983 + FeedZipHtml(zip_buf, 11675, 984 + "e363e1c61354fc7632aae67b2566192d8f9f689933f2903058"); 985 + FeedZipHtml(zip_buf, 11700, 986 + "0ad46ee4a9d6b9a2eae61ae03ef75d0adb90dba407c6a31b24"); 987 + FeedZipHtml(zip_buf, 11725, 988 + "1e859fc4934e22cba56a4317fecd9b3015d02b284bb4bf9d91"); 989 + FeedZipHtml(zip_buf, 11750, 990 + "401dbbcae1ad531e08a1a16c1129f8753e9b67b62fef13ed17"); 991 + FeedZipHtml(zip_buf, 11775, 992 + "5ce40d8cf0be8844d0855f6ee3448c1c3839e80a85c520d832"); 993 + FeedZipHtml(zip_buf, 11800, 994 + "3c8aa40495dc50eaf5b09c5496e054ec810d4da18ab148ee80"); 995 + FeedZipHtml(zip_buf, 11825, 996 + "0ee74bc015dcc23f64a03532e078ecc3e9f06bca17bf635881"); 997 + FeedZipHtml(zip_buf, 11850, 998 + "2e9b18886bc3730da7366d5ef2568e15067867b7a815b237b1"); 999 + FeedZipHtml(zip_buf, 11875, 1000 + "e25ae566b13f1a2796984ad9301f67cffcf1b299bbc90d03f7"); 1001 + FeedZipHtml(zip_buf, 11900, 1002 + "82bffdd7cf5b9b9baf333b0263a3feb640d5228c3d412314e7"); 1003 + FeedZipHtml(zip_buf, 11925, 1004 + "6427858dadd2096275ae10887c64d70ab25f607c97654f512d"); 1005 + FeedZipHtml(zip_buf, 11950, 1006 + "f3127ed6af1743f9f247117f21cac36f14a52768fb924e0118"); 1007 + FeedZipHtml(zip_buf, 11975, 1008 + "5a85a6b0d638c693560523fc864ac3c607d45011a023e2c8bb"); 1009 + FeedZipHtml(zip_buf, 12000, 1010 + "ecfb2ebf8b51be383324ac9c4b9a1d7b5ebfd4e3e5107dc83b"); 1011 + FeedZipHtml(zip_buf, 12025, 1012 + "d4ded07dd81d0965d96ae2c82422c1c1379d1642b8b2ca75c3"); 1013 + FeedZipHtml(zip_buf, 12050, 1014 + "5dd867f09b35dffbc64ee9085db2183c1af3d8ad2b2fc45064"); 1015 + FeedZipHtml(zip_buf, 12075, 1016 + "f93806adad9e1bf59cd3835d3ebfafe82038f4e4793d2ce7c9"); 1017 + FeedZipHtml(zip_buf, 12100, 1018 + "756c6af3702f14b143ae52f4c6ba60d351a1d0241c039d065e"); 1019 + FeedZipHtml(zip_buf, 12125, 1020 + "1720a22d6c1a039fc399c6e602c934df89e14a4ce8854cd02c"); 1021 + FeedZipHtml(zip_buf, 12150, 1022 + "43674d8af6fec7b6b47491a4445e2ccf9a6a0ca093b42402aa"); 1023 + FeedZipHtml(zip_buf, 12175, 1024 + "5684d4a11f5689f571a16058df3e2a2eb497629af5604da4de"); 1025 + FeedZipHtml(zip_buf, 12200, 1026 + "13c0a79678dd4c7309274c61856999e41634c522d94d73558f"); 1027 + FeedZipHtml(zip_buf, 12225, 1028 + "80765a93780244bfe50b132a63cdd7335d7712132f3241bce4"); 1029 + FeedZipHtml(zip_buf, 12250, 1030 + "afca6064bbcb5dba8b09dde80961ddaa9014d9687d05a55a66"); 1031 + FeedZipHtml(zip_buf, 12275, 1032 + "28f69e79ff3afbe7cbb6ddd491d4725b4405e3bd58facf4718"); 1033 + FeedZipHtml(zip_buf, 12300, 1034 + "dd9184111ed23a725d88e6c1fc86d27e7025fcd0e685512d73"); 1035 + FeedZipHtml(zip_buf, 12325, 1036 + "e27d8ecfefd3158067613718f882118b523360ef897cc5bb4e"); 1037 + FeedZipHtml(zip_buf, 12350, 1038 + "de38f5d4d84bf12d9dd660f4042272c6982f2856be1c351663"); 1039 + FeedZipHtml(zip_buf, 12375, 1040 + "05830cbeb48e0f4f3eae3af0bf9f56565bc73b1ff51f8efa6b"); 1041 + FeedZipHtml(zip_buf, 12400, 1042 + "e723ffc51db37f61cfafe562b47f330631b73a48b9a9d409e1"); 1043 + FeedZipHtml(zip_buf, 12425, 1044 + "8eb0723936d82a172ec11f3107357463da1f8bb0d342591250"); 1045 + FeedZipHtml(zip_buf, 12450, 1046 + "4db2a3836e193a94cb522e956646af677a9b2d69299ffe28d5"); 1047 + FeedZipHtml(zip_buf, 12475, 1048 + "568eee134a0f5572dfc26df77be342cb49c20414467aedc280"); 1049 + FeedZipHtml(zip_buf, 12500, 1050 + "392d325d39088012f182819ae613da50ac7e25a244dcac5420"); 1051 + FeedZipHtml(zip_buf, 12525, 1052 + "e11c5fd2db71404d0f1005045701039d108e41186c1b7918fa"); 1053 + FeedZipHtml(zip_buf, 12550, 1054 + "002c80c0d11ff4410512ce05c6ef5bd4286041b6cda9099b93"); 1055 + FeedZipHtml(zip_buf, 12575, 1056 + "ac9cdfed8b57dca09d6b979fc092fb8eb674b2005094803de8"); 1057 + FeedZipHtml(zip_buf, 12600, 1058 + "e110edeef52a85e27f3b19b672242eb54d0123478c1f68021b"); 1059 + FeedZipHtml(zip_buf, 12625, 1060 + "c469f1933d663bdd0d89e8bbf07b1888d5da7719f48565249e"); 1061 + FeedZipHtml(zip_buf, 12650, 1062 + "0286aaa0e8fb30ea8aa35fcead24558df746d37f4f60019897"); 1063 + FeedZipHtml(zip_buf, 12675, 1064 + "b7c37979d7382f6fc7cccb4b404a31defdbdb5c27138caf87c"); 1065 + FeedZipHtml(zip_buf, 12700, 1066 + "93d00d8361a0c07fcf61328583933011aff87c6b1cdf9597d8"); 1067 + FeedZipHtml(zip_buf, 12725, 1068 + "4b045d6eb9a05ffbe42f4ed80c857d4306a791a10a5fc81835"); 1069 + FeedZipHtml(zip_buf, 12750, 1070 + "03d5f03f38b904a492021afe723aa44bfc4e250c185be220d6"); 1071 + FeedZipHtml(zip_buf, 12775, 1072 + "6c0e56222e0096d3ed52dcc5c047ff83b3eb87dd6ff4f6ef7c"); 1073 + FeedZipHtml(zip_buf, 12800, 1074 + "02e46fd14142aabc5ab365a4b7ab4753f3b1730847cdea4ee3"); 1075 + FeedZipHtml(zip_buf, 12825, 1076 + "b031c186b5e2a7d38451d1b90e2f3c31432d6690b46898294a"); 1077 + FeedZipHtml(zip_buf, 12850, 1078 + "293c9d3966618ac3b85a3918ed53b260a49e8405f18219c1d9"); 1079 + FeedZipHtml(zip_buf, 12875, 1080 + "52cf2256c84165d20b1468983dbd5168e8424579843bc96ca2"); 1081 + FeedZipHtml(zip_buf, 12900, 1082 + "ac3fa912e5b2200703253a3a9470f25ce3240893d766bfb5cd"); 1083 + FeedZipHtml(zip_buf, 12925, 1084 + "fc65a0c48f27e272c97833a12d8c73ca1b1e1be991c5b50761"); 1085 + FeedZipHtml(zip_buf, 12950, 1086 + "4e56b2d95c906475d86f2afffd5519b051f5319daba63364f3"); 1087 + FeedZipHtml(zip_buf, 12975, 1088 + "8cf8ea6133e25d6383233176bd281f1fec26095eb6caeb1bee"); 1089 + FeedZipHtml(zip_buf, 13000, 1090 + "e38c5c1f73040873d1df79e0f0851b7889f7a74865baa00672"); 1091 + FeedZipHtml(zip_buf, 13025, 1092 + "3d2af480ad6161a6496b1cc6b1d7f16f579c5882689825f80a"); 1093 + FeedZipHtml(zip_buf, 13050, 1094 + "659ab94201f515264bea0db4d5f8e84e223e32e045ef48c5bf"); 1095 + FeedZipHtml(zip_buf, 13075, 1096 + "63643afad0e140d14de257e9d3157a63017c283081059de8bc"); 1097 + FeedZipHtml(zip_buf, 13100, 1098 + "ae6058f4530ffd1e833aa362f829a6947f13506102d3717569"); 1099 + FeedZipHtml(zip_buf, 13125, 1100 + "26f3e546e55384fd003fdda5a481253e8e42978742df8ce909"); 1101 + FeedZipHtml(zip_buf, 13150, 1102 + "c76aef0af0d68f00028e31c38c1faafd35a9d4378c337e178a"); 1103 + FeedZipHtml(zip_buf, 13175, 1104 + "17c2d2912cd38364360441cba6a73e1df958874289600cceb1"); 1105 + FeedZipHtml(zip_buf, 13200, 1106 + "8883aca61e366f5dacb35e1bba57f0f98d2b93a47941d7eb09"); 1107 + FeedZipHtml(zip_buf, 13225, 1108 + "f63bc6891bd1cb557e24e36d8b80c6d1e44ecfae38663b7330"); 1109 + FeedZipHtml(zip_buf, 13250, 1110 + "859d498c9338bb325050740b017cd9f5dd387ee5a822313a80"); 1111 + FeedZipHtml(zip_buf, 13275, 1112 + "d84cf22e7f32736a9bbd72bf4b0eeaa48953b343667f54e833"); 1113 + FeedZipHtml(zip_buf, 13300, 1114 + "f3cba6cf814cfdb16e0f9a9a1215b55e7d943e17a3f04a9c4b"); 1115 + FeedZipHtml(zip_buf, 13325, 1116 + "012af35ada7acdcad0e66bbf19c65b055ef245e462d499f641"); 1117 + FeedZipHtml(zip_buf, 13350, 1118 + "3f16d1292aa63e7aa65127be314bafb06ca17f262b6bea760d"); 1119 + FeedZipHtml(zip_buf, 13375, 1120 + "b1c5d7d3e485c6a0508ea48b354a793be6d9e45d833917f1de"); 1121 + FeedZipHtml(zip_buf, 13400, 1122 + "5892d7dbfe4e24466d3399dd829fbf151fe5e1d79ad7548529"); 1123 + FeedZipHtml(zip_buf, 13425, 1124 + "759983d45444dc90f8950fb4b8565dcfc38b5460527afe927d"); 1125 + FeedZipHtml(zip_buf, 13450, 1126 + "f9c201061361bb5775e33cdd8c6b60ca54a65ed1a572a0dfd3"); 1127 + FeedZipHtml(zip_buf, 13475, 1128 + "a14dbafe9c31235dd6f8d6929df6a42951a1a6eab44b92f3ba"); 1129 + FeedZipHtml(zip_buf, 13500, 1130 + "c045148b13909a0ec480b2f11107ea29d7f3bbe89b7ce52083"); 1131 + FeedZipHtml(zip_buf, 13525, 1132 + "7b33ba99b60563bdbc33e825d3b6ce14e11d04770ae82dba13"); 1133 + FeedZipHtml(zip_buf, 13550, 1134 + "05856dee949d69324990eaa9bca007ff0c7057c1d7904a70c1"); 1135 + FeedZipHtml(zip_buf, 13575, 1136 + "80d51908c9d1bc5eb003e6d1bb7185e2bdab6dae1eb2b275ae"); 1137 + FeedZipHtml(zip_buf, 13600, 1138 + "387ecd78df9a9aecdfb921be2b71526e88e77b3c14434d5173"); 1139 + FeedZipHtml(zip_buf, 13625, 1140 + "b9e6f7203d83a6cc64dadeced1e1c9fe45fbfcf0e420269d7b"); 1141 + FeedZipHtml(zip_buf, 13650, 1142 + "767af4e9e0f4245ea5b8290a70894bcd8d0f41772a418a7d1e"); 1143 + FeedZipHtml(zip_buf, 13675, 1144 + "08490267122c8c2a0bd1136e9ce474044578e2efb8473c2909"); 1145 + FeedZipHtml(zip_buf, 13700, 1146 + "a924001fed509b2e39fd90363e103ecc0492ad65de6b2b5ec4"); 1147 + FeedZipHtml(zip_buf, 13725, 1148 + "1f613f0854ee47300de4b95ed4d70f9803a8a36c849eb2116c"); 1149 + FeedZipHtml(zip_buf, 13750, 1150 + "5e2a56100ec6b3f9827500e9064ccb4703cb04aa1896144f3a"); 1151 + FeedZipHtml(zip_buf, 13775, 1152 + "6b038da5123dc148cf9a8936b2a43d1e106d520df940099402"); 1153 + FeedZipHtml(zip_buf, 13800, 1154 + "d804950cfbdc2e39d4fc80e82377ac074a1c095d1394c99ec8"); 1155 + FeedZipHtml(zip_buf, 13825, 1156 + "6cc4497b3c20fa1c7f386a1f3e340547d950466124d55b2b5e"); 1157 + FeedZipHtml(zip_buf, 13850, 1158 + "698c42d3d55caedb43a3d583547829c152f09aa4da14b567f6"); 1159 + FeedZipHtml(zip_buf, 13875, 1160 + "7968f47a780ad0942e82ad214af16c3957918d5c45a7d20322"); 1161 + FeedZipHtml(zip_buf, 13900, 1162 + "dac1fee9f17efbfcd3eee9d1d1fe6efbf09e48973dded49191"); 1163 + FeedZipHtml(zip_buf, 13925, 1164 + "4ae198d781ac0b283e200aa55bd65aeabcccaac6352323c912"); 1165 + FeedZipHtml(zip_buf, 13950, 1166 + "a5309be5cd7552488baf37fa94d7abe1fd2f930d4dce6f18a0"); 1167 + FeedZipHtml(zip_buf, 13975, 1168 + "7302318f4eb741a2acadb97131a3b6cac15094ec12483475f3"); 1169 + FeedZipHtml(zip_buf, 14000, 1170 + "4258f3ca92e5ee824ccc32a9e4d60724553981b2cbd2fd88d1"); 1171 + FeedZipHtml(zip_buf, 14025, 1172 + "1c1234ef1139c732f3cace9d0e803918e6929af90f393578fc"); 1173 + FeedZipHtml(zip_buf, 14050, 1174 + "aeae324c7cbc96facb2e300fd99a9186eac96566d3279ca1cc"); 1175 + FeedZipHtml(zip_buf, 14075, 1176 + "a64b3e7e7a287a4433233fb7c4abaf2f3ab9da57ce3867268e"); 1177 + FeedZipHtml(zip_buf, 14100, 1178 + "ae54a0320b9b7dc59f1ffc923fcfb7e6e3f2351f3ffc351fcf"); 1179 + FeedZipHtml(zip_buf, 14125, 1180 + "49e88a557ffe6b2d3b559eff3d5f1ed17f94e51195cea7ef5a"); 1181 + FeedZipHtml(zip_buf, 14150, 1182 + "557e2cf2d1c79633a6d0a6337d852d037e6d6f2c33279f193f"); 1183 + FeedZipHtml(zip_buf, 14175, 1184 + "9d8dd39a7a3a4b7c78b36624f654af0b9d313fd7ece580954f"); 1185 + FeedZipHtml(zip_buf, 14200, 1186 + "f04aa5d2b2d17c9a1f89337e7a8f48bc6d128996bdebf3fc48"); 1187 + FeedZipHtml(zip_buf, 14225, 1188 + "9cf1d37b44e29ff3205107e1e8d3418ca66a662ccc6876e57a"); 1189 + FeedZipHtml(zip_buf, 14250, 1190 + "5411b214eb967de4787eaccff8e93d627dd420d6473361fdce"); 1191 + FeedZipHtml(zip_buf, 14275, 1192 + "79b1ff59b69fed4ea22bd8618bcf56bf7ee79bdc05c6e8965c"); 1193 + FeedZipHtml(zip_buf, 14300, 1194 + "35a56d2da78b9c4a58345957f372365fe40cdfdd139fbb92ab"); 1195 + FeedZipHtml(zip_buf, 14325, 1196 + "8d836efa8c989bb0bc7ca96ed80f7a2548532db3a1acfe570f"); 1197 + FeedZipHtml(zip_buf, 14350, 1198 + "0b61f41e7b0abe9c28bc66a9de7a86b83b12c120195ab2c472"); 1199 + FeedZipHtml(zip_buf, 14375, 1200 + "43190a6c6a527a17f8edf19ba413f66ed56be7cce27e7edeef"); 1201 + FeedZipHtml(zip_buf, 14400, 1202 + "4b85f1c30fa763111ca07ac2404a9d06337d114de199129615"); 1203 + FeedZipHtml(zip_buf, 14425, 1204 + "7662752689e3d1e2fbbe87c1549c5f2d7040dbe0bb6955f3c2"); 1205 + FeedZipHtml(zip_buf, 14450, 1206 + "f9266eaf41df29af87c206fc0fc3269f4967683fe7b217c409"); 1207 + FeedZipHtml(zip_buf, 14475, 1208 + "d3b2da30d9096426392e85249e12757914e7bafe72fdf9faf3"); 1209 + FeedZipHtml(zip_buf, 14500, 1210 + "1c62cd72bd2adad34824c05169b91bd378d50138c348a5b350"); 1211 + FeedZipHtml(zip_buf, 14525, 1212 + "392c806ad9cb3c9b9c9631d42a2627bf14beef8de3d0ebe553"); 1213 + FeedZipHtml(zip_buf, 14550, 1214 + "4fd5ddd11b1ffd2191d5698d64f66df4aec2515544b17c7a97"); 1215 + FeedZipHtml(zip_buf, 14575, 1216 + "e6b8ca2cb42ccf95f95011bfe3250ba7854215fbe1b58856d4"); 1217 + FeedZipHtml(zip_buf, 14600, 1218 + "cc699cf5683ce130632e9ca726314bdd96753e88849b38bb5e"); 1219 + FeedZipHtml(zip_buf, 14625, 1220 + "975e2e8ec75178e38d284e9805b90f3a0be6e46719d9107a72"); 1221 + FeedZipHtml(zip_buf, 14650, 1222 + "76ca82f1b1731406838d2337310a1dc4fc62f1da8827266b47"); 1223 + FeedZipHtml(zip_buf, 14675, 1224 + "f9fac7be1bb811d5f07cb07291d7c76722f288c04595ac9b5a"); 1225 + FeedZipHtml(zip_buf, 14700, 1226 + "0e15c8bb98447db75b532d8388dce5fbfb1484b1821b6521be"); 1227 + FeedZipHtml(zip_buf, 14725, 1228 + "2329f53b504d47f54b8e8859ebb4106262537155086e48cd2d"); 1229 + FeedZipHtml(zip_buf, 14750, 1230 + "668a0746e225abbb74f2278db70c31e1f7453d117b5da7d4fc"); 1231 + FeedZipHtml(zip_buf, 14775, 1232 + "941d6637c71a761203c3e10d28a241beb2a1eb4ecee88e99e5"); 1233 + FeedZipHtml(zip_buf, 14800, 1234 + "dd380ebb1ebd8d213b149fde108c9ebc7f1de812dff2958be0"); 1235 + FeedZipHtml(zip_buf, 14825, 1236 + "3b557cb4897fb0cf19ab4d7b09d60be3cc4a89fa63e08b986f"); 1237 + FeedZipHtml(zip_buf, 14850, 1238 + "580926cafa6326734bcd043db3969e3cfb72dded4977a8be4a"); 1239 + FeedZipHtml(zip_buf, 14875, 1240 + "ab89891b1591af458e66d5be8453cdf8d6a49569fdd3cc7b88"); 1241 + FeedZipHtml(zip_buf, 14900, 1242 + "57f820420244cba479e32264f2301d9338f9e2062f009845ba"); 1243 + FeedZipHtml(zip_buf, 14925, 1244 + "aedf9df8fc8079553edf9bc4047a4033c27907c68e31ed2f3e"); 1245 + FeedZipHtml(zip_buf, 14950, 1246 + "929d6ca3607347906be2e9c988b8114049dcf85b395b4ad18d"); 1247 + FeedZipHtml(zip_buf, 14975, 1248 + "50764b59133b719f27ee6c803b3348bf2706556c59091b3e8c"); 1249 + FeedZipHtml(zip_buf, 15000, 1250 + "a377893faa6d84ea73957d9bf236e3b0c0d83f9a9cfd9a60c3"); 1251 + FeedZipHtml(zip_buf, 15025, 1252 + "fd413fe2ebdcc25e11392017dd6fa050713f937b4d29031fc6"); 1253 + FeedZipHtml(zip_buf, 15050, 1254 + "bbf2817831cf30b794316b79d6f5fadf2ddb8078f839d75fa7"); 1255 + FeedZipHtml(zip_buf, 15075, 1256 + "b834728de053cd2e42cbaff957e901ff2afe6a38ebba2bce5b"); 1257 + FeedZipHtml(zip_buf, 15100, 1258 + "477ba2bae515c60fe3736bd033ff3e3bbdeb7ef544ed8a1a0c"); 1259 + FeedZipHtml(zip_buf, 15125, 1260 + "366a037c309e416d83070822aecbb0eeecc87f49473965bbc7"); 1261 + FeedZipHtml(zip_buf, 15150, 1262 + "678163976a0246e1643094c5fff41b6476fb51381d570de4f7"); 1263 + FeedZipHtml(zip_buf, 15175, 1264 + "c6253c43bd4f037d7a281c3533edd9b3c6464d2feabc63dcd3"); 1265 + FeedZipHtml(zip_buf, 15200, 1266 + "3144f95407133772e16b8ed8f53da1f4b904dd6901bb10f8e5"); 1267 + FeedZipHtml(zip_buf, 15225, 1268 + "2249e54cbcbe2d618d6cb138aa2c191aec5982f547b5b2d6e1"); 1269 + FeedZipHtml(zip_buf, 15250, 1270 + "1540e3934a121f8800bef6bd3f453343cf631cd520ac8c814b"); 1271 + FeedZipHtml(zip_buf, 15275, 1272 + "f37eeb32cf9c752066fc789c624215e8d4060b0670df2a1f3b"); 1273 + FeedZipHtml(zip_buf, 15300, 1274 + "2c64e0bbf1da99987c8373d28fae3f80c350321cb10ee2fab3"); 1275 + FeedZipHtml(zip_buf, 15325, 1276 + "f0a99103c12b0f28559439933eeb3657b0a8609c7ccf7b61a4"); 1277 + FeedZipHtml(zip_buf, 15350, 1278 + "c500f1e8a85f8ff89912d2b49f281a2fe2d2f5bfcb2e5df154"); 1279 + FeedZipHtml(zip_buf, 15375, 1280 + "ae8a857cd797ac27935159861eddd402c51f08955e26adb132"); 1281 + FeedZipHtml(zip_buf, 15400, 1282 + "cd7a9a6b807b8c2e28642d9759a94ca0ab4c889312d3e1a474"); 1283 + FeedZipHtml(zip_buf, 15425, 1284 + "fdab4e905b7f0d2be26ec33d9c4b5afe81f40bada7655e71e7"); 1285 + FeedZipHtml(zip_buf, 15450, 1286 + "4ab2056f37cb0d8c9d5ed98db76aa9c018e579c906bf7ca19f"); 1287 + FeedZipHtml(zip_buf, 15475, 1288 + "638fecda1c3e75a9a16caa9a0c959637eba24240312d95e1cb"); 1289 + FeedZipHtml(zip_buf, 15500, 1290 + "c452063d4e01444d4c229dbf93b33a19fdbdd148f4d0cfe2df"); 1291 + FeedZipHtml(zip_buf, 15525, 1292 + "3a1dd147331cc8a416c7b92fff1451b8863070169d9b8ae499"); 1293 + FeedZipHtml(zip_buf, 15550, 1294 + "e67f3b8eca26541c5266355a41e74340852165e222126e0db7"); 1295 + FeedZipHtml(zip_buf, 15575, 1296 + "aaf0876ea2be7501f54031b3f5145e2d789cd88a0a6f51a188"); 1297 + FeedZipHtml(zip_buf, 15600, 1298 + "40a61a15bdf283c885288d7711c97496b2f38e95d9a633f172"); 1299 + FeedZipHtml(zip_buf, 15625, 1300 + "665c1e03839de3bb5dc50dcc096ed2185f2e84192a23a0cce6"); 1301 + FeedZipHtml(zip_buf, 15650, 1302 + "d9344d2de2373bf87dd0d9831d3c5dc53d92b13c22cb685c00"); 1303 + FeedZipHtml(zip_buf, 15675, 1304 + "0961e8c74f41859ffba21fe7952ca19fd138879e9c4ec4458c"); 1305 + FeedZipHtml(zip_buf, 15700, 1306 + "bf4c4202f48f44e3def9a8f973d9515379cabe1881304fe1bd"); 1307 + FeedZipHtml(zip_buf, 15725, 1308 + "9ded5dc06e14daeae6aa96f2c81cfbe96896efee31bca32bc1"); 1309 + FeedZipHtml(zip_buf, 15750, 1310 + "a4e88e55e77ae87587cec8bd65f7ea24c19803c79eef2e1f1f"); 1311 + FeedZipHtml(zip_buf, 15775, 1312 + "b51309d772ea815f678b6aca1e5f66fffc1eb1e902b41c0a65"); 1313 + FeedZipHtml(zip_buf, 15800, 1314 + "d5e0258b692800a9f1d1171d7bd487fee7edf6e9d9e974842e"); 1315 + FeedZipHtml(zip_buf, 15825, 1316 + "39f088e66d24e6e8620c3dee35dca88eeca62915bd082fbe23"); 1317 + FeedZipHtml(zip_buf, 15850, 1318 + "2fb97db6bd9bfec1fb434139a61d1eb8904ab270e88301b673"); 1319 + FeedZipHtml(zip_buf, 15875, 1320 + "88bb7c9ae59a1dc5fad5293a1b4c2f733ff48143e8a17c188d"); 1321 + FeedZipHtml(zip_buf, 15900, 1322 + "608c5734039900d92ccc18a94143bf755ace4be77f3b6787f0"); 1323 + FeedZipHtml(zip_buf, 15925, 1324 + "3fb00fb590b75600391bd0807feb20b715d9c1f8618591a512"); 1325 + FeedZipHtml(zip_buf, 15950, 1326 + "04d03c1b6a22cbac5e221311a4798f69a7e10031a20ae731ce"); 1327 + FeedZipHtml(zip_buf, 15975, 1328 + "048ed1efe427cfaed1cb94357ba5e649a7e49576b637394973"); 1329 + FeedZipHtml(zip_buf, 16000, 1330 + "de51e662005f9f33e42bc672e2a13bcee65b56a35c09c0384c"); 1331 + FeedZipHtml(zip_buf, 16025, 1332 + "4d43d14d31887d20e01bb4ca568cd179f0640898ec511de0f2"); 1333 + FeedZipHtml(zip_buf, 16050, 1334 + "41690dd203640e9c1f8cee6701371446d2f7b11008da6e34f0"); 1335 + FeedZipHtml(zip_buf, 16075, 1336 + "6bc721bdc026a11a413a76b0f636c827b4caaf10738292c966"); 1337 + FeedZipHtml(zip_buf, 16100, 1338 + "333b736e876caa6799ab3bc775fa5a3953433d2524d10b3548"); 1339 + FeedZipHtml(zip_buf, 16125, 1340 + "da9e3818389360e4502173357b957aaa14a08cda71e3788219"); 1341 + FeedZipHtml(zip_buf, 16150, 1342 + "b28d24dbbcb2423e6a3b90c4671a0033698cb26de29ab36bcb"); 1343 + FeedZipHtml(zip_buf, 16175, 1344 + "393fbd85ddadfb6ab51abac3f6bafcbd8fb396b39a723b70de"); 1345 + FeedZipHtml(zip_buf, 16200, 1346 + "7294a12d5fd7041c234a85a65193701ca856196945b1e27eb9"); 1347 + FeedZipHtml(zip_buf, 16225, 1348 + "b8ed524ac44c1b260653fdf4a8f6ccbb9ecafe559e45408af5"); 1349 + FeedZipHtml(zip_buf, 16250, 1350 + "233c8339cd1cc054d52c7bc094d9da72c688aebc3a34fc0b17"); 1351 + FeedZipHtml(zip_buf, 16275, 1352 + "76ffc5dc83dce32da03060463b785cea1a3a998c546d308d43"); 1353 + FeedZipHtml(zip_buf, 16300, 1354 + "a066b1c57eb96af6a8468ef582353fc71c43f01ded7c703c88"); 1355 + FeedZipHtml(zip_buf, 16325, 1356 + "7b5a2f8be4123a990bb4dcd1669a4b10507eb35ac1fd8d0e7c"); 1357 + FeedZipHtml(zip_buf, 16350, 1358 + "9ff8c6d063632d5c109d2b28ebfad61e9b4f3abe84c2cf6398"); 1359 + FeedZipHtml(zip_buf, 16375, 1360 + "d6ebc31f6585cdeface0379f976978b49acc249d8f50d1371a"); 1361 + FeedZipHtml(zip_buf, 16400, 1362 + "e671a0abee58b551da9ccd4364a2b0963a997fa007a2527ade"); 1363 + FeedZipHtml(zip_buf, 16425, 1364 + "95d7c3423b26c64a548b32cd2d6a453755a2a15cfe4b139536"); 1365 + FeedZipHtml(zip_buf, 16450, 1366 + "3af03dab9542389a0cb9e9eac5c8824b198d43db3467f68b8b"); 1367 + FeedZipHtml(zip_buf, 16475, 1368 + "5fdc9b2adaccaba26408c67082af1552b35a60fa2c2c6a2e4b"); 1369 + FeedZipHtml(zip_buf, 16500, 1370 + "0441bf2158eace95e73ac7efcebff72480c79d681fab5c5912"); 1371 + FeedZipHtml(zip_buf, 16525, 1372 + "dcc816e6facd3c2703c3e3ef5b85dfa7289abb5f8135198acf"); 1373 + FeedZipHtml(zip_buf, 16550, 1374 + "cc5e1690ef34108baf82f0079b74321b6cc93289545a8c19b0"); 1375 + FeedZipHtml(zip_buf, 16575, 1376 + "44d70101f6bcf80ffb4da8d1f844a04608c44e1c742248b516"); 1377 + FeedZipHtml(zip_buf, 16600, 1378 + "9a44434ae14248158ec6c92d3a0faa48d70e27dda16def4fdb"); 1379 + FeedZipHtml(zip_buf, 16625, 1380 + "9e08d718e1c83192469176c3d128c4fce7c9b510419e8c78ef"); 1381 + FeedZipHtml(zip_buf, 16650, 1382 + "2777b14920298d7f74b0d8a2abea24ea8faaa8fc3bd552b512"); 1383 + FeedZipHtml(zip_buf, 16675, 1384 + "999b9e68dc94f604d2d18b257ac848a18ed233cbfe3f266e15"); 1385 + FeedZipHtml(zip_buf, 16700, 1386 + "ad4eaf44e4bb63bb48aac6277a2d4b99c254139fc5d54d6157"); 1387 + FeedZipHtml(zip_buf, 16725, 1388 + "4fca78389df314fdc5e9f764e761654fafdf17546a9a2eb73a"); 1389 + FeedZipHtml(zip_buf, 16750, 1390 + "215ab875c4f65081666786b4f9891de67976aa330052caf6c0"); 1391 + FeedZipHtml(zip_buf, 16775, 1392 + "c3aaa5e855efc1712011af9cd9b65c3c5bd0965b4ad17d98c5"); 1393 + FeedZipHtml(zip_buf, 16800, 1394 + "0fc722aea22ba556bb6a94b4663d641e3e0fc64226a933fccd"); 1395 + FeedZipHtml(zip_buf, 16825, 1396 + "66e9d3a755e7b6aaf166abeacbf2c686f1f32016d0bcecf29b"); 1397 + FeedZipHtml(zip_buf, 16850, 1398 + "0bbc5957594f289504268e80115d4e45475901fab2ce485e5b"); 1399 + FeedZipHtml(zip_buf, 16875, 1400 + "71e95f4eb74fe3b878974d97d17c8a641d2aba78ef8b9b66e7"); 1401 + FeedZipHtml(zip_buf, 16900, 1402 + "d649ae43f4b347708457857631c5f4cd26a292934ca3d0d16f"); 1403 + FeedZipHtml(zip_buf, 16925, 1404 + "5b8824faad5e5ca0faef416aa64249dfbb2927da61eaeb25a0"); 1405 + FeedZipHtml(zip_buf, 16950, 1406 + "ddaebc3db6ee33aaf16997b95372832984e4ada4d276dc2cb5"); 1407 + FeedZipHtml(zip_buf, 16975, 1408 + "1defeea5da2af752593d53dfb9438a7c4e1671e1df1bdc4fe9"); 1409 + FeedZipHtml(zip_buf, 17000, 1410 + "beb4a941971debf50804b4d20786196604fb1d4b7467b9ebab"); 1411 + FeedZipHtml(zip_buf, 17025, 1412 + "41bf97c90b0b72a73d71c37c67c4dabeb652475b735e36934d"); 1413 + FeedZipHtml(zip_buf, 17050, 1414 + "16e3bb7be29226bc7b4d39f6cabc7a8db9f44c865a889ff089"); 1415 + FeedZipHtml(zip_buf, 17075, 1416 + "9f2af6a04a2f62295394bb0f1bf41d9a8cb12097e4136bccb7"); 1417 + FeedZipHtml(zip_buf, 17100, 1418 + "21dd9bbf72370ae3d8b6c1c98686d9aeb9519fb86e215c773d"); 1419 + FeedZipHtml(zip_buf, 17125, 1420 + "0c63a31c182e931343d2b0947f8d6ab7b837de6832323a6606"); 1421 + FeedZipHtml(zip_buf, 17150, 1422 + "e654a6b9a979022fe8fa931e6c9672cbe58155441aae36cbb9"); 1423 + FeedZipHtml(zip_buf, 17175, 1424 + "ab9583494709dd77c3a7c223cf157c0c4355707d952b7721fe"); 1425 + FeedZipHtml(zip_buf, 17200, 1426 + "551d41b808c7ff13fb377a3550cbfb56ee7a6bd0ef96d19c8b"); 1427 + FeedZipHtml(zip_buf, 17225, 1428 + "71e73df1ceec0ebf4a675f05c75c5162df22bfe0ef8d734b43"); 1429 + FeedZipHtml(zip_buf, 17250, 1430 + "83cee3fafd5e386133cb0688f14a530b7b88de3b4b0a44ddb4"); 1431 + FeedZipHtml(zip_buf, 17275, 1432 + "08366868dc274ea8e284bc4e20bce3ed580943e41f109fa397"); 1433 + FeedZipHtml(zip_buf, 17300, 1434 + "de92ae16fdfda707bb4ed70dc200a35f29f6d505cc08f2e3eb"); 1435 + FeedZipHtml(zip_buf, 17325, 1436 + "2b501e60563aaf3a637c731905c76e127937d85e3f25606353"); 1437 + FeedZipHtml(zip_buf, 17350, 1438 + "b6c54df210362bc2f87bf50cd30bf00694ef4ef02de124c941"); 1439 + FeedZipHtml(zip_buf, 17375, 1440 + "9e7ddeeb8c39f53abea98555b8ce3012fdb7cf8649328e5f6d"); 1441 + FeedZipHtml(zip_buf, 17400, 1442 + "6c8860fddafbe68df125ed7a180d36f0af8dbdfdb57f1d1e3f"); 1443 + FeedZipHtml(zip_buf, 17425, 1444 + "dbe6ff4bb733f4e848dbf18f4a4c54fe18d3ceb25d43399831"); 1445 + FeedZipHtml(zip_buf, 17450, 1446 + "94f392e2fd31be8acc207618fabdb82c8b0f303d88c29a4520"); 1447 + FeedZipHtml(zip_buf, 17475, 1448 + "9cd65918270787176bf8a679a509f9900ca918b401f62f1bf1"); 1449 + FeedZipHtml(zip_buf, 17500, 1450 + "2e32dc09a292e7010d025e6b9a856f1238d3aa7cc29b67580e"); 1451 + FeedZipHtml(zip_buf, 17525, 1452 + "4d883c4adbdc4b93e1bacac68f613918f6f085c5ed2b3dcacd"); 1453 + FeedZipHtml(zip_buf, 17550, 1454 + "1c0446c480eb59010cc7d8069ca69ff7c292011984811e3e0d"); 1455 + FeedZipHtml(zip_buf, 17575, 1456 + "1ee183719aff1d7b836f9d93b0279cf3892fe8482bf0d180e7"); 1457 + FeedZipHtml(zip_buf, 17600, 1458 + "63467c14c0a17ca13c2555403e2542679be2295e39b0236c1c"); 1459 + FeedZipHtml(zip_buf, 17625, 1460 + "9fee6d392dc284bcce902913e96db3f1541727371f8df7f483"); 1461 + FeedZipHtml(zip_buf, 17650, 1462 + "dd49f02d08afa5ee58c93f5b87e9b678bafda037e6ebb2428f"); 1463 + FeedZipHtml(zip_buf, 17675, 1464 + "17dc83d221c030889c8ade2f65ef3008cb3ba72fd67fd8c929"); 1465 + FeedZipHtml(zip_buf, 17700, 1466 + "069d128ad446ae9a2255e81037988c98339cc3c2052e8d6a84"); 1467 + FeedZipHtml(zip_buf, 17725, 1468 + "20cb47f81da671533200c376872d2abe98a3f9c845a748efca"); 1469 + FeedZipHtml(zip_buf, 17750, 1470 + "05f61990e35f1550f7627e00e276873c2b5eb8e3af8062d099"); 1471 + FeedZipHtml(zip_buf, 17775, 1472 + "68054462885e912b213d2c48a6bc8ef39258f8fd955cca6620"); 1473 + FeedZipHtml(zip_buf, 17800, 1474 + "d7388c630f0388328cc9908db0be86be9bc0c09b8150cf9a34"); 1475 + FeedZipHtml(zip_buf, 17825, 1476 + "b1cd07e17f4ce28412e6e757ce8b2626e98613bfc7d8c367ef"); 1477 + FeedZipHtml(zip_buf, 17850, 1478 + "b8f5c947ea60c9a067456b6a80552032d1c2015011e2126cbe"); 1479 + FeedZipHtml(zip_buf, 17875, 1480 + "56fe221594148e45e42a4a31782e4b150c3614eed5ad232b84"); 1481 + FeedZipHtml(zip_buf, 17900, 1482 + "a8e8220fa338a919dfacaf82f06228131a56842511d1ee4c4b"); 1483 + FeedZipHtml(zip_buf, 17925, 1484 + "0b43f2804ee209f5d73c708d6b4a0b0760426c2ceb62b89cb4"); 1485 + FeedZipHtml(zip_buf, 17950, 1486 + "dca3b4d2db09e69bee5074bf61ed82443b61a9e4ce2afa5ec5"); 1487 + FeedZipHtml(zip_buf, 17975, 1488 + "fa601d55c0e96ffbe7473b6717cee9b9d33efdb0fbcb3efdf3"); 1489 + FeedZipHtml(zip_buf, 18000, 1490 + "f0a4bd7f7eb1bfdbbe40056138e57e371ece9b691bd4968ad9"); 1491 + FeedZipHtml(zip_buf, 18025, 1492 + "cd6448514ad675251425a70a03f5d6b0446eef316da47ecbd8"); 1493 + FeedZipHtml(zip_buf, 18050, 1494 + "5cda1e9bc512bbbb6edf979219737a379b1a2ea8ea185826ee"); 1495 + FeedZipHtml(zip_buf, 18075, 1496 + "23afe73f904b303da00fd67232c86cb86e17131ff4221f1f84"); 1497 + FeedZipHtml(zip_buf, 18100, 1498 + "70f7bc3821c1790a0db21fc6f62482ace121d432a7d5373507"); 1499 + FeedZipHtml(zip_buf, 18125, 1500 + "d922c65fb6bbcf7815aa394d5fa7d3aac8d14aeb6849cbc44c"); 1501 + FeedZipHtml(zip_buf, 18150, 1502 + "b6b27b7e8137ec09e627b36abd7991d4509eb87b98fe419370"); 1503 + FeedZipHtml(zip_buf, 18175, 1504 + "a989e534387fa58296657bfb5982bc56163062b6cec88bab4e"); 1505 + FeedZipHtml(zip_buf, 18200, 1506 + "e40683f202265f985763cc232459d53cf561067b1687864285"); 1507 + FeedZipHtml(zip_buf, 18225, 1508 + "399fd3d9f9e9bfd75f5a39913c0aadcd15e555287025804118"); 1509 + FeedZipHtml(zip_buf, 18250, 1510 + "20f810eff2872dfac1e34aea327c871371110652abff83341e"); 1511 + FeedZipHtml(zip_buf, 18275, 1512 + "d5c83187119aa5f98caa7fa89fec07509c3476f05485550af9"); 1513 + FeedZipHtml(zip_buf, 18300, 1514 + "204789a7648037b7e3d8b212d6d929188cb1bae5f422ae6e08"); 1515 + FeedZipHtml(zip_buf, 18325, 1516 + "10bf7cb1f54fa745e50a7f3fb8f8f9e5ca2a1be9190869fc0c"); 1517 + FeedZipHtml(zip_buf, 18350, 1518 + "94c037aa86a079aa399489aff81c44e9af92dcd9167166929d"); 1519 + FeedZipHtml(zip_buf, 18375, 1520 + "50d775e9583089f94c0587027cd96fd280864febc5b0018dfd"); 1521 + FeedZipHtml(zip_buf, 18400, 1522 + "5f518dfbec98ce5b87694466350a351c0e103fa3105fd677bb"); 1523 + FeedZipHtml(zip_buf, 18425, 1524 + "93089fd573f9462e26d83376639a4b49b33edcbda21b6c9029"); 1525 + FeedZipHtml(zip_buf, 18450, 1526 + "7eb8a017c7188e294df18044bdcbf50ecd21b57298300241e2"); 1527 + FeedZipHtml(zip_buf, 18475, 1528 + "ddde82ccb197d6706d829294a17296f169298cbe67a32c734f"); 1529 + FeedZipHtml(zip_buf, 18500, 1530 + "2ff34b97dcd443eb9c0693f99bfdb2bea1b1ef6907b7d48852"); 1531 + FeedZipHtml(zip_buf, 18525, 1532 + "f142d64bf05ce738bfdb57445473f491dd68566d4d53a9d991"); 1533 + FeedZipHtml(zip_buf, 18550, 1534 + "1f268db08a223ab7553c18184b3dbd6c45b43a243af81058c5"); 1535 + FeedZipHtml(zip_buf, 18575, 1536 + "887f6f0081ea0ec505830226ed84bddb6da53a4dfcfdfcbcdf"); 1537 + FeedZipHtml(zip_buf, 18600, 1538 + "7fa63c83a763111c78fc348d6ca3825f0f406708c9b324d338"); 1539 + FeedZipHtml(zip_buf, 18625, 1540 + "52eecebeef218ff2711e36dcff39f212f2b96105b79ef34ddc"); 1541 + FeedZipHtml(zip_buf, 18650, 1542 + "5e83359677a0c0ff30681b125293a31ac5c503e52864211dc2"); 1543 + FeedZipHtml(zip_buf, 18675, 1544 + "dc24f7cc2cbfb37efb08f0c9e58738a1278f03189b6cbb0330"); 1545 + FeedZipHtml(zip_buf, 18700, 1546 + "400668daf4f50e3dd9d6e8b461fce27654a55533cd4d2bd6c6"); 1547 + FeedZipHtml(zip_buf, 18725, 1548 + "077f9894b3e8d6f87624fb576a5979fe69f9e1802e213f9e9e"); 1549 + FeedZipHtml(zip_buf, 18750, 1550 + "d30dd3d8ed56544f7d37c1218bb4e4df4b046195ccd5f2b31a"); 1551 + FeedZipHtml(zip_buf, 18775, 1552 + "74f8cfc4ed6169d7580c388f96e5c0564df0fb81e0e1708534"); 1553 + FeedZipHtml(zip_buf, 18800, 1554 + "71f196a343a8e00269fa9c89be5abcdaa32f9547f89ad2ec12"); 1555 + FeedZipHtml(zip_buf, 18825, 1556 + "6e3c9dbb4c7f423e2cb9a5614e5e36edcf458ea90c9f75e640"); 1557 + FeedZipHtml(zip_buf, 18850, 1558 + "06ec92476ad673a22ed1e35cd23b4d02756633f395b948a988"); 1559 + FeedZipHtml(zip_buf, 18875, 1560 + "8e807c145285d670052f9e97b9dc38e2f14adcfc32f12de9bc"); 1561 + FeedZipHtml(zip_buf, 18900, 1562 + "d2b6393782b9067838dc93d129b41467086b51245ed469b233"); 1563 + FeedZipHtml(zip_buf, 18925, 1564 + "f371124e665f70618a79ba4e5f50ec445c5dc18638e0177712"); 1565 + FeedZipHtml(zip_buf, 18950, 1566 + "f7c2a8df2ff78f17ba2cca51bed0899abde9329ca91aeaa96e"); 1567 + FeedZipHtml(zip_buf, 18975, 1568 + "55edb7c9041295c611e9812fd5c0cfb67de1467cfdc9a42da1"); 1569 + FeedZipHtml(zip_buf, 19000, 1570 + "ea2968bb3891b58a0baf8ffa7dd814a931154cb31872e4f6bc"); 1571 + FeedZipHtml(zip_buf, 19025, 1572 + "495cba359496d8a637484d0fbe10ba4d2bb3cc326f7a020126"); 1573 + FeedZipHtml(zip_buf, 19050, 1574 + "5ff49335acfdc34eb496ae93853101b42ac4b5f2a2724989c8"); 1575 + FeedZipHtml(zip_buf, 19075, 1576 + "1b0cf31fe9fa98e64721e1cde9d2ba75d4023997e9d25cc648"); 1577 + FeedZipHtml(zip_buf, 19100, 1578 + "e0edb7b812910a68d781053dd8dda89417dea71b63a5553c42"); 1579 + FeedZipHtml(zip_buf, 19125, 1580 + "80c5c34d68a044464ff345dda2e3986b6840c154478727fb17"); 1581 + FeedZipHtml(zip_buf, 19150, 1582 + "edf3c39303aacfa5eedfdd98cde1afe5362e0d75816b2eb38d"); 1583 + FeedZipHtml(zip_buf, 19175, 1584 + "0a5de6e2955507497219469784e69238263b9fde0f040f8c99"); 1585 + FeedZipHtml(zip_buf, 19200, 1586 + "9925ad9cba2239827f91f6d3dd18d336e27db0e7d08d44efcc"); 1587 + FeedZipHtml(zip_buf, 19225, 1588 + "4d86b69c4f6963edcda7e6e9abd19197c5482d798a3afe70d4"); 1589 + FeedZipHtml(zip_buf, 19250, 1590 + "3e34508ee117f938272ec722df5a632d44ae7512d3c2c90857"); 1591 + FeedZipHtml(zip_buf, 19275, 1592 + "77251c0553c14dc4448e31141018f6c0f2d4a7988b9dfdbbe3"); 1593 + FeedZipHtml(zip_buf, 19300, 1594 + "106f432e4bea41dafba5a51b4dd9ef476e57556dacdaabecb5"); 1595 + FeedZipHtml(zip_buf, 19325, 1596 + "ee163bd382e83f5675a315d4385c48c28b701bf174171cd0a5"); 1597 + FeedZipHtml(zip_buf, 19350, 1598 + "0f2e2d7d699756cea12b3b5d0829c72e7acdc8616102822faf"); 1599 + FeedZipHtml(zip_buf, 19375, 1600 + "e164b57159a5323d44316c146549b7513ec6e060b5c87236ea"); 1601 + FeedZipHtml(zip_buf, 19400, 1602 + "dbc272eaf3d0fe7f261e9b5ec9a52ade3395a18a1fd969ae8d"); 1603 + FeedZipHtml(zip_buf, 19425, 1604 + "c5129a4b92cb9a54b538aca9a91dfbdc0be239345580e62205"); 1605 + FeedZipHtml(zip_buf, 19450, 1606 + "5e651c2be543ce68a6c9ac760cc68c8c3e2994dd22154617b3"); 1607 + FeedZipHtml(zip_buf, 19475, 1608 + "ea8a5f6d8ec7c60dbfd3caef9db5f399c1817c8057b668da69"); 1609 + FeedZipHtml(zip_buf, 19500, 1610 + "14230b0a0a2b351743485da910270d442c973aa03a61851346"); 1611 + FeedZipHtml(zip_buf, 19525, 1612 + "6654465bc30271446256a94fcd2e768e2b2f623cf550b89819"); 1613 + FeedZipHtml(zip_buf, 19550, 1614 + "16c4cbd26133b332a428041d53d8d77e4cbce7664cf0faa035"); 1615 + FeedZipHtml(zip_buf, 19575, 1616 + "ad3aa2a31328f481d64da1acae45b76ef5186bac631b66918b"); 1617 + FeedZipHtml(zip_buf, 19600, 1618 + "49475556b3f2876eb7932ec612e09753f740e5a013416f7ae7"); 1619 + FeedZipHtml(zip_buf, 19625, 1620 + "4adbffc100d52c179e2b2e348b3c0b697aabd52aeee22b0dac"); 1621 + FeedZipHtml(zip_buf, 19650, 1622 + "50472b6503aee7083e20c81069e62cb5ae38cb4e794e522a8c"); 1623 + FeedZipHtml(zip_buf, 19675, 1624 + "625ebcc8e01e15756306f14bc72a872c4d1597e6187697a5aa"); 1625 + FeedZipHtml(zip_buf, 19700, 1626 + "449d99ad733a9f4a2a1f3739f022d886f79933a5651842e502"); 1627 + FeedZipHtml(zip_buf, 19725, 1628 + "55aa28e1b7095b3393830e999ee121832f3eef9f9f96dfaa5c"); 1629 + FeedZipHtml(zip_buf, 19750, 1630 + "0c6183863991976dc7b4b4754e7496b8059a1c7871748a2598"); 1631 + FeedZipHtml(zip_buf, 19775, 1632 + "acbaec6f479641a4c01d5b8803bfce1e479b84be88ea58a5e5"); 1633 + FeedZipHtml(zip_buf, 19800, 1634 + "27ec25cebb18d2820121aed36aa2d9e335be67e1573b1c4837"); 1635 + FeedZipHtml(zip_buf, 19825, 1636 + "dae4d0893844b97c16c3ea9f3957027439851182fed497461c"); 1637 + FeedZipHtml(zip_buf, 19850, 1638 + "882b6301b0a6a8ec255ff4c0f6001fa7744f51e2a5174e9812"); 1639 + FeedZipHtml(zip_buf, 19875, 1640 + "210a7d87efc7f08331bd718bd5b39d268f62b25492ed528a1a"); 1641 + FeedZipHtml(zip_buf, 19900, 1642 + "9abe1a6f70d86639035d328140878ce68a9674ade1c334f8e0"); 1643 + FeedZipHtml(zip_buf, 19925, 1644 + "78bf7dfe69f7f4e8687fb77d787ab2a2431f35ea47221ac867"); 1645 + FeedZipHtml(zip_buf, 19950, 1646 + "5d9a6dd4feaa7942a38328571883def3dc3a228a4272f189a0"); 1647 + FeedZipHtml(zip_buf, 19975, 1648 + "1b4e7019c21e56599f8877a3d52327095b61075a67d363c124"); 1649 + FeedZipHtml(zip_buf, 20000, 1650 + "1c088c794daf8ba6459b344f3bdcff8e0148cbdeab9be6a4df"); 1651 + FeedZipHtml(zip_buf, 20025, 1652 + "3cdf374dc1947260da728cb8e5c1174091ba3c09367695e79c"); 1653 + FeedZipHtml(zip_buf, 20050, 1654 + "a1ecadc9a33d55866d6d6eeb694d8f354ca5157dd9a46ec9b4"); 1655 + FeedZipHtml(zip_buf, 20075, 1656 + "348953368b0cf3c6579251c74b227cc26c5461e3d09628166c"); 1657 + FeedZipHtml(zip_buf, 20100, 1658 + "458099cfdbc52b0ad7a34175c81ead8e22d571600059b33c9e"); 1659 + FeedZipHtml(zip_buf, 20125, 1660 + "64dd381623dc38a1c7087d12219d2c5a32ebc28a712269c52b"); 1661 + FeedZipHtml(zip_buf, 20150, 1662 + "eb0be0d77713cfefed0024b6381cd93427bfcef3fdbdf1ebd9"); 1663 + FeedZipHtml(zip_buf, 20175, 1664 + "e9d1a783d3933cb31a3f3f6e4e4d1969116c3ae6baaf0be251"); 1665 + FeedZipHtml(zip_buf, 20200, 1666 + "5955d6fbd3a254d3b639b974ae019a65d3fd1b604eff367d5c"); 1667 + FeedZipHtml(zip_buf, 20225, 1668 + "edc6f22979463a65b0af0a68e13b3b970eff95bbdc224872ec"); 1669 + FeedZipHtml(zip_buf, 20250, 1670 + "7e13bad86fa1de42da5866187e29350da747e72d60f8f91e6a"); 1671 + FeedZipHtml(zip_buf, 20275, 1672 + "95d574f8d5031b916e6306433860e2ff6ed0eb1b7d0ac993f6"); 1673 + FeedZipHtml(zip_buf, 20300, 1674 + "9593260728ea11e9982f5327f25eb7a85554860be8eff5f034"); 1675 + FeedZipHtml(zip_buf, 20325, 1676 + "d4671e0b27094e2185f6a7d851c5cca9e071bd5a246d233741"); 1677 + FeedZipHtml(zip_buf, 20350, 1678 + "16e016f3d34a5e03a29a9ac532d030ab3bd214dec3c0801754"); 1679 + FeedZipHtml(zip_buf, 20375, 1680 + "3b7acf587f8d6c2e33d2f824618caa957a4b64b93ae3444641"); 1681 + FeedZipHtml(zip_buf, 20400, 1682 + "0892752d30de8fa5ea552e36bf178a38f82951873a82982e19"); 1683 + FeedZipHtml(zip_buf, 20425, 1684 + "02cac609c087835b4ea540474f0adac75c13da0456cef0b496"); 1685 + FeedZipHtml(zip_buf, 20450, 1686 + "8a5cb1595e8590bd0889fe10c0de5112d69eb6cd1dda3ec700"); 1687 + FeedZipHtml(zip_buf, 20475, 1688 + "0b50b2a2a86581c42af65e9196152d9cd37d4fc68caa300a05"); 1689 + FeedZipHtml(zip_buf, 20500, 1690 + "9f71606f01d899987759be177762e37c225f5ccadbb43564fb"); 1691 + FeedZipHtml(zip_buf, 20525, 1692 + "e28147664dbb714c3cac2c80d87b913b16251ec2f6a56e6dfc"); 1693 + FeedZipHtml(zip_buf, 20550, 1694 + "85d2bc035bbd4d4b621c33510929b0177b86354540746e9d1e"); 1695 + FeedZipHtml(zip_buf, 20575, 1696 + "2c4d4608495f01ea368ceb7963bcbde517b0692623990928f5"); 1697 + FeedZipHtml(zip_buf, 20600, 1698 + "2e94e8ccadc294c8761f3f191af4e3a763fa4b2721a68c0169"); 1699 + FeedZipHtml(zip_buf, 20625, 1700 + "1ea174a6adaa998a8be3993e67a6fa3c752e0a59a9749c3823"); 1701 + FeedZipHtml(zip_buf, 20650, 1702 + "4cc743412ea94ce2de787eb8c7664b76c4341e1c7b697e508b"); 1703 + FeedZipHtml(zip_buf, 20675, 1704 + "c9449bcbe833e5dfcd9afc804c84e585e5de17d5febb5b9d3b"); 1705 + FeedZipHtml(zip_buf, 20700, 1706 + "ca352f5632ce3dd4ec410f335825439888ea8bc92042818a06"); 1707 + FeedZipHtml(zip_buf, 20725, 1708 + "a6f4822eee601cdb0ee37c34b1f089fe30dec71bab4d533e81"); 1709 + FeedZipHtml(zip_buf, 20750, 1710 + "6e3a09132a52f6caa8fa85415ce94d152904997795b6c1df94"); 1711 + FeedZipHtml(zip_buf, 20775, 1712 + "2bd308e3cfb065df0565d49fe06168ccefc3e455aa179500ca"); 1713 + FeedZipHtml(zip_buf, 20800, 1714 + "2f785e3bcaabf2d9ec726c7431d4934afba803d5b254004643"); 1715 + FeedZipHtml(zip_buf, 20825, 1716 + "4041d95107534a5691cfe44034236f919e7f9bbdb607cd1784"); 1717 + FeedZipHtml(zip_buf, 20850, 1718 + "4074dcdc314b4e7728a39d8c87ded045e6c176b33d03f2abaa"); 1719 + FeedZipHtml(zip_buf, 20875, 1720 + "d190abd4594ae9fd215fac59d64ab0b1754549ae301f66fa50"); 1721 + FeedZipHtml(zip_buf, 20900, 1722 + "41310c6164da566dab9ce6f0754299562f7f95a0f5ebfe4d57"); 1723 + FeedZipHtml(zip_buf, 20925, 1724 + "90a8d8ab335afa2d4cd5cf3fc56c4a7f6993af6699f00d272e"); 1725 + FeedZipHtml(zip_buf, 20950, 1726 + "b9c7cd281b6da45481caa03609706b0240b55a3058899382dd"); 1727 + FeedZipHtml(zip_buf, 20975, 1728 + "61ef32be58cdf45669270c3d0d3f0a79d2e5e4624ae9e75287"); 1729 + FeedZipHtml(zip_buf, 21000, 1730 + "5224aa3c25a516c3caf43dc1a44bf67550798a4133c3a09962"); 1731 + FeedZipHtml(zip_buf, 21025, 1732 + "90860721842550de2b5e13e0736b2fc5a4ef76bfc92b26d429"); 1733 + FeedZipHtml(zip_buf, 21050, 1734 + "59b5a644dd0b62fca1c77e934cfc554ab9554760c4c0755ee7"); 1735 + FeedZipHtml(zip_buf, 21075, 1736 + "6c84515ec52a0009871ddcdee24917a061856ee2c0c496b920"); 1737 + FeedZipHtml(zip_buf, 21100, 1738 + "4e2c8334c6b42de6828cacbd6a6d53a0d14fa6a4332dd57f2b"); 1739 + FeedZipHtml(zip_buf, 21125, 1740 + "b361c00a2c0644a7e95159231bf07b6916c78edeb5330319e9"); 1741 + FeedZipHtml(zip_buf, 21150, 1742 + "136d1b6c7d9dbc3a4529cbe6842ef9c0a4c1a36041f42a34b7"); 1743 + FeedZipHtml(zip_buf, 21175, 1744 + "17c7a17f252e8cc76d59c9cff798f3247687619a7592cc7d97"); 1745 + FeedZipHtml(zip_buf, 21200, 1746 + "b05ae62f60e3b478aa62e72d4d3cab07573b555fa9286d8a83"); 1747 + FeedZipHtml(zip_buf, 21225, 1748 + "a4e9642e23ca8d3909dc7e9f6c697976e4ce5900691e0652c3"); 1749 + FeedZipHtml(zip_buf, 21250, 1750 + "ac00ea49b2481931ce90ea2e7a11677ec50c6531bad9f63b72"); 1751 + FeedZipHtml(zip_buf, 21275, 1752 + "dccc83dc1bbfa534cedc04c81f1f2f2bc92233854553982def"); 1753 + FeedZipHtml(zip_buf, 21300, 1754 + "5a8be0323aabbc07231fbd752591e069fb1d2e47e71ae48168"); 1755 + FeedZipHtml(zip_buf, 21325, 1756 + "b5aa1bd2b9f8cd76b89f7ec9c5812d92e7b2aca572e2021307"); 1757 + FeedZipHtml(zip_buf, 21350, 1758 + "31c7ada41b7ae19954fe126b416cb53b497612cc2e5dc65769"); 1759 + FeedZipHtml(zip_buf, 21375, 1760 + "87a64f380b18feafc18b65d71877ba0c68298a9369c96c9a94"); 1761 + FeedZipHtml(zip_buf, 21400, 1762 + "de4194f27f9562a739342f198f0c940a267f695e1cb4fb3e1e"); 1763 + FeedZipHtml(zip_buf, 21425, 1764 + "fb5e42e1b9d7211c384003c72ae60ba0a2d0313815a81310d9"); 1765 + FeedZipHtml(zip_buf, 21450, 1766 + "e978388d19349c775192422ab14a52721de654c1f38ff2d7e0"); 1767 + FeedZipHtml(zip_buf, 21475, 1768 + "fba67430f1a1de2b5752958c39d2d7b259caa26cd632e5f0a4"); 1769 + FeedZipHtml(zip_buf, 21500, 1770 + "afcde3513e02a12319ce8c10575a5f397e1f1b9befeab887fd"); 1771 + FeedZipHtml(zip_buf, 21525, 1772 + "9b0443ef4b03e8d22ea5395e284df61bebabe45201687ef466"); 1773 + FeedZipHtml(zip_buf, 21550, 1774 + "05e3805e25205ed36011755ccaa46675f9f1b1f1420cbd4ab1"); 1775 + FeedZipHtml(zip_buf, 21575, 1776 + "17d3299fbc062a49507a388725717af68b49676d90de7c512c"); 1777 + FeedZipHtml(zip_buf, 21600, 1778 + "3c3af9f1305ffc869a60296164ca53e18a84ef10de7282d035"); 1779 + FeedZipHtml(zip_buf, 21625, 1780 + "fcb078b9b125fba4b25bd2f1851e8c842ed76b9a7ba0ca0b80"); 1781 + FeedZipHtml(zip_buf, 21650, 1782 + "2131e4c409f086578c104f2a13a44ebddec7dc392b19ddd1c6"); 1783 + FeedZipHtml(zip_buf, 21675, 1784 + "2689533d511ae54317c598e49392ed77d446d66115d2c96c64"); 1785 + FeedZipHtml(zip_buf, 21700, 1786 + "1d2cc33196ef51d09d462a90a041db7f42ae961211927c6b7a"); 1787 + FeedZipHtml(zip_buf, 21725, 1788 + "14f32254e8726f7a7e0e762ea24a31b895759163f92150a8b3"); 1789 + FeedZipHtml(zip_buf, 21750, 1790 + "37a79f1239b58f2bcfc177e31d7e6ea979a51ec5cc8bbb2ab2"); 1791 + FeedZipHtml(zip_buf, 21775, 1792 + "1941858f9076e6ce3c0f0173df2f928ad9540bb390b234b6ca"); 1793 + FeedZipHtml(zip_buf, 21800, 1794 + "d2e93112519b3bf38960faf1628590e6a9433b7e67bb834fad"); 1795 + FeedZipHtml(zip_buf, 21825, 1796 + "8f3903bcf5e24d3ec7a57e97b263a99130bae4621c6fe678d6"); 1797 + FeedZipHtml(zip_buf, 21850, 1798 + "8317d97a3e9aaed1699ae5a3f30aab4387b2ca8acc98dd54ba"); 1799 + FeedZipHtml(zip_buf, 21875, 1800 + "b4a469c1d7b959c34266e16f8a11e4842539ce490ae48c26af"); 1801 + FeedZipHtml(zip_buf, 21900, 1802 + "d48a31cb0498f1457f29ac44401567a66efc8fd7741486baa3"); 1803 + FeedZipHtml(zip_buf, 21925, 1804 + "a07eb21ded6ea92732cd7836d006466ab84ee3f0777cc090ac"); 1805 + FeedZipHtml(zip_buf, 21950, 1806 + "6bbf5d964c2ebb2a362f3b0f2203d24bda5206c41e826f13ef"); 1807 + FeedZipHtml(zip_buf, 21975, 1808 + "260712a2a502f2d02585df11836e950c1c2f51660a73ff35a5"); 1809 + FeedZipHtml(zip_buf, 22000, 1810 + "a781dc86ddf9731b52d9b62ec6e1d4ca6df8d74fa3bf277c77"); 1811 + FeedZipHtml(zip_buf, 22025, 1812 + "12b8b7edc803fe9b70f08fe5eecbd6ad447560b8b9e80d447c"); 1813 + FeedZipHtml(zip_buf, 22050, 1814 + "4967e337d95a365f6a3d96fd5a23f2fda1c0346f4c4b47c6b4"); 1815 + FeedZipHtml(zip_buf, 22075, 1816 + "ac29a6cc8e34435a36850927830abbb2c9fae5b245d1f2cf69"); 1817 + FeedZipHtml(zip_buf, 22100, 1818 + "e8a04d911559b316cdccd714a321fd89180a929ea37e8a9d0d"); 1819 + FeedZipHtml(zip_buf, 22125, 1820 + "a528e0dffa3171c99d1c5fc4a917c8f432a0eb25342a45fa0f"); 1821 + FeedZipHtml(zip_buf, 22150, 1822 + "043ae9ccd8084b0d5cd34140f3a88a7f1d61d8caf9d3041bcc"); 1823 + FeedZipHtml(zip_buf, 22175, 1824 + "2d37f74a88d1e88b78856f1d75ad4c3d46f670a94acf98097a"); 1825 + FeedZipHtml(zip_buf, 22200, 1826 + "536eab51d4a8967e57ff95d41db54481aab84c9c2dc0928858"); 1827 + FeedZipHtml(zip_buf, 22225, 1828 + "fdd4c205ab94ca88920e01a3a8528eb4812561c8ef0456249d"); 1829 + FeedZipHtml(zip_buf, 22250, 1830 + "aa5e6703f6faaee793ad596639fd16466110feb1e7b983c81d"); 1831 + FeedZipHtml(zip_buf, 22275, 1832 + "15354db67d6e71eec3c7e252e0f9f032c6559749757dd99fae"); 1833 + FeedZipHtml(zip_buf, 22300, 1834 + "911a807db9c0dfbfea92287324ce9e74563d9df5a8f4123332"); 1835 + FeedZipHtml(zip_buf, 22325, 1836 + "33752cdf2d22fac36bcea926698411cd04c29058798c572532"); 1837 + FeedZipHtml(zip_buf, 22350, 1838 + "8a134660b354e1a58376b1ccff3712af32358ed9e2e7ea20ff"); 1839 + FeedZipHtml(zip_buf, 22375, 1840 + "f85fe9adcef7a15f77c3a00bdc5f9a8c5d355668a7bedb4df8"); 1841 + FeedZipHtml(zip_buf, 22400, 1842 + "32ae54e910f52e878090787e636aba427d0cf0debf0e35b0f4"); 1843 + FeedZipHtml(zip_buf, 22425, 1844 + "7deb4ff971467d9a9a535e0fd914eaec2a42a91b18911990d5"); 1845 + FeedZipHtml(zip_buf, 22450, 1846 + "1abd97885925bff85bec0d46ee6b6ae97b7e42b5235e73786e"); 1847 + FeedZipHtml(zip_buf, 22475, 1848 + "d777e9c50a579ef7b6a98a25f19ae4e7db7042af30181754ab"); 1849 + FeedZipHtml(zip_buf, 22500, 1850 + "9a9e35736a483d9c2328426eb605bc2355ab39c8dc200c51c9"); 1851 + FeedZipHtml(zip_buf, 22525, 1852 + "ee10b93a9c487f00db53af4fe51746ecdd58955bfa5ef46f03"); 1853 + FeedZipHtml(zip_buf, 22550, 1854 + "be8dde5cbe8df376fbf4ecf4c9a961bcc7ff0d23d6edaff1a9"); 1855 + FeedZipHtml(zip_buf, 22575, 1856 + "69ceb09e79be9f7787c0c2a74cd9b9b70600057e7309bd081e"); 1857 + FeedZipHtml(zip_buf, 22600, 1858 + "e865d38cca8ac96c627a681bc2b9c62c0c7e24dcdead438f06"); 1859 + FeedZipHtml(zip_buf, 22625, 1860 + "6465522f29ba2155580c3e7149f0cbbbda3e9a387b5edc75a3"); 1861 + FeedZipHtml(zip_buf, 22650, 1862 + "9ea86200dde7ae9c30cf40cb6389dc03a8ac0ffc5a8752a4fb"); 1863 + FeedZipHtml(zip_buf, 22675, 1864 + "3a80da4bd1c7ef79338cbfe25c0f3d309088bcae6635f978a9"); 1865 + FeedZipHtml(zip_buf, 22700, 1866 + "c850d3e8a97cc941589c9ba246d433c632b2cbd71bd68c2869"); 1867 + FeedZipHtml(zip_buf, 22725, 1868 + "9b9d3a53ea574dcf163865fc6905b296ca1c99b480352cc5d7"); 1869 + FeedZipHtml(zip_buf, 22750, 1870 + "289aa3497768beb0dde03c13dac2abad30dc380dfe49ebf46a"); 1871 + FeedZipHtml(zip_buf, 22775, 1872 + "becbbc2364bb10ce7c137a0f0dac1a84eaf187fe182f720596"); 1873 + FeedZipHtml(zip_buf, 22800, 1874 + "d07203c9390947d3dd4d8b5c604c9f8593f0e73226eaf86e4f"); 1875 + FeedZipHtml(zip_buf, 22825, 1876 + "14683f9d7bcac774ca06bd4f8e6127a954251c43053c24dfbb"); 1877 + FeedZipHtml(zip_buf, 22850, 1878 + "756438a4d608b9ada173abb6245a5863a43a12fd327261d322"); 1879 + FeedZipHtml(zip_buf, 22875, 1880 + "48563eee7741367aceda87c164509d6cc762300e966549495b"); 1881 + FeedZipHtml(zip_buf, 22900, 1882 + "5737ec68c030c445bdf9517373942d9bbc68bd70e573ec99c6"); 1883 + FeedZipHtml(zip_buf, 22925, 1884 + "fba6068f06d39231513fd190e0d26abac6956503fc788e298e"); 1885 + FeedZipHtml(zip_buf, 22950, 1886 + "4a1892da16c19115037fcf2cc9f594b23c398dbc2a81b17508"); 1887 + FeedZipHtml(zip_buf, 22975, 1888 + "bae41f8d93db8af0a79d3fbdd1241916594036b49c7152781a"); 1889 + FeedZipHtml(zip_buf, 23000, 1890 + "b30a3f16dfc5d4ae6f5035b4631f7b11850da6b001a2946ed6"); 1891 + FeedZipHtml(zip_buf, 23025, 1892 + "408403ca4be206f14a9a14631846de9f68b0faea847225c817"); 1893 + FeedZipHtml(zip_buf, 23050, 1894 + "6226efe86cc31acd3414b0b8d9bdbcef644a16fb58b6c45994"); 1895 + FeedZipHtml(zip_buf, 23075, 1896 + "b44c14dd04172af37dec910771b2fd729d12ce4fc8014fb95f"); 1897 + FeedZipHtml(zip_buf, 23100, 1898 + "642912593124c64e68bd6c80b543fd28f7892ad221395292d4"); 1899 + FeedZipHtml(zip_buf, 23125, 1900 + "74a70085043ddf18813c30d3e22702d87e1c875e65ea64537f"); 1901 + FeedZipHtml(zip_buf, 23150, 1902 + "0d6740d469a0ea4874bfbd7236b7de3e7fedbc787b76b8b1f5"); 1903 + FeedZipHtml(zip_buf, 23175, 1904 + "daf927fcdfd7cebfdebec03f4be5e12c0affb066f0950d2d59"); 1905 + FeedZipHtml(zip_buf, 23200, 1906 + "264117df281ae855bed955c795989adb8abf574016aa723915"); 1907 + FeedZipHtml(zip_buf, 23225, 1908 + "ff98d7a7f2cfb8bc4e59ed641273d6868e6087244a825aea6c"); 1909 + FeedZipHtml(zip_buf, 23250, 1910 + "3205b43610589258498a515e02f26e5e18ab67d412b50c24e3"); 1911 + FeedZipHtml(zip_buf, 23275, 1912 + "a47a941f63b20d08055300c77a4d6ecc54093b2df79b8b5de4"); 1913 + FeedZipHtml(zip_buf, 23300, 1914 + "0a693ef4054fb687c2edc95f56745e0c3ec952be3dacdf0cf3"); 1915 + FeedZipHtml(zip_buf, 23325, 1916 + "f0f1d9c8c4a1d4edcab4b212c6b60233da7229545813813b6e"); 1917 + FeedZipHtml(zip_buf, 23350, 1918 + "870791cd8f95b6956efa9537c7564e54cb50f4ac39c9e54d45"); 1919 + FeedZipHtml(zip_buf, 23375, 1920 + "902075b89de9fc3b07185cf6af1210d9a51c94c52da6aefcd4"); 1921 + FeedZipHtml(zip_buf, 23400, 1922 + "5ee80208213bfc39adc368aec853555861612c3bc30477a3f0"); 1923 + FeedZipHtml(zip_buf, 23425, 1924 + "dd895c0bd087c2d04b5deea361eb66e398efe29f03d350da96"); 1925 + FeedZipHtml(zip_buf, 23450, 1926 + "b86d17ae5da9c006ef9814690c34306d698fd2ab11eaa9d207"); 1927 + FeedZipHtml(zip_buf, 23475, 1928 + "ba31e39ae1c6eabf73310aaf64cd017c1729ba132a4b2cc1ca"); 1929 + FeedZipHtml(zip_buf, 23500, 1930 + "9dc9686fed82c13abb7f000f8dee384ee3bc3d73a1f027ad54"); 1931 + FeedZipHtml(zip_buf, 23525, 1932 + "9f250a77c4773ddcc338bfb8b1e558271b2a2214344761abf9"); 1933 + FeedZipHtml(zip_buf, 23550, 1934 + "cc5587145ce81493199dd9f0d04d9b9a3a025fc2995e404947"); 1935 + FeedZipHtml(zip_buf, 23575, 1936 + "0d800d56d510ab91afa823dd60e6eba61d3d3ec6d7f7e87a5d"); 1937 + FeedZipHtml(zip_buf, 23600, 1938 + "d718c5c7eb89b8491c4a34ac6a4dc570cc725198b9828d1b75"); 1939 + FeedZipHtml(zip_buf, 23625, 1940 + "87f4274a1f911be0ec7b37b5333ce37f6642b41ff8f9eca1ba"); 1941 + FeedZipHtml(zip_buf, 23650, 1942 + "b6c8ea0c04006cd5be27df15a494942c171b38d32061ce3283"); 1943 + FeedZipHtml(zip_buf, 23675, 1944 + "9e993b3a85b439821564a29b284f2b7a13b1f5dc01cce0233a"); 1945 + FeedZipHtml(zip_buf, 23700, 1946 + "309e71ca74fe96db096166118493c11035c830f47b9c380e01"); 1947 + FeedZipHtml(zip_buf, 23725, 1948 + "ede59465065e9501b52e8c88cb534a4c89eb2b03d675aec080"); 1949 + FeedZipHtml(zip_buf, 23750, 1950 + "67b28ef09d4506e0d51493a469d0969030c98bf1f5daf01c81"); 1951 + FeedZipHtml(zip_buf, 23775, 1952 + "798e65a5e5853ab903346fd3fd0580e38b3836a78f47a0ebcc"); 1953 + FeedZipHtml(zip_buf, 23800, 1954 + "afa817056ee85ef541a0e09c9e70399dab2ca5d7096f385a26"); 1955 + FeedZipHtml(zip_buf, 23825, 1956 + "758ea6184a2360d4838e947f14066627cbef787d0b472f15a1"); 1957 + FeedZipHtml(zip_buf, 23850, 1958 + "6386e865985e876a10243d3c8e8db022c830bc7646184c6430"); 1959 + FeedZipHtml(zip_buf, 23875, 1960 + "5a3ce49bc75b2e0c259762aa6c5cd30cd0d233f5da7e0d431e"); 1961 + FeedZipHtml(zip_buf, 23900, 1962 + "095874255f87d137a698b1bd649eeb7b54d06e10b9e3a1d775"); 1963 + FeedZipHtml(zip_buf, 23925, 1964 + "5a707cc5d3eb8a99b8b6dc27187f7cb167f108e2cfd5f7c686"); 1965 + FeedZipHtml(zip_buf, 23950, 1966 + "fa56fb57d557153b42e303aeca389df8fe665a75508ff7b2b3"); 1967 + FeedZipHtml(zip_buf, 23975, 1968 + "556caa78769f0be7533e9c0bedf38f3907e61730594de4ffb8"); 1969 + FeedZipHtml(zip_buf, 24000, 1970 + "20bb234ee31d6e65f50f589ff3f1f8886c0137414d1d80bda0"); 1971 + FeedZipHtml(zip_buf, 24025, 1972 + "a21eaa22476ef60c6f533e644437ce99d76aaafb7e41532cd0"); 1973 + FeedZipHtml(zip_buf, 24050, 1974 + "8d3f726f8a75a4197234b908d65274bfd82bc73660236d7e24"); 1975 + FeedZipHtml(zip_buf, 24075, 1976 + "c878b1b7360d174eebb3b951e8830ba592e9e183d1f202992f"); 1977 + FeedZipHtml(zip_buf, 24100, 1978 + "f62af99330f6383968d188eb1d517d613bce6463f556b06cac"); 1979 + FeedZipHtml(zip_buf, 24125, 1980 + "c8cac87be82e06ec707d644a9acf39d78c5a04326156fedd87"); 1981 + FeedZipHtml(zip_buf, 24150, 1982 + "b79d3b62e12c591c7a7d33f24665c22a62164c5c374d1106ba"); 1983 + FeedZipHtml(zip_buf, 24175, 1984 + "55fbdc19aed74e8846fbb517e32314005a829b8ec41755153e"); 1985 + FeedZipHtml(zip_buf, 24200, 1986 + "eef6a5cabd55201036dc634cdd7b4a211dc8f3269abd54c548"); 1987 + FeedZipHtml(zip_buf, 24225, 1988 + "570e93172748347c769da8ac6042d56f0ffbf26b8e9733aa0b"); 1989 + FeedZipHtml(zip_buf, 24250, 1990 + "a0af245f413bae5d8707bd1769e6fddcc36ecb75b9478fbcad"); 1991 + FeedZipHtml(zip_buf, 24275, 1992 + "4b48d3381321e543f6b0db9d449501777effd0c8b466cb7c90"); 1993 + FeedZipHtml(zip_buf, 24300, 1994 + "ef326394e5343470ecddfc732cce22491f2d9495e0b526afa3"); 1995 + FeedZipHtml(zip_buf, 24325, 1996 + "97feaa304ef1dccf96c297dc1598e421233a0fa897530874a2"); 1997 + FeedZipHtml(zip_buf, 24350, 1998 + "feda0073596bef72750a99e5a0b02a607dcc85476b5b54c8fc"); 1999 + FeedZipHtml(zip_buf, 24375, 2000 + "3ff211f30867aaecd20cadae64d5ef3a34beadb0511459dd54"); 2001 + FeedZipHtml(zip_buf, 24400, 2002 + "7a4208c435d6a3293973945efc343af07cae7716dcb3f3d37f"); 2003 + FeedZipHtml(zip_buf, 24425, 2004 + "afbfac1b391d76d087c2de091460ba424781caeca42aa0ec5c"); 2005 + FeedZipHtml(zip_buf, 24450, 2006 + "f481d5d18eb9b88d316a59166c939e1ab9c25295aa7184658c"); 2007 + FeedZipHtml(zip_buf, 24475, 2008 + "4a29f3f1d3c268d3ccd04d5387aaca79325d26e56901e3a8ef"); 2009 + FeedZipHtml(zip_buf, 24500, 2010 + "bb5721c3c0c584323c4657f2af9d3fb09ed2d442435acb1979"); 2011 + FeedZipHtml(zip_buf, 24525, 2012 + "9c5779f6aaba3e2dab0195c61b5224e4045863d21d661239b2"); 2013 + FeedZipHtml(zip_buf, 24550, 2014 + "4fda506cfdcef39f61ed8a13a8d731b09d0c88a6d74d78b425"); 2015 + FeedZipHtml(zip_buf, 24575, 2016 + "f7941bd126810acea848ea8d646410e2e8cd64fbef49781d0f"); 2017 + FeedZipHtml(zip_buf, 24600, 2018 + "7e7ee92884621d376f9bef7d3c5282af95032e1058d8042026"); 2019 + FeedZipHtml(zip_buf, 24625, 2020 + "371c4e8427f71c3a6526489001dfed0ae9e24b86e81c76f1ca"); 2021 + FeedZipHtml(zip_buf, 24650, 2022 + "090baf46a23ff10127801f3797fc05fe07572d31506a53445e"); 2023 + FeedZipHtml(zip_buf, 24675, 2024 + "0f3396ef4c92e1eef985c5a2c87668392efce33270f9f59ce1"); 2025 + FeedZipHtml(zip_buf, 24700, 2026 + "7f58e5960a96357e5acc551eefdfb2dc210152b8cdc31015b5"); 2027 + FeedZipHtml(zip_buf, 24725, 2028 + "0093cf34ecfafdb5e4c6b5cd529b0fb75e8cd207b4a0b0a80b"); 2029 + FeedZipHtml(zip_buf, 24750, 2030 + "be725c0fbd7eb24b21676a96ccafca97592041fa5df90d3bf6"); 2031 + FeedZipHtml(zip_buf, 24775, 2032 + "f95875dd8a1d3ecd1945900371a9502ce8d2b772df21b5e4bb"); 2033 + FeedZipHtml(zip_buf, 24800, 2034 + "856dc7ed76e90f6225b958bae9e265b19aaa3a74b5e5c0f693"); 2035 + FeedZipHtml(zip_buf, 24825, 2036 + "976e5d18826587cf7f250ae8456b4a7cae4109e2e9cba33018"); 2037 + FeedZipHtml(zip_buf, 24850, 2038 + "78c9a4e4249ceb736f392e6747191e7602acc48c2101be5a00"); 2039 + FeedZipHtml(zip_buf, 24875, 2040 + "f67af1cfe769deeb53dcf064a01d6e24b8c5e5ee5af84bbc71"); 2041 + FeedZipHtml(zip_buf, 24900, 2042 + "a17f64ae5dea9d6e4e0a70c04ebeb6f9f3f38de7e9d64d74e3"); 2043 + FeedZipHtml(zip_buf, 24925, 2044 + "750084b2a2a1ab0a656532871bc3c833dbf30df84666724326"); 2045 + FeedZipHtml(zip_buf, 24950, 2046 + "e0a7d9302506ed4661ac1d0687bc39c847ce7b784ec113db7a"); 2047 + FeedZipHtml(zip_buf, 24975, 2048 + "b9ce3e51ef9b810b8e5c4b306daec303e711f55c5bf148ca1a"); 2049 + FeedZipHtml(zip_buf, 25000, 2050 + "129584c4a924fd82e473369cbfc3fff94a28a7c1248f64c682"); 2051 + FeedZipHtml(zip_buf, 25025, 2052 + "beffa2aecebf9e7f6d90f34a45bbebfaa2b8c9ea5f4b37d9f4"); 2053 + FeedZipHtml(zip_buf, 25050, 2054 + "bb72ed8b7dcab5ef17d5a55cff4ecbbd910373e990dc074f22"); 2055 + FeedZipHtml(zip_buf, 25075, 2056 + "a0d56a9e174bea9d1725d5bbc61b18639c103e10dc45257390"); 2057 + FeedZipHtml(zip_buf, 25100, 2058 + "1121741e944fa2f9d5a2178749148ebd2e214381c01e38477a"); 2059 + FeedZipHtml(zip_buf, 25125, 2060 + "7de8b9938e9eca8f6b9466a6b706ee8d177f4d639d0c0f2d4d"); 2061 + FeedZipHtml(zip_buf, 25150, 2062 + "089c5e35254f4645907020021c27ec6551419163d7410698af"); 2063 + FeedZipHtml(zip_buf, 25175, 2064 + "a5b2701e2680cd8230183f974983f9652913d29392c3604f0c"); 2065 + FeedZipHtml(zip_buf, 25200, 2066 + "22c1095e66372d0bb02c62b6fbe0ea081756c9d6b90519955a"); 2067 + FeedZipHtml(zip_buf, 25225, 2068 + "cfc2d8a31d931fedbce55720c44c3cac7a32a7b756dd91d3a0"); 2069 + FeedZipHtml(zip_buf, 25250, 2070 + "dafa973289e8e3a3b0229718bf97b289f96d29e56e7690a30b"); 2071 + FeedZipHtml(zip_buf, 25275, 2072 + "97d8b7b69fab99a500d2c2e6bc1796e1e555320daf0b55212f"); 2073 + FeedZipHtml(zip_buf, 25300, 2074 + "25bef692ee30a30b51918042e49ef0ff3f775a543d74452ac0"); 2075 + FeedZipHtml(zip_buf, 25325, 2076 + "9b357374aef816a76e13f37229db353d03139c1555502eaedd"); 2077 + FeedZipHtml(zip_buf, 25350, 2078 + "71710f563f966ec1faabb9724364877fe086580cd052bddb9b"); 2079 + FeedZipHtml(zip_buf, 25375, 2080 + "35a6a689e9065cf63f587df6637f12e7fdf6f2711cc2b2d347"); 2081 + FeedZipHtml(zip_buf, 25400, 2082 + "0f86d3cebaee09be03f681ed8601ec61bea38a357ed74efd9d"); 2083 + FeedZipHtml(zip_buf, 25425, 2084 + "f6f1e52e56efb59c1ed3b616f2db55e8f54cfe634c1fbbc01e"); 2085 + FeedZipHtml(zip_buf, 25450, 2086 + "37193636bf738bfaab53fca957fca950d607f461d8ef5bd4a1"); 2087 + FeedZipHtml(zip_buf, 25475, 2088 + "e5d7af0b80b13b1fd89864aed88d6018147f1f167ff2ee8288"); 2089 + FeedZipHtml(zip_buf, 25500, 2090 + "55e7cf99d0b32035f2eee8f4dd1a0760f7ec128a39d501082e"); 2091 + FeedZipHtml(zip_buf, 25525, 2092 + "5d912d5a94e8527814a6dd0ac2f40e71255b1e83ded81dd2ed"); 2093 + FeedZipHtml(zip_buf, 25550, 2094 + "49c2492ae5b09672d7b2e01d2a8664e845e41b1fc56a3cb4b8"); 2095 + FeedZipHtml(zip_buf, 25575, 2096 + "e5e95baf421586f6308d169c96c9e9bab567e487e338cdea15"); 2097 + FeedZipHtml(zip_buf, 25600, 2098 + "e6ea23698e3417625ea6cef6f02fe5eb0a379da553cb49aa9e"); 2099 + FeedZipHtml(zip_buf, 25625, 2100 + "ca24e5cf646691b506a683c6f217390f97b173f7f816ce7132"); 2101 + FeedZipHtml(zip_buf, 25650, 2102 + "04cbdd3daf2f8c4de8b85ec522d4a1e5c4952fa99a618f3b4e"); 2103 + FeedZipHtml(zip_buf, 25675, 2104 + "058d7f51d6d0445a1a5bf099b68a2fb847abee9976163ef87c"); 2105 + FeedZipHtml(zip_buf, 25700, 2106 + "1e62d6d63b8ffc00299be235474aa7e5a2bf50e51efd4c2e14"); 2107 + FeedZipHtml(zip_buf, 25725, 2108 + "593f750e22d7a1f147447315893f3ed1e1e312e8f0691a1d3e"); 2109 + FeedZipHtml(zip_buf, 25750, 2110 + "3dd1e1d342e940716f63ce6b5e24826a6dc965ecd8908b458d"); 2111 + FeedZipHtml(zip_buf, 25775, 2112 + "e88f77d6d6c741127e4985b994a89a905c375522ef6ccbc513"); 2113 + FeedZipHtml(zip_buf, 25800, 2114 + "8639998e5c3027b2687e279a62c11ac6a45c8b9d2c4b366c17"); 2115 + FeedZipHtml(zip_buf, 25825, 2116 + "02cb63b57a3bf4744fe61085035444a1c2d38d5f8c1987455e"); 2117 + FeedZipHtml(zip_buf, 25850, 2118 + "79e124ce2b06758e6a9ee12a6c61699a561277b126f2222178"); 2119 + FeedZipHtml(zip_buf, 25875, 2120 + "ac96736df6320ce8fb61ad2a7b5a59d295a46dd4cc9606f662"); 2121 + FeedZipHtml(zip_buf, 25900, 2122 + "277cb8dc61181da556f7c218a59a4f2a6cf28f4f44b312ede3"); 2123 + FeedZipHtml(zip_buf, 25925, 2124 + "bd13adc280fff444342bd13edd3bd1f6649601d7569c3dd7a1"); 2125 + FeedZipHtml(zip_buf, 25950, 2126 + "92809a2e8dbdf7ab15246c802753f305531ccf25287c8e0927"); 2127 + FeedZipHtml(zip_buf, 25975, 2128 + "e7c1e0617c1850daa04e99d564f6a887c385c75703ec9b6681"); 2129 + FeedZipHtml(zip_buf, 26000, 2130 + "ab4abec61a2a580e9b1681d137882ef5751026a5389511d7b3"); 2131 + FeedZipHtml(zip_buf, 26025, 2132 + "a394662a4126b5d543e3925444a051331febcd2fbd87714995"); 2133 + FeedZipHtml(zip_buf, 26050, 2134 + "0ea3f181721caad534e3091c1f7dcacbaaebe4321aaaf0b978"); 2135 + FeedZipHtml(zip_buf, 26075, 2136 + "3edc89dbe2a6840fb9ad1e727994c56d51b188d45d1c257292"); 2137 + FeedZipHtml(zip_buf, 26100, 2138 + "ef160b4f26e6d58df33368c56bb94c737911ed72f47e297f59"); 2139 + FeedZipHtml(zip_buf, 26125, 2140 + "f570422231b6f0966374edb87f5da8310898d5eb321ea350c4"); 2141 + FeedZipHtml(zip_buf, 26150, 2142 + "8f352f9bcc5c14c740104e359c213c419c7f5db76ac406a9d2"); 2143 + FeedZipHtml(zip_buf, 26175, 2144 + "32aadc541a295978935752f6a6d993e2c1eed9e52e3f7cb7e4"); 2145 + FeedZipHtml(zip_buf, 26200, 2146 + "8a4b1b5b9cc36cc7c236d4f0aed0f005cec23d11e5d845730b"); 2147 + FeedZipHtml(zip_buf, 26225, 2148 + "d6340bc211c8d26e28fafd786eaef997e49a8308a872e0613e"); 2149 + FeedZipHtml(zip_buf, 26250, 2150 + "a99ec0709583b3a3abadbf5b192963673227e93c5448c61438"); 2151 + FeedZipHtml(zip_buf, 26275, 2152 + "f815a0f3ba1ed5a1d1b9ac5566627ea44ed5d9a5cfb224e407"); 2153 + FeedZipHtml(zip_buf, 26300, 2154 + "0883958d625bb80166f226e4ca077f8aa162950951663dcc73"); 2155 + FeedZipHtml(zip_buf, 26325, 2156 + "08a50e66ec977dd91371e271e8be93609ab0c41698906131cc"); 2157 + FeedZipHtml(zip_buf, 26350, 2158 + "2435c2f788b9ca742a49325521c61806ea44c5f7340feb8aec"); 2159 + FeedZipHtml(zip_buf, 26375, 2160 + "716e16297732cd227d84e7a84f9f0da709fcc5ef16d3515810"); 2161 + FeedZipHtml(zip_buf, 26400, 2162 + "d9a1d2956c627956660a58ea8ae10f729d6dcb370bca11cf66"); 2163 + FeedZipHtml(zip_buf, 26425, 2164 + "4bc9a14966087c3f54ef2b389efa951c2ccdb727694adbe5ab"); 2165 + FeedZipHtml(zip_buf, 26450, 2166 + "944b08b2aa65647498c47b1b5fd89fa19bd2c1d209019f6c80"); 2167 + FeedZipHtml(zip_buf, 26475, 2168 + "4ec3b067ae454dbac993b640c254cd3f593b0f056c25074d31"); 2169 + FeedZipHtml(zip_buf, 26500, 2170 + "9024cff9b1c1039b40ef143f79e86dd06cd95030dba45bc069"); 2171 + FeedZipHtml(zip_buf, 26525, 2172 + "b34dfae2ee93be88ea4eca11350d04d8e88fde4c7011543cd1"); 2173 + FeedZipHtml(zip_buf, 26550, 2174 + "1d20ddfb3afc0ff5f3c41a36a87579a9956a349a86944d0d37"); 2175 + FeedZipHtml(zip_buf, 26575, 2176 + "67a9cea39b67335e198b055a2ed65e455c96d9ab695b7d34df"); 2177 + FeedZipHtml(zip_buf, 26600, 2178 + "c9669d07c7f5cd58a44001bb0d1baf80b22db050adb8c486fa"); 2179 + FeedZipHtml(zip_buf, 26625, 2180 + "886ce4103a1742abadfdda78550f61e8a197d660f595b2741f"); 2181 + FeedZipHtml(zip_buf, 26650, 2182 + "8078c843f2d24f22c8ff1527914c73e94944aeb28cde4b398d"); 2183 + FeedZipHtml(zip_buf, 26675, 2184 + "cc2757350f287952e864b065966786e088d655b9399a1b9bb9"); 2185 + FeedZipHtml(zip_buf, 26700, 2186 + "6b3d9d751a4eddf34f5bea9e0bae70bb762c1277cf4d5c328c"); 2187 + FeedZipHtml(zip_buf, 26725, 2188 + "d58f87414fdc80b11bf47cb2bfbeebb0ffc3c04b246214b28a"); 2189 + FeedZipHtml(zip_buf, 26750, 2190 + "dac1d2a9e5e02b009b41a2dfb058bf22a7becbe9aaec2f97ea"); 2191 + FeedZipHtml(zip_buf, 26775, 2192 + "8f350a7bf9bc1d4dc2b35a7382667d2a1c46122bb5a272775d"); 2193 + FeedZipHtml(zip_buf, 26800, 2194 + "c2979351109b693e641de7cb48f42fe3db581d41dc1e723ce5"); 2195 + FeedZipHtml(zip_buf, 26825, 2196 + "4ba1cace3fa65a844f89a06524fcab2a27b66ca6a3134afd26"); 2197 + FeedZipHtml(zip_buf, 26850, 2198 + "8911d6e94625f69cfea277573ff281ca383c0236942e230c65"); 2199 + FeedZipHtml(zip_buf, 26875, 2200 + "aa6da7d865a32fe6d4cfd92ae038ca3596fe36caf329e39ec4"); 2201 + FeedZipHtml(zip_buf, 26900, 2202 + "54e5afc1a7ef3ecdd8360786495b7d171456b4f24a1eaf3347"); 2203 + FeedZipHtml(zip_buf, 26925, 2204 + "2c9c360bcc5b5a0bdf46c554347dd5e9808a8b5d50802aef78"); 2205 + FeedZipHtml(zip_buf, 26950, 2206 + "dd458e64ee419c06533ceb37baea89ee6d9ad56fffe2ec8093"); 2207 + FeedZipHtml(zip_buf, 26975, 2208 + "b9a49974f45ac17066eb20ad30682732d1d606a5010c6e2bf0"); 2209 + FeedZipHtml(zip_buf, 27000, 2210 + "f74fbf1f5cfcfcf22775f1e6b971faebe5e9c9d1a79ff8eacd"); 2211 + FeedZipHtml(zip_buf, 27025, 2212 + "f2b6981e2153c7b5487049d5fdb30b063f2e005d0f9a93d393"); 2213 + FeedZipHtml(zip_buf, 27050, 2214 + "fd0230fbc7676d3b1c41984e594413a6d5c6eb569fd203d381"); 2215 + FeedZipHtml(zip_buf, 27075, 2216 + "afc4fab1883e6666aca5e9b0e37cda8ebf6c4ee3f17877d77a"); 2217 + FeedZipHtml(zip_buf, 27100, 2218 + "53e1ba1fcdd7c63c5df4e81db3d3dfea945d6435071ed925e9"); 2219 + FeedZipHtml(zip_buf, 27125, 2220 + "a11b85b0db15e36ced686d6e480f834de7af30ff91e62b54e8"); 2221 + FeedZipHtml(zip_buf, 27150, 2222 + "5a498dfdb64cc044f9b3e26ec89a132433fffc87527102a079"); 2223 + FeedZipHtml(zip_buf, 27175, 2224 + "dd8b30ea6ac51d0abaf2bd8e14682f11cecbf57fe0952bea2f"); 2225 + FeedZipHtml(zip_buf, 27200, 2226 + "2a3d99bab0b8c47abcb22e218189d5d2590e5466283c7453f9"); 2227 + FeedZipHtml(zip_buf, 27225, 2228 + "cb20d58f63b00d5fd91c9a5e193ebced9cff0dbacae07ed2ab"); 2229 + FeedZipHtml(zip_buf, 27250, 2230 + "bb2140e40e44dcc695557ff11b555bcc7e11577f7291dca229"); 2231 + FeedZipHtml(zip_buf, 27275, 2232 + "66ef4a92dde41656a12550b1ec8fe3c185b55e5ab6bde5c491"); 2233 + FeedZipHtml(zip_buf, 27300, 2234 + "5778f8b77029d94912ac1d4a8cc89a90b78bb2ad0210472ad4"); 2235 + FeedZipHtml(zip_buf, 27325, 2236 + "d86f2681f79f093e68cba617c411d4ba950c7c299e2f52856c"); 2237 + FeedZipHtml(zip_buf, 27350, 2238 + "d9c2404a3cb3808e17f8749a41b1c09d5f9d6eb8085e461a70"); 2239 + FeedZipHtml(zip_buf, 27375, 2240 + "deafa4b7e626763c018d10c729bd653d9ef2fbb95e4f9d6a76"); 2241 + FeedZipHtml(zip_buf, 27400, 2242 + "c9beb2dcd1e5bbb458bc73da110fc7d85af8d9c624ab3fa259"); 2243 + FeedZipHtml(zip_buf, 27425, 2244 + "77498bcbf6ff42b5dea59fddd206f6c565306175933d5f4f75"); 2245 + FeedZipHtml(zip_buf, 27450, 2246 + "0e4e67b68f8d19af5c86eacd449baf123b54357132eeb95a6b"); 2247 + FeedZipHtml(zip_buf, 27475, 2248 + "4b65e41c67752799b85d1c4d26f7f9512b5218157032a02562"); 2249 + FeedZipHtml(zip_buf, 27500, 2250 + "75d4405e6851ad77207a97934fc3f6e665fcb76c4b13d24932"); 2251 + FeedZipHtml(zip_buf, 27525, 2252 + "a8522367c00dd2222f4a05c7afb4ee4455f5d3d9e9e149fba7"); 2253 + FeedZipHtml(zip_buf, 27550, 2254 + "5587fff159ffeb38fdedf8274369e137478727fb17edf3c393"); 2255 + FeedZipHtml(zip_buf, 27575, 2256 + "03ec94fef539fbe771aeb530ced9e9d1a783d3139e89fef9d9"); 2257 + FeedZipHtml(zip_buf, 27600, 2258 + "f8f7b1f97be1dbe30f47ed430d7cfad7e7ec9fc7b956fb38d9"); 2259 + FeedZipHtml(zip_buf, 27625, 2260 + "05e57efa6cf9edd8d6af0c46bd48f3efcff91f8e0b3d0ae31d"); 2261 + FeedZipHtml(zip_buf, 27650, 2262 + "ec9f1eefb7cf3fed9e1e1dedefb60f79d4e2af9f4b7e3e2efd"); 2263 + FeedZipHtml(zip_buf, 27675, 2264 + "bd6422b37f66d0cc48d9efc95ec5faa452d86bf16476539717"); 2265 + FeedZipHtml(zip_buf, 27700, 2266 + "2b3f7d64e359ba9be4e5ced69ebcd65b2daaf9ea7ca6d945f2"); 2267 + FeedZipHtml(zip_buf, 27725, 2268 + "04c73fdd75d475764ced635220aebb1583994092ae53a3aeb1"); 2269 + FeedZipHtml(zip_buf, 27750, 2270 + "3e6f912d4549e2e5ed18e68056967e16b0cfe6d2e515d38b69"); 2271 + FeedZipHtml(zip_buf, 27775, 2272 + "40aea6104a703fd741c2e76373b297cd4dd62c6e90b3a6263d"); 2273 + FeedZipHtml(zip_buf, 27800, 2274 + "3bc374f3549248bc52a7b52c2fea232e5ae5f2ecfb1a55f1b5"); 2275 + FeedZipHtml(zip_buf, 27825, 2276 + "7bbb8a5e4ce39ce6ddfe5428ad4b1500c07894995ee5c1bceb"); 2277 + FeedZipHtml(zip_buf, 27850, 2278 + "bb11bf97cf68e3bbedfb36234f0da8fdacffc401e018fa05e6"); 2279 + FeedZipHtml(zip_buf, 27875, 2280 + "56db28d91c7cd008c2600d8b48f4dca8074b49e4166cdaef74"); 2281 + FeedZipHtml(zip_buf, 27900, 2282 + "552eba1338b846cec5ff1ca1098f45e1b25b056246fb38f8ae"); 2283 + FeedZipHtml(zip_buf, 27925, 2284 + "eb0b10adeffa3191eceb6aeadb3dc86e8fd2b34bc71a87ea0b"); 2285 + FeedZipHtml(zip_buf, 27950, 2286 + "ca5cc192c87c1ae0e380275d441375a14cbb61470c5d8c9e8d"); 2287 + FeedZipHtml(zip_buf, 27975, 2288 + "b2fc9bc284de0880eb6f7ef2fa6f83e435a08ca6d06026d1a4"); 2289 + FeedZipHtml(zip_buf, 28000, 2290 + "1c4a65e5292b4e557d46dfef69dbd1fe5f20f204179b557665"); 2291 + FeedZipHtml(zip_buf, 28025, 2292 + "46d8b9e8e261619a2166edb65c63cc7aa3b138539f6e85d99e"); 2293 + FeedZipHtml(zip_buf, 28050, 2294 + "c2ea695e9c70767ed41a29cf9806904ae89cc64ea3b79fce86"); 2295 + FeedZipHtml(zip_buf, 28075, 2296 + "78435b6291adfe48092ae7b2cb9cbbd8654b39d5ed79711764"); 2297 + FeedZipHtml(zip_buf, 28100, 2298 + "7a1a7b59bbcdc45e0be7075d25b5ccb2a6639749b9bd1ce57a"); 2299 + FeedZipHtml(zip_buf, 28125, 2300 + "51388e25d9d8a397a59a76172bde4ab01c03ec461e176605aa"); 2301 + FeedZipHtml(zip_buf, 28150, 2302 + "a33a4292223ba679b664e92cc59babd0a2892d7a0ac6a5d1fc"); 2303 + FeedZipHtml(zip_buf, 28175, 2304 + "5c0c70eb897ef3224caf9e5e3a16958ab5a39dee4b20304323"); 2305 + FeedZipHtml(zip_buf, 28200, 2306 + "492c81ba18bab8494ea4df978ffb25547e4dc26b7e283f52c5"); 2307 + FeedZipHtml(zip_buf, 28225, 2308 + "12857e5f41e964852bf3d47ac155f84dc6caed9eefefb4f79d"); 2309 + FeedZipHtml(zip_buf, 28250, 2310 + "df0ecfdb1f768e9cf6cebba37d677d7dddf97001f67b66f416"); 2311 + FeedZipHtml(zip_buf, 28275, 2312 + "fcbcb2980dbc549e8187a7d2d5d2e9de686a086d0945abe476"); 2313 + FeedZipHtml(zip_buf, 28300, 2314 + "958476acf4b285b4ca38581e09a4d78e01a6ebd422058a7d1e"); 2315 + FeedZipHtml(zip_buf, 28325, 2316 + "96327d37f1fc1e29adf37624c8fe5514d02bc28bec3265bb5a"); 2317 + FeedZipHtml(zip_buf, 28350, 2318 + "6b1b4cdd16b6fd906be022adbbe1906ede6f750533ae6e86c9"); 2319 + FeedZipHtml(zip_buf, 28375, 2320 + "877509e22c7c0bb198d736adc501e80e6b781b93a75cd20b2f"); 2321 + FeedZipHtml(zip_buf, 28400, 2322 + "e07bceb3088ea6bd674eab0b18c662b62ba06adc9ecc744de0"); 2323 + FeedZipHtml(zip_buf, 28425, 2324 + "c127e7a7bfabe88684ce08e5812acc37c79d68174e4396e0e7"); 2325 + FeedZipHtml(zip_buf, 28450, 2326 + "6cfb43e5293cb5194b78608c843f69f09669882104d56ac3d2"); 2327 + FeedZipHtml(zip_buf, 28475, 2328 + "e961d1580238557344791ec042a7b015a474b61a600ba58629"); 2329 + FeedZipHtml(zip_buf, 28500, 2330 + "6643d1fd7641922a7ae728c316512bf4b9a73d9400a18a8371"); 2331 + FeedZipHtml(zip_buf, 28525, 2332 + "3852dbde904202eeac9516b06d5232633cbd97d5d643591631"); 2333 + FeedZipHtml(zip_buf, 28550, 2334 + "b94a6829bd5050793d32aad72b49f63b17cda9a298d9e52111"); 2335 + FeedZipHtml(zip_buf, 28575, 2336 + "ec1a0866589cec3ebad51e84df0fdbbf9c7e6833550c37c223"); 2337 + FeedZipHtml(zip_buf, 28600, 2338 + "23d014ab28dfa5466481e59b87a41025adabd521e29e0202bd"); 2339 + FeedZipHtml(zip_buf, 28625, 2340 + "e4967d08ca3bd8fdffd97bf3e7b6b12441f8e79abf02e18d9d"); 2341 + FeedZipHtml(zip_buf, 28650, 2342 + "a2762995edeaeee9965d8e9025d9ad2959f64a725d1d1d0a90"); 2343 + FeedZipHtml(zip_buf, 28675, 2344 + "042994498005809258317ffce6f14ee0e120c553e6ccf7cd96"); 2345 + FeedZipHtml(zip_buf, 28700, 2346 + "85c777e4cbcc97774e1d9e6aee47a49df9d83d1dbdda46ddfb"); 2347 + FeedZipHtml(zip_buf, 28725, 2348 + "a9584e7b14d9e2e60c9852ee49dcab8a5591abe9d0480a79a1"); 2349 + FeedZipHtml(zip_buf, 28750, 2350 + "4e6c34b7abe11281deb4e6769541a17c199d7fb02e3c16c032"); 2351 + FeedZipHtml(zip_buf, 28775, 2352 + "f1788d025fd1fa574d368e412def5f80233704ea028abbad73"); 2353 + FeedZipHtml(zip_buf, 28800, 2354 + "46e975c77433d0147b62675a7bd14a251d001f40740828b35f"); 2355 + FeedZipHtml(zip_buf, 28825, 2356 + "2789bf04113b06caa971850497f046974f72650bd505efc96b"); 2357 + FeedZipHtml(zip_buf, 28850, 2358 + "b426a3e09a31d0031bb6d8012733cacc9432093b6322ef07cf"); 2359 + FeedZipHtml(zip_buf, 28875, 2360 + "082ed4f95e7c29faa0395ec1858de512df7c832725d0f83a96"); 2361 + FeedZipHtml(zip_buf, 28900, 2362 + "dafe215f4b57b40f4c820e281f999977e5de9c157569cf4836"); 2363 + FeedZipHtml(zip_buf, 28925, 2364 + "bb5ec890d273b27922ed26984e692576952559ed985c8ec99d"); 2365 + FeedZipHtml(zip_buf, 28950, 2366 + "f10d82e873ee4f81f1601b8b340bbb8ebe01a54391e1358842"); 2367 + FeedZipHtml(zip_buf, 28975, 2368 + "2cfdb58bbffdab8cc3ad80879d8d00d221ec74c812411efb42"); 2369 + FeedZipHtml(zip_buf, 29000, 2370 + "7594d4ee854827f30c18cec6c9d43ca99ac1207cb9664ff4cd"); 2371 + FeedZipHtml(zip_buf, 29025, 2372 + "f90611d10ae155de30761198214d64399f000303de72f2b694"); 2373 + FeedZipHtml(zip_buf, 29050, 2374 + "e5391626df4b20481e97ccad928add38139606e15d20d4fb42"); 2375 + FeedZipHtml(zip_buf, 29075, 2376 + "0ae452ac44cc05df183e64d45d0ff93466bf326c382a9b1991"); 2377 + FeedZipHtml(zip_buf, 29100, 2378 + "6f72d807c0ecf74354a08d5e0d64a3881362e3083c8ca4146e"); 2379 + FeedZipHtml(zip_buf, 29125, 2380 + "8ba13fc526a121e66df7265d79310043fe691a625ca8089824"); 2381 + FeedZipHtml(zip_buf, 29150, 2382 + "bffcc18348b4898ca6e448c8c2bd3abcf7a7a951299efb9523"); 2383 + FeedZipHtml(zip_buf, 29175, 2384 + "0a22e2183196b7fe781c44a544fd79dc88a09dc31a1173c92f"); 2385 + FeedZipHtml(zip_buf, 29200, 2386 + "378d90799b3544eafdeb1d687e13b8e263ecea43e0be8e3318"); 2387 + FeedZipHtml(zip_buf, 29225, 2388 + "798abef6ecdf0ba462494c3b0a9ec522f43ec8e8d2f83e1c29"); 2389 + FeedZipHtml(zip_buf, 29250, 2390 + "82d6f719d1f05f464cf9db3806c61171d989559429b9d4b5b2"); 2391 + FeedZipHtml(zip_buf, 29275, 2392 + "4e23e04b18c9edbc0613214976eb60d1081cd0891f78bfb130"); 2393 + FeedZipHtml(zip_buf, 29300, 2394 + "6910285ed586d9e0ff083185a29bbf63ba2024312afd88c0ed"); 2395 + FeedZipHtml(zip_buf, 29325, 2396 + "7c380862bc648f867c02d78ff20de60677b3a1361937eb6089"); 2397 + FeedZipHtml(zip_buf, 29350, 2398 + "ff736de615060f22484749484918dc9951bc061933573e2c50"); 2399 + FeedZipHtml(zip_buf, 29375, 2400 + "2b0ee3ee1965a9312200053192ec3d9f4eafaece3e9c5d5d9f"); 2401 + FeedZipHtml(zip_buf, 29400, 2402 + "1d9352d264dff27fd0b10ce8af235244ffbab6470da3b03204"); 2403 + FeedZipHtml(zip_buf, 29425, 2404 + "8749ab01239f5b392ad339d3abfb78f0833ebf460822790312"); 2405 + FeedZipHtml(zip_buf, 29450, 2406 + "77f2b52a345bb0d23515aad116444e83e83665f11911e34321"); 2407 + FeedZipHtml(zip_buf, 29475, 2408 + "5f46ee0fed4a6fc927063b254ed802f07dfc746d404f41a4ed"); 2409 + FeedZipHtml(zip_buf, 29500, 2410 + "81983a162636a17aec1d38994a5360970adfc854f9f1147dff"); 2411 + FeedZipHtml(zip_buf, 29525, 2412 + "b097a096c9c95b215cd684b03e534db9fdac34e3a0cc0de4cc"); 2413 + FeedZipHtml(zip_buf, 29550, 2414 + "4e406e926f51b4b27cbd847674d3955bd2f95a762a48e70def"); 2415 + FeedZipHtml(zip_buf, 29575, 2416 + "1d83c8f65f2ec883de1201f07b39968fe9711408bf570d7a67"); 2417 + FeedZipHtml(zip_buf, 29600, 2418 + "ea4619ecdd791e6b05fe1d6d29077c6133c87fbb91b90e92c0"); 2419 + FeedZipHtml(zip_buf, 29625, 2420 + "36ee7a6c2b19aae22a3ae99a3d46ce2686ce81e2b976b7bacf"); 2421 + FeedZipHtml(zip_buf, 29650, 2422 + "59705c83c44d86cb4dfeb2539c92001ec7cc27917da836a972"); 2423 + FeedZipHtml(zip_buf, 29675, 2424 + "11e5d1088e7831acba8bdcc8b5ded6e7f12081f7a6feb64a06"); 2425 + FeedZipHtml(zip_buf, 29700, 2426 + "b6bcaaecbcb55cc684775a7315e2e9c2bfa69952ca68de16fe"); 2427 + FeedZipHtml(zip_buf, 29725, 2428 + "f2e4ada4368e0426e74fe6a11e9951c87b21d4d4276d52c7df"); 2429 + FeedZipHtml(zip_buf, 29750, 2430 + "8a7d18697a672adb349f6d6c46301bd2870e6ce5a4637934d5"); 2431 + FeedZipHtml(zip_buf, 29775, 2432 + "bddbef83ee4a73070f41970a8b21ba84a2cea54abc937a03d6"); 2433 + FeedZipHtml(zip_buf, 29800, 2434 + "1f30d63ea8d49195fa2b5d611c441b7752d84ba634594a6064"); 2435 + FeedZipHtml(zip_buf, 29825, 2436 + "cb2dc519b75e7b7f39787e209b8c639e71476dbdb7467c5f40"); 2437 + FeedZipHtml(zip_buf, 29850, 2438 + "0507d4f6bba0ef0fe341453f470a5a8091c73c92f8ba444053"); 2439 + FeedZipHtml(zip_buf, 29875, 2440 + "fffeaacb3988e8180da6ea37bc3070d674e5e53ce7d4829a12"); 2441 + FeedZipHtml(zip_buf, 29900, 2442 + "1a3131f0c6c00fbbfc41feeb4d6ad961644c64ada40b87722d"); 2443 + FeedZipHtml(zip_buf, 29925, 2444 + "156a8fc0381e4f18d5d218f9482f48bb49081f4051026e450b"); 2445 + FeedZipHtml(zip_buf, 29950, 2446 + "7d27543421d71b0c42700fc4e093b7cdb434214773bbc38596"); 2447 + FeedZipHtml(zip_buf, 29975, 2448 + "54a85d7a3d25179a006525614a6cce3228a3deb8e71c5c9361"); 2449 + FeedZipHtml(zip_buf, 30000, 2450 + "5f218fd58a61796b611ddce6dfe588d519b76f745147589e39"); 2451 + FeedZipHtml(zip_buf, 30025, 2452 + "b23997a0caf5544654d51390a3e01122a6ab044d5bb91564bf"); 2453 + FeedZipHtml(zip_buf, 30050, 2454 + "236b275937414f0d11eeebca12112623dd264160b96c659f57"); 2455 + FeedZipHtml(zip_buf, 30075, 2456 + "614e91561edb9ee3be3975e8fafd98dc1cc065e7f5c10a6142"); 2457 + FeedZipHtml(zip_buf, 30100, 2458 + "c24b8ad52c5591d924be47f0e4b2e0fa5476368ccadf98e630"); 2459 + FeedZipHtml(zip_buf, 30125, 2460 + "128d6a7340ea53b6970d239f1cd68dc032422b8e79e2b4504b"); 2461 + FeedZipHtml(zip_buf, 30150, 2462 + "a2216ae30387f5d850dec52c458375d0fe440a8280e6d44a6a"); 2463 + FeedZipHtml(zip_buf, 30175, 2464 + "a251c4183453e143453dae01a2f88973aeec3ef6e4f63b01f6"); 2465 + FeedZipHtml(zip_buf, 30200, 2466 + "975066dd509ad09abf316e48159f7a5092828cd25f94a9944f"); 2467 + FeedZipHtml(zip_buf, 30225, 2468 + "2d23de105549dbd00e82c3da1de0858cc2542196858e4a4911"); 2469 + FeedZipHtml(zip_buf, 30250, 2470 + "355206519c48f9bfc9d196fa7c2e401748b3e930a8d002aece"); 2471 + FeedZipHtml(zip_buf, 30275, 2472 + "4fbe039d042b8600d8c99ef835cafcc5640cb3844a6936865d"); 2473 + FeedZipHtml(zip_buf, 30300, 2474 + "67a52ae6d0319eb4ad87a049c993b9e669af40f7f8c73f7acf"); 2475 + FeedZipHtml(zip_buf, 30325, 2476 + "fff18f675879e461347ce9563f54814f61ab30d00fc3a99c18"); 2477 + FeedZipHtml(zip_buf, 30350, 2478 + "d879e32a21dea07a9800867cf4e1f91886dd10b507dc0457c8"); 2479 + FeedZipHtml(zip_buf, 30375, 2480 + "32dfff8867a7ca48eab730a734b688a201228e01f7acac3346"); 2481 + FeedZipHtml(zip_buf, 30400, 2482 + "012d34abc1ee5b6847a0c8201c482554c8a98493bf9ebcf9e5"); 2483 + FeedZipHtml(zip_buf, 30425, 2484 + "eac44be1f3c857f3c511d73a0edfece5fd20f3d583ab3fb0f0"); 2485 + FeedZipHtml(zip_buf, 30450, 2486 + "e356c83e2007c4238ce261af9aa574c10b1d47f110ffd1cd5b"); 2487 + FeedZipHtml(zip_buf, 30475, 2488 + "6a161fbb546f4439f47434122dad3c2aeeaa99b82700a96547"); 2489 + FeedZipHtml(zip_buf, 30500, 2490 + "0a65ac053e02027894c047126f75e126ad3fd7946b42a712e9"); 2491 + FeedZipHtml(zip_buf, 30525, 2492 + "ba6ca872541a15e4c1959c81e6605c4f29bda55e9eabd31b95"); 2493 + FeedZipHtml(zip_buf, 30550, 2494 + "7569ad5de45aa5435b9eb4e3bbd58ffe4d856ed2bfc919bc67"); 2495 + FeedZipHtml(zip_buf, 30575, 2496 + "a8a6b69e1d0167843b2efeceefa0db8fc9953f784fe4046dde"); 2497 + FeedZipHtml(zip_buf, 30600, 2498 + "6c98defc3101a94baa9f143a203b55c2c7a01766d6370e2b58"); 2499 + FeedZipHtml(zip_buf, 30625, 2500 + "f16b0148cda0f44c54d6c583d11d2d884309bc322897e8ada4"); 2501 + FeedZipHtml(zip_buf, 30650, 2502 + "fb84751f925f927c3a1d7580a575391a205fce8b522a02ac25"); 2503 + FeedZipHtml(zip_buf, 30675, 2504 + "92db1585347c4a4292687f0ca64e2e0eeb9a376d328cc2250b"); 2505 + FeedZipHtml(zip_buf, 30700, 2506 + "2b7b60293d24b73ab805ec8d9a580843186ca518391ce66a5b"); 2507 + FeedZipHtml(zip_buf, 30725, 2508 + "ca4d59853c745410be288856e6262546891a2b22e91964f748"); 2509 + FeedZipHtml(zip_buf, 30750, 2510 + "44caa2f0ac2a742283ee806e0b22fbed0454210cececf99d10"); 2511 + FeedZipHtml(zip_buf, 30775, 2512 + "de8ba9e37d23c3a47b2326aa9afb31b054816b18f43177de2a"); 2513 + FeedZipHtml(zip_buf, 30800, 2514 + "145ab82c4b79888290c2d8343544a89188890fb6e121ab7f0e"); 2515 + FeedZipHtml(zip_buf, 30825, 2516 + "044dfc1406f78dde04c7f83a267607632bbea8f4ccb95e8495"); 2517 + FeedZipHtml(zip_buf, 30850, 2518 + "ed6749efc1c6eeffab790d10f41bf618a81bb68229cccb7de4"); 2519 + FeedZipHtml(zip_buf, 30875, 2520 + "2b8073a5f99765f7162ce02d9057781173754d34579a98a6e7"); 2521 + FeedZipHtml(zip_buf, 30900, 2522 + "5775b9d868a90849f99ab9e4ad5084e93b39ada522964ac3f6"); 2523 + FeedZipHtml(zip_buf, 30925, 2524 + "24ea05093753b0560acd560908d77d0c8164150f1fa796fadb"); 2525 + FeedZipHtml(zip_buf, 30950, 2526 + "0faf45a399bd27f2aa99153b9aa93a8e1fd4f3e124abf8f2b8"); 2527 + FeedZipHtml(zip_buf, 30975, 2528 + "776d751b5a96a2b3b107a87fd936fff1b24ad26ca23ea3aed2"); 2529 + FeedZipHtml(zip_buf, 31000, 2530 + "7ec28c5b7cf4139664dbf88439f7e17cc0e0a28a0fd5efc1a8"); 2531 + FeedZipHtml(zip_buf, 31025, 2532 + "fcb512114a6a9aca77c94221658ba21b11e93a38dd135377ae"); 2533 + FeedZipHtml(zip_buf, 31050, 2534 + "e371fc3e881bbd09b9b175cc2b83e1c378309d218620cf3317"); 2535 + FeedZipHtml(zip_buf, 31075, 2536 + "b8e292b8fa1a77f8e415926b01ac7dd5f469b3583a5e26f05b"); 2537 + FeedZipHtml(zip_buf, 31100, 2538 + "6bd9f978b7408b30d8027ebdf92ac7b6f3e38b206bcc8f8db1"); 2539 + FeedZipHtml(zip_buf, 31125, 2540 + "75bc270a324c857d243b5ecc824be4c6ebd9e0d7c38c2f1868"); 2541 + FeedZipHtml(zip_buf, 31150, 2542 + "1bc88be13a17c08b0552ec38f157ca893f474973cf70d9e06a"); 2543 + FeedZipHtml(zip_buf, 31175, 2544 + "ceb3126a8f4763cce5a07c4f51fd35cafbc7cb380105ac8551"); 2545 + FeedZipHtml(zip_buf, 31200, 2546 + "77382122c160b0fe24c12bef05632c97f5aaccd076ad4d7618"); 2547 + FeedZipHtml(zip_buf, 31225, 2548 + "1281092513dac4249259348d390735917746eae5f6bce51877"); 2549 + FeedZipHtml(zip_buf, 31250, 2550 + "156436f69c45fdd8113f553ab456eb68f894d53db518bfb79a"); 2551 + FeedZipHtml(zip_buf, 31275, 2552 + "4dd06339df4bba7cd23283bb3907638ca546e0d2010cd81337"); 2553 + FeedZipHtml(zip_buf, 31300, 2554 + "ee86be6cb05c42624b2502f528563e474940cd77a3ace4206c"); 2555 + FeedZipHtml(zip_buf, 31325, 2556 + "864f83acf9fbd7f4d911ada873615732ab05ee62842da98571"); 2557 + FeedZipHtml(zip_buf, 31350, 2558 + "28ff1401216bcc8005be7b3a6f4f81b28ee3f1340907b78e52"); 2559 + FeedZipHtml(zip_buf, 31375, 2560 + "1895c3eb88b12b073e9ef81fbd66db032408a2b4f04aae8e92"); 2561 + FeedZipHtml(zip_buf, 31400, 2562 + "d5190861cfc576368e9ebb2636e88c00e644fa0cb7f110de65"); 2563 + FeedZipHtml(zip_buf, 31425, 2564 + "6af2fdda68885d28f7a013cb4413ee5e234ae7a67904227da2"); 2565 + FeedZipHtml(zip_buf, 31450, 2566 + "4475edc60c5a4a32c34ad0029498d8ce6252aeb12c968bbe11"); 2567 + FeedZipHtml(zip_buf, 31475, 2568 + "931989306d0cc10c0e06078801c7c7cfbd17a245255634c6bf"); 2569 + FeedZipHtml(zip_buf, 31500, 2570 + "786f7fc55454fcdb9693bc3b0eceddfbb172781df92db15164"); 2571 + FeedZipHtml(zip_buf, 31525, 2572 + "258d1df57a42f4a49c657a60f0e897a2c02ef5032a08a67962"); 2573 + FeedZipHtml(zip_buf, 31550, 2574 + "580579a9620c73ea8e0dfa246f299296a939a5685af5834d45"); 2575 + FeedZipHtml(zip_buf, 31575, 2576 + "d4cb7235a90c7729e3c69f1b59650eb1c43b1b79a9c493d128"); 2577 + FeedZipHtml(zip_buf, 31600, 2578 + "c5b519dcc9b6e316bdc1369a9495ffaa1c5e954b2284978a1f"); 2579 + FeedZipHtml(zip_buf, 31625, 2580 + "cfd922bbc1c4335a021634f3da13597229b0fa4a3d2a6886f6"); 2581 + FeedZipHtml(zip_buf, 31650, 2582 + "3c23a7a540446d9711c2309c95528383f8f25e663731e60b75"); 2583 + FeedZipHtml(zip_buf, 31675, 2584 + "a8f6f3d9ad9fc95444a75d4c27d6bd127922ba1c974f456494"); 2585 + FeedZipHtml(zip_buf, 31700, 2586 + "f093fb7d6ac86031521c5700b4321fbdd6c857f5d5e0132616"); 2587 + FeedZipHtml(zip_buf, 31725, 2588 + "82363d0aca925fcc73362847524875a94a72d1954778595742"); 2589 + FeedZipHtml(zip_buf, 31750, 2590 + "2f26b85c9ba548b69a3fb925ae1f83e97d9ccc22a3c99fd491"); 2591 + FeedZipHtml(zip_buf, 31775, 2592 + "ed171eb60693214b6a880f5ff4e936483e337745f388f08efc"); 2593 + FeedZipHtml(zip_buf, 31800, 2594 + "de648a7c8ae07d2236c23281aa0a0f6b7eb3b988582189e5d0"); 2595 + FeedZipHtml(zip_buf, 31825, 2596 + "6031025801b16a6530f18b2d472ac9a8f06d46a6fe3ef1c7b7"); 2597 + FeedZipHtml(zip_buf, 31850, 2598 + "61b792a9e5c6b6bc8761187db9b90595a78041a02bc5136c0d"); 2599 + FeedZipHtml(zip_buf, 31875, 2600 + "8536daf38f6f6771e53e7a9d992dce58116b5dde9ab3280d92"); 2601 + FeedZipHtml(zip_buf, 31900, 2602 + "0c9e7ab86e1625b080422405272a322c20e15d8ad356989d34"); 2603 + FeedZipHtml(zip_buf, 31925, 2604 + "ac08a7f3de56545ac9d92aa76aea654d8ca51d75267c0fa12f"); 2605 + FeedZipHtml(zip_buf, 31950, 2606 + "6bcab2d086a0837907c17783b08ff3b6f55fc60c61e32fbf8f"); 2607 + FeedZipHtml(zip_buf, 31975, 2608 + "838161e8e13fa67783ff0b20a3bf8ffde930f69b19aa6c976c"); 2609 + FeedZipHtml(zip_buf, 32000, 2610 + "bb6000971965a19966b62827ed36f203fd6034e108a5a32b68"); 2611 + FeedZipHtml(zip_buf, 32025, 2612 + "7515b47412a0df337546312c869ea810af9c46d110d3408f56"); 2613 + FeedZipHtml(zip_buf, 32050, 2614 + "7f2a2f033fac5466a081a84be35a1e95cfa8e3f94b63a1be17"); 2615 + FeedZipHtml(zip_buf, 32075, 2616 + "05f786955e6d9e1f6feaed5072cda91aeae06d91f7cb6858e0"); 2617 + FeedZipHtml(zip_buf, 32100, 2618 + "6f5c93c0aa0822934cc4fa78d3ba5024568a5469efbd5c2d0c"); 2619 + FeedZipHtml(zip_buf, 32125, 2620 + "5a1a3b94711e3d970fc0c603469b3211a562565d60c6c7fab2"); 2621 + FeedZipHtml(zip_buf, 32150, 2622 + "dc63ee00b73ea8c7027f388d860bd9c301b0920fa0f12f1fce"); 2623 + FeedZipHtml(zip_buf, 32175, 2624 + "bd2b2eb3f0932ab360ec9bab752b3d964faab4425d9c488486"); 2625 + FeedZipHtml(zip_buf, 32200, 2626 + "60375fb80c7e79c866463f1076b3580d505f2e944c36c9e211"); 2627 + FeedZipHtml(zip_buf, 32225, 2628 + "569d16ed5fac42e002ceb0d92d27b0bc6c5e4e62ce9182c86e"); 2629 + FeedZipHtml(zip_buf, 32250, 2630 + "8a96d27f79a2c7637083a687dcd7ea965475ab49e1e83a78c8"); 2631 + FeedZipHtml(zip_buf, 32275, 2632 + "e65d6c15ca8281a7b3f3816b2a7b8e28c984cfe7eb69c140b9"); 2633 + FeedZipHtml(zip_buf, 32300, 2634 + "ba6a91bd5787ec067d1d45d37b7f4a562ea3a0182f8e2973f4"); 2635 + FeedZipHtml(zip_buf, 32325, 2636 + "3bbb08989852518e2e8ffe3b13beb007e1ff731f936c89fd4d"); 2637 + FeedZipHtml(zip_buf, 32350, 2638 + "f678b214bb092581d694cda9b2db0916d1e2fa5efea8130e26"); 2639 + FeedZipHtml(zip_buf, 32375, 2640 + "8e18b47b692d7a5d595b46e24749b5154779399bbbc81b4089"); 2641 + FeedZipHtml(zip_buf, 32400, 2642 + "0c0f1366dfa6c65dabdbe8b0be26f6272f9e6be450891c25f5"); 2643 + FeedZipHtml(zip_buf, 32425, 2644 + "21b25224135a16533d475a58d3cf3480d0e66672f2426b97dc"); 2645 + FeedZipHtml(zip_buf, 32450, 2646 + "e54d142da90b74ef1a5da6fa76ec9deb8de7af77cb39e06580"); 2647 + FeedZipHtml(zip_buf, 32475, 2648 + "827cbd80911b55cef9dacd040f5bd92c99bdc0e91a4ebe342b"); 2649 + FeedZipHtml(zip_buf, 32500, 2650 + "7a8930bb9371162de3c8163a060b425884d1443e0845262ca3"); 2651 + FeedZipHtml(zip_buf, 32525, 2652 + "2a4aa41d2c4529bc20395947c5495a328fdc82dfedc6097228"); 2653 + FeedZipHtml(zip_buf, 32550, 2654 + "f441c44f47f671280d9a3f3751317874ad1fb9844fcc549868"); 2655 + FeedZipHtml(zip_buf, 32575, 2656 + "e6f50a9c6325967b19a36447f76bb6908b5c32ebc62d367a49"); 2657 + FeedZipHtml(zip_buf, 32600, 2658 + "3657b1e48423a768c6b42042011b095561890621e9e9152fe9"); 2659 + FeedZipHtml(zip_buf, 32625, 2660 + "0b51ca084a820b80e117b27227cb72868507915c8a4b17dcdd"); 2661 + FeedZipHtml(zip_buf, 32650, 2662 + "48883d310842adde04251680efb6d703708af715c457317e49"); 2663 + FeedZipHtml(zip_buf, 32675, 2664 + "e4f7e815d74280a612226831a46e83d97d801d529d444992e8"); 2665 + FeedZipHtml(zip_buf, 32700, 2666 + "4650a511e3b8a3caf53d885c2eb1deda668cdb186b1bef697d"); 2667 + FeedZipHtml(zip_buf, 32725, 2668 + "92a858ff0949a23b6bdb129ebd3a12738e5c81b5cdb1da765a"); 2669 + FeedZipHtml(zip_buf, 32750, 2670 + "db66e4033b6bdb53b1b61918bc65d63663e74fdcda562f60e4"); 2671 + FeedZipHtml(zip_buf, 32775, 2672 + "462dc1dad684d36da8b56d27e3ecac6d5b48f90509a381b5ad"); 2673 + FeedZipHtml(zip_buf, 32800, 2674 + "307a5e75bfa9b96dce050bac632df6b6026390f636f3c36235"); 2675 + FeedZipHtml(zip_buf, 32825, 2676 + "7b31f3cedeb6d1c4e714f01bd9db164680f3a8204fc2de5620"); 2677 + FeedZipHtml(zip_buf, 32850, 2678 + "4a656f5b3b55eeec6d1bf42436ceb92d0edfd454c6f9726e05"); 2679 + FeedZipHtml(zip_buf, 32875, 2680 + "f22e30a7233fe32ee776fea763869cdbed41d4f9736ee745d6"); 2681 + FeedZipHtml(zip_buf, 32900, 2682 + "5dcead4a2ab5d1a436e7d635bc71ceadf3c78bc8b9754fbc88"); 2683 + FeedZipHtml(zip_buf, 32925, 2684 + "9cdbd967deba9cdb1c116d68ce6d6e9733e7dce67ebfcbb9dd"); 2685 + FeedZipHtml(zip_buf, 32950, 2686 + "78fee496b89ae4dc3a7fb1b9998eb3a4dcae433cdba5dcce86"); 2687 + FeedZipHtml(zip_buf, 32975, 2688 + "8635bfd95c449c39e5f691f2d7d79a727b15646c76789fc493"); 2689 + FeedZipHtml(zip_buf, 33000, 2690 + "7165a1c7fcb89637c0ff5e4e89c7d564b436ae98284c3374f8"); 2691 + FeedZipHtml(zip_buf, 33025, 2692 + "0ad38c06888bd379e62c87d2b061fed1ebc5411a7d9b795378"); 2693 + FeedZipHtml(zip_buf, 33050, 2694 + "96892d82f493e987577736e5fea385bcd3d7cb28b2b88d78ad"); 2695 + FeedZipHtml(zip_buf, 33075, 2696 + "199f81b6352cd2185981dbeb2a96eb424336214653ea1e4d3e"); 2697 + FeedZipHtml(zip_buf, 33100, 2698 + "ff2c18cd859bc62b6c2eb2e5587059bc598e40ac94d90aa32b"); 2699 + FeedZipHtml(zip_buf, 33125, 2700 + "39ddba0b2bcb5d5ba1d674c564f5d52d9fb78b8d2d20aaf489"); 2701 + FeedZipHtml(zip_buf, 33150, 2702 + "602c4b364d3196476f13c6eaf37d3d185be297d9468cb52543"); 2703 + FeedZipHtml(zip_buf, 33175, 2704 + "3ad1273f8cb28f49af046b2b7fd1a237cc19e033c64137318e"); 2705 + FeedZipHtml(zip_buf, 33200, 2706 + "5a8731eb9402d71007404084099459cbd8176b247152c06cac"); 2707 + FeedZipHtml(zip_buf, 33225, 2708 + "1fb200e6ccb135f905438e7b1eb0058c11425971a2e021f3fc"); 2709 + FeedZipHtml(zip_buf, 33250, 2710 + "3bb8772a50cde01bc76968d974ec18143e206c06ebb064f1d8"); 2711 + FeedZipHtml(zip_buf, 33275, 2712 + "1b0677c1505461510133af276f3e0d030c7d8ba869d9e4cd21"); 2713 + FeedZipHtml(zip_buf, 33300, 2714 + "ad48db432ce7b56809d1b1ac1f0f87f13d8da22b87cfc904eb"); 2715 + FeedZipHtml(zip_buf, 33325, 2716 + "eb8607c101d9b5ee7177f8699f7f6d5406167374c40a188113"); 2717 + FeedZipHtml(zip_buf, 33350, 2718 + "00ac8d055114ba0d07b7f277075eb9cf3357390cfe3f9328bd"); 2719 + FeedZipHtml(zip_buf, 33375, 2720 + "33c0427d3d16afe892522af762f8486dcfa8c0638ef47c4224"); 2721 + FeedZipHtml(zip_buf, 33400, 2722 + "ce009b89c6f33fc93f4f46a05db54162eb58c08ee23796e20d"); 2723 + FeedZipHtml(zip_buf, 33425, 2724 + "3a17e10ea9df6795cb0ccfcd45333c2952668e371329e77ff2"); 2725 + FeedZipHtml(zip_buf, 33450, 2726 + "f590f2a3e5d41d292f9c948b4ff6d743ca4ec3559350befcf0"); 2727 + FeedZipHtml(zip_buf, 33475, 2728 + "52917ba5867e232ecc8e56ad929fc9f83f2b1dee84c085a15b"); 2729 + FeedZipHtml(zip_buf, 33500, 2730 + "8535ad62fc9c6fc6bad171d9d8b7e3620d4c5e15e3b714ad0a"); 2731 + FeedZipHtml(zip_buf, 33525, 2732 + "72c5a2d0ea6b7e1ca58d9160569fc1ae876d4c023b3f33abca"); 2733 + FeedZipHtml(zip_buf, 33550, 2734 + "ed823fa3cbe981177c22d95c4bc858cf0ff86a13d76b08cb35"); 2735 + FeedZipHtml(zip_buf, 33575, 2736 + "700569ebc5c5b6336b7d36e2df25adef92d67749ebab4a5aaf"); 2737 + FeedZipHtml(zip_buf, 33600, 2738 + "1529ec414b48596fc0e53634637d27d4ec52d4b781ce0b1a66"); 2739 + FeedZipHtml(zip_buf, 33625, 2740 + "bd0a911f5c1982316772ec23d6da883a9079f25f6878657d08"); 2741 + FeedZipHtml(zip_buf, 33650, 2742 + "db2e197da3c8cc69ca69a252ac82d41eb5dac6e6a0e70950a5"); 2743 + FeedZipHtml(zip_buf, 33675, 2744 + "a0af89027789e72ba640498270e6613af601cbfefaac1cdffa"); 2745 + FeedZipHtml(zip_buf, 33700, 2746 + "cffbcfbbcf9f8903de7effe6b5efe1e5fff06cfce26f216a2e"); 2747 + FeedZipHtml(zip_buf, 33725, 2748 + "99ffec0de67af52711257aa56642dfd9d547ef030cc1aedaaf"); 2749 + FeedZipHtml(zip_buf, 33750, 2750 + "bff361133885633bb7c69abde7f8bfcfdebc1333c2d05b89e4"); 2751 + FeedZipHtml(zip_buf, 33775, 2752 + "ae71575310fd1eea467d7c7f8c6294308dd68d1689763dfcc9"); 2753 + FeedZipHtml(zip_buf, 33800, 2754 + "28ee4d905a6a76311961b32a1ae6e0762c6a9ea5b104074b9b"); 2755 + FeedZipHtml(zip_buf, 33825, 2756 + "453e5732b02aaff59bb2df78423e5d875b8ff7440981a02f63"); 2757 + FeedZipHtml(zip_buf, 33850, 2758 + "bd28da93891d00161b41dc5c479061b5be2ee4705613746fac"); 2759 + FeedZipHtml(zip_buf, 33875, 2760 + "16aab744647b6d72aa0b8e9017deef8224455e29ea5add09d9"); 2761 + FeedZipHtml(zip_buf, 33900, 2762 + "1b36799d84830186aaeae4c734031eb1ddbaac94230d9c29a2"); 2763 + FeedZipHtml(zip_buf, 33925, 2764 + "a26310a89bdd785c7cf546e27b5355f6b153b7e1d191805dee"); 2765 + FeedZipHtml(zip_buf, 33950, 2766 + "3ad88ced4cea53c9a6e42d7127be3cf534d0a6f1e83454bcb3"); 2767 + FeedZipHtml(zip_buf, 33975, 2768 + "68c689a929da2452bc5174c083030f7b57808ec484c51f61cf"); 2769 + FeedZipHtml(zip_buf, 34000, 2770 + "c380f8b2f545ac12be81cd86c8d7c470dc1a30003d277005c0"); 2771 + FeedZipHtml(zip_buf, 34025, 2772 + "e3ebe938c8ff4dfddbcf00c2a092daa3d45f730ba214a00601"); 2773 + FeedZipHtml(zip_buf, 34050, 2774 + "afe64817de2b2c3e8c0713fd3d25dd5afd13de8d388a4753fd"); 2775 + FeedZipHtml(zip_buf, 34075, 2776 + "3dee67f7bed88b79a6bbb01b3860f04f3fe9a9f1f8298aa3f7"); 2777 + FeedZipHtml(zip_buf, 34100, 2778 + "413ce04e6e27b9c3f742a04a849990b2c23779c908ae68645e"); 2779 + FeedZipHtml(zip_buf, 34125, 2780 + "a8aba521d3b83431a4598ce8c8598a069a573526ec8709886d"); 2781 + FeedZipHtml(zip_buf, 34150, 2782 + "6872f05a6865d5fd0931d57d4f86358c8304c7a4a269e2d9c5"); 2783 + FeedZipHtml(zip_buf, 34175, 2784 + "d5e9e535eefa158a468839e55d0e4365477ecd0d0d350d09b9"); 2785 + FeedZipHtml(zip_buf, 34200, 2786 + "13a7fcfce9e4e8fad410c1ec368762036c15f673855714bd26"); 2787 + FeedZipHtml(zip_buf, 34225, 2788 + "f13d8967b6f3739bb9f3fb20336ef2cc91d99b1fd15a3f9fba"); 2789 + FeedZipHtml(zip_buf, 34250, 2790 + "1470450b958e7e6134b06f0e1059189b2a1858ce88e5c4a203"); 2791 + FeedZipHtml(zip_buf, 34275, 2792 + "c5e7cffa5e14e79631273727e6ec0e515a428aad568c9ac001"); 2793 + FeedZipHtml(zip_buf, 34300, 2794 + "80d86fa7971f19e3e11ffb2f0898daa62dee161161755277bf"); 2795 + FeedZipHtml(zip_buf, 34325, 2796 + "17e7256ecc4e0970553cf6bb938fdf7d7c7f49a64f1061b80f"); 2797 + FeedZipHtml(zip_buf, 34350, 2798 + "e857287c5bd2f76dd0fd72c5759910254e9cf28e6b54cbbb8b"); 2799 + FeedZipHtml(zip_buf, 34375, 2800 + "e15a6b4ab4b87fd9ebdc8c41e50c1f96438d3dc0123c7c07de"); 2801 + FeedZipHtml(zip_buf, 34400, 2802 + "18c741389e556c4a1302f23d16850502c3ae0e959c20de20c4"); 2803 + FeedZipHtml(zip_buf, 34425, 2804 + "74a0c6fd1cdb4a91f185446a47d7d747c7ff3c3dd93f795ba4"); 2805 + FeedZipHtml(zip_buf, 34450, 2806 + "5475709a85e9cde4c7bcc873b18694ef3b6f06012a94c9f406"); 2807 + FeedZipHtml(zip_buf, 34475, 2808 + "8e381945a9f1849416d5a2c42daa0221e99af708538689e777"); 2809 + FeedZipHtml(zip_buf, 34500, 2810 + "f129f186fe140df832c74bf389944b5b4cbd2f517c1f6942f2"); 2811 + FeedZipHtml(zip_buf, 34525, 2812 + "19f7733b7ea177dc890111854a430bb7c994c2ab8ae542be02"); 2813 + FeedZipHtml(zip_buf, 34550, 2814 + "7c288df2019354c1892fe73ccc026f180cfcee94e6c7a8dd78"); 2815 + FeedZipHtml(zip_buf, 34575, 2816 + "48d1b3ac95980570be3f7871f09ccbe0f8c93064f4d92becf4"); 2817 + FeedZipHtml(zip_buf, 34600, 2818 + "e5dc3b35b6273809134a6e81efe75e40b822ca20a140f09783"); 2819 + FeedZipHtml(zip_buf, 34625, 2820 + "e770528cbd8eb048502705ae80ea9e008afbdc7fb1710a90b3"); 2821 + FeedZipHtml(zip_buf, 34650, 2822 + "b801191dd5994abc03f6e4bdfff4e37bfab1501ebb6c3cc39d"); 2823 + FeedZipHtml(zip_buf, 34675, 2824 + "8040f7c9ef7ef107417e512558e0bfae7355776c2a50eaaa54"); 2825 + FeedZipHtml(zip_buf, 34700, 2826 + "4e41a30411f1564ae0b81549541e522a9275ea51f5a32c00d9"); 2827 + FeedZipHtml(zip_buf, 34725, 2828 + "5c0a805d246e2c3204679c445ad5653ab9f87c7eae8bf8d0be"); 2829 + FeedZipHtml(zip_buf, 34750, 2830 + "c4213f1c9d5df01b2b26d7be9d349d8c1820001b7f32ccdc8f"); 2831 + FeedZipHtml(zip_buf, 34775, 2832 + "1702f86892c5801757999f384a73995f9b714efb176be398d7"); 2833 + FeedZipHtml(zip_buf, 34800, 2834 + "45592024d8664e2e2a18a8ed14a3c450d8f1777002602fb7ec"); 2835 + FeedZipHtml(zip_buf, 34825, 2836 + "8bc4b0d130412e04c74488d19af7a0208c31d20f6e8d1a9fcb"); 2837 + FeedZipHtml(zip_buf, 34850, 2838 + "575bb240262805aa72c1d5fbd72dc8bf232412bd8e24477238"); 2839 + FeedZipHtml(zip_buf, 34875, 2840 + "76d0f82bb256ffbd6a6c857b1d04d9fad13576d47e303ece88"); 2841 + FeedZipHtml(zip_buf, 34900, 2842 + "acf883adc6d55e9066493c95591775483a897a8b4345b1b689"); 2843 + FeedZipHtml(zip_buf, 34925, 2844 + "8c3bf49e0fbdcf40a54184ac936cdde3ca917ec1e2a8300557"); 2845 + FeedZipHtml(zip_buf, 34950, 2846 + "4979b20aa643cc538a3edf3a05433c4e91b7d577c2193b1bea"); 2847 + FeedZipHtml(zip_buf, 34975, 2848 + "10d3a18ab2b3c0328f43cc1cfa232124ee4db273963e582042"); 2849 + FeedZipHtml(zip_buf, 35000, 2850 + "1995e2b2321f2b1ff63c53fca371e56cacd78319df0bc01d13"); 2851 + FeedZipHtml(zip_buf, 35025, 2852 + "dc1cfccc31aa25a4e4620908fcdaa8ec6afb3ff0c66e08ce85"); 2853 + FeedZipHtml(zip_buf, 35050, 2854 + "002665d2ca7d6aab97ec86425bea2b3e794bc23a114f3d5178"); 2855 + FeedZipHtml(zip_buf, 35075, 2856 + "27ce4e574c065519d0232fada83331e249de2270982042187a"); 2857 + FeedZipHtml(zip_buf, 35100, 2858 + "ebcbba4906ffe064398cd52ba857ac47c0f13f7d3cbbb8668a"); 2859 + FeedZipHtml(zip_buf, 35125, 2860 + "730af030e4fcece2f4eafaf2ece2bd73dcf77aaaf35fdf7fbc"); 2861 + FeedZipHtml(zip_buf, 35150, 2862 + "700efa8b1cf4e1f3f9f559f9a27fb5c6d5acfcb7dca4e5cbff"); 2863 + FeedZipHtml(zip_buf, 35175, 2864 + "971cf9fef4e387d3ebcb5f8f3f9e9f9f1e5f9f15c6933cddd1"); 2865 + FeedZipHtml(zip_buf, 35200, 2866 + "7652a67f7f8aa09540697bead8cc64ffc27fcdc522c1457e87"); 2867 + FeedZipHtml(zip_buf, 35225, 2868 + "4f05b2e454055099ec87f172f60bfcf6e7b7d7dfda87fcf6e7"); 2869 + FeedZipHtml(zip_buf, 35250, 2870 + "1f0b7f7af7feddb78bb741e6585719c3b80c28e1a501d3281b"); 2871 + FeedZipHtml(zip_buf, 35275, 2872 + "b978c6618d5f1cdf5830db1061771c46a1a21908b37cc53bb0"); 2873 + FeedZipHtml(zip_buf, 35300, 2874 + "3c2b27b802d68ce3340d3b887558ee94acea61c6055c81050d"); 2875 + FeedZipHtml(zip_buf, 35325, 2876 + "4b584ffb3f285e796606b412f43909d32ebc500dd0a76ce44c"); 2877 + FeedZipHtml(zip_buf, 35350, 2878 + "e8b3f44bd5d95725ef002569b8c07fe2103c240e646930ecc3"); 2879 + FeedZipHtml(zip_buf, 35375, 2880 + "736e4660121f21b40171308b27a0ad735ddc288f43abb9cd05"); 2881 + FeedZipHtml(zip_buf, 35400, 2882 + "189c07e32f834a8b33994f948d646778ce1b9e356c6a6ccfc5"); 2883 + FeedZipHtml(zip_buf, 35425, 2884 + "8133989f8b3ff6365749d5863932672116519244de348b63d1"); 2885 + FeedZipHtml(zip_buf, 35450, 2886 + "32e7a17536b583b89f94bdedd1cca06d792451dfd87fb158f3"); 2887 + FeedZipHtml(zip_buf, 35475, 2888 + "7d858905afa8c224a83e3737b3183f59010ef7fbcf2c2bef3c"); 2889 + FeedZipHtml(zip_buf, 35500, 2890 + "983c974d505a9ddd4641c2fc055804699e9dcd248faf653641"); 2891 + FeedZipHtml(zip_buf, 35525, 2892 + "f975566c5d91557069c85a6a142cc1d279ad826e74749805bf"); 2893 + FeedZipHtml(zip_buf, 35550, 2894 + "0e8444f98a8d156f618ab2b850d7281b41f1bf578958cc3f3c"); 2895 + FeedZipHtml(zip_buf, 35575, 2896 + "3ab7b84d2a951479cf309b70facc100ae94a193fc8594b8c10"); 2897 + FeedZipHtml(zip_buf, 35600, 2898 + "261211356d2ff1c394fc87dd80f3a830502349b0da4605d838"); 2899 + FeedZipHtml(zip_buf, 35625, 2900 + "36ee749c0e64379e22d0ec31adaace42ab86a0dfc3e07b61f3"); 2901 + FeedZipHtml(zip_buf, 35650, 2902 + "34a2d3d3698ac51ab0b5d4547732506879fae9eabd7eb5138e"); 2903 + FeedZipHtml(zip_buf, 35675, 2904 + "720fc9c7e90ba891ec9490210417c1dff36c2c65599979e992"); 2905 + FeedZipHtml(zip_buf, 35700, 2906 + "2e87b1f53a04c42074adc2693d0a1447f8ef1b42a8e6ada1da"); 2907 + FeedZipHtml(zip_buf, 35725, 2908 + "de288c6e88e99ec413543c81517443e928f638960fc74ccbc7"); 2909 + FeedZipHtml(zip_buf, 35750, 2910 + "00937aa89a83be97ff7ebd64c866ce1651de9e47f0142ab870"); 2911 + FeedZipHtml(zip_buf, 35775, 2912 + "c6033e884866c628cc12c6ef8c3e67881429618bea65462dcf"); 2913 + FeedZipHtml(zip_buf, 35800, 2914 + "ec1e67804f786937a8ee52a81f4e4e7fa15b835f24e1c30d55"); 2915 + FeedZipHtml(zip_buf, 35825, 2916 + "8fd762bab965668ca93749312e833238602e0cf943bdb26d44"); 2917 + FeedZipHtml(zip_buf, 35850, 2918 + "3af00e71df74164cfb1e637db1fdb8bf9fddc7fb7fc6f1e860"); 2919 + FeedZipHtml(zip_buf, 35875, 2920 + "f9a8fb1b2c73cef5d36ad0578dac41e1b6875bbfa1a26c453c"); 2921 + FeedZipHtml(zip_buf, 35900, 2922 + "0ea845d2cd7dd80381bf1a9dc5d0db201cdc669b8696ccdbf0"); 2923 + FeedZipHtml(zip_buf, 35925, 2924 + "a45c7ecec1c74453bc55200a03ece55ffff600ffbf370e1f82"); 2925 + FeedZipHtml(zip_buf, 35950, 2926 + "21ccf182e7953f9795f2bc96b1ede77bcb42b2a35e0ff14626"); 2927 + FeedZipHtml(zip_buf, 35975, 2928 + "18b8f12b37a88e3baef1b261f858588008aacc7c724c2720b3"); 2929 + FeedZipHtml(zip_buf, 36000, 2930 + "92bafae500f67d905d503a3552a41bacd690fa270794689021"); 2931 + FeedZipHtml(zip_buf, 36025, 2932 + "82de4d39e5ae4fc04f74e06dc459e4a190bc73d447a6648c17"); 2933 + FeedZipHtml(zip_buf, 36050, 2934 + "0f7a92c59712e3459c0592b2cc15b9ea5d4a7233c56f6531d3"); 2935 + FeedZipHtml(zip_buf, 36075, 2936 + "6592c9463c62137a711699a9859404a4b9b57d5e8267219700"); 2937 + FeedZipHtml(zip_buf, 36100, 2938 + "a6f04c47a8f5865d1de37bc9c8e0536b318d1228d138668539"); 2939 + FeedZipHtml(zip_buf, 36125, 2940 + "40cf49414ca283267e3440ad80f762bc55b677b9b8f9b4d052"); 2941 + FeedZipHtml(zip_buf, 36150, 2942 + "4a234b332cbc8cef6b901046d4e320efac02030d344de2fb9b"); 2943 + FeedZipHtml(zip_buf, 36175, 2944 + "6832ea2cadb2ea42d11403f8c56e4b1e89760952a1f4a12e5f"); 2945 + FeedZipHtml(zip_buf, 36200, 2946 + "4fb34834d6b3bad0d8d8fae3d1388a4d04c6a9e121c7ee5b48"); 2947 + FeedZipHtml(zip_buf, 36225, 2948 + "ac0e94ad43bfb311dccbb570523bd14f8d687921fe27e53e0d"); 2949 + FeedZipHtml(zip_buf, 36250, 2950 + "e38e892a1a09d78029bc2bb228b4b8bb20ed664feaf71dd8ac"); 2951 + FeedZipHtml(zip_buf, 36275, 2952 + "320450e8efb34944b1bccf00a24a5737a6093958d8b0117cba"); 2953 + FeedZipHtml(zip_buf, 36300, 2954 + "78dff6fefbd329fcdfebb377ef70929f83ce274ff81ff15729"); 2955 + FeedZipHtml(zip_buf, 36325, 2956 + "e3108a16227f9159a83ed481325824410aeabeb204f042877c"); 2957 + FeedZipHtml(zip_buf, 36350, 2958 + "de5c1cc0b3713478460604c4fb4fe868cfb9ce9ffd3e0e8c21"); 2959 + FeedZipHtml(zip_buf, 36375, 2960 + "b8cbe2185003fb7a0c9ea138e661ff3ee88cf5283c61ce3b2d"); 2961 + FeedZipHtml(zip_buf, 36400, 2962 + "4f804581448da5513812609384c99014a069c9ca28f8e5197d"); 2963 + FeedZipHtml(zip_buf, 36425, 2964 + "faee99c7269abd03c38c635e71e99b0ecacbc1e0c0bb4fb0b5"); 2965 + FeedZipHtml(zip_buf, 36450, 2966 + "a532eee0ea7bd5c6139091eadc94c6b0bc8bd229a1e76294dc"); 2967 + FeedZipHtml(zip_buf, 36475, 2968 + "1c590d727ab869ed6f1042377f165935fd7d54fc7b9aa4e5a5"); 2969 + FeedZipHtml(zip_buf, 36500, 2970 + "0a962ad689ce8f39efa874c2e418720e9f557500132232814d"); 2971 + FeedZipHtml(zip_buf, 36525, 2972 + "b1d29f7fbc26f18f7f6cfe5ce3a90c117966479d1b23287ca5"); 2973 + FeedZipHtml(zip_buf, 36550, 2974 + "fcb38e5aa99a828255ca07e838999a314d5633e363ca47e1c1"); 2975 + FeedZipHtml(zip_buf, 36575, 2976 + "755c4c611cc78f14920519bd34a4fb437fe0b5d81384cf097b"); 2977 + FeedZipHtml(zip_buf, 36600, 2978 + "8a48d5c13f8d30f20c04c0a9f1e5257d516656f961af64b151"); 2979 + FeedZipHtml(zip_buf, 36625, 2980 + "e962a3d2c546658b8d8a8bd931f54bd1ba24b3a8d5bcf203cb"); 2981 + FeedZipHtml(zip_buf, 36650, 2982 + "3986d788656c8676663b94d6a2a1016c4590c559d40b1e4a2f"); 2983 + FeedZipHtml(zip_buf, 36675, 2984 + "c01cf434802f634be84852985825e83ff85f824f71e86aac6e"); 2985 + FeedZipHtml(zip_buf, 36700, 2986 + "7df65a5596d05a2b28f9785094f42411598eb3852ce5360557"); 2987 + FeedZipHtml(zip_buf, 36725, 2988 + "6f60d54659232e46d11d3d2cb50ac16cb7f95bcd75fe363f90"); 2989 + FeedZipHtml(zip_buf, 36750, 2990 + "ff5ce45d2f651f5b8d08de6f0b46850f35a8f061fe2b182d12"); 2991 + FeedZipHtml(zip_buf, 36775, 2992 + "1596b28fed46850f8be60a75b8f0db232ea18a1e178a28abdf"); 2993 + FeedZipHtml(zip_buf, 36800, 2994 + "e47663d16f0b40a3b39402a1df7f7aebc82652df5ab4b4cb6a"); 2995 + FeedZipHtml(zip_buf, 36825, 2996 + "b4c64017dfa3c22814ad918b2ec4786c8ccacae57feb104375"); 2997 + FeedZipHtml(zip_buf, 36850, 2998 + "a38b8dc72b0f464a9d10a63f1bc0c5f3045137c69895818174"); 2999 + FeedZipHtml(zip_buf, 36875, 3000 + "1b8292c270ea9b194d0a27c944479e630b678509c91aa6d1f6"); 3001 + FeedZipHtml(zip_buf, 36900, 3002 + "67c30e88f13754000693dec950845571001a93884a77960217"); 3003 + FeedZipHtml(zip_buf, 36925, 3004 + "61f12e89474e101b1f35a0dd7094502ebd86d503ba069012de"); 3005 + FeedZipHtml(zip_buf, 36950, 3006 + "65f7b160401ffb697644a16483b0eb886d363f97b38cb58337"); 3007 + FeedZipHtml(zip_buf, 36975, 3008 + "8c7a619f6270a82b5c17992587d08e2799cbe2650118d9071d"); 3009 + FeedZipHtml(zip_buf, 37000, 3010 + "41a38e654031b84cc9306d85b5cb7378ee752488e6bb4c3473"); 3011 + FeedZipHtml(zip_buf, 37025, 3012 + "1be1c1df79a33055011fd2faaa6ffc9b3c6dc1596eced2236a"); 3013 + FeedZipHtml(zip_buf, 37050, 3014 + "35e78eee290c69a95a56641f746bf25cb1a374c0fa9e177a4a"); 3015 + FeedZipHtml(zip_buf, 37075, 3016 + "10a2707aeb1cd220a66aee33ac7dd4ee83649f9e8e987e669c"); 3017 + FeedZipHtml(zip_buf, 37100, 3018 + "4d9727b51d5321561fe22c0459a042e58bdad549704ec22889"); 3019 + FeedZipHtml(zip_buf, 37125, 3020 + "48aa6a217c9316ab4507961b0881ff6320c5e3134dfe2b9f64"); 3021 + FeedZipHtml(zip_buf, 37150, 3022 + "82ab7ee824c73e807e1fc30c7bde1f13515eeeabce2a79170e"); 3023 + FeedZipHtml(zip_buf, 37175, 3024 + "01ae009a9fa9475491f472035a9ef7f0a24a80aef848733ebc"); 3025 + FeedZipHtml(zip_buf, 37200, 3026 + "acfa75f9c7bdb989b32c8f8bbbeaa4c2491b29fc603e176561"); 3027 + FeedZipHtml(zip_buf, 37225, 3028 + "36f5ee6fe334f03ebcbdf4fa20eea598f3051bbc17b0428e31"); 3029 + FeedZipHtml(zip_buf, 37250, 3030 + "516c165dac405f8342a392e0214b80d8bc316a2054d20e4038"); 3031 + FeedZipHtml(zip_buf, 37275, 3032 + "7d6126ab0354a62f15f02b2fea98db13384ccd85215fed65f1"); 3033 + FeedZipHtml(zip_buf, 37300, 3034 + "357515a4d67251c817931496aaba2a3de82bbfacd080d62aaf"); 3035 + FeedZipHtml(zip_buf, 37325, 3036 + "ebed241cf660837c23c59bb2bf3f994b52250d22ba83470036"); 3037 + FeedZipHtml(zip_buf, 37350, 3038 + "e79a57b207c5c2d0ad46a429634218dd74a67c657ccf545a5a"); 3039 + FeedZipHtml(zip_buf, 37375, 3040 + "5425559832f22390a428148366a7f01c8eb75029177d51d18b"); 3041 + FeedZipHtml(zip_buf, 37400, 3042 + "5b104d52297ae5aff9f1f2c4df5df2c4e5ffb94e829c34e1b5"); 3043 + FeedZipHtml(zip_buf, 37425, 3044 + "9408750ca7ee8040881ec9af5ac4b844305531c3dc80ada331"); 3045 + FeedZipHtml(zip_buf, 37450, 3046 + "0603e8505d79e5750c915127e7c16bc21c57cb1be962ca0443"); 3047 + FeedZipHtml(zip_buf, 37475, 3048 + "e3e393bb31ac5b10e052c497fa8a1c0106aa7fd21525eb8fb0"); 3049 + FeedZipHtml(zip_buf, 37500, 3050 + "e3b84f419d694c1640caa3c239ef51d1b232d88183a514bb80"); 3051 + FeedZipHtml(zip_buf, 37525, 3052 + "4d92a2f8de4b510f9b8a6c1ba1df837a3f0cfd743f921d25fa"); 3053 + FeedZipHtml(zip_buf, 37550, 3054 + "9c3b564646a517572e285a9f7797b789977712a65925e5e901"); 3055 + FeedZipHtml(zip_buf, 37575, 3056 + "7881f3b93468c6c4ef8593f44931c5f48f09861d76c3a43b19"); 3057 + FeedZipHtml(zip_buf, 37600, 3058 + "a5dd24ec70d96cfc3608b18d227e82a3b6900d7a5c2b950f41"); 3059 + FeedZipHtml(zip_buf, 37625, 3060 + "258118247bb95bf28cff599064f1301aa2e9b2a2ed89a8cdfe"); 3061 + FeedZipHtml(zip_buf, 37650, 3062 + "958b10bfbcbd6181b5480cea1392c168f8894bd54b23b069e8"); 3063 + FeedZipHtml(zip_buf, 37675, 3064 + "53a0349c830d7edd26369004d45d0f3fc4f130f0a325cfccb4"); 3065 + FeedZipHtml(zip_buf, 37700, 3066 + "c93d063e5f9ee1e77c03a8a5ad2a85f62b73f59a63cfc324aa"); 3067 + FeedZipHtml(zip_buf, 37725, 3068 + "9bbe002164c9049d70ba3563dcc1de9f68c664ea90ac03be9f"); 3069 + FeedZipHtml(zip_buf, 37750, 3070 + "c45db2331f5891d1dc9c511f581a5845e3552a7d835ce11726"); 3071 + FeedZipHtml(zip_buf, 37775, 3072 + "44b9808cb83620d512c9d7f8535c5bb66bf26afe47ef425da6"); 3073 + FeedZipHtml(zip_buf, 37800, 3074 + "da840e84959d648d83a84d085b2c16ff19e0839d197c4c3478"); 3075 + FeedZipHtml(zip_buf, 37825, 3076 + "cc6f8e66ff128ec732011f9b416a9beeec7b2fa08409c84267"); 3077 + FeedZipHtml(zip_buf, 37850, 3078 + "9ca647115546f90c886786ba28536544effafc8ca262528bdd"); 3079 + FeedZipHtml(zip_buf, 37875, 3080 + "12e24076c0a7996fef2cb48fcae47d301cee8bce10c6fc5cfb"); 3081 + FeedZipHtml(zip_buf, 37900, 3082 + "9b1afcdaa0b3adea2009989bc2de0de406c65e9ce68fa4a60a"); 3083 + FeedZipHtml(zip_buf, 37925, 3084 + "a4996213ceb2a71fc8f77d9009aa75f23afdb98504fe91f1d5"); 3085 + FeedZipHtml(zip_buf, 37950, 3086 + "26466a4b1d463dea6854d2927a79847b0a9a87dfcd38003c02"); 3087 + FeedZipHtml(zip_buf, 37975, 3088 + "adb8cb3e2683560d5ac62c55186d79d28dc60e71120e420cef"); 3089 + FeedZipHtml(zip_buf, 38000, 3090 + "35c18cfa8be8790abfc0862aa2e8991addbdf5710f41c24e40"); 3091 + FeedZipHtml(zip_buf, 38025, 3092 + "f8aef378cefaee5e238ce6bd80c3190d2641ed500064e3380d"); 3093 + FeedZipHtml(zip_buf, 38050, 3094 + "33a03a02247b3714b22bbc32f6594b5e1229a3b01b0ca7c2fb"); 3095 + FeedZipHtml(zip_buf, 38075, 3096 + "4ac401071c27f1384850bea43d691f8ec2be3e9c304ea89d84"); 3097 + FeedZipHtml(zip_buf, 38100, 3098 + "ec2d21dc4bfe24e5a40b109940caa9dd88095cd9f55b9c8733"); 3099 + FeedZipHtml(zip_buf, 38125, 3100 + "6542d230874090074e5e035b888281afa0c37b868f808707f0"); 3101 + FeedZipHtml(zip_buf, 38150, 3102 + "1ba4b4241007249e8439e24323b1a39658917ca48791bca85e"); 3103 + FeedZipHtml(zip_buf, 38175, 3104 + "0b67cdf7b061acaac8f2601a92c72da331f9fd7144f6c87ca7"); 3105 + FeedZipHtml(zip_buf, 38200, 3106 + "866416d93cc84966af4ab1d4ea560240ff7cfd6effefca778e"); 3107 + FeedZipHtml(zip_buf, 38225, 3108 + "02f2f5e92fd7082760ee219128f62bba238cc5b52cc2930c5c"); 3109 + FeedZipHtml(zip_buf, 38250, 3110 + "d11df0f1ee1088d16e3efcd5d1e08e046d12e4375f16c87452"); 3111 + FeedZipHtml(zip_buf, 38275, 3112 + "a13d84e5593725b63db79cfcaf4a59f7df3572f42cebd74acc"); 3113 + FeedZipHtml(zip_buf, 38300, 3114 + "736c65c912b5966a82fcd5ede4eb9d7cfd58f95a744d613621"); 3115 + FeedZipHtml(zip_buf, 38325, 3116 + "d16b11f2f1b14019b725407cac78b6574169475440c740ee1c"); 3117 + FeedZipHtml(zip_buf, 38350, 3118 + "7de5a1c50f631db69cb9406a74ab33d6a340204c17a6e02110"); 3119 + FeedZipHtml(zip_buf, 38375, 3120 + "864743f8006fc07e3c5e0fc3ff1c75ab2e4e7fde88ab9b44ab"); 3121 + FeedZipHtml(zip_buf, 38400, 3122 + "be3c6bc5cdbb3e11a7edbc3bf1adfee296da33f07a618169dc"); 3123 + FeedZipHtml(zip_buf, 38425, 3124 + "62e13fffd7df5fbe78f18ac77cbef8f1e2e3cf176ce42f28aa"); 3125 + FeedZipHtml(zip_buf, 38450, 3126 + "be117317ddc5a2dd532c02276bdaf829001f5b8fa803ca7ac0"); 3127 + FeedZipHtml(zip_buf, 38475, 3128 + "0ed48f03b52dda95c13b376a07f4c701bdb23f747ec40ed88f"); 3129 + FeedZipHtml(zip_buf, 38500, 3130 + "c470ecb6fc5380cae91596ba2e43f1dcb01dd81700f64b1fdb"); 3131 + FeedZipHtml(zip_buf, 38525, 3132 + "84d782dd18b603fb23c17e372883f4dd6007dcc701f7fdd851"); 3133 + FeedZipHtml(zip_buf, 38550, 3134 + "54417ed901f731c0350ccd57e19f6e6e911bb366809b694114"); 3135 + FeedZipHtml(zip_buf, 38575, 3136 + "69015bc2ea559d2906938a2a5836acf2ba943624adc9f67f2a"); 3137 + FeedZipHtml(zip_buf, 38600, 3138 + "4cd365e096dfeb41bd4cfb7e1ed24597966dcd412bbb36509b"); 3139 + FeedZipHtml(zip_buf, 38625, 3140 + "a61ca763cd5244977615da8b9adf94ec9f1c3c8c876137ccf4"); 3141 + FeedZipHtml(zip_buf, 38650, 3142 + "195211f323fd76d5976919cc5cb7a9066cd6751a46b9a0df57"); 3143 + FeedZipHtml(zip_buf, 38675, 3144 + "1e155940501af20c4fceea2e49d826f07a9441b1ee1ece5c06"); 3145 + FeedZipHtml(zip_buf, 38700, 3146 + "4cd77d1406b66ac276d6742b15c4a568477999703e8a254bc3"); 3147 + FeedZipHtml(zip_buf, 38725, 3148 + "c328bef047e4250b78ba73f138187de6705c5af8b83c5f4c3d"); 3149 + FeedZipHtml(zip_buf, 38750, 3150 + "1d5ac427c0c01ea2ba9b7f170e83b3d26005feba59b4c77b92"); 3151 + FeedZipHtml(zip_buf, 38775, 3152 + "35ef4b2ce1043e6dfe5efac544717e5fa1aa174bcb5fa96a91"); 3153 + FeedZipHtml(zip_buf, 38800, 3154 + "7104480992c6d9d547ddd70d3d102a7aa5daf7567967570dee"); 3155 + FeedZipHtml(zip_buf, 38825, 3156 + "acedf569883ba176a9f659f32eb94ebd846807dd07e3a1df55"); 3157 + FeedZipHtml(zip_buf, 38850, 3158 + "2df06c70920468b77c2a58636532aeece0c8f2ccebc91b13d4"); 3159 + FeedZipHtml(zip_buf, 38875, 3160 + "94b342e2268a8ca3499a7922d38c3c6bd2a22bd10a7e6def04"); 3161 + FeedZipHtml(zip_buf, 38900, 3162 + "7fff1884aabc5c6cdc5a7eb9eaebec97dbf6ce7ac8d8aec67e"); 3163 + FeedZipHtml(zip_buf, 38925, 3164 + "37f8e4ea4b638d103e50ebf3715a378131a238c1dad12ba4f6"); 3165 + FeedZipHtml(zip_buf, 38950, 3166 + "1f9c45bf42e442f6f138042bdc9c9906625f9a68871358bb4d"); 3167 + FeedZipHtml(zip_buf, 38975, 3168 + "020ab412fe44582fa2170e7e41db955cd22d69c212ff39cc5e"); 3169 + FeedZipHtml(zip_buf, 39000, 3170 + "f5ad2dfee7207bc58d70b0ee63379e0c7b0893008bf24fe8d1"); 3171 + FeedZipHtml(zip_buf, 39025, 3172 + "35e862efc06cba5ac022f33036022ded30c7521867f49cf534"); 3173 + FeedZipHtml(zip_buf, 39050, 3174 + "4ba27d8a0dc49213e5cfb1fcbe590fb2dcd5e63dc9859d2df1"); 3175 + FeedZipHtml(zip_buf, 39075, 3176 + "51aebcbbab4677d7f6c662d0a6f14efb692e80758d8f737e2f"); 3177 + FeedZipHtml(zip_buf, 39100, 3178 + "cb7e9e2bafd9f83ecf35ef1e69eb915e299a3578a66b516d13"); 3179 + FeedZipHtml(zip_buf, 39125, 3180 + "1eea716e93bba77a394ff57598953888e4c7cd7aa4694b9bf3"); 3181 + FeedZipHtml(zip_buf, 39150, 3182 + "32f376667b8e11f3aece4fbebb3af5c8ef566b9d3feaa41465"); 3183 + FeedZipHtml(zip_buf, 39175, 3184 + "5d764df2fb66dd94dcd5e65c96dad192ef4b174273df97fc5e"); 3185 + FeedZipHtml(zip_buf, 39200, 3186 + "7f5f8f2e7e38d38da9a211adb7d80a15b9d8dbf8616f732ed0"); 3187 + FeedZipHtml(zip_buf, 39225, 3188 + "dcd6d264e00fe730271752fcc57983e6804dba425f5fa01417"); 3189 + FeedZipHtml(zip_buf, 39250, 3190 + "3a6f724d1dbc5f7ee512ba2c3680a4020f6dcaf1c30af40e2f"); 3191 + FeedZipHtml(zip_buf, 39275, 3192 + "231cd5eb2ddb65a6ef3a3f00edc3a66893e6b654fc257ca52d"); 3193 + FeedZipHtml(zip_buf, 39300, 3194 + "3a7ec99d80f155ce922fe64b5c47d7e77e8aea4f1a9c72a559"); 3195 + FeedZipHtml(zip_buf, 39325, 3196 + "3775dba35a8803b244ff3ad8f0284e31e50267212290f72d3a"); 3197 + FeedZipHtml(zip_buf, 39350, 3198 + "d4cc46bf1c4f9d88a643de386014b1e66c024519ce560b486b"); 3199 + FeedZipHtml(zip_buf, 39375, 3200 + "e0c6c152c68e2f189cf9699bc4c4fef2c9cf6e4f1fc8c32deb"); 3201 + FeedZipHtml(zip_buf, 39400, 3202 + "4c9484c8e6865211cbc495dabd0b9aa8456486651d16eb519b"); 3203 + FeedZipHtml(zip_buf, 39425, 3204 + "85c2b8ad8562ae316375fa0456d77a379ca4b7ee040af5d909"); 3205 + FeedZipHtml(zip_buf, 39450, 3206 + "2f236969f100bb0c286b887472914588a42e9c915d2a0b0638"); 3207 + FeedZipHtml(zip_buf, 39475, 3208 + "1466d83d38a41a21d4a218d395b2a0f2d4e7b1df83b99c4716"); 3209 + FeedZipHtml(zip_buf, 39500, 3210 + "df5ae4f6180314f7e364fff3e5b9dbb0b13cab062602856f72"); 3211 + FeedZipHtml(zip_buf, 39525, 3212 + "9ba0a57335c6291792dfda215657f1703c6ac66dd59fd9263c"); 3213 + FeedZipHtml(zip_buf, 39550, 3214 + "9cd36b998ab57892811eadfc774352db13140cc209f6a0ef0a"); 3215 + FeedZipHtml(zip_buf, 39575, 3216 + "e5d8a78631dcb10ecd1b80d5bdc0484ae284e3be68b19b99b9"); 3217 + FeedZipHtml(zip_buf, 39600, 3218 + "49563e23cf4e1246ce26936bf18606194cc4e2fe42316f8038"); 3219 + FeedZipHtml(zip_buf, 39625, 3220 + "d408fb319a5bce55c0829dc3e5130c3b6f8cf93f22f9dc8769"); 3221 + FeedZipHtml(zip_buf, 39650, 3222 + "c04cc79dce4123d16203e89e6297c92c38249bc3d5ffa3cac9"); 3223 + FeedZipHtml(zip_buf, 39675, 3224 + "d26d2ebbeee893a45e87cadb619bbf08879f5d9fde7c38fae5"); 3225 + FeedZipHtml(zip_buf, 39700, 3226 + "e6fcf4e2fdf53fbd1675211e4eb1b5d5fbb782ea9dc961d6ea"); 3227 + FeedZipHtml(zip_buf, 39725, 3228 + "7451b88343ce0e310bc678f15880bf17c709e1c80865ad718c"); 3229 + FeedZipHtml(zip_buf, 39750, 3230 + "1780749206dd4962d630624499a49c8242b9bf807cbd304538"); 3231 + FeedZipHtml(zip_buf, 39775, 3232 + "13f844c61b22607986cba98ede91997119f587bf0b9338a24b"); 3233 + FeedZipHtml(zip_buf, 39800, 3234 + "b9f393902e0f2ee3ead3d1f5d91141e4eaf4f8f3e5d9f5af3f"); 3235 + FeedZipHtml(zip_buf, 39825, 3236 + "60f1bf079d38e877d27838c930164625d902aec5492fa04ef4"); 3237 + FeedZipHtml(zip_buf, 39850, 3238 + "66b04c1031569808635c9f805e1a0487646fc272d59fa3d4ef"); 3239 + FeedZipHtml(zip_buf, 39875, 3240 + "eb16c8f9123f05c671852d6ecb3887fcd84269b9ca998a04ea"); 3241 + FeedZipHtml(zip_buf, 39900, 3242 + "6627e6436fe69e3e62e6b2acf4558816ccc3d49e391159c505"); 3243 + FeedZipHtml(zip_buf, 39925, 3244 + "8aed53196b46c1d0e27935cc4eb239516babc5bc284414000c"); 3245 + FeedZipHtml(zip_buf, 39950, 3246 + "b907fc0ebe132d2d902b99b9920e7ea85250e917bdefe23be0"); 3247 + FeedZipHtml(zip_buf, 39975, 3248 + "0a3007900c170393220c73cae22c16eb69cd5a8f62ef2b4e86"); 3249 + FeedZipHtml(zip_buf, 40000, 3250 + "df8a8214dfcc2d26abae6a2c2963d2eb246147c13e8f908ab9"); 3251 + FeedZipHtml(zip_buf, 40025, 3252 + "21f0ee5e814d7c059ad6770b4aeabb61eb9f8ae26e57976727"); 3253 + FeedZipHtml(zip_buf, 40050, 3254 + "b2d70ca98eeb2cf2a6cffa7d7d41b62b38d859fa3e8807893f"); 3255 + FeedZipHtml(zip_buf, 40075, 3256 + "be7575eac88f68f169677b94ac3dfd6c76e6a1684d9c902c91"); 3257 + FeedZipHtml(zip_buf, 40100, 3258 + "2183d66cd1a306e8f787fbb8183b26c27ea571c56c190d83b9"); 3259 + FeedZipHtml(zip_buf, 40125, 3260 + "5a6a8b1806d64101f597bc422288f3b9fd593435b07c60d5aa"); 3261 + FeedZipHtml(zip_buf, 40150, 3262 + "9cd13343f17ce40ef6e6279132b696092a0ceb4f49fc3b49f8"); 3263 + FeedZipHtml(zip_buf, 40175, 3264 + "6597a1066cc65d58fb7d4a57f14f3f7d370cc7e3a077f41038"); 3265 + FeedZipHtml(zip_buf, 40200, 3266 + "f2dd8b63d6762182bb720b5eda8e87fb41e5ad1f0e265cb7e7"); 3267 + FeedZipHtml(zip_buf, 40225, 3268 + "d09380fdb5fd0bb3e828cd50fb139749a60dd26b70d02fed5f"); 3269 + FeedZipHtml(zip_buf, 40250, 3270 + "71d013b94c4c211883c618bbb2df73032aaf51daf8b484217e"); 3271 + FeedZipHtml(zip_buf, 40275, 3272 + "7d3a04c8a78d7ffe0814c8ec5e4038c61fa35c078f73c66fb3"); 3273 + FeedZipHtml(zip_buf, 40300, 3274 + "71547ac3d605f34f49380a3e04f08fd077d8545da336007cb4"); 3275 + FeedZipHtml(zip_buf, 40325, 3276 + "1fcfdcf65a8178e267935129f0e8eb06004ded72adb0fa0c1b"); 3277 + FeedZipHtml(zip_buf, 40350, 3278 + "2e05157edc0048c93dae9932e9d976ba3a0a43360068f67ed7"); 3279 + FeedZipHtml(zip_buf, 40375, 3280 + "0abaa38730bd79717341c5c14b60678cd900e0c9adb2daca8d"); 3281 + FeedZipHtml(zip_buf, 40400, 3282 + "04fa6192321afab0d735c3f2631206a28b591d488da11b00d9"); 3283 + FeedZipHtml(zip_buf, 40425, 3284 + "dcc63714c02f1b20ebcb4d46d6340051b6b729c06c8cad2fb7"); 3285 + FeedZipHtml(zip_buf, 40450, 3286 + "075bd709e1c7da67b2780c6306d30a1bcdb518b2afc389d65a"); 3287 + FeedZipHtml(zip_buf, 40475, 3288 + "8a1f63ab5e7cfff22fffd8ff7e9925f967b2060967bb04d5a9"); 3289 + FeedZipHtml(zip_buf, 40500, 3290 + "ec0d5dc4f1b2912d0faf4236e9cc8743b871bcb6eb55c3e138"); 3291 + FeedZipHtml(zip_buf, 40525, 3292 + "b80fc32fafaf3f7efa584347250e7ddd0e3bc12ed9c2360e08"); 3293 + FeedZipHtml(zip_buf, 40550, 3294 + "8c2745d4690be5561104207a141bbf83b1dd49221ac60aaf7e"); 3295 + FeedZipHtml(zip_buf, 40575, 3296 + "395be122ff38f9355a3f1d4686fc8856ad39612df0140e9b4e"); 3297 + FeedZipHtml(zip_buf, 40600, 3298 + "8c7eacce1b4190219f48868a4741761f275ff86f4084fe7e46"); 3299 + FeedZipHtml(zip_buf, 40625, 3300 + "6732acf5e6e5c0215f10fa005885319e6d0b21da16f8efd22a"); 3301 + FeedZipHtml(zip_buf, 40650, 3302 + "df0aa3ee70420e1d19b01f00176323362d52514fe20c182842"); 3303 + FeedZipHtml(zip_buf, 40675, 3304 + "18eed7c1ceaf6f8cefd5083eff9dfcb2e04bb92eb815382542"); 3305 + FeedZipHtml(zip_buf, 40700, 3306 + "1af8cd8eb20801831b0104d0a530bdf7a7f0367c9baa0639b2"); 3307 + FeedZipHtml(zip_buf, 40725, 3308 + "d7acf0ded005b9dbe468a445eee01940db632ffe63ef9ba0bd"); 3309 + FeedZipHtml(zip_buf, 40750, 3310 + "ff42bba66a9ea48a50247baf550488df9bdfbf3c227a561acd"); 3311 + FeedZipHtml(zip_buf, 40775, 3312 + "d1f6d0cdd0c078b8a099e1cfb77e7af3672e20680d2bb66192"); 3313 + FeedZipHtml(zip_buf, 40800, 3314 + "6190f851976671f72fda60aee7c37f9ebcfd7025c27053afc5"); 3315 + FeedZipHtml(zip_buf, 40825, 3316 + "2c07ce257c53e4cc0f29e425a2c5bf047b6e97588a2103e81a"); 3317 + FeedZipHtml(zip_buf, 40850, 3318 + "0dc6586e3d502fcf016fc3ea360e0091e047881c8aa8ab5e78"); 3319 + FeedZipHtml(zip_buf, 40875, 3320 + "17f6d08a3b89c23f260109496ce3355eb243da763ae9c0d261"); 3321 + FeedZipHtml(zip_buf, 40900, 3322 + "c48d1b69d74c50e8e90d3376d38e29e9e720d7bd1c16c74bd6"); 3323 + FeedZipHtml(zip_buf, 40925, 3324 + "0bcb8e4f9701754c87cbbc9aa6593032c5306b0b54967e9fcd"); 3325 + FeedZipHtml(zip_buf, 40950, 3326 + "c8da49b9e75888d08657820757f8cf0d9b736e5e3a818ce981"); 3327 + FeedZipHtml(zip_buf, 40975, 3328 + "61df9f78fb18b84d43bbb13c714a1b5086e99a3d108ee2b1f4"); 3329 + FeedZipHtml(zip_buf, 41000, 3330 + "89551f6e8dbfece606b17b18728c96b5b3035af1f9c1f3dc7a"); 3331 + FeedZipHtml(zip_buf, 41025, 3332 + "ca9d6dcca45cd98e6ef0b57cb3ede29a6d836bda4c323d447e"); 3333 + FeedZipHtml(zip_buf, 41050, 3334 + "aea518c553590ababfc5500bacf6cc097979b7bcdeb488022b"); 3335 + FeedZipHtml(zip_buf, 41075, 3336 + "63b627a08c94b35af3ebb21eda05b3012ce63a0c84877b14df"); 3337 + FeedZipHtml(zip_buf, 41100, 3338 + "910b46e33753fbd0a30c8a50c7d0efe99e0bc8380e05da6030"); 3339 + FeedZipHtml(zip_buf, 41125, 3340 + "ed1780f75d904c31da02ee629262b85e24923200f9a7f18412"); 3341 + FeedZipHtml(zip_buf, 41150, 3342 + "ec0cdf7a8a1210d0f7fd2de08cfcde8b49f2dca097f6a8d73b"); 3343 + FeedZipHtml(zip_buf, 41175, 3344 + "4be38bb8e732445cdfe8cfa58f4adfef06fbc577a5cded31f3"); 3345 + FeedZipHtml(zip_buf, 41200, 3346 + "c9229b2795d11df8bd9e48770de10689f1e2a129de461c5006"); 3347 + FeedZipHtml(zip_buf, 41225, 3348 + "5c99b19eb2bfcec8cfbab78439a05a0bc7dd3bf899c42da450"); 3349 + FeedZipHtml(zip_buf, 41250, 3350 + "0a2a0a2302db2bce5191a46ba9f49e5a8f586860488b5c379e"); 3351 + FeedZipHtml(zip_buf, 41275, 3352 + "6e3cf3bfc0ec885318b6cbc199d3827501f750826ec2517c76"); 3353 + FeedZipHtml(zip_buf, 41300, 3354 + "c2a59364096d4cf015873710f1552527d288598e671f800cab"); 3355 + FeedZipHtml(zip_buf, 41325, 3356 + "10cdf85e8a69117c9c1dd3e65470978266c88c10941692894e"); 3357 + FeedZipHtml(zip_buf, 41350, 3358 + "10e21418871b51d7e5928bf34997834381b696725fe6ce9b85"); 3359 + FeedZipHtml(zip_buf, 41375, 3360 + "ded56530aaba2afd79d69bdac01be107a270276b833d33dcd3"); 3361 + FeedZipHtml(zip_buf, 41400, 3362 + "dea08a1fe3e772211f1b8c94924a10f54abf61c85f4ac1aedb"); 3363 + FeedZipHtml(zip_buf, 41425, 3364 + "cbb51134c87523744ba16c7b1fdb375b66d8a8e68734ed22ef"); 3365 + FeedZipHtml(zip_buf, 41450, 3366 + "f9f8d68f06014e8b7076deb53da4f4be031830e7756e122176"); 3367 + FeedZipHtml(zip_buf, 41475, 3368 + "e9b404f58191f0097026d86354683c01e99ba3130de3b1472d"); 3369 + FeedZipHtml(zip_buf, 41500, 3370 + "eed1b47c1b8ecb6e77554cb39470f5e7592f7203efcac134f1"); 3371 + FeedZipHtml(zip_buf, 41525, 3372 + "646b83fd45708feba757a0e0b9020dae6fac11b393d23689b2"); 3373 + FeedZipHtml(zip_buf, 41550, 3374 + "291e51d10dc89964106141935825ce3e0a7a2420d25be75d9b"); 3375 + FeedZipHtml(zip_buf, 41575, 3376 + "f1f482dcf8127a012a521ca4ae350d2c3724ecf0c05e715202"); 3377 + FeedZipHtml(zip_buf, 41600, 3378 + "eea6489a3ddc4d392e980376a8d0181546718ff3bf487f56b7"); 3379 + FeedZipHtml(zip_buf, 41625, 3380 + "aebecb1bdd0c2c1004ffcfc01f563104fc5e89032fdc52147c"); 3381 + FeedZipHtml(zip_buf, 41650, 3382 + "7959ceab370c0d6ee19044a944a56ce102b296ee6882bd2932"); 3383 + FeedZipHtml(zip_buf, 41675, 3384 + "dd06a303ef2d7a8db23c36a44d390323808126b9f49d94cc9f"); 3385 + FeedZipHtml(zip_buf, 41700, 3386 + "daf32d3182e233e42fe23bd06c6742287e9996c7554af1c9f8"); 3387 + FeedZipHtml(zip_buf, 41725, 3388 + "bec327173e5dbb2fd7cd5e084328f641e2d9462001685fb879"); 3389 + FeedZipHtml(zip_buf, 41750, 3390 + "e01d685871459f9386668ed9a969a69ae6d2ce5829e3266e98"); 3391 + FeedZipHtml(zip_buf, 41775, 3392 + "772f87d1e385965b32a4599c88fee262442ed184ae6133943e"); 3393 + FeedZipHtml(zip_buf, 41800, 3394 + "811bc02bde519db572f4114376d8b36cec714835d6f7474935"); 3395 + FeedZipHtml(zip_buf, 41825, 3396 + "0b4720d0220de652a6681a43e65436370c05b4be496aa66cf8"); 3397 + FeedZipHtml(zip_buf, 41850, 3398 + "28f93c5fb8f0cdf6082d88e88bd7ee165f4caea15160ae1b27"); 3399 + FeedZipHtml(zip_buf, 41875, 3400 + "dc59c28d57b10c7bc8d77de3d8d893ef242a972cc8ba3e8f60"); 3401 + FeedZipHtml(zip_buf, 41900, 3402 + "914e4080251176e1f78ced1c60cef2227b70d1b931b37ae4ea"); 3403 + FeedZipHtml(zip_buf, 41925, 3404 + "4ab7adedaa15c0c99d66d57bf3ab48910c4b9fe2e174201b80"); 3405 + FeedZipHtml(zip_buf, 41950, 3406 + "2cfe4248c4adba0d1a30e7559cbce560bb4db98ac998fbe278"); 3407 + FeedZipHtml(zip_buf, 41975, 3408 + "b0318a6c34fd97cc4c7b0106c70c4390e3f17a86522d046a0a"); 3409 + FeedZipHtml(zip_buf, 42000, 3410 + "47a1d201b8c337dd9df06e0ac382d2f7e84a44623c752b9fe0"); 3411 + FeedZipHtml(zip_buf, 42025, 3412 + "d6bbc3b8fb050bc8b43de9a6e7f9b3c4bf0b12511d874b3a50"); 3413 + FeedZipHtml(zip_buf, 42050, 3414 + "8906e0e461c2292822ad91bc69af276f020c9cc64ac231fe8b"); 3415 + FeedZipHtml(zip_buf, 42075, 3416 + "0426fcf79ee60b7ef245327d0a84e4e0092f05505645c41981"); 3417 + FeedZipHtml(zip_buf, 42100, 3418 + "a68b44385914ae2ae83137a63a1e63d3b04b066639b1cb375b"); 3419 + FeedZipHtml(zip_buf, 42125, 3420 + "96c3838c414218b8a891499cf95086b1c7930c4b2fd211c92f"); 3421 + FeedZipHtml(zip_buf, 42150, 3422 + "4ff5aa106bacd8df7b3f15b7c057893f55ae032c8790a69391"); 3423 + FeedZipHtml(zip_buf, 42175, 3424 + "aa48cda546682b6d7e27a89a91ef25f17d412644fb19d743e6"); 3425 + FeedZipHtml(zip_buf, 42200, 3426 + "4de07e03bf7b0bc4907188805e882332c26c6ac4f08b470d04"); 3427 + FeedZipHtml(zip_buf, 42225, 3428 + "d80c439f70b73c91152d9b628c8a125b92981289f198a2ba8a"); 3429 + FeedZipHtml(zip_buf, 42250, 3430 + "370d326e49bf6284d5418765e86a8d28e591caddf3da6c50b5"); 3431 + FeedZipHtml(zip_buf, 42275, 3432 + "09183b8ec79321e32c2286bece0e45dec6b2163afc70287810"); 3433 + FeedZipHtml(zip_buf, 42300, 3434 + "32c5a41302bb820389972c0c52ab06977de56a52aa749ebb7a"); 3435 + FeedZipHtml(zip_buf, 42325, 3436 + "55011deb682382bfe2706ecae1c08fbd701444292556c0d25c"); 3437 + FeedZipHtml(zip_buf, 42350, 3438 + "8d542fcbbfe5e814d74fccee5b721f2bc622784651877b3bfd"); 3439 + FeedZipHtml(zip_buf, 42375, 3440 + "c4c1318eac06e37b29123536cb9b61b38f9a7b6b0364b1ec10"); 3441 + FeedZipHtml(zip_buf, 42400, 3442 + "a01272bc7e2844620e5bf2d9648695ef4837ca3c02cc810218"); 3443 + FeedZipHtml(zip_buf, 42425, 3444 + "46ba62e4e575594d2505129987118f42aa72c4cf3df15a47bd"); 3445 + FeedZipHtml(zip_buf, 42450, 3446 + "27aef2a3b0916ade2a5f0533d864006c4ee328c65f52e865b9"); 3447 + FeedZipHtml(zip_buf, 42475, 3448 + "f8ae43b1166e08c4ca0220965421adf17de1483bffdc4f1169"); 3449 + FeedZipHtml(zip_buf, 42500, 3450 + "857b8b9c59a9b6390bb1e16960f0c22d49427ba9c260e3fbc2"); 3451 + FeedZipHtml(zip_buf, 42525, 3452 + "3178feb99f2206b339e14923f0c20d2642aaa4ae3e6e14ce8f"); 3453 + FeedZipHtml(zip_buf, 42550, 3454 + "980f890ba565f0121e39f50c38bc41e9990602b34d9eac2f02"); 3455 + FeedZipHtml(zip_buf, 42575, 3456 + "f45e0b951faa264b05fa27c32c541ff738aab5980528910901"); 3457 + FeedZipHtml(zip_buf, 42600, 3458 + "45e526a76cb8e72ae1721407976c1f05a062301af986a1d2b4"); 3459 + FeedZipHtml(zip_buf, 42625, 3460 + "9b9c9d90c86eef81dc19cba213ecf0208b9956108b1e568ad6"); 3461 + FeedZipHtml(zip_buf, 42650, 3462 + "b339914a28e771eb3c1d1a3a57872c23247bc422a8e93bf68a"); 3463 + FeedZipHtml(zip_buf, 42675, 3464 + "3e519a2aee838d884ba7ab8bd8eda5a918bc2a1a9b7fb5ada3"); 3465 + FeedZipHtml(zip_buf, 42700, 3466 + "b49f30532b0d4721209dcc49b44162901b2301f77511395e49"); 3467 + FeedZipHtml(zip_buf, 42725, 3468 + "988558fbbd17f645d224134aa17a3a4c134703eccb0368340a"); 3469 + FeedZipHtml(zip_buf, 42750, 3470 + "ff14fd6146fe43389a8c80f882a0d7d61152bfa33146d8d899"); 3471 + FeedZipHtml(zip_buf, 42775, 3472 + "d1e32746cdf12401a2c5c431387c9c481f9361383a8ea334f8"); 3473 + FeedZipHtml(zip_buf, 42800, 3474 + "63c2450ca4495018d087817f17b8e809ade59c141e465d9800"); 3475 + FeedZipHtml(zip_buf, 42825, 3476 + "6805099aaafa732212a5b0f97daa9ffc107427449906c4847f"); 3477 + FeedZipHtml(zip_buf, 42850, 3478 + "050ed7dae3ba01c39c2f9576a72a1803d161b6acf6b6e57744"); 3479 + FeedZipHtml(zip_buf, 42875, 3480 + "bfea87dcfe1d4623e340aab637b7634d8f674df8ff5e45feb8"); 3481 + FeedZipHtml(zip_buf, 42900, 3482 + "9c1fc911a56c810d8a458e1002be50f99a7a17a38b33cdbdae"); 3483 + FeedZipHtml(zip_buf, 42925, 3484 + "baeb9b147e5eca8eac91e434c6f2992583673acd4689100403"); 3485 + FeedZipHtml(zip_buf, 42950, 3486 + "f67a019bc2baececb7466a07f8d12174fb332c588d9560f7d8"); 3487 + FeedZipHtml(zip_buf, 42975, 3488 + "5b9072c122cd29ac0e0fafed2c76264723d39d12b029dd50e6"); 3489 + FeedZipHtml(zip_buf, 43000, 3490 + "9852497506a42c358d1a6dd453ce15515e80d3ad69cc0f5611"); 3491 + FeedZipHtml(zip_buf, 43025, 3492 + "52aa7021bcf34c9d3f58354c5f89a5a99c3a92ab33e73cb0ad"); 3493 + FeedZipHtml(zip_buf, 43050, 3494 + "e053edb6a1cd71616b6057a2d9c6040e3d4497d10873fc11a2"); 3495 + FeedZipHtml(zip_buf, 43075, 3496 + "29a5eaf6b12b9b9971fe4d33264488b90a4e34dbae0411e437"); 3497 + FeedZipHtml(zip_buf, 43100, 3498 + "86c2a686a2eacda993f5b19d920ebdc08628b77e1a5899f855"); 3499 + FeedZipHtml(zip_buf, 43125, 3500 + "1c118181fe2aedd35f029fbbe245e03fafd9df59c6ee72034b"); 3501 + FeedZipHtml(zip_buf, 43150, 3502 + "b94fafb33f56fd798dbf93776edff10320d2c928727d612f25"); 3503 + FeedZipHtml(zip_buf, 43175, 3504 + "3b62ed4f8a2956739f3a216f33cfd4904f2f924d6facb54ffa"); 3505 + FeedZipHtml(zip_buf, 43200, 3506 + "bdb1cf837228924c6602928e028c972886dc8a33336992330c"); 3507 + FeedZipHtml(zip_buf, 43225, 3508 + "e79fba0d4e308e346364f77b61328523381b15a6d0d8c10b44"); 3509 + FeedZipHtml(zip_buf, 43250, 3510 + "14ca62a046f9e3909fcf13fd8e0c3e231a95441cbbd9f54523"); 3511 + FeedZipHtml(zip_buf, 43275, 3512 + "8bfc360b7da3a583ca68dd09b33efb707476f18c381c9676e8"); 3513 + FeedZipHtml(zip_buf, 43300, 3514 + "e4f894dc546ef33065dc7c6bba6a4b2008c40c6230602fd999"); 3515 + FeedZipHtml(zip_buf, 43325, 3516 + "3fc9e2914ffa0489bbf8f52ee8c9a70c9bb4c0ce7b9d6707cf"); 3517 + FeedZipHtml(zip_buf, 43350, 3518 + "08d662ffcefe8e8a89f2ca6d51d3cf2861419170a881e05b66"); 3519 + FeedZipHtml(zip_buf, 43375, 3520 + "eca682d31640e4b801e9813684fc010aeb52cc37bcccb2d818"); 3521 + FeedZipHtml(zip_buf, 43400, 3522 + "7a9bcd3263dae9cc07341ccf4d5e38ab030535aa1a53abb29c"); 3523 + FeedZipHtml(zip_buf, 43425, 3524 + "bb9bdc41009f21bcb587967db25db44ab68bc6977689c9a52d"); 3525 + FeedZipHtml(zip_buf, 43450, 3526 + "b762c59b9973da7f943775ac02034c5898417e85935a1d6ab4"); 3527 + FeedZipHtml(zip_buf, 43475, 3528 + "38d52e1132c494ee875e07acc04440894833b26485a01bcac3"); 3529 + FeedZipHtml(zip_buf, 43500, 3530 + "c1aa627e0f2408557bac20a8efe5375bf1ecbf9665e897f2d8"); 3531 + FeedZipHtml(zip_buf, 43525, 3532 + "4f3a544a29a01baa78ebad71ad528d020d1f37a0b1df90a93e"); 3533 + FeedZipHtml(zip_buf, 43550, 3534 + "2d795c0a3851f61a2f665563c0308806dc87aacaf0e2dadf46"); 3535 + FeedZipHtml(zip_buf, 43575, 3536 + "3d822215713e7b27c5595961368c7440eee92db6474e3c6de8"); 3537 + FeedZipHtml(zip_buf, 43600, 3538 + "4a4510170ad8f954716565e84edd8f16f68b540418bec95d13"); 3539 + FeedZipHtml(zip_buf, 43625, 3540 + "415cf78af231b050378a9ac84651a8df6007de1fbc97c25e4b"); 3541 + FeedZipHtml(zip_buf, 43650, 3542 + "3d7c8743810efa78fa9d60f8d041b1b390d8923c1d59e7bc5b"); 3543 + FeedZipHtml(zip_buf, 43675, 3544 + "9f628fa5ae424df058341735cba2c9a803a3012cbcdf027329"); 3545 + FeedZipHtml(zip_buf, 43700, 3546 + "3b1e2359b3e3a1728e45cc3265cf405e2f1a821935d2447c1e"); 3547 + FeedZipHtml(zip_buf, 43725, 3548 + "ae913b654066b60c5e04b1b50c6b2485f8c474814a5278df23"); 3549 + FeedZipHtml(zip_buf, 43750, 3550 + "d5e58f74cce130be277b0aa82d85430521698c85eb322516d7"); 3551 + FeedZipHtml(zip_buf, 43775, 3552 + "49f1d1173a996f85378963d29bc32a2cd9c4266fc83447a070"); 3553 + FeedZipHtml(zip_buf, 43800, 3554 + "41969fbe59774165a3a8df12c6db28968cd06190eaac483a3e"); 3555 + FeedZipHtml(zip_buf, 43825, 3556 + "7539a35859a5578ec7c3e28b49863fa94d93fc5283805c50b2"); 3557 + FeedZipHtml(zip_buf, 43850, 3558 + "1b8f4333b251dca2417af201f1492f9ce2011aab836e025fae"); 3559 + FeedZipHtml(zip_buf, 43875, 3560 + "76483dcd6b554373d4f275a886badd6a37d5f42ddcb25db7b5"); 3561 + FeedZipHtml(zip_buf, 43900, 3562 + "1e34e3a3faf40ffa148269381037affb2e59e5152249851356"); 3563 + FeedZipHtml(zip_buf, 43925, 3564 + "d534df69c73bed78a71d2f483b765abad33251bd42ec72a9c6"); 3565 + FeedZipHtml(zip_buf, 43950, 3566 + "cd54e29c8ac74e51b145d52e15ddc078d98736d5d0458d023f"); 3567 + FeedZipHtml(zip_buf, 43975, 3568 + "2a0894664959d59fb4dcb41f9a5ecf7045be8675a9fce63b5b"); 3569 + FeedZipHtml(zip_buf, 44000, 3570 + "1761511cbb91d2dcaab6b60c996e63f6be1ac96e9b8fbb8df2"); 3571 + FeedZipHtml(zip_buf, 44025, 3572 + "5d45f44e5e95db05ef6c68f0ce9a1f89d3878a70f0dcc05510"); 3573 + FeedZipHtml(zip_buf, 44050, 3574 + "760f70a713462e8fa9a66939e82e0cee1ffbbc6cc5b996f136"); 3575 + FeedZipHtml(zip_buf, 44075, 3576 + "3d8d83cf6cfedf81e869bd81db69e3c01bfd99e2b2e0affacd"); 3577 + FeedZipHtml(zip_buf, 44100, 3578 + "60f3846c7724add73dcfd65a89f547e81ac0762b63eee5813d"); 3579 + FeedZipHtml(zip_buf, 44125, 3580 + "7f3191fac7609ad36384791a9f07fc671f34186cb8a0acd9fe"); 3581 + FeedZipHtml(zip_buf, 44150, 3582 + "9d69c5462098f84880507b968fdd30f6696e111cc693e193e8"); 3583 + FeedZipHtml(zip_buf, 44175, 3584 + "633102d91b22c24ab6723d8e1ed39675f1776de1c0a711eb0b"); 3585 + FeedZipHtml(zip_buf, 44200, 3586 + "c832183b33d0ce0cb43c33900b2d8c9e24ca51081822261769"); 3587 + FeedZipHtml(zip_buf, 44225, 3588 + "5c9ace9c6697afc7c0e4e21408c53c5e8bb22346802b3789fa"); 3589 + FeedZipHtml(zip_buf, 44250, 3590 + "f4239b58d222bf52bc41322dd15f86783b603b53114f9cdec6"); 3591 + FeedZipHtml(zip_buf, 44275, 3592 + "93618fb0dbe2be62a766d1559b786451108132b9de2155c7c5"); 3593 + FeedZipHtml(zip_buf, 44300, 3594 + "37b8ecb4b28bd44ff84e5b9da3b0e70d56eaa26d8b23d06bbe"); 3595 + FeedZipHtml(zip_buf, 44325, 3596 + "b413a8421ac04bdf5cc41999cf0e99a6ca78bd62f1aef3aa6d"); 3597 + FeedZipHtml(zip_buf, 44350, 3598 + "b03a26d78f0d6be0c9db7c25249bce7676caedb1533e972a28"); 3599 + FeedZipHtml(zip_buf, 44375, 3600 + "9574117aa8471604f8aae31d3a2400a13ce8163db23883a392"); 3601 + FeedZipHtml(zip_buf, 44400, 3602 + "348364929344525851d81f142a6be4e337953147e1f351a526"); 3603 + FeedZipHtml(zip_buf, 44425, 3604 + "3c24eff83dda2c9af4752ab76435568ed5f0cd5717e636eb6d"); 3605 + FeedZipHtml(zip_buf, 44450, 3606 + "c5e99667c47d1ac75faabafc75026a1b95e6868663c1ff76b6"); 3607 + FeedZipHtml(zip_buf, 44475, 3608 + "e36db31d7f5d0fb7067ff96b6d5c51492548277babfd591bb1"); 3609 + FeedZipHtml(zip_buf, 44500, 3610 + "9962c93b937048b2a9d58c78038c63b24030fca7324b31728a"); 3611 + FeedZipHtml(zip_buf, 44525, 3612 + "6e7a0aed2888529c845b910ff16f234ab6e926a890bbdaf88a"); 3613 + FeedZipHtml(zip_buf, 44550, 3614 + "e28c6a1aa9c4504ca82808382d60afc8c6d4754b552aa16c42"); 3615 + FeedZipHtml(zip_buf, 44575, 3616 + "9b6279d14074a10dc23c8ed219f66ccd87502a1c89462d6c21"); 3617 + FeedZipHtml(zip_buf, 44600, 3618 + "419ae0cddedf8ad65899ff85ce071ab84f3fccf7cbcd1f491c"); 3619 + FeedZipHtml(zip_buf, 44625, 3620 + "050d8825e720435efe2043bffb4548e1eeed7b2d78287ca06f"); 3621 + FeedZipHtml(zip_buf, 44650, 3622 + "1f4b50f426d4a312fe74879d533dd4f2d292b4fc7c1505a1f8"); 3623 + FeedZipHtml(zip_buf, 44675, 3624 + "d7c60220cff98edb9cd70abe2ee006dc55ec8e81cb48afd91d"); 3625 + FeedZipHtml(zip_buf, 44700, 3626 + "61944415374c9daa8f454452b576e4acb65049960c6eafc867"); 3627 + FeedZipHtml(zip_buf, 44725, 3628 + "bd09de4f2fe425d416cd4868dd8518d63d8637c1274a3ee49a"); 3629 + FeedZipHtml(zip_buf, 44750, 3630 + "a4fd7ed80d31e8fd3b7a993cbc1d2cff689b758475088be6a7"); 3631 + FeedZipHtml(zip_buf, 44775, 3632 + "930eb651269ddf1f494ee9df01ab24c9e4f2e8c321239ab651"); 3633 + FeedZipHtml(zip_buf, 44800, 3634 + "4bab293fa6b497dbc9c04037b41c79e3a19fc19eacfed3e2f9"); 3635 + FeedZipHtml(zip_buf, 44825, 3636 + "a5f0667c3fd482b00cc300e6ee103221b39618850932513a11"); 3637 + FeedZipHtml(zip_buf, 44850, 3638 + "87c3ee62a398ad3a5e90247152d6f42157c9d27c4d16e78ebc"); 3639 + FeedZipHtml(zip_buf, 44875, 3640 + "24fe743582fb2ae9155236b294278f40e6eb86497702f24d98"); 3641 + FeedZipHtml(zip_buf, 44900, 3642 + "4d1f2be42e7c5d1e097cc2df1a91d17c4a94815f971b168c5f"); 3643 + FeedZipHtml(zip_buf, 44925, 3644 + "9223b5308aa49c846613e63ddeb1019d30ea050f5e8a609529"); 3645 + FeedZipHtml(zip_buf, 44950, 3646 + "0c70e21c0c091830871ff504fbf2086eae9fe1071c6f57c430"); 3647 + FeedZipHtml(zip_buf, 44975, 3648 + "6c4d2cc12251a1e80a8a48149a1d958a9b1bc34b9e62fd7cb8"); 3649 + FeedZipHtml(zip_buf, 45000, 3650 + "69dfbb0579074066eceed91be33728fcf96f5ca6e6e2c409b6"); 3651 + FeedZipHtml(zip_buf, 45025, 3652 + "70c472ded97d107047eb83e7a685eb39ffb30d0f0b324209ca"); 3653 + FeedZipHtml(zip_buf, 45050, 3654 + "02743a6f380185ad40c097e06470ca0199e63478e4ece2811c"); 3655 + FeedZipHtml(zip_buf, 45075, 3656 + "0f8113a090dc0b536253b04bb167049bfd52756f83ee17a709"); 3657 + FeedZipHtml(zip_buf, 45100, 3658 + "1d2696ec9cf76e64e4e90be13c7ae4dc9866c4ee36d3a4e51b"); 3659 + FeedZipHtml(zip_buf, 45125, 3660 + "e715e7c86ee1f92b6c531ab4aab747f7de2cfe6e990ced046e"); 3661 + FeedZipHtml(zip_buf, 45150, 3662 + "18775c5216bf62f096f48e6fca117ae26c959d0f577d2ba45b"); 3663 + FeedZipHtml(zip_buf, 45175, 3664 + "36bd151afc546fa5aad3eff26fa5b2f9a063d013bb85097668"); 3665 + FeedZipHtml(zip_buf, 45200, 3666 + "c256af20d4898be81802c8515418818231b66e11cd9d583d92"); 3667 + FeedZipHtml(zip_buf, 45225, 3668 + "8966bad31ca83a4374b2a2ab87ff92defa496064cdc94630af"); 3669 + FeedZipHtml(zip_buf, 45250, 3670 + "bc30fb16e6ecb0ce41098670cdb7b2c475979c531428d067a1"); 3671 + FeedZipHtml(zip_buf, 45275, 3672 + "9f1bcb0cb8bd4b274cd09b844f500aff1eb212a44ea09a110f"); 3673 + FeedZipHtml(zip_buf, 45300, 3674 + "0192385e24dba133c6d0b0c896844eab7d33efd486850b5cb9"); 3675 + FeedZipHtml(zip_buf, 45325, 3676 + "080e479c4447b7c2e152f4f24941e54a3caab9269764c35917"); 3677 + FeedZipHtml(zip_buf, 45350, 3678 + "4154764f740cda11c48e20964110268aad95206a3a563b8755"); 3679 + FeedZipHtml(zip_buf, 45375, 3680 + "d66e7cbc7768216b3dca15b37e5a2e162c1852412221eeaa98"); 3681 + FeedZipHtml(zip_buf, 45400, 3682 + "b85cc70f99a6cf24d8acfc80dd1044b9f755335c409642a880"); 3683 + FeedZipHtml(zip_buf, 45425, 3684 + "8e61b1a07ccb0e0d1d662022388803340f0eb0e85018fda29e"); 3685 + FeedZipHtml(zip_buf, 45450, 3686 + "a04089eba079f586cd9e1d81499bf0f0d49059a38ee08ba1b2"); 3687 + FeedZipHtml(zip_buf, 45475, 3688 + "452cb523b21d91d988b4561a3b1e82a4524e5cf4b914d5a3e0"); 3689 + FeedZipHtml(zip_buf, 45500, 3690 + "7e7f7b64bd2e9e8501970b8596c1d2546fe315610635798af3"); 3691 + FeedZipHtml(zip_buf, 45525, 3692 + "5d9e4040c340e738e339bcda40b87524d3881e335741d02bbf"); 3693 + FeedZipHtml(zip_buf, 45550, 3694 + "5863d09c4d47dfcf5f597599ad287deeb9a143892751f8c784"); 3695 + FeedZipHtml(zip_buf, 45575, 3696 + "5cf42c874ed9cfc65d5984a78c2324a9b056ae8d078edaab6e"); 3697 + FeedZipHtml(zip_buf, 45600, 3698 + "61299b282ce92e5103a8bd4b39e869b5156d7897dc9fa4f62a"); 3699 + FeedZipHtml(zip_buf, 45625, 3700 + "71d41aaf122bb1d10ad771f575e606b62afa90b8439a4274ff"); 3701 + FeedZipHtml(zip_buf, 45650, 3702 + "99b13f9b7cd5aadb81ba09ece16cdd068b4578edb222ad0806"); 3703 + FeedZipHtml(zip_buf, 45675, 3704 + "89023f4945940a29c246ba046bf21497cfe0c0a95eb1d99f95"); 3705 + FeedZipHtml(zip_buf, 45700, 3706 + "67f52bd1aecf742d6abd1437857c5c3efdd5f122b257e42cc1"); 3707 + FeedZipHtml(zip_buf, 45725, 3708 + "2278df286434c10b3daec5c5b9be36acc8159faa450de2f208"); 3709 + FeedZipHtml(zip_buf, 45750, 3710 + "4184d9ecf841bf5a337e9c8420a676c2c104048aab6080bfaa"); 3711 + FeedZipHtml(zip_buf, 45775, 3712 + "f1e094fd625996b945a3c0699452301719ba74380ec52014d2"); 3713 + FeedZipHtml(zip_buf, 45800, 3714 + "d718c8b7184a8782d9906b5e53f1b92408303a016432d92e25"); 3715 + FeedZipHtml(zip_buf, 45825, 3716 + "9fc2a527e7f0181928c49e58913080d3c89423399dbada61d0"); 3717 + FeedZipHtml(zip_buf, 45850, 3718 + "cf30932c0694c1f807776135e762a26a5b27e0572cbb8ff785"); 3719 + FeedZipHtml(zip_buf, 45875, 3720 + "ce98f2a5e944b45b74ceb24e417a503cf445f4052074d2e3bf"); 3721 + FeedZipHtml(zip_buf, 45900, 3722 + "8a1823da63f0509307146249c26444e06a613656f46d66868e"); 3723 + FeedZipHtml(zip_buf, 45925, 3724 + "607c211a04d35cd891b20dee91f41be4af0a151c209a549349"); 3725 + FeedZipHtml(zip_buf, 45950, 3726 + "17b6e387119d94534a0837e38955e25007c1141a9171cc9fae"); 3727 + FeedZipHtml(zip_buf, 45975, 3728 + "8f28a1b1bce60b9f29dc539dc34d65c6a0e684e5322bd44f84"); 3729 + FeedZipHtml(zip_buf, 46000, 3730 + "651b41a3409cf087fb237cb46a2d18de26f071d9941c593ae0"); 3731 + FeedZipHtml(zip_buf, 46025, 3732 + "928852c38bdb27f441996c9f4e8e5105586f1b1de964284f02"); 3733 + FeedZipHtml(zip_buf, 46050, 3734 + "11b2c10ef609fc5d05b889e80820228c5e3555b9d2caa0a581"); 3735 + FeedZipHtml(zip_buf, 46075, 3736 + "5e79c8e662bd30d04b84d9c961f254adbe8f2982ba29391673"); 3737 + FeedZipHtml(zip_buf, 46100, 3738 + "0c839ecc78335a50dbe7e703eb378402c2ac4835af9562d5cc"); 3739 + FeedZipHtml(zip_buf, 46125, 3740 + "64af40226b502831e494fc10e7b0ffea8056356ce6807bf8db"); 3741 + FeedZipHtml(zip_buf, 46150, 3742 + "7e69d03d7e2c09bca78af68e98fb8d344118d6b3e081b2c265"); 3743 + FeedZipHtml(zip_buf, 46175, 3744 + "9ab628d5792d5a88e3c50ec9f890de86631d9523f5184ad7b4"); 3745 + FeedZipHtml(zip_buf, 46200, 3746 + "32b5f57b887425a284d3ef28c5722cfe25de1d2105f92c0329"); 3747 + FeedZipHtml(zip_buf, 46225, 3748 + "76742943a7f75566dca2f39e5574f6d2729f7398b2cb7f2ec9"); 3749 + FeedZipHtml(zip_buf, 46250, 3750 + "7f76dcc426e44037cb54a6b0fcbec40c2381d8e330e27c5e31"); 3751 + FeedZipHtml(zip_buf, 46275, 3752 + "75ce291654364ae4320472c9a412116317129ebcd540510641"); 3753 + FeedZipHtml(zip_buf, 46300, 3754 + "f2d4d65904d7cfd0518922e1a99aa15bc3760c7d690c5dc8b1"); 3755 + FeedZipHtml(zip_buf, 46325, 3756 + "950cdda8facc3c5df7fcdbb1f51d5b7f826c3d67e931387bee"); 3757 + FeedZipHtml(zip_buf, 46350, 3758 + "cb8eb9e71a079a55f6dc9c5d8fd944b6ee6e3ab8313b6e130b"); 3759 + FeedZipHtml(zip_buf, 46375, 3760 + "db179e867d8e9e97597691bf1dcefbdc6bf5912945318d5cb1"); 3761 + FeedZipHtml(zip_buf, 46400, 3762 + "2a0c0fcba5e6e9e789780772d1d65de8936ebb8f6cbca79951"); 3763 + FeedZipHtml(zip_buf, 46425, 3764 + "bad7e05532f97118514604f38b0cf6d0996440e3bb776bf76e"); 3765 + FeedZipHtml(zip_buf, 46450, 3766 + "6de0bbb5fd85938cc752c17f15ef2511958ec461af2e8c105b"); 3767 + FeedZipHtml(zip_buf, 46475, 3768 + "a3fa6e8afc25191471c5696917fcd9a8dc4452b22a2be74039"); 3769 + FeedZipHtml(zip_buf, 46500, 3770 + "5df7cdd94745cbcf18e8eae6516a0e325e264079c6591cdd57"); 3771 + FeedZipHtml(zip_buf, 46525, 3772 + "da2ae35eecf3dbb4d8fc94ed8380b5fe600054204cfff04da7"); 3773 + FeedZipHtml(zip_buf, 46550, 3774 + "67767e872b4f352f2e9c90678439c8a5a5f395883f9b859970"); 3775 + FeedZipHtml(zip_buf, 46575, 3776 + "a367e4055393e596b133a369a114eb11a9abb6b33415f0b8da"); 3777 + FeedZipHtml(zip_buf, 46600, 3778 + "a0834bbe9ebcf9c4696d912809c5f9af8e58611b8dc2e82efe"); 3779 + FeedZipHtml(zip_buf, 46625, 3780 + "1298615ba62d9d2b1fb46c1baf276dbc1b615ad562cdfb200a"); 3781 + FeedZipHtml(zip_buf, 46650, 3782 + "1278e6ab4a06b8466f80383457b5916a216fcbce5729126ea8"); 3783 + FeedZipHtml(zip_buf, 46675, 3784 + "44782a1312541c64ea393153d09128b942128af0f5b1108989"); 3785 + FeedZipHtml(zip_buf, 46700, 3786 + "064539849c9b1cf5ff1d7c97d7d9f3d20c478c407a90520c45"); 3787 + FeedZipHtml(zip_buf, 46725, 3788 + "366646968119055a2af3d9b5c994b788fd95fe18c4868750b0"); 3789 + FeedZipHtml(zip_buf, 46750, 3790 + "e7c4ef859354575014ef3f5ce5001eedfd4fc1e40b562e153b"); 3791 + FeedZipHtml(zip_buf, 46775, 3792 + "ee0a9e3e1cc409dceac8608eeb6213c7f45ce2bfcefd29224f"); 3793 + FeedZipHtml(zip_buf, 46800, 3794 + "69bca63d7085c443f7876bcedd626123f7de068d40156bda64"); 3795 + FeedZipHtml(zip_buf, 46825, 3796 + "72e61057d1ad584458531403b616e4d8190b7f3caa8c4be4c7"); 3797 + FeedZipHtml(zip_buf, 46850, 3798 + "8a5d511e3adca95b3b756ba76e2d5eddca87237498af58c50a"); 3799 + FeedZipHtml(zip_buf, 46875, 3800 + "04dbe15a05eeca33ba45a428b8292a9f095bcd9f4112cbf6a5"); 3801 + FeedZipHtml(zip_buf, 46900, 3802 + "5cfc956a4d148c2dbe37898ccbce6121a193a11a20ced3d5c0"); 3803 + FeedZipHtml(zip_buf, 46925, 3804 + "50ec95faeee8fc8af7d32186839549f70afa844967f0234da7"); 3805 + FeedZipHtml(zip_buf, 46950, 3806 + "f44b897b42d5048ea0aa2c30076b6b14141bcf5ba894aeb278"); 3807 + FeedZipHtml(zip_buf, 46975, 3808 + "e45cd7a37f1685598327df1ab6d84773b6377dfdcf1f154f21"); 3809 + FeedZipHtml(zip_buf, 47000, 3810 + "31138b15e1f3e6cfff0a8e8788664c2d40384840cb7b10ad65"); 3811 + FeedZipHtml(zip_buf, 47025, 3812 + "16f52aae0b71b9544503d4cd0d2c45de6dc3c36e0c9a4490e9"); 3813 + FeedZipHtml(zip_buf, 47050, 3814 + "546c2beb288f83ebc8113a25cdadc115e506ce73458ff4fc2c"); 3815 + FeedZipHtml(zip_buf, 47075, 3816 + "710773aaed1bb8cbb610fdf7c989ba4daa0af0c5713c9e0c59"); 3817 + FeedZipHtml(zip_buf, 47100, 3818 + "6f319c41b9e29f7e916e1a857aba64ab223c172566a1e021ec"); 3819 + FeedZipHtml(zip_buf, 47125, 3820 + "ce676a5e5d2d4fecb3d2dceeb49357485a73c89606ae2ce6e0"); 3821 + FeedZipHtml(zip_buf, 47150, 3822 + "55079247107bec4c84a118d51fd437c4e5f7b8c216f04b2196"); 3823 + FeedZipHtml(zip_buf, 47175, 3824 + "1a4c149d96d36630589fb0960649f68e6df858beb291e496fb"); 3825 + FeedZipHtml(zip_buf, 47200, 3826 + "cd62b946bf34dd6fb338414860604d44d427410809b8e4ca87"); 3827 + FeedZipHtml(zip_buf, 47225, 3828 + "8464a484a331e272aef9e3b9860b8149ddd079be45a1cc6876"); 3829 + FeedZipHtml(zip_buf, 47250, 3830 + "e1db2552731552f38fc35ea913aefce0c6a9731bf373c74ee2"); 3831 + FeedZipHtml(zip_buf, 47275, 3832 + "7bed8923ad4a14bf253857f9b5d644471a25fefaac0aa782e7"); 3833 + FeedZipHtml(zip_buf, 47300, 3834 + "5dc02946a4dbefdfbcf6c95cf3c3b328c8eee3e4cbb33757ff"); 3835 + FeedZipHtml(zip_buf, 47325, 3836 + "ef5c191052b348a90a5ab8e0a15c1511e770ece7d6c2fb1ee1"); 3837 + FeedZipHtml(zip_buf, 47350, 3838 + "fd3b312b0cbd95a8ec1a773505edf4a16ed4d9d547efc5f72f"); 3839 + FeedZipHtml(zip_buf, 47375, 3840 + "fff28ffdef5151160a4addafa4f91a7f328a7b130cf0a9fc85"); 3841 + FeedZipHtml(zip_buf, 47400, 3842 + "456a5793117609a29fb818d9fb203bf7d34c00e854de65917b"); 3843 + FeedZipHtml(zip_buf, 47425, 3844 + "950c6c817e959589e7f2df1bc06d8cbca2510c44920438a181"); 3845 + FeedZipHtml(zip_buf, 47450, 3846 + "bc026965a922441d449bb68840537e4dce14d4bf43c58e9354"); 3847 + FeedZipHtml(zip_buf, 47475, 3848 + "e0c51a07448be5ef86d4da61e62288afae6f8cef9590dd9ca4"); 3849 + FeedZipHtml(zip_buf, 47500, 3850 + "3daab36f52a0e098d294637a5f1000060d080d798a15a7a8d2"); 3851 + FeedZipHtml(zip_buf, 47525, 3852 + "95c88cc3ff4b6e5b4eace3baa1b0513fd5e6dd3e5f0b3b0f04"); 3853 + FeedZipHtml(zip_buf, 47550, 3854 + "527a1a647b551a56888c2c3419d91edd72f8e6b9fcbb605c04"); 3855 + FeedZipHtml(zip_buf, 47575, 3856 + "eb7d1e9dcffd9c31add3da69f1eeadcf8dafde54491accd056"); 3857 + FeedZipHtml(zip_buf, 47600, 3858 + "d111b3693b8f991a3e248d2492e52ed8f66efdf4e6cfb51fbc"); 3859 + FeedZipHtml(zip_buf, 47625, 3860 + "641f6d346cc6f737dd388cba24016c953607ff79f2f6c3958a"); 3861 + FeedZipHtml(zip_buf, 47650, 3862 + "476991609a82049b8403d86e8a998c3d4aa025d165187e09f6"); 3863 + FeedZipHtml(zip_buf, 47675, 3864 + "346b0823a0bf5e90e8966c201206633fc1c925277615fc0780"); 3865 + FeedZipHtml(zip_buf, 47700, 3866 + "883b919123012d7417f6b0fc30d78d30bc3b06633fa45da793"); 3867 + FeedZipHtml(zip_buf, 47725, 3868 + "0eac1c46ac89d0a699d02769801e18643f1edbf8f255e4616d"); 3869 + FeedZipHtml(zip_buf, 47750, 3870 + "71f3bc363c0c0e6dca5ad3ea3009b74c4e164379dc37d843db"); 3871 + FeedZipHtml(zip_buf, 47775, 3872 + "33f208c99dc15e72738cd61ea97e71437d516e3e097b1a6a52"); 3873 + FeedZipHtml(zip_buf, 47800, 3874 + "7d55019aded534cd02abe6bb7d165c6bff45838508e1678491"); 3875 + FeedZipHtml(zip_buf, 47825, 3876 + "5815877d7fe2ed7bbffcfa1b0dedc6f2bad2990e9ba72ec776"); 3877 + FeedZipHtml(zip_buf, 47850, 3878 + "f45494cf8c7dea7aa82cef5f50e4d004dd3f13742a7d31ff48"); 3879 + FeedZipHtml(zip_buf, 47875, 3880 + "0f871e8b9fe9cfaaf8bf6c49ead3459ae272cb84817bfb25d9"); 3881 + FeedZipHtml(zip_buf, 47900, 3882 + "d1ae17aced7abfdac6fb35db737592c4e3d2c7caf8b8242965"); 3883 + FeedZipHtml(zip_buf, 47925, 3884 + "c1ccea386f994d4548336332f3a42159d34dbfeb9eae108aec"); 3885 + FeedZipHtml(zip_buf, 47950, 3886 + "ed50767fa4f0b39e6840e44f325400879cb0438638c0ab693c"); 3887 + FeedZipHtml(zip_buf, 47975, 3888 + "a16839a3932766cc231bbac7381af9bd1793bcb84182ca51af"); 3889 + FeedZipHtml(zip_buf, 48000, 3890 + "7796a200ca28ee1052ad1165afa2bb7acdc689af1c20dfeb89"); 3891 + FeedZipHtml(zip_buf, 48025, 3892 + "5223611ab3554a9caee466842346b81a45e08052b4c56f176a"); 3893 + FeedZipHtml(zip_buf, 48050, 3894 + "70fa00485b732df690b27b899053b9e492ca0b9b53935bca6d"); 3895 + FeedZipHtml(zip_buf, 48075, 3896 + "49cf4afeaea42f8f0fa22bbb55d57ecab031f408ebd60e8285"); 3897 + FeedZipHtml(zip_buf, 48100, 3898 + "1b092f8351cd95592366bcb10dbc19edf56a4847cbbf03ee52"); 3899 + FeedZipHtml(zip_buf, 48125, 3900 + "e478c3988fe1b752b91e7dc4a5e4029a7ee9379da4b9750c10"); 3901 + FeedZipHtml(zip_buf, 48150, 3902 + "01222b5893cc771fcb3b2cabcd5fcd0c69c245dee8319581c1"); 3903 + FeedZipHtml(zip_buf, 48175, 3904 + "6911b0ce8bb58794ddef1045b9f9ae6f93888ecbe270712b19"); 3905 + FeedZipHtml(zip_buf, 48200, 3906 + "c383c1520c7955e59bbb659951fd5666f23a9924f08c521ad5"); 3907 + FeedZipHtml(zip_buf, 48225, 3908 + "9f67bcc60dbc29c91ee966d606f08be01e5449dc42498565ae"); 3909 + FeedZipHtml(zip_buf, 48250, 3910 + "066d8e990ff41bc6e344dd62268b964c389e48bd9ab436cc29"); 3911 + FeedZipHtml(zip_buf, 48275, 3912 + "de435d4cb5ad1662a159674b3e691ef5cf4ec201b6c794d4c6"); 3913 + FeedZipHtml(zip_buf, 48300, 3914 + "d7d10b86d4f5db2c149b04e3a12f1b54025795dc763eb6ba04"); 3915 + FeedZipHtml(zip_buf, 48325, 3916 + "01b3578b166acc608716f3a0c528eeb1638ffd77eabd95dfe5"); 3917 + FeedZipHtml(zip_buf, 48350, 3918 + "ed6e0646001380b7af965198630823667869b749492c43942b"); 3919 + FeedZipHtml(zip_buf, 48375, 3920 + "6904dc2efeb1141db5578b306acc6087305bc35996802b2861"); 3921 + FeedZipHtml(zip_buf, 48400, 3922 + "c006dddd85840422be573d332fca04f82f2fb7e605ba853312"); 3923 + FeedZipHtml(zip_buf, 48425, 3924 + "451335b32518c85fa6f34ae89b4ad96d303af0dec62289da42"); 3925 + FeedZipHtml(zip_buf, 48450, 3926 + "89b42913612c307045a42ecb75293910a6c6f459b337653f4c"); 3927 + FeedZipHtml(zip_buf, 48475, 3928 + "d24cfe22c656093361956cf9b32406548954c6f71d52b991ea"); 3929 + FeedZipHtml(zip_buf, 48500, 3930 + "da7dc36e46436812a0ab4322dba660024a6f302f45e4c153e1"); 3931 + FeedZipHtml(zip_buf, 48525, 3932 + "c486dc98328cd88edac9761ea076173a62a0e006d8525a0c4e"); 3933 + FeedZipHtml(zip_buf, 48550, 3934 + "b72abc700885d58d85da6388ee18080e19c912bec9c7c9e938"); 3935 + FeedZipHtml(zip_buf, 48575, 3936 + "351134970beb5c46f4bbdaeab1e8ba62a796c5989e71eb0ffb"); 3937 + FeedZipHtml(zip_buf, 48600, 3938 + "aae69a8c1b1108297da0f8289779edca510e7f5d8772b9314f"); 3939 + FeedZipHtml(zip_buf, 48625, 3940 + "0ce524fc7628d718e5249556a1dc2b4e6ecbb8cdb10100f182"); 3941 + FeedZipHtml(zip_buf, 48650, 3942 + "0b462cbe11ea856fc8b968424765be15cbae34c89bc36a1a2f"); 3943 + FeedZipHtml(zip_buf, 48675, 3944 + "4fd8e9480ec8efe91f7b227bd20855a84c49ad279d529b6e6e"); 3945 + FeedZipHtml(zip_buf, 48700, 3946 + "4c19e928132886cf9c7f7ccba4b3099462a43b50e5038909dc"); 3947 + FeedZipHtml(zip_buf, 48725, 3948 + "302a96a1d05dab81969f74c22cc1a68a3ae9b18240e49c1407"); 3949 + FeedZipHtml(zip_buf, 48750, 3950 + "2c0380451f03954a091742f420f00a6f9e3eea2bc7950b09b8"); 3951 + FeedZipHtml(zip_buf, 48775, 3952 + "4626b0eb276666a5d8c66ac8a394aa75299a050a163fa11b5d"); 3953 + FeedZipHtml(zip_buf, 48800, 3954 + "6cab2c883337a63244e2e42d07f16f1c3f878d395286298a40"); 3955 + FeedZipHtml(zip_buf, 48825, 3956 + "54d708284207033175630dc19d5cf747e13646f879a62a0150"); 3957 + FeedZipHtml(zip_buf, 48850, 3958 + "9a07a29315587befa7e262f87685d84ae801bf92214fccebb9"); 3959 + FeedZipHtml(zip_buf, 48875, 3960 + "f001edce0e9cc2a8f8bc12ac23e1790f7884c007bceec16b41"); 3961 + FeedZipHtml(zip_buf, 48900, 3962 + "fcd2e87b40738699d997ee8ccf61125e26cae759146794c1ea"); 3963 + FeedZipHtml(zip_buf, 48925, 3964 + "2531b529c153cafc8129c0c91f0068cb1fa647a1f07ac52122"); 3965 + FeedZipHtml(zip_buf, 48950, 3966 + "02314525a1e8315f31a198b0de11ca96114a9357aa9c50de07"); 3967 + FeedZipHtml(zip_buf, 48975, 3968 + "99d080df4e55018b42ee853de4d141576690f323679fb310d8"); 3969 + FeedZipHtml(zip_buf, 49000, 3970 + "fa83978db2a8fd5008d120d790ef5cda246402be9f714fba03"); 3971 + FeedZipHtml(zip_buf, 49025, 3972 + "05350c44c6e0d2ebb2062376a12a20e97814669934a570a603"); 3973 + FeedZipHtml(zip_buf, 49050, 3974 + "6188dfc5884311998a1ded00299e1f3c778785562468e9fd9b"); 3975 + FeedZipHtml(zip_buf, 49075, 3976 + "169e471104521695e6eb14caf275fd48269a71fb139177172a"); 3977 + FeedZipHtml(zip_buf, 49100, 3978 + "cb83d2fe4267be954a3f0aa32f55986f7c5f34dacf3df593c4"); 3979 + FeedZipHtml(zip_buf, 49125, 3980 + "7932f815da27f273b565c83f77d0d1ea305f08003742a1ada8"); 3981 + FeedZipHtml(zip_buf, 49150, 3982 + "dc9d1f3573b197d2422f2595d1361e75595fced702921626a5"); 3983 + FeedZipHtml(zip_buf, 49175, 3984 + "b98a5a63763e6dae6a0b45c86b00b1e92422237fbea2982c9a"); 3985 + FeedZipHtml(zip_buf, 49200, 3986 + "6d092fae345377ae717ee5e6f562f2075a6cf1b45de1b4fac2"); 3987 + FeedZipHtml(zip_buf, 49225, 3988 + "69b91bd8b4a26994745055396dd6de0a54652d2836ea5b7185"); 3989 + FeedZipHtml(zip_buf, 49250, 3990 + "05e47c159dcad5e7d2c8e9e07e7f1bd25358a12cf429574a5c"); 3991 + FeedZipHtml(zip_buf, 49275, 3992 + "759b72396ce3bb94e37d09a9abbce56d6ed07c3166a6b0b601"); 3993 + FeedZipHtml(zip_buf, 49300, 3994 + "573b635f6b0e18a9eb6b8da3d6d4d71aefc8d16c965ccde5b7"); 3995 + FeedZipHtml(zip_buf, 49325, 3996 + "5af68bad6d4fcbaef5d86a4f2b899120fb88eeb43cf78abad3"); 3997 + FeedZipHtml(zip_buf, 49350, 3998 + "9a8b6d51775acd1f37a739adc28985135c6d73dadca0b98a08"); 3999 + FeedZipHtml(zip_buf, 49375, 4000 + "349e6715ad69e7a2df0f35bcd8dd9a96d27a17d190b65205d8"); 4001 + FeedZipHtml(zip_buf, 49400, 4002 + "f5a37d0c01a08c4ae455debeb030ac0c7977dd0b1fdbbd5030"); 4003 + FeedZipHtml(zip_buf, 49425, 4004 + "ba7cf742c99377cd0b7755c9b7a02ab98a54d8f52e5c2367af"); 4005 + FeedZipHtml(zip_buf, 49450, 4006 + "eb5d688f597b6b988632d406ed781b1bd5d43c5573b42e54d1"); 4007 + FeedZipHtml(zip_buf, 49475, 4008 + "51bbce85bb47eb2b7eb4441e478c3591a8e42e5b7b97d45563"); 4009 + FeedZipHtml(zip_buf, 49500, 4010 + "968619ba7d04b6da83a3fb16516314aaeac7217c3776938ef0"); 4011 + FeedZipHtml(zip_buf, 49525, 4012 + "cd5efed504360477edbec55df3c35df343b9d1ed6c7e9837d6"); 4013 + FeedZipHtml(zip_buf, 49550, 4014 + "6c78f3435b2eaa6b7e58367a03e4a985343fdceaf36da34c59"); 4015 + FeedZipHtml(zip_buf, 49575, 4016 + "d1fc3027b17ff5cd0fb7b326f8fd28ada807fef3872b127ed3"); 4017 + FeedZipHtml(zip_buf, 49600, 4018 + "7892c05ed75b0e7ca632ddb073d928918a9416f9657e44ab8e"); 4019 + FeedZipHtml(zip_buf, 49625, 4020 + "f6acfa88f4c354147265eb83813b18f70b22edc88fb8ccb590"); 4021 + FeedZipHtml(zip_buf, 49650, 4022 + "6b1d20952f7b982042f7c3c12461fbe12cbe660c01937fac7d"); 4023 + FeedZipHtml(zip_buf, 49675, 4024 + "55f0dc976243ef83ecd81ffb9d7018666119904a06b7bc4932"); 4025 + FeedZipHtml(zip_buf, 49700, 4026 + "9c45cd9f692e60a8615660b27e0724668c809bc5646cde9b5c"); 4027 + FeedZipHtml(zip_buf, 49725, 4028 + "1fcb59e24d90f45556f0ae29ace98ffb6ae80ca52311249fa3"); 4029 + FeedZipHtml(zip_buf, 49750, 4030 + "996ea37478a3fb2805cc67d5dace068daef549966d940a6fc3"); 4031 + FeedZipHtml(zip_buf, 49775, 4032 + "610f24c63257fa6aa0761564b9f39f81a85d02b392c18fc3ba"); 4033 + FeedZipHtml(zip_buf, 49800, 4034 + "7258c27229aaccec6e4aa52a748d539baadc919897d33d45b6"); 4035 + FeedZipHtml(zip_buf, 49825, 4036 + "8301fa42630bd86e5599f69500dec0be0ffeb89663c09816bc"); 4037 + FeedZipHtml(zip_buf, 49850, 4038 + "ec5957011f207253843b0c19f963c7076ae772e390d2eed02f"); 4039 + FeedZipHtml(zip_buf, 49875, 4040 + "27725c957406a2db4d0a8aa835f43f3cc7ffc0b33f086e583b"); 4041 + FeedZipHtml(zip_buf, 49900, 4042 + "cbcd9c66d3020e84e90ddc5504779c386a8db7bdfe301cdff8"); 4043 + FeedZipHtml(zip_buf, 49925, 4044 + "0f41da40a2ab608a5f3db8f8a7e130e815bfb83796de747d0a"); 4045 + FeedZipHtml(zip_buf, 49950, 4046 + "da288cc7696eeec31e9a8ef2c529e81b3cbb83dbac417d8ab5"); 4047 + FeedZipHtml(zip_buf, 49975, 4048 + "dc586356d4f6d4e69adff20a6f54edaefc6a177f8b6d2940e6"); 4049 + FeedZipHtml(zip_buf, 50000, 4050 + "90dbd8cb1f9320994a55ce5e146e4b985ad082c3b7d611d374"); 4051 + FeedZipHtml(zip_buf, 50025, 4052 + "1e2772d07d97443c77de5898c488c421f59f2fcf95ad46da6e"); 4053 + FeedZipHtml(zip_buf, 50050, 4054 + "f45de0c405f181341e38649a792ddd3a9643a3b4a9b5d81a8d"); 4055 + FeedZipHtml(zip_buf, 50075, 4056 + "b721b0955747eb376da1d0394a64d28b0dd093a0d7754dadf1"); 4057 + FeedZipHtml(zip_buf, 50100, 4058 + "9d40699abfc53ca20755586cfd84a51ed52b8a361b333284ec"); 4059 + FeedZipHtml(zip_buf, 50125, 4060 + "35871e3db372469cee0a6bf4741dc6fbce1bdf7c814be693af"); 4061 + FeedZipHtml(zip_buf, 50150, 4062 + "74c329050532d824391a3f0595338b013f84ef61920a758182"); 4063 + FeedZipHtml(zip_buf, 50175, 4064 + "30f3f04bbd5670303840dcfbf6c501fcefb7869f14fef2fdc1"); 4065 + FeedZipHtml(zip_buf, 50200, 4066 + "73fa8bf30e05d9f34eb4992fe53605b32e7ffae9eafde15fbe"); 4067 + FeedZipHtml(zip_buf, 50225, 4068 + "7ff9376b0bf457f8e3f72fcbf761321adecc87b30fa79cfc27"); 4069 + FeedZipHtml(zip_buf, 50250, 4070 + "2b67e1105d7f9d1a85952295b129fadd77e368606d8afffafb"); 4071 + FeedZipHtml(zip_buf, 50275, 4072 + "3818946f8a581cefc6c440e67c0c1b2359c5859c5eab1b4f86"); 4073 + FeedZipHtml(zip_buf, 50300, 4074 + "3de1e4f95624de5480c162a0bc7438cff1d35bb96e3cf6b15d"); 4075 + FeedZipHtml(zip_buf, 50325, 4076 + "074a8e7a66d7da8a39ab65ab16106a6c4a3c7d2c99cd6d9c84"); 4077 + FeedZipHtml(zip_buf, 50350, 4078 + "7fc6641d45f9954328f11f0f0ecfbc382f32fb2ada425f55d9"); 4079 + FeedZipHtml(zip_buf, 50375, 4080 + "3652e3a0b7b0a27837d02c130e057b839347b1f3c4ea419963"); 4081 + FeedZipHtml(zip_buf, 50400, 4082 + "79b4539bab8b978917038588f042c432602b8cf08d38a8b179"); 4083 + FeedZipHtml(zip_buf, 50425, 4084 + "270ae8a7ac6a5738cae3072f78408355ca1d5f60f4387c0886"); 4085 + FeedZipHtml(zip_buf, 50450, 4086 + "7cf4c76e835fcdda7d88c775391b112f74e515116974fcee97"); 4087 + FeedZipHtml(zip_buf, 50475, 4088 + "4142ae047ed371f43f8307eff2fd5b4fcc817948a9a75843bf"); 4089 + FeedZipHtml(zip_buf, 50500, 4090 + "fff7e7cf9f5b7ce1e8eff8bf95148a224128e32a2ad0c6c910"); 4091 + FeedZipHtml(zip_buf, 50525, 4092 + "84e12c9598c23c55b429448dd38248c9b39b133baaf651fe28"); 4093 + FeedZipHtml(zip_buf, 50550, 4094 + "9bd45db2fe630c96cbb58194aa95f951ad9985eac75944e8a6"); 4095 + FeedZipHtml(zip_buf, 50575, 4096 + "37db200250a9b583c831b3836f4946b947db4bf8620ae6125b"); 4097 + FeedZipHtml(zip_buf, 50600, 4098 + "8895b3d8f2e766dcd9713c9e26921f6b40152f4e0d6c7c7957"); 4099 + FeedZipHtml(zip_buf, 50625, 4100 + "22c440e4af8a9fe7be54a8bc0097156c00f393ba4194e67fb1"); 4101 + FeedZipHtml(zip_buf, 50650, 4102 + "578e45458215e8a3b628626a795e64a854db23ee867ea67290"); 4103 + FeedZipHtml(zip_buf, 50675, 4104 + "3b260f2feb7adb109738b441a6265999696a1117d7ef9ab7af"); 4105 + FeedZipHtml(zip_buf, 50700, 4106 + "d19809419fe6361ef6309f8d037c94ebdc0cb2e7fed385e802"); 4107 + FeedZipHtml(zip_buf, 50725, 4108 + "77284731a81e0ec4d0d2a7d17a0326db91430c7b3e09a8a666"); 4109 + FeedZipHtml(zip_buf, 50750, 4110 + "c88e8a84c0b81c18742326e3d01cf299b6f5131dbe393e7eee"); 4111 + FeedZipHtml(zip_buf, 50775, 4112 + "bd38782e0539fa8bf7f657ef2ffcb78a07ea1b8e27e0dc1254"); 4113 + FeedZipHtml(zip_buf, 50800, 4114 + "23c2d41338c24e562ccfc29f192220ddbf208e4159012db337"); 4115 + FeedZipHtml(zip_buf, 50825, 4116 + "d473fa3bf532c3c400a26ac0bafd178f6d0b6591cd4702761d"); 4117 + FeedZipHtml(zip_buf, 50850, 4118 + "5b16a3e662ccf319270b96ad45eca5dcccb3581b4f0343dd82"); 4119 + FeedZipHtml(zip_buf, 50875, 4120 + "8e33a3a568369fd822f6e8b2753de60956be483c33738a7471"); 4121 + FeedZipHtml(zip_buf, 50900, 4122 + "4f6ec7808088e901bce87ef14a7d0cb43685201a1155c0ce3b"); 4123 + FeedZipHtml(zip_buf, 50925, 4124 + "18b62ae46ea4d0f1227ca78b719000483311dc57ee211183e6"); 4125 + FeedZipHtml(zip_buf, 50950, 4126 + "b9f22fc1346fe2275e37a74776c93b213212369259835e4aac"); 4127 + FeedZipHtml(zip_buf, 50975, 4128 + "a911a7366252f71d9655a6fd2f0c49cb040138ac30a2e877da"); 4129 + FeedZipHtml(zip_buf, 51000, 4130 + "f7d271d0c5a81078348759b8cfe7175be2e83dc36a030fa94c"); 4131 + FeedZipHtml(zip_buf, 51025, 4132 + "0cb20d86141caa0d65426f55a62aa7b91157e20d950084461c"); 4133 + FeedZipHtml(zip_buf, 51050, 4134 + "78a70f3e56774d0fc5efcda3a970193a1cdcc80fa42f8b9db1"); 4135 + FeedZipHtml(zip_buf, 51075, 4136 + "0e4db1a362351af12d9b209f0b13a4b9b7c7ccf762e1f3bd58"); 4137 + FeedZipHtml(zip_buf, 51100, 4138 + "e87cdfbbf667e4bd7ee3362c08d46f6056b095794ba2eb62e6"); 4139 + FeedZipHtml(zip_buf, 51125, 4140 + "189b2901a5fca457c07afbc786d2fadaecd70a2b6106663f8c"); 4141 + FeedZipHtml(zip_buf, 51150, 4142 + "72e6ff0d320454b2cfc2b01532d066068312e624bba396dcd3"); 4143 + FeedZipHtml(zip_buf, 51175, 4144 + "5a1fae1346d14ac0db633601ea1ffc2f4129bcc9903f37d56c"); 4145 + FeedZipHtml(zip_buf, 51200, 4146 + "84187119f4afa63591593c669edb70bb8647614491a91cc6aa"); 4147 + FeedZipHtml(zip_buf, 51225, 4148 + "ff38cdff51491223ffc1f10bff21ff8b190492ed39d4d2659b"); 4149 + FeedZipHtml(zip_buf, 51250, 4150 + "428ff105093965328ee53994eeb1c22616e11bc44b51920f5e"); 4151 + FeedZipHtml(zip_buf, 51275, 4152 + "86fe0700dfdc39c29d375441b1dfa6de5bf412e01fdfc60f5e"); 4153 + FeedZipHtml(zip_buf, 51300, 4154 + "cbff228a87031e0080caccfef3bece579757e56f73e9ad3d9d"); 4155 + FeedZipHtml(zip_buf, 51325, 4156 + "47ba8a39e5472d8a9217f424176f670bdee62a785b43d6016c"); 4157 + FeedZipHtml(zip_buf, 51350, 4158 + "e74b8c1452f20acf4a1f6bbd0036455cb2efecf3e5b9fb0ef2"); 4159 + FeedZipHtml(zip_buf, 51375, 4160 + "a3e6b9861233585994d3d2df6ab9b506c1f0d29c6ed86d644c"); 4161 + FeedZipHtml(zip_buf, 51400, 4162 + "01ba2917f46a517cc478cce5630cebf7704ab55fa40d489db7"); 4163 + FeedZipHtml(zip_buf, 51425, 4164 + "f8be6917bc58403bc30f4be31c8cd60d2dcb1dcebef03d9d79"); 4165 + FeedZipHtml(zip_buf, 51450, 4166 + "28ccc57010765f2ff2e1b39eb76e0cbb3372552a972650943f"); 4167 + FeedZipHtml(zip_buf, 51475, 4168 + "1d7479c66db948ca2c1a2ea80a1ffbb9a8c9704b37a02ae7e8"); 4169 + FeedZipHtml(zip_buf, 51500, 4170 + "1550d743ee4f6d6f5a18c4b06c4c8773d39fbeb6af17266d99"); 4171 + FeedZipHtml(zip_buf, 51525, 4172 + "017bd30542280bdd9d8f655981125f25ebaae4581653121c69"); 4173 + FeedZipHtml(zip_buf, 51550, 4174 + "1ca7a1eabc238a358adc6f359788a6a3c89aa07798fbd88de3"); 4175 + FeedZipHtml(zip_buf, 51575, 4176 + "a41752592eeeca88f7d77adef69eefd18d86f9a472b9a9f0cd"); 4177 + FeedZipHtml(zip_buf, 51600, 4178 + "643c867ba0ca7d203144121971fe5f3cff214cb9f6978f6eca"); 4179 + FeedZipHtml(zip_buf, 51625, 4180 + "41cce6807b103cd8af4a3e551efd6bfde84e9c65f108b49d15"); 4181 + FeedZipHtml(zip_buf, 51650, 4182 + "71f2ca9bb048a04a678105c3d1646454dd5379ee3ed63280f5"); 4183 + FeedZipHtml(zip_buf, 51675, 4184 + "f0972f18d2a86f083bb6ad716cc2cbf1d83c4774480fc36e45"); 4185 + FeedZipHtml(zip_buf, 51700, 4186 + "aea3e5d7dea24c47a965e1fecfb5fbde7e461d835a32e4423c"); 4187 + FeedZipHtml(zip_buf, 51725, 4188 + "09d5e1edeae6679ba9ed2d2a74debc1e66909a39cac8726317"); 4189 + FeedZipHtml(zip_buf, 51750, 4190 + "ac42174abdf85e061bf1b8ee4659395931cf77c21f6016b99f"); 4191 + FeedZipHtml(zip_buf, 51775, 4192 + "8822f71341c4ba26880c76a0aa07a21c461a0cfbfb4285f7ee"); 4193 + FeedZipHtml(zip_buf, 51800, 4194 + "6f8328dfb5f8e4ad74c798de18e19cf82cb57f0692e96ee001"); 4195 + FeedZipHtml(zip_buf, 51825, 4196 + "9f92780c3c35c36e67fbde0510d3bb24084a479fc0a04ff092"); 4197 + FeedZipHtml(zip_buf, 51850, 4198 + "865def24c6d4eab291466086fb3346697c5f37e02f3503f6af"); 4199 + FeedZipHtml(zip_buf, 51875, 4200 + "8e6a27c1310de6d9bf386e32150e73cc66386f4c2b4b55988c"); 4201 + FeedZipHtml(zip_buf, 51900, 4202 + "7ce447fed40beee08f132e58c23573500746a181cac01a6912"); 4203 + FeedZipHtml(zip_buf, 51925, 4204 + "0245be85272d1860fb9b201971023076840d85eb5a6d61ad76"); 4205 + FeedZipHtml(zip_buf, 51950, 4206 + "1e6dbda9e42bce61b371968601980ba07f2e25643424308297"); 4207 + FeedZipHtml(zip_buf, 51975, 4208 + "0a34bfc26b28bf85cb00cf52c3d973435a5e3cecb93831309c"); 4209 + FeedZipHtml(zip_buf, 52000, 4210 + "c75d082fd5f032e4261677117266790e1da486c1d672ce6983"); 4211 + FeedZipHtml(zip_buf, 52025, 4212 + "4945c95a3432c19e44455a7c0aa8a8449660d9894d21c4ab20"); 4213 + FeedZipHtml(zip_buf, 52050, 4214 + "332ef773e26ad46d0f412570490fb22b52b724007d6df42a67"); 4215 + FeedZipHtml(zip_buf, 52075, 4216 + "973cda21046c377b7eac28ecf7eeb0224aef19682b6937180e"); 4217 + FeedZipHtml(zip_buf, 52100, 4218 + "fd2888277052f177cf1291b74812a6d616255531f5b7566951"); 4219 + FeedZipHtml(zip_buf, 52125, 4220 + "202afc76e32aeec3e5a99c9f68058abef4bbb2e772c36c6273"); 4221 + FeedZipHtml(zip_buf, 52150, 4222 + "4fabdd545b8835372fac1ffe0b3e1c1c1c189f9f5bdfff3d13"); 4223 + FeedZipHtml(zip_buf, 52175, 4224 + "b3309a74706f06aee7f67f31dc798f8a27b3c22fda355299ca"); 4225 + FeedZipHtml(zip_buf, 52200, 4226 + "62ebc34371985b652050697786e4256d04340b1558865dfa59"); 4227 + FeedZipHtml(zip_buf, 52225, 4228 + "2652c042ac3ed7f63a93acd05f111b3e92b44ecbd8bd1fad59"); 4229 + FeedZipHtml(zip_buf, 52250, 4230 + "29e13609110361b203c5cd90dd7c4097461627534dbb876e9e"); 4231 + FeedZipHtml(zip_buf, 52275, 4232 + "67d4b104a27766d3f2315fe516943a85fe496a64264a71dee3"); 4233 + FeedZipHtml(zip_buf, 52300, 4234 + "c91decd0c0235adacc7a342fa2f84b13cf0a3f2ddc57f1f706"); 4235 + FeedZipHtml(zip_buf, 52325, 4236 + "1eb2350437dc317ce41400925285782a0dca33dfdfc6147b1a"); 4237 + FeedZipHtml(zip_buf, 52350, 4238 + "70411cefd64f25ffcee2912c118871aa91ac9fa78a638fe228"); 4239 + FeedZipHtml(zip_buf, 52375, 4240 + "1ee23fbac4ccac1dd8fc5bff13fee3635ed64f0f71326145c1"); 4241 + FeedZipHtml(zip_buf, 52400, 4242 + "20f2e7c018132c0faf82625dd88895ada421e5c0a3a6ad6a3c"); 4243 + FeedZipHtml(zip_buf, 52425, 4244 + "a88725a8717848f5c1fa7112004fdfff124cd3c3c35ca8993d"); 4245 + FeedZipHtml(zip_buf, 52450, 4246 + "14b4d8019061c530cc0000b906d87af9187f3c0ea25ef977ae"); 4247 + FeedZipHtml(zip_buf, 52475, 4248 + "0729becbf65737b2d8a9eb175d3fcd5e5224a4fa956c337ec3"); 4249 + FeedZipHtml(zip_buf, 52500, 4250 + "3fb77f99bf0aa5902956997b5df92165ae623acdf78cc7b54d"); 4251 + FeedZipHtml(zip_buf, 52525, 4252 + "c220d5f21721466a3c6601a8e1e2813eb0cc548f8cfd67f332"); 4253 + FeedZipHtml(zip_buf, 52550, 4254 + "f1f75ed983941fb241ef52716b4ff0793a222b1088ffbd2009"); 4255 + FeedZipHtml(zip_buf, 52575, 4256 + "efd85b1d536a8df12e73553bae0c2b6df65c074f2201e79ba8"); 4257 + FeedZipHtml(zip_buf, 52600, 4258 + "a2a4de08b81a8cd446236af988a9b1bdb02f1dde646de61279"); 4259 + FeedZipHtml(zip_buf, 52625, 4260 + "54be320d50c404344d425f368cf91d351bd134b950e8bc1b63"); 4261 + FeedZipHtml(zip_buf, 52650, 4262 + "306f86b62bff2e0ee5f3814f2ba13d3627e618638e69c022be"); 4263 + FeedZipHtml(zip_buf, 52675, 4264 + "7413b2c4f2d65216e6099c4cc643acc0175cc6f78e6888e298"); 4265 + FeedZipHtml(zip_buf, 52700, 4266 + "96377ba789a22843290ae275e22e9ff8baa967912a2c4b1350"); 4267 + FeedZipHtml(zip_buf, 52725, 4268 + "4f2e8f5791029d2080f03f3d5182905e3a8535b4aa7807d1d7"); 4269 + FeedZipHtml(zip_buf, 52750, 4270 + "84f9a5cc2953002e3260321a02d83f0989e0c740166dde3b28"); 4271 + FeedZipHtml(zip_buf, 52775, 4272 + "bf5157e71d7b6b5ca195d07591f774198ce2bba0e6a21c831a"); 4273 + FeedZipHtml(zip_buf, 52800, 4274 + "de943c6bc319da5e8edbcc1ba227608b8bd21de5612963881c"); 4275 + FeedZipHtml(zip_buf, 52825, 4276 + "e821b2f1f01eb9fda097c27fa388d3652f6037b09986e1d3a1"); 4277 + FeedZipHtml(zip_buf, 52850, 4278 + "7d9a06c8bc4c85fdc593115694a6e20e11b792425106e59f6b"); 4279 + FeedZipHtml(zip_buf, 52875, 4280 + "e3f03a0fc1aa924bab8204c66934a2d2010b781cd7286366c3"); 4281 + FeedZipHtml(zip_buf, 52900, 4282 + "be28de8c070fd17349aeabb007b88c7ccd6402b32266802cad"); 4283 + FeedZipHtml(zip_buf, 52925, 4284 + "47a05c38429e0eb9b66f32d5f5b18b18e91ad582659ccf18ca"); 4285 + FeedZipHtml(zip_buf, 52950, 4286 + "34429e29be7dae5fd032f86dfcc5f10312986eb8455f13dcdf"); 4287 + FeedZipHtml(zip_buf, 52975, 4288 + "b8bdce4a65db791021beac4c81660980fd45ac8d19aa582f14"); 4289 + FeedZipHtml(zip_buf, 53000, 4290 + "4db70a9a24a97c7ae4819645588ec8ecfaed49c2edd8427ab6"); 4291 + FeedZipHtml(zip_buf, 53025, 4292 + "318116b44d96500250a249a0e0dada520d55ae8e405d9faadf"); 4293 + FeedZipHtml(zip_buf, 53050, 4294 + "cdbd08d2987f9b8514fa87f580715b1f3e9f5f9fed63de2e1d"); 4295 + FeedZipHtml(zip_buf, 53075, 4296 + "41951d0f75f5754ff79015d6015d383c05c623ba5a8ce041a4"); 4297 + FeedZipHtml(zip_buf, 53100, 4298 + "957a94660db21cb18e128334a1803409aace0bac5262f4858c"); 4299 + FeedZipHtml(zip_buf, 53125, 4300 + "f11000321edab6f4e09b185333932f853a81ab467309eb0684"); 4301 + FeedZipHtml(zip_buf, 53150, 4302 + "13ea1e84299a22cd30cb91ca137b7f06492c3a6d70b5687a5f"); 4303 + FeedZipHtml(zip_buf, 53175, 4304 + "ee41adbdd560c3a18282f68d760e23d1e0b92dc4cc781090c0"); 4305 + FeedZipHtml(zip_buf, 53200, 4306 + "a68ae9b3d20f0cd89228b86b850e6e318bbe5bde4feec8102a"); 4307 + FeedZipHtml(zip_buf, 53225, 4308 + "b086aa0db40da4f04daee2bfbc5ef14486069a86224d3c6fbe"); 4309 + FeedZipHtml(zip_buf, 53250, 4310 + "58cf6bb884f7d0a5e3aedbe850a3de97fbbe29e6291eed4b8d"); 4311 + FeedZipHtml(zip_buf, 53275, 4312 + "5ebed15180c54b118bb891449b768980328024e245a4a9cd61"); 4313 + FeedZipHtml(zip_buf, 53300, 4314 + "b07298113a96b1ddaef24f6155cc608ee177d731f5b9f05ad6"); 4315 + FeedZipHtml(zip_buf, 53325, 4316 + "83b167304d40bffcaa47249fc89636e4820853d5e040025360"); 4317 + FeedZipHtml(zip_buf, 53350, 4318 + "83a8ed40482045755dd77cc8515dc098ba7ed2b34a30d49837"); 4319 + FeedZipHtml(zip_buf, 53375, 4320 + "5c9211099761940689658e3419c9c205a693241e97779932bf"); 4321 + FeedZipHtml(zip_buf, 53400, 4322 + "ce28b3d7fd745e31c29eb7cc60f188ad369f72b1fa86a1ec4b"); 4323 + FeedZipHtml(zip_buf, 53425, 4324 + "d543b37fb607b40029af442f939fc2e07e8fed0af0260e273d"); 4325 + FeedZipHtml(zip_buf, 53450, 4326 + "a93a4a6621479ee19bc2f211cce5638814a72aa3211670bb9b"); 4327 + FeedZipHtml(zip_buf, 53475, 4328 + "8a0eba8289a0232efcf23569294b328830adf2b28b23d8b311"); 4329 + FeedZipHtml(zip_buf, 53500, 4330 + "86b25dfdf353915ad5a796d747d6e4a81fe2c0e1eead9fa038"); 4331 + FeedZipHtml(zip_buf, 53525, 4332 + "d3905816b7088ad169526c568e1f68298c482c5304f0c7e32f"); 4333 + FeedZipHtml(zip_buf, 53550, 4334 + "655f941d9aeac6e4bf76e320e9062f4ff20bab4579d04886d0"); 4335 + FeedZipHtml(zip_buf, 53575, 4336 + "e686d1be99b66e547b8ffc000c40bb61f779f52a4384e00df5"); 4337 + FeedZipHtml(zip_buf, 53600, 4338 + "09cbef93fdef3706a13a160284efc469a1cdf0bf9dffbba716"); 4339 + FeedZipHtml(zip_buf, 53625, 4340 + "9f91398574eb5cec4812f3ad3f460c50ade7149913b3ca4922"); 4341 + FeedZipHtml(zip_buf, 53650, 4342 + "b3f9cf2466b15db693c22d53e8b068bc7a874571413005666b"); 4343 + FeedZipHtml(zip_buf, 53675, 4344 + "bad47047016da9158f4266113e87a11fa4b7630e1ce67f7083"); 4345 + FeedZipHtml(zip_buf, 53700, 4346 + "392ea572d0ebf4e99fe9a40f6c7fcf21a5b8bd628ce8ac10b8"); 4347 + FeedZipHtml(zip_buf, 53725, 4348 + "da468aba4f8cfaf46b0a06877f03ff032602f247cc6cbb07cc"); 4349 + FeedZipHtml(zip_buf, 53750, 4350 + "d56846f2f69d370a502ab02a297dbe7eb7ff7763dfc79f5ebc"); 4351 + FeedZipHtml(zip_buf, 53775, 4352 + "fcebcb6a1f8bdbdde5063ad222ed12533a3decc1c66cee152e"); 4353 + FeedZipHtml(zip_buf, 53800, 4354 + "b6cfe1c39da964c28e931ab4aa6185b891a62024ea1aabb976"); 4355 + FeedZipHtml(zip_buf, 53825, 4356 + "7434bf6e7856b78aa27aeb3e7c829a600746d55ba18698da4f"); 4357 + FeedZipHtml(zip_buf, 53850, 4358 + "028f34b563410ab8b83e7d7f7ae91d7dbefe7876717c79fae1"); 4359 + FeedZipHtml(zip_buf, 53875, 4360 + "f4e25a93e9379f7ed49dc0449fb25a1028c623223e541d10a2"); 4361 + FeedZipHtml(zip_buf, 53900, 4362 + "395c4961e22758f4fa7f7efb9f0ffff3db07f5c7f3b38bd3ab"); 4363 + FeedZipHtml(zip_buf, 53925, 4364 + "ebcbb38bf7e617a99de18fce7f7dfff122ff3352b86798d0f8"); 4365 + FeedZipHtml(zip_buf, 53950, 4366 + "4d7e3ed964d038abb97517920b96cae90f2c0679fda13f38c4"); 4367 + FeedZipHtml(zip_buf, 53975, 4368 + "168832fe06582e3fe774e5cfebef5a33e1c2c4af4c0e6d341d"); 4369 + FeedZipHtml(zip_buf, 54000, 4370 + "9a6d018b8f3b361f8e46410f2bc9a1ea3509874cae4a0823d9"); 4371 + FeedZipHtml(zip_buf, 54025, 4372 + "6ac625f5cbe05a0f79289c8a63d501a3f909012e301e62bc1a"); 4373 + FeedZipHtml(zip_buf, 54050, 4374 + "8635f37287aee57821164b7c7a2efe7b320c61f6139f28cbc5"); 4375 + FeedZipHtml(zip_buf, 54075, 4376 + "dbcc27a880b1c55e4be71f7f3ebd34b810fdfbf808c525ecd3"); 4377 + FeedZipHtml(zip_buf, 54100, 4378 + "a65d1a1e8711ea467ad11d2b368008d43d9ddebc96c42f162f"); 4379 + FeedZipHtml(zip_buf, 54125, 4380 + "1da9dbc0f83e7db296a47fcfba24e591744bda7b5e1d7d3835"); 4381 + FeedZipHtml(zip_buf, 54150, 4382 + "16c07f36989f92528c067ec5f4ed62b85afe49afc1391a8fb8"); 4383 + FeedZipHtml(zip_buf, 54175, 4384 + "c0e94857f0bb098b0206d23560cd424a70ac26e5078c89a450"); 4385 + FeedZipHtml(zip_buf, 54200, 4386 + "0cd2360f5df3b6bd693c21e39121718f81bb2b54e435412cc7"); 4387 + FeedZipHtml(zip_buf, 54225, 4388 + "818043f8cadd838a724b7e10d496c5fc07734404b85466964b"); 4389 + FeedZipHtml(zip_buf, 54250, 4390 + "1eeb4dc0d5f21d27ec4684de7d301c4aa308681666f01c46af"); 4391 + FeedZipHtml(zip_buf, 54275, 4392 + "f0ee7a719cb04101c58e718cc508904da441779284191a3fd3"); 4393 + FeedZipHtml(zip_buf, 54300, 4394 + "4990ca468f9354c72521087b618a1285f9c430bbed38f677aa"); 4395 + FeedZipHtml(zip_buf, 54325, 4396 + "af40d541812d04d15d98c4d188eb4472956304c9d5a7a3ebb3"); 4397 + FeedZipHtml(zip_buf, 54350, 4398 + "a3f3b3ebd39babd3e3cf9767d7bffe80c2d443a04c9c52ce12"); 4399 + FeedZipHtml(zip_buf, 54375, 4400 + "769b90ab3d02a2f500d6d869b8df67830ab6ba8a58f631bb32"); 4401 + FeedZipHtml(zip_buf, 54400, 4402 + "5678651e4a7516f5c96d2328f70394281f336a33ab58be0d72"); 4403 + FeedZipHtml(zip_buf, 54425, 4404 + "3a4d9457466807955ac0bfe7f125888ed005891c59555e8027"); 4405 + FeedZipHtml(zip_buf, 54450, 4406 + "71b9441eac177a65d3bfa6b2a0982227ff397ebd69f2ff4a65"); 4407 + FeedZipHtml(zip_buf, 54475, 4408 + "f8eaa4148549926c41cced4f869c78c417c2494f4618b576b8"); 4409 + FeedZipHtml(zip_buf, 54500, 4410 + "11ebe1558413202f9f9204e9101d0d9995c445e3105af22c95"); 4411 + FeedZipHtml(zip_buf, 54525, 4412 + "0e732246ab70b43dcfb19f9df4b118e9638e8755f5f3dc3dac"); 4413 + FeedZipHtml(zip_buf, 54550, 4414 + "1bfcb0b2310e784d9931103e2ddf18b88845caed79b6c1acdc"); 4415 + FeedZipHtml(zip_buf, 54575, 4416 + "ae56fb90cef1943acc5ec8d837cbec853b6a691f808815df44"); 4417 + FeedZipHtml(zip_buf, 54600, 4418 + "abd64acd591b6d27da1901bed66778a7ee3ef95799954ae7ab"); 4419 + FeedZipHtml(zip_buf, 54625, 4420 + "ac3eb9f5cd19b4ca9ae76e695aa37cff96a134aef8fd5bcd1b"); 4421 + FeedZipHtml(zip_buf, 54650, 4422 + "b653823688fbee94a0a7ca6e7ffce0a82ba73e959af766b0ee"); 4423 + FeedZipHtml(zip_buf, 54675, 4424 + "d59a1117b40ea94249d00d658f5f634565326456e28e7ee805"); 4425 + FeedZipHtml(zip_buf, 54700, 4426 + "693709c7322ae9b14a50d397018e5ffa32183a9025b53bca12"); 4427 + FeedZipHtml(zip_buf, 54725, 4428 + "cff7823cd2eef8b817489ebcce01a475973a20a8fbe74318c9"); 4429 + FeedZipHtml(zip_buf, 54750, 4430 + "135d5050b0d6db20ccd21c3cc819f4f70a6790aaada191c70d"); 4431 + FeedZipHtml(zip_buf, 54775, 4432 + "e86f53c96e4504381e164f49dcd735a58173f3cd6c4c90eeb8"); 4433 + FeedZipHtml(zip_buf, 54800, 4434 + "f8d7cac58144fffb0a8dcb6e4e2e3eaf849b2f702d64cac516"); 4435 + FeedZipHtml(zip_buf, 54825, 4436 + "ec8a979731fbe5b26b71beaf94659ba75f1cdb36bafac828fd"); 4437 + FeedZipHtml(zip_buf, 54850, 4438 + "948479d9781a83e67122a376b6da09fd367da58a368a445190"); 4439 + FeedZipHtml(zip_buf, 54875, 4440 + "6a75ec4f0493e9e89db797eabf31e1e3ea16607c7c79650e70"); 4441 + FeedZipHtml(zip_buf, 54900, 4442 + "fe1dff781e4703f13731bd70e6f06f8ccf2ea02fe77ddaf1fa"); 4443 + FeedZipHtml(zip_buf, 54925, 4444 + "af83d7b3dbe097f3ab32b7057c9ac1a350eba0986d3a64c9f7"); 4445 + FeedZipHtml(zip_buf, 54950, 4446 + "71f225bd0d82cc1de16bfb24fa61926637c3300a6ea8736ec1"); 4447 + FeedZipHtml(zip_buf, 54975, 4448 + "35b128df433ac60a59b42ff641605dd70f613789d318f4e083"); 4449 + FeedZipHtml(zip_buf, 55000, 4450 + "8761ea4916848d1337c64591dff8829c118f710fe46e58d4ac"); 4451 + FeedZipHtml(zip_buf, 55025, 4452 + "e152c777e4ddc17bc2e29e88e4829a3298158ea07e2bdd0664"); 4453 + FeedZipHtml(zip_buf, 55050, 4454 + "4721ef027786a38f4ee3fc81d3ec95c31f874f80ca90e2380f"); 4455 + FeedZipHtml(zip_buf, 55075, 4456 + "c749f0e88d08693ab5cd24155e820a30eeecd24f99edfefcae"); 4457 + FeedZipHtml(zip_buf, 55100, 4458 + "94edc227cd276fe264a6d6b4b3b3e5c52ed7d4839cdefbba4d"); 4459 + FeedZipHtml(zip_buf, 55125, 4460 + "6ede813cf607c14d1afe59c8a7a84dfaf8f7237dcc94974599"); 4461 + FeedZipHtml(zip_buf, 55150, 4462 + "bfbe0780a17fa7f124e92e865f0bf0cec6b6711fccae554ee6"); 4463 + FeedZipHtml(zip_buf, 55175, 4464 + "91965c87535963d15118127f4a8530ba2e669fab976f727cfc"); 4465 + FeedZipHtml(zip_buf, 55200, 4466 + "e130df437b4d6f44990b19f7b87617b2c263c76b81dfc68633"); 4467 + FeedZipHtml(zip_buf, 55225, 4468 + "e4175a47646effcaff7868fc3e287048e2a015b111c13db358"); 4469 + FeedZipHtml(zip_buf, 55250, 4470 + "556f1e53e2a91800420887f7640a30ea35b84c140c08796835"); 4471 + FeedZipHtml(zip_buf, 55275, 4472 + "f98090e28169f0f4d7b0cfab620c712f8ebea5320041c4bddc"); 4473 + FeedZipHtml(zip_buf, 55300, 4474 + "91f361a504b100d660c21f37494f5961acffee45fd9a5ed493"); 4475 + FeedZipHtml(zip_buf, 55325, 4476 + "5fcae3af7ec985465d514dfabaf7f19bfa5f97644fb63d2ef4"); 4477 + FeedZipHtml(zip_buf, 55350, 4478 + "57f8b3d11dc4781b650b97b8977f60c97e01d4820be69b2c12"); 4479 + FeedZipHtml(zip_buf, 55375, 4480 + "c7bd716649973cd80b8abdfae59d788f909ef28843c8fd2847"); 4481 + FeedZipHtml(zip_buf, 55400, 4482 + "b29abec83b1e9b1bc7b7e2e03a8470547880139d613e718378"); 4483 + FeedZipHtml(zip_buf, 55425, 4484 + "29ecfe6cc69ef50de7237870022bef0c13b594abf5fb9392b0"); 4485 + FeedZipHtml(zip_buf, 55450, 4486 + "5dde4071aa93b3ab6b78c1ae8d393e9cfd725a368d8549aef9"); 4487 + FeedZipHtml(zip_buf, 55475, 4488 + "2e3e5e9caaad9d9f5dfc786a6eeff385fe53994c70a3abad62"); 4489 + FeedZipHtml(zip_buf, 55500, 4490 + "590d819954ea85c899b421ba2be6a0f4ca00b8e5482076c919"); 4491 + FeedZipHtml(zip_buf, 55525, 4492 + "6aa59543431010b5bd10716890100724f33eb456bc37b11afe"); 4493 + FeedZipHtml(zip_buf, 55550, 4494 + "937ea12ab3e5ac60fc9f2bc8525fe4d3b20dcfcbd63e31a81b"); 4495 + FeedZipHtml(zip_buf, 55575, 4496 + "9c8449c54b2346b4b0f4c90d31b8391e9cba49be9a7767a8df"); 4497 + FeedZipHtml(zip_buf, 55600, 4498 + "1b59b24a551ee6aa4627546106b4b0daf748c2b2f97be48bfa"); 4499 + FeedZipHtml(zip_buf, 55625, 4500 + "357132353da5b82b21d3ff9f83de034738f1166dd6b37bc376"); 4501 + FeedZipHtml(zip_buf, 55650, 4502 + "6fd8ee0ddbbd61eb79c3bef9c6e9dd772a4aea538b4a3502db"); 4503 + FeedZipHtml(zip_buf, 55675, 4504 + "cbbd38ed3215081e8b3f8637d872705af8c2f80eccfdc6f9c3"); 4505 + FeedZipHtml(zip_buf, 55700, 4506 + "0248a513da3d7ce8778261f9678ae6e7168d332c49bf4ae2cc"); 4507 + FeedZipHtml(zip_buf, 55725, 4508 + "974133eedfd1ce00021897fa3a5728a3267a60eed8015196bf"); 4509 + FeedZipHtml(zip_buf, 55750, 4510 + "99be65949b24a7143d6521178f4ce2e150f5ce14d7cb8f2097"); 4511 + FeedZipHtml(zip_buf, 55775, 4512 + "5a34153517db95f7ab705495c92232c47c78aa8928285d5201"); 4513 + FeedZipHtml(zip_buf, 55800, 4514 + "194f83ac3ee2d846135ca5ad922c0b7fb5b140fdd975fbb45f"); 4515 + FeedZipHtml(zip_buf, 55825, 4516 + "5e499cd47ddb348e2a2772bc008719dbf654e046a653073991"); 4517 + FeedZipHtml(zip_buf, 55850, 4518 + "5967124602b380d3f2728ae531cc6d08a2bf307f0af166b94f"); 4519 + FeedZipHtml(zip_buf, 55875, 4520 + "a1ad8665fb0fdf38eb141adcd8157a6d2035a34337a304171f"); 4521 + FeedZipHtml(zip_buf, 55900, 4522 + "4f2b0c759efc0ee7d56e38ae8b89cc35c3e08a5bff2e1f63e2"); 4523 + FeedZipHtml(zip_buf, 55925, 4524 + "b5d486aa76519a616bc73688388e2e2d260d9eb0493bd28136"); 4525 + FeedZipHtml(zip_buf, 55950, 4526 + "893d0115e7c4879bdb9e4668afe4608e4359b24cd570f4ccba"); 4527 + FeedZipHtml(zip_buf, 55975, 4528 + "665cb2ecfb0231acf631ddbd8aab7a15afae6f8e275824a3b5"); 4529 + FeedZipHtml(zip_buf, 56000, 4530 + "577c17f547ae91bb6f1526b49e08feae5c628e6fb22e51e173"); 4531 + FeedZipHtml(zip_buf, 56025, 4532 + "67e8f782f2a995e78cc7b997e06fb844e113bf0baedf593eb9"); 4533 + FeedZipHtml(zip_buf, 56050, 4534 + "8a3a8af839f147fbc0e7c7fb583617fb09e7c6cce5776332c7"); 4535 + FeedZipHtml(zip_buf, 56075, 4536 + "6beb4ec891efc3758ee3613ca05afd580f05f3e7b151833f55"); 4537 + FeedZipHtml(zip_buf, 56100, 4538 + "4f226ae454b1583c31842693945d05f0f12dc2c2fa2812f160"); 4539 + FeedZipHtml(zip_buf, 56125, 4540 + "fea413c241f91260a1e940955314e3f7b4a30d2183854a716f"); 4541 + FeedZipHtml(zip_buf, 56150, 4542 + "7d38b3ec42212a8f62f9e09eeca624ebc6c2f21ff91d36d667"); 4543 + FeedZipHtml(zip_buf, 56175, 4544 + "d242591d561d111bd8efde86c39ed03de198b7e138d5d23d4c"); 4545 + FeedZipHtml(zip_buf, 56200, 4546 + "df9f200b17a5ec99fa52ffcef027993e2ee66cfc548836a9ea"); 4547 + FeedZipHtml(zip_buf, 56225, 4548 + "0468584dfc2e684a7ef70b5f0f6ccf7c56085ef487b11f02ab"); 4549 + FeedZipHtml(zip_buf, 56250, 4550 + "00cd1ad7e98409163016a5a5858a22e190835234b5a0640147"); 4551 + FeedZipHtml(zip_buf, 56275, 4552 + "ec370f1658ce78abfaf07f497b9d6469d80b885ff23dde8766"); 4553 + FeedZipHtml(zip_buf, 56300, 4554 + "ad58923e22fc1d3f1aa6c641e3732dbdab04260b16525cd1bc"); 4555 + FeedZipHtml(zip_buf, 56325, 4556 + "cfec65072fcd90dacde28206e4951c45f283316ab6220e6df7"); 4557 + FeedZipHtml(zip_buf, 56350, 4558 + "3ef3651d74bd307b3abb06842e0da12b574fc74139c33ecbb4"); 4559 + FeedZipHtml(zip_buf, 56375, 4560 + "f81046b2794a6634fb129dc6e1ec1f8ece283298e0d5a1901b"); 4561 + FeedZipHtml(zip_buf, 56400, 4562 + "6a2eaddf373452887660dec95b8dfec48f87ba0570a853ba5e"); 4563 + FeedZipHtml(zip_buf, 56425, 4564 + "8ba659fb56cfae12a0c8b1da112da43b9bcbf217a396273ee5"); 4565 + FeedZipHtml(zip_buf, 56450, 4566 + "35d8a0096109d85052b1632b6f2bf76255de96f16a99b7a51f"); 4567 + FeedZipHtml(zip_buf, 56475, 4568 + "2cd76d951dbe58183dcb137281a9e9ca2b42cabff545dd77ea"); 4569 + FeedZipHtml(zip_buf, 56500, 4570 + "2fa45bc3e0db7879c63623e2a8cdb086199b8536aad83fe34e"); 4571 + FeedZipHtml(zip_buf, 56525, 4572 + "a1bb9deb6aca0f8deb08eea970c4ec10201f094f15c8471890"); 4573 + FeedZipHtml(zip_buf, 56550, 4574 + "7151e0a0d4443489b005ca0aefa6d248b99ddb7990655caa8a"); 4575 + FeedZipHtml(zip_buf, 56575, 4576 + "d5096c3711bde5d73daaa085a421ea983aac01b0d6ea3db057"); 4577 + FeedZipHtml(zip_buf, 56600, 4578 + "229ddb01246f158a38598c8d8cb94faaef9422b761007a0650"); 4579 + FeedZipHtml(zip_buf, 56625, 4580 + "3b49a20ab47e6abe42827c2296402928b1941873c0162d11f3"); 4581 + FeedZipHtml(zip_buf, 56650, 4582 + "4a12cb0e696c9f435e62919e1eb37b23cae82c7f047f3ca636"); 4583 + FeedZipHtml(zip_buf, 56675, 4584 + "e8a84ae5720218ebe471f0e68402a0ea50f7b82724f5e3118d"); 4585 + FeedZipHtml(zip_buf, 56700, 4586 + "9d72114b249e8a6da5dc934b194673cbb59979dd83e8c8be69"); 4587 + FeedZipHtml(zip_buf, 56725, 4588 + "6a1a1647dae6e8c3a70220575e44db5b44016d52280b9a73dd"); 4589 + FeedZipHtml(zip_buf, 56750, 4590 + "59485cd7d2bae33cd92d47d82622e2860d0c6856c6d78c5b98"); 4591 + FeedZipHtml(zip_buf, 56775, 4592 + "b1855b9c1a4b21a6f21930b42be3f432680ad0fff2e8833c36"); 4593 + FeedZipHtml(zip_buf, 56800, 4594 + "ef7a51872f55c42bdafbb65d3d81db56f7607ceda4fe2d69ea"); 4595 + FeedZipHtml(zip_buf, 56825, 4596 + "a5fc38866b2495597c277d82aa7de59b03a82060de22e59d24"); 4597 + FeedZipHtml(zip_buf, 56850, 4598 + "de083b8dbcc6061cbc315d2b9582c42dfd34afa0be0f32d641"); 4599 + FeedZipHtml(zip_buf, 56875, 4600 + "3fc0ca70952e3db5300617c36e75a6cf51eb7db55db75448d4"); 4601 + FeedZipHtml(zip_buf, 56900, 4602 + "284ec995047a1a221620ca208ab1f8a537e295588ec74a6fea"); 4603 + FeedZipHtml(zip_buf, 56925, 4604 + "91c969d49aa5547a07d88f421d71c4d41e37eb42a4a00e1069"); 4605 + FeedZipHtml(zip_buf, 56950, 4606 + "1d9854edb9d307d4194b00951fe5dd819e034a08b74671d97f"); 4607 + FeedZipHtml(zip_buf, 56975, 4608 + "05fc4cab6f3904612bc509a521c31422856035e526ba9c1e26"); 4609 + FeedZipHtml(zip_buf, 57000, 4610 + "a229618e9f780e51afd1100909ad8e22ef1494a0613c0e7222"); 4611 + FeedZipHtml(zip_buf, 57025, 4612 + "81095267cf5bbc2009816f81c010ed1912b8d0ab4617452d0e"); 4613 + FeedZipHtml(zip_buf, 57050, 4614 + "92046549eca886f490a3381626ecfe1d034f1c8aceba576594"); 4615 + FeedZipHtml(zip_buf, 57075, 4616 + "394bcfe3fba3abe3b333d7251a5fd9809fd25dd57bda4b2fed"); 4617 + FeedZipHtml(zip_buf, 57100, 4618 + "2ca2fef4949c07cb8b9212707a2a421168e3712ae6c72b0952"); 4619 + FeedZipHtml(zip_buf, 57125, 4620 + "c9c242f1b0a90400184efbf3fe6bbf13b2094215b6a8906eaf"); 4621 + FeedZipHtml(zip_buf, 57150, 4622 + "6f03457c083fc018b1fd367713f2e567362262cb1a3272a211"); 4623 + FeedZipHtml(zip_buf, 57175, 4624 + "b1ed3da7ff2696e97075e0ff205fdbe79f7cbef8f1e2e3cf17"); 4625 + FeedZipHtml(zip_buf, 57200, 4626 + "aeb861c5d8e1565172256be2ca9aa6a77f0c41cee83e7b838f"); 4627 + FeedZipHtml(zip_buf, 57225, 4628 + "ec27f8afa0870260dbbb62d950ff89c55cfeeb4fc2a298b249"); 4629 + FeedZipHtml(zip_buf, 57250, 4630 + "658b7bab5ffd31c423de00ab3af7d3ec14e9cc6199748c5a2c"); 4631 + FeedZipHtml(zip_buf, 57275, 4632 + "d7172c9fe95cb264d3b361df0f5d461f9e346c97dd6226b177"); 4633 + FeedZipHtml(zip_buf, 57300, 4634 + "a0825bea584a465db900e1d1991e3032e616a09d9407e94888"); 4635 + FeedZipHtml(zip_buf, 57325, 4636 + "5c0144e201b2b772a8e9311cdb395ba00e52d20c339961398f"); 4637 + FeedZipHtml(zip_buf, 57350, 4638 + "ea4ea302af7d028d5817deccb1ac388a8a553f1616400f65d0"); 4639 + FeedZipHtml(zip_buf, 57375, 4640 + "5474a893fb3d7d0840f352ed7659ce611a2a7e77f577bbe637"); 4641 + FeedZipHtml(zip_buf, 57400, 4642 + "449ed55236f24f1ccac31e330d1564830ddb64f00d4e8044ff"); 4643 + FeedZipHtml(zip_buf, 57425, 4644 + "0a39a8d25384d3d0c418547e624f7822e4e129f0dc21163b1d"); 4645 + FeedZipHtml(zip_buf, 57450, 4646 + "4a46dc0c609b5e42ba5fa46381e0a55c2712c4d4666e2cf0f2"); 4647 + FeedZipHtml(zip_buf, 57475, 4648 + "953d8372f8e8223e42baddb3e690589f25c05a9c091206adbc"); 4649 + FeedZipHtml(zip_buf, 57500, 4650 + "280da11022e8ab2ac5c7c5ad11f042ea3791a7eb63703f429d"); 4651 + FeedZipHtml(zip_buf, 57525, 4652 + "e6659b0f9e1ff7e7f2426db477a78295d6b184f706212f888d"); 4653 + FeedZipHtml(zip_buf, 57550, 4654 + "4af496629d9667117b8c5b68ce26813b9ab787eab939693d28"); 4655 + FeedZipHtml(zip_buf, 57575, 4656 + "de25f18823f3ca002147b428b2a313f7f20e2b0191b7e71fdf"); 4657 + FeedZipHtml(zip_buf, 57600, 4658 + "96b2c5ba49543db51b55e6ab7a914640f73d1cefc59ddf0161"); 4659 + FeedZipHtml(zip_buf, 57625, 4660 + "24d4614bfa1561b90ad6f4c7e964e82bf4555d8411ba6f61bb"); 4661 + FeedZipHtml(zip_buf, 57650, 4662 + "b6e672c65329ce221a4ee6f89ea20bcbb12c67d4d61ecb44a0"); 4663 + FeedZipHtml(zip_buf, 57675, 4664 + "ab73155b1acb9a7312464c3111f31d25a41e2c967108ed98f8"); 4665 + FeedZipHtml(zip_buf, 57700, 4666 + "4585c457f0a31a37ffae92d2e488baa7b716c1aa26d93404cb"); 4667 + FeedZipHtml(zip_buf, 57725, 4668 + "a196378cfd9ef3cecd87758780cde20537fa4d2a2394b3943a"); 4669 + FeedZipHtml(zip_buf, 57750, 4670 + "8796d38918d092e86660abc25e2d4e9623f025dd81d5894f4a"); 4671 + FeedZipHtml(zip_buf, 57775, 4672 + "02d838044e46480dbb67600b545528cd4630da83697835451f"); 4673 + FeedZipHtml(zip_buf, 57800, 4674 + "8d0147b349250de074311929e5ae1c58e6a82a883592b625c4"); 4675 + FeedZipHtml(zip_buf, 57825, 4676 + "5c4981689b31b763b9580a4f890b888d81d5941397414eeed3"); 4677 + FeedZipHtml(zip_buf, 57850, 4678 + "51caa930c409b3b6e74cb39e41243221899170d351270652f5"); 4679 + FeedZipHtml(zip_buf, 57875, 4680 + "94514c5bbc2e843221b7340f60cd76995ca941cda6ba694b73"); 4681 + FeedZipHtml(zip_buf, 57900, 4682 + "87d48ce8883f3cd7be1b5c6b083a3579be6cedc9c2b23d6fdf"); 4683 + FeedZipHtml(zip_buf, 57925, 4684 + "7b3113f63ff2693d1a0e1b508239aa8a1266b93e1ff3eebb78"); 4685 + FeedZipHtml(zip_buf, 57950, 4686 + "25c37014e25b31c4fed218bb0e67fcc9e0add60daf9140ea25"); 4687 + FeedZipHtml(zip_buf, 57975, 4688 + "61d8f54f6845ab240e1ad1c2d7c31d188c1fd8166746e81721"); 4689 + FeedZipHtml(zip_buf, 58000, 4690 + "ac727ce69dbb9afe1e3dfd493c917dc197307bbe1cc522e77e"); 4691 + FeedZipHtml(zip_buf, 58025, 4692 + "1c5aa347334830fe884af6646cea55084d465785251e9ec363"); 4693 + FeedZipHtml(zip_buf, 58050, 4694 + "13f06a70f4d2bf072229c750febe282a178c38f1ef3d4b56dd"); 4695 + FeedZipHtml(zip_buf, 58075, 4696 + "50023e8ee32f41af123e6a48431015b0b17a024245d8b05bb5"); 4697 + FeedZipHtml(zip_buf, 58100, 4698 + "78fcbc2f7213631ce6c1c181f76f35e2a276e9a6b7dea51d3d"); 4699 + FeedZipHtml(zip_buf, 58125, 4700 + "f2e23dbf8f2912d4215eda234d7afa49c4295a5ec190427a0e"); 4701 + FeedZipHtml(zip_buf, 58150, 4702 + "69ffb663d9ef22eaa4ac98280f2e3fc92ffec68a46301cee23"); 4703 + FeedZipHtml(zip_buf, 58175, 4704 + "f15653ae7a665f8943918e701f76b57b560504a939387f02c3"); 4705 + FeedZipHtml(zip_buf, 58200, 4706 + "1113c39ed9f7512014c6e8c53efc25882e6cb2e5682e8db673"); 4707 + FeedZipHtml(zip_buf, 58225, 4708 + "2279d5cfe747f126b32e15c1c5067618be100ccf055ba8b809"); 4709 + FeedZipHtml(zip_buf, 58250, 4710 + "a1d5b7176456ca9380f64c1c536cc97599f4eb1ee8b4e53e56"); 4711 + FeedZipHtml(zip_buf, 58275, 4712 + "6b56fbcabbbfb41332d3fa2165c7743045d534b1cb48196595"); 4713 + FeedZipHtml(zip_buf, 58300, 4714 + "9f022a61813e11ec50ae693700d5a5683b57092639a8e5b9f3"); 4715 + FeedZipHtml(zip_buf, 58325, 4716 + "e9b00a5e3197e0b1a6085e9344af0024ae48b867f2f0a4f044"); 4717 + FeedZipHtml(zip_buf, 58350, 4718 + "87f7e93517ce76c553c0a74914fe310974d02ad338d9c072f3"); 4719 + FeedZipHtml(zip_buf, 58375, 4720 + "bb1280f1c0ae896556988f814e5825cc28ed2e4d80b9e945b5"); 4721 + FeedZipHtml(zip_buf, 58400, 4722 + "24f853da050133752cc79074ad6778cdd8dad8372d88365322"); 4723 + FeedZipHtml(zip_buf, 58425, 4724 + "6ba351aaca61e917aebe38c97f24f3e95e2ed1c9f644b988c0"); 4725 + FeedZipHtml(zip_buf, 58450, 4726 + "a4f9121c9dd50a546dcdd028fb3e70f92dacef4e6c9ed3d6eb"); 4727 + FeedZipHtml(zip_buf, 58475, 4728 + "84b8690016a5e24af0f7a03a1d3a2c419d5e1ca43a6c269ddb"); 4729 + FeedZipHtml(zip_buf, 58500, 4730 + "b4d614a82701a67256c295875482b609f513747b345705d41e"); 4731 + FeedZipHtml(zip_buf, 58525, 4732 + "8b7cde92e0f499da465f4b2e510a2c63dc0cac756638766ffd"); 4733 + FeedZipHtml(zip_buf, 58550, 4734 + "68a0628bd5b664f0bf1664b60fc6c0a4a48056036531b20cce"); 4735 + FeedZipHtml(zip_buf, 58575, 4736 + "8f7cad1c70b684c7cd077539a4cb758a622c4805dd3b158066"); 4737 + FeedZipHtml(zip_buf, 58600, 4738 + "33cca159cc36f1ea948b4a0cd8690c6bd01860bfb552b03966"); 4739 + FeedZipHtml(zip_buf, 58625, 4740 + "2621b8d4e06b7215cb69bda0f51c46e0652f59340c2f7bc5bc"); 4741 + FeedZipHtml(zip_buf, 58650, 4742 + "b178d9eb2d459191f4b2483dc6d7547801bf5d8e0aa309bd56"); 4743 + FeedZipHtml(zip_buf, 58675, 4744 + "83b9539c4474ccc3b070cc6dda27adc4a7625dd5110718069f"); 4745 + FeedZipHtml(zip_buf, 58700, 4746 + "a5560c32fe153060e223efa0ccb688eb5d6c819282c858a1a3"); 4747 + FeedZipHtml(zip_buf, 58725, 4748 + "88cf0b5651cad8bb088a2fe828266acea4a268c7ecea341404"); 4749 + FeedZipHtml(zip_buf, 58750, 4750 + "59b582a2472c4d3fb120b681a23382a08176921bb641cac9f6"); 4751 + FeedZipHtml(zip_buf, 58775, 4752 + "00b8cc63ec1a562e9c96bb8ceb1fbb1917984b6498718d7964"); 4753 + FeedZipHtml(zip_buf, 58800, 4754 + "841997985d289871814529889aff6e05aec37f61702efe0537"); 4755 + FeedZipHtml(zip_buf, 58825, 4756 + "859b114a08fd3ff87f5cffff7fbcbe7da13376121f45a16198"); 4757 + FeedZipHtml(zip_buf, 58850, 4758 + "052f6fd23f86201dd11fcef10f761a8eb76f54f2c010129197"); 4759 + FeedZipHtml(zip_buf, 58875, 4760 + "f302674cb04bc4ebdb976fec9f18e90d3f81c0453a10881647"); 4761 + FeedZipHtml(zip_buf, 58900, 4762 + "49f71616e866a466c1afe0b79978077bd9ed0fcf5e3c7ffebf"); 4763 + FeedZipHtml(zip_buf, 58925, 4764 + "9f791d0ad9837f59c947f03f01a6e580a234f67b18d9f8c3b3"); 4765 + FeedZipHtml(zip_buf, 58950, 4766 + "bf3d834d14f28182e7f8bfcfe4a47f8539cd9c9f06830be93e"); 4767 + FeedZipHtml(zip_buf, 58975, 4768 + "aff9ff107fb93c7f79234ec52904252a280ecf8797df096880"); 4769 + FeedZipHtml(zip_buf, 59000, 4770 + "0067025c0784871126ec1e88199c6b5f53339d9be34f9f675e"); 4771 + FeedZipHtml(zip_buf, 59025, 4772 + "de8c6c87df038ee90b996d13c77e98c48b00c330ec7471ae19"); 4773 + FeedZipHtml(zip_buf, 59050, 4774 + "979f24c345ad8edd53665afc37f8d52216ff13e6a1d27227a7"); 4775 + FeedZipHtml(zip_buf, 59075, 4776 + "efce8faea90eeade6c5b39ffedc3d182e030fc73e4cfb6f8a7"); 4777 + FeedZipHtml(zip_buf, 59100, 4778 + "8bf70b5a7b8c994fb32cfddf9f4e17b5f6efe360e0b5e244fe"); 4779 + FeedZipHtml(zip_buf, 59125, 4780 + "f73e8cebc433dec3f5d9bb770bda0fe88efdd9167f1fc40b5c"); 4781 + FeedZipHtml(zip_buf, 59150, 4782 + "7f10c4b36fe1e7d3b79f16b4fe7dd019cfc80c6efde4fc6a51"); 4783 + FeedZipHtml(zip_buf, 59175, 4784 + "ec00261ba6b36de0e3388816889198caf5fbf825b186ff068c"); 4785 + FeedZipHtml(zip_buf, 59200, 4786 + "7cf9fcf9f326bc41c80354d5d72b7f9c6512345784c45ce92e"); 4787 + FeedZipHtml(zip_buf, 59225, 4788 + "75cbc45c452eec259e6f1d62019b4ae841dce637fbd64f6fe8"); 4789 + FeedZipHtml(zip_buf, 59250, 4790 + "b437dc0dd4b8a382e4883fbbc6f63b529fc63ad50cab5c0297"); 4791 + FeedZipHtml(zip_buf, 59275, 4792 + "04d5c17f30dc59be8cd3cca7efe2925f782d9411f72ad1486f"); 4793 + FeedZipHtml(zip_buf, 59300, 4794 + "b017f431217ac63d8a67c46bfd198e0fd9b4005a76e67befa8"); 4795 + FeedZipHtml(zip_buf, 59325, 4796 + "20e8decaf70f809eef0837171f8d53c4936c5d07198bfc99e6"); 4797 + FeedZipHtml(zip_buf, 59350, 4798 + "2780477175dbc3f76ac6fd219f5add06fbfec35ffe7f7b57d7"); 4799 + FeedZipHtml(zip_buf, 59375, 4800 + "dcb6cdaceff32b38e7c6f28ced247ddb73324ddb19f9238e3a"); 4801 + FeedZipHtml(zip_buf, 59400, 4802 + "cec7d84ed3f626438bb4c496221592b2adf7d71fec2e00825f"); 4803 + FeedZipHtml(zip_buf, 59425, 4804 + "1265891225edf422b54481c0ee02789ec56277c10ebeebfef9"); 4805 + FeedZipHtml(zip_buf, 59450, 4806 + "63db671ac02eabf37fc74b4fb45ca7e1dce495d5a10c3a706c"); 4807 + FeedZipHtml(zip_buf, 59475, 4808 + "84797007e2e754c36b420936efbdc124b2d33b4bcdcd47c497"); 4809 + FeedZipHtml(zip_buf, 59500, 4810 + "30198db12e311dd7345cdac3171c2aa108ab0313e4d80fe3d8"); 4811 + FeedZipHtml(zip_buf, 59525, 4812 + "172cbe7d630378b4e0c8beba779fad0e0c69dabef1f8fe7243"); 4813 + FeedZipHtml(zip_buf, 59550, 4814 + "6aa79608c22dbc382390443ea2709fd55eb58931ae6e881b55"); 4815 + FeedZipHtml(zip_buf, 59575, 4816 + "634de06c78b530a22c7623cff6bdff42f480f7e4fa32c42cde"); 4817 + FeedZipHtml(zip_buf, 59600, 4818 + "6e982cafb0e28848b7e0bf1ceb3fb331e1707dcc86ac8fb7d3"); 4819 + FeedZipHtml(zip_buf, 59625, 4820 + "b1abbecfb86ce1d874323ab5032756df9738b80b773c354d02"); 4821 + FeedZipHtml(zip_buf, 59650, 4822 + "baa22e711b1217cd8a9fc96ec18fd2706fc8fc813e542f999e"); 4823 + FeedZipHtml(zip_buf, 59675, 4824 + "48a5960636a4c6a38332a40dfd2c3f9c919f4e8601e7f26a51"); 4825 + FeedZipHtml(zip_buf, 59700, 4826 + "1599195c15e33e73c29d2f411ce79222ce9e53e669a8947049"); 4827 + FeedZipHtml(zip_buf, 59725, 4828 + "6a29b26d43f424e69f679f432e2832d21264eea6d741b98a30"); 4829 + FeedZipHtml(zip_buf, 59750, 4830 + "c8e419f5020f12fac9541c74eafef7c5f5a734c4bad23f927c"); 4831 + FeedZipHtml(zip_buf, 59775, 4832 + "cec86f86452f40da47813b0a03af6fe9c6d5c1ed5a245663c0"); 4833 + FeedZipHtml(zip_buf, 59800, 4834 + "3759bb5af1b0d3d6db36ee8fe664983feaeab5c7749debdbe4"); 4835 + FeedZipHtml(zip_buf, 59825, 4836 + "d874db869c9e61cd5baeef44f77bba94effcd51867a6da1a9b"); 4837 + FeedZipHtml(zip_buf, 59850, 4838 + "7c697a2459ad05890b2c5a31ffa0b21c69fc0a0a7a64277d4a"); 4839 + FeedZipHtml(zip_buf, 59875, 4840 + "208c9d3c88ad747d3d5cabde487499f21faaf287baeb7e4a99"); 4841 + FeedZipHtml(zip_buf, 59900, 4842 + "82cbeeb9cb7bfc3517b99bd5eac4d8d9d316e7ec2b2596b2a6"); 4843 + FeedZipHtml(zip_buf, 59925, 4844 + "5e959c66cfd9ec02f771d10dcfc47fc9d05515ba21dccab446"); 4845 + FeedZipHtml(zip_buf, 59950, 4846 + "72abe682b9e015d00426f0d085a7f237d90c3bdd5e43ecc598"); 4847 + FeedZipHtml(zip_buf, 59975, 4848 + "65796cc344ad85221b828089ee46bf7530b0177f1adbc27c36"); 4849 + FeedZipHtml(zip_buf, 60000, 4850 + "299f706cf75b8890c592f14c035a66cea7c6926c7c4f171258"); 4851 + FeedZipHtml(zip_buf, 60025, 4852 + "dc3a96183cd49d82d76d7ce0f8fe8bef82ade7a1dbb7d7e5bb"); 4853 + FeedZipHtml(zip_buf, 60050, 4854 + "057df9c3e25306f8059694780c179837314e1c8af06ddfcc51"); 4855 + FeedZipHtml(zip_buf, 60075, 4856 + "b00c2e0a5274c9e9f473e805492a4ce7ce28979a09d23aa2eb"); 4857 + FeedZipHtml(zip_buf, 60100, 4858 + "d60fae4e3d5ff876acdb92a23ebec4d205fafb69648fa6ce37"); 4859 + FeedZipHtml(zip_buf, 60125, 4860 + "df7d48edb402301c7fd6e29d01303735926118fdf75be46a36"); 4861 + FeedZipHtml(zip_buf, 60150, 4862 + "4df8427f0d91d0c5af670cb1687fa23b905a3acddf46c3b4ce"); 4863 + FeedZipHtml(zip_buf, 60175, 4864 + "64bf73355c0a0396596033c3447081531821b0c229237b6c54"); 4865 + FeedZipHtml(zip_buf, 60200, 4866 + "d48b8d4c73d4b016c6cf2f30e01deb57a8296f655f5b1e1c8e"); 4867 + FeedZipHtml(zip_buf, 60225, 4868 + "d506c45389ae4d710085330e2456801070553930237c9d061d"); 4869 + FeedZipHtml(zip_buf, 60250, 4870 + "6bbce8e4eaba8404d62851b34ca6d32b2b9192b6e8c5901a55"); 4871 + FeedZipHtml(zip_buf, 60275, 4872 + "5f81c903acbc909321c5f9a50d940f10a2dac37f08cde98230"); 4873 + FeedZipHtml(zip_buf, 60300, 4874 + "f9c6c2c7007ba7468c01efc51562a17d9a560abdf62eb156ac"); 4875 + FeedZipHtml(zip_buf, 60325, 4876 + "c0c769fb6e02e5b777c8cb493a942333f61ce383c5fc9d4b62"); 4877 + FeedZipHtml(zip_buf, 60350, 4878 + "35f5deed7168c2524dbdfe38195d04b240c63c413ecff3822a"); 4879 + FeedZipHtml(zip_buf, 60375, 4880 + "871aa658184a317969969bf5c15027cea0832084694d5b82b1"); 4881 + FeedZipHtml(zip_buf, 60400, 4882 + "4ce73946ea78e594638444d4797ff1e7f1f5e5a94c91a5bd1e"); 4883 + FeedZipHtml(zip_buf, 60425, 4884 + "95b3d9c24eaf9d74aa4ee0db57e606694417840bdca7ebc11d"); 4885 + FeedZipHtml(zip_buf, 60450, 4886 + "b65c3df797723d541973def94011ec8ed4370ef3e4c52d5668"); 4887 + FeedZipHtml(zip_buf, 60475, 4888 + "820f8ae929c49fe265b12beb5c61167170e3dabef5f5e2d432"); 4889 + FeedZipHtml(zip_buf, 60500, 4890 + "0de60836710f979503b16cbf79f5e695dcca3548db6e23912d"); 4891 + FeedZipHtml(zip_buf, 60525, 4892 + "1698067d5cc935e4d7cdb08dd295bf657c63790c41fbedcb53"); 4893 + FeedZipHtml(zip_buf, 60550, 4894 + "aa0222f015d4258a771052a4833329cbe70c63c99fe12930ff"); 4895 + FeedZipHtml(zip_buf, 60575, 4896 + "51dd322d79262a6b7d8e2d9610acb97d9dfb9e8d1ffd167b38"); 4897 + FeedZipHtml(zip_buf, 60600, 4898 + "1f34c94218e2d7a92ee4afccb4dcfa1ead710d17d6a3eeed6d"); 4899 + FeedZipHtml(zip_buf, 60625, 4900 + "f7ecfdc5f9f1f9a9f588c54f30704853b6c2a27b1f4e02275b"); 4901 + FeedZipHtml(zip_buf, 60650, 4902 + "29a3bcd6fbec0a84b2ca272db646a53ee029aafe60eb5061de"); 4903 + FeedZipHtml(zip_buf, 60675, 4904 + "b6be7d0ccfedc446521c9f09c1240b58db227891b23ff7e10d"); 4905 + FeedZipHtml(zip_buf, 60700, 4906 + "001ae9b5448c35687c964965e151b3c24a6330d6292b1a8e14"); 4907 + FeedZipHtml(zip_buf, 60725, 4908 + "55c77deafb13c42619191e6e8d10cbcebfeb8a6fc9a3f039b2"); 4909 + FeedZipHtml(zip_buf, 60750, 4910 + "9843569a150b2ec8cfb4aa3a62c9a75f4faf13648ece5b2422"); 4911 + FeedZipHtml(zip_buf, 60775, 4912 + "e89721a00f5eb0e84eb8aa036ef16a6f3419c954178ab691c7"); 4913 + FeedZipHtml(zip_buf, 60800, 4914 + "ae4f877490c17bbdc25be7f1618936eca78d69c37e626d64b5"); 4915 + FeedZipHtml(zip_buf, 60825, 4916 + "d17d186c4a1b5dc2592f3fb876c02a31b142b42995c055b211"); 4917 + FeedZipHtml(zip_buf, 60850, 4918 + "26b2c43bf270459c1593e28fc439771f36af1bf1c6c0b123c7"); 4919 + FeedZipHtml(zip_buf, 60875, 4920 + "12bdf1a836286b496be9bdf8371c44f6a809453d3be8f6e3a5"); 4921 + FeedZipHtml(zip_buf, 60900, 4922 + "607a54be536654d22592b45e1d0f1206dd4d50a37a187ba1d5"); 4923 + FeedZipHtml(zip_buf, 60925, 4924 + "e55d5124855b28c9b77beea75b59cdad86e3a9aee7094ff73d"); 4925 + FeedZipHtml(zip_buf, 60950, 4926 + "e7aae2701f9f49c46b3f394ef974812f2f1edc6071c25ac30f"); 4927 + FeedZipHtml(zip_buf, 60975, 4928 + "4403660f509b3c40a093de484527accc050a76d43b6f74cded"); 4929 + FeedZipHtml(zip_buf, 61000, 4930 + "3c7831dc19122bef83e73e1e9651d68cc535b072a2a98e60e3"); 4931 + FeedZipHtml(zip_buf, 61025, 4932 + "4ec2683ad768c9bc0cdbba73335d588d75952de730cdf4fd94"); 4933 + FeedZipHtml(zip_buf, 61050, 4934 + "d8f2edfebf9833550c4cb5658d876182b11e623bd2d1228444"); 4935 + FeedZipHtml(zip_buf, 61075, 4936 + "3ade897b629d776fbb97d7bdf34321655592f73212fb42df96"); 4937 + FeedZipHtml(zip_buf, 61100, 4938 + "890d8d9fa843a758a8002f89a95ebe7827fa22e332403fb14a"); 4939 + FeedZipHtml(zip_buf, 61125, 4940 + "76f3e1cbd56defb4fbf19cb2afd778479ac19db6aa3bdc4403"); 4941 + FeedZipHtml(zip_buf, 61150, 4942 + "7f9a39f62af460de9488bcb1efc2b6b7f6c991852cd7ae33ff"); 4943 + FeedZipHtml(zip_buf, 61175, 4944 + "a1cbc84d97ebeac74e9f1f1fbe6f22a1a706754f905962f324"); 4945 + FeedZipHtml(zip_buf, 61200, 4946 + "46fd4d8377795bd8c4b690a2aaac6d506f8ef2df4993507d0d"); 4947 + FeedZipHtml(zip_buf, 61225, 4948 + "9cfc03640cb9b150921a1399d9d19d27741f7998a076340e65"); 4949 + FeedZipHtml(zip_buf, 61250, 4950 + "ff219001b4162736617f1d65490ee8427e1b05e0d41de3d5b1"); 4951 + FeedZipHtml(zip_buf, 61275, 4952 + "96cc14be35cb01cb212bcb2e01a1ab8fe048cbdd8be60f90c0"); 4953 + FeedZipHtml(zip_buf, 61300, 4954 + "dcdf1f58b803438d1bc80994b887a65a65d5e25cb733336e91"); 4955 + FeedZipHtml(zip_buf, 61325, 4956 + "aedb907d59de12974e08b34f1a9e123a2d871d902e698a19d3"); 4957 + FeedZipHtml(zip_buf, 61350, 4958 + "9566c42f4dde47160b9bb54cbd3e0713006810920368306f03"); 4959 + FeedZipHtml(zip_buf, 61375, 4960 + "ff1006610b565e802dcfdf725b3e88956c92db3d46ded65aba"); 4961 + FeedZipHtml(zip_buf, 61400, 4962 + "ad913ee7780caaf6a5946cf0eeb4b3bb53eb48f186f7d0c53d"); 4963 + FeedZipHtml(zip_buf, 61425, 4964 + "b5da9d8651822e7547ac0de2a311aab46937edaa5db394f483"); 4965 + FeedZipHtml(zip_buf, 61450, 4966 + "e47766ded8e9d4dd6e1ace1022b7bd11ce0321edaa76607f85"); 4967 + FeedZipHtml(zip_buf, 61475, 4968 + "a0592fa9ded46067fc0ae2297de2857ce2bdeb0d86a5db1a36"); 4969 + FeedZipHtml(zip_buf, 61500, 4970 + "02f768cabf7ca1c67aedc6a18f471ff8209d88cd097f647d34"); 4971 + FeedZipHtml(zip_buf, 61525, 4972 + "a20fb82ef7b95a27f4105c9a9bf1102b6e4b15873d09d2d8ce"); 4973 + FeedZipHtml(zip_buf, 61550, 4974 + "3ac73bacd99dd02cc91df04b926ba1acc323d186933e572de5"); 4975 + FeedZipHtml(zip_buf, 61575, 4976 + "98b6fccf76329cfbd087f39fe63da2f7e74a0a3527589e6d93"); 4977 + FeedZipHtml(zip_buf, 61600, 4978 + "6d73fdb6898f79f1b7ef1381d455f591f906fc22e707b093c4"); 4979 + FeedZipHtml(zip_buf, 61625, 4980 + "1d8d315f1ad51c9637d0f2b79721b3ab97b94b4855bf02624a"); 4981 + FeedZipHtml(zip_buf, 61650, 4982 + "e7a7c7f742eff34f995fde7c393bbbb8b9293b6d7ef9aedbbb"); 4983 + FeedZipHtml(zip_buf, 61675, 4984 + "fa725debd47916b99a8613ac5f3691bc5ab240e0969971e6c7"); 4985 + FeedZipHtml(zip_buf, 61700, 4986 + "08197b3cacb0255d1b626c763098f8764a7129c6fda4c08c85"); 4987 + FeedZipHtml(zip_buf, 61725, 4988 + "7422f90adbf7c34724d482392aef81bc6a2ede2a83e5913ebe"); 4989 + FeedZipHtml(zip_buf, 61750, 4990 + "2d7a217c1b82192ad8684ad867a722729fec3ebc3573d15f8d"); 4991 + FeedZipHtml(zip_buf, 61775, 4992 + "f32056690042c7f58b43b90f27916035d56381fc7a24a1cf21"); 4993 + FeedZipHtml(zip_buf, 61800, 4994 + "7c26f8dea7b19c17524c1de96170bc186c137d1592a21e9e58"); 4995 + FeedZipHtml(zip_buf, 61825, 4996 + "17767fa82ef1d32ff3ae081bcc165c602a61e81d664950a41b"); 4997 + FeedZipHtml(zip_buf, 61850, 4998 + "cde557ddf84b0b4ceb5737c03f0f4b86e4dd8b11015fbcf7c0"); 4999 + FeedZipHtml(zip_buf, 61875, 5000 + "0f30636c09d886caf96b046ee0da684e3561a250304d8d344d"); 5001 + FeedZipHtml(zip_buf, 61900, 5002 + "3aa86bf96406fd6296e7f8c64dd4bb7ac17d182fb67da43502"); 5003 + FeedZipHtml(zip_buf, 61925, 5004 + "4bbeb4ef624c2551ed299db3bd6da66fcb2f6fbd40cc8b24c6"); 5005 + FeedZipHtml(zip_buf, 61950, 5006 + "da1d13ac1c151fa25675a5c40770928811812b24ec7bb69c64"); 5007 + FeedZipHtml(zip_buf, 61975, 5008 + "b6e95153192f8ce17ed3651e73792902aa9e67fa288cf41619"); 5009 + FeedZipHtml(zip_buf, 62000, 5010 + "61c843ad8c0074245f452fc91b25ec2c9733437bb7f4aa5126"); 5011 + FeedZipHtml(zip_buf, 62025, 5012 + "ba4eceab253d34ca9b9560f63bc7150be2c80bdcb86c0ae806"); 5013 + FeedZipHtml(zip_buf, 62050, 5014 + "a5edbf8587c2919760abe6c3e81cc2d1440fb4acd9be58751d"); 5015 + FeedZipHtml(zip_buf, 62075, 5016 + "9c0f5810122772261506797e28731a05a942288678ad54ef11"); 5017 + FeedZipHtml(zip_buf, 62100, 5018 + "6552b7d5d7b4148861bc466f1aac00564756d792197fe1739c"); 5019 + FeedZipHtml(zip_buf, 62125, 5020 + "8d5647569e155bcbf1eb5ab792dd78de45f22ce23b0bc7d348"); 5021 + FeedZipHtml(zip_buf, 62150, 5022 + "a39edaf3a39ff9d933e767e33dc107c412e98a3955aba3f3e6"); 5023 + FeedZipHtml(zip_buf, 62175, 5024 + "a1ee23ce842b6a79cdb3313b609d502796a6ac3a380c7dc78d"); 5025 + FeedZipHtml(zip_buf, 62200, 5026 + "d0d6cd230433ab0299a2b22a65f74e9d796a0a15079016530b"); 5027 + FeedZipHtml(zip_buf, 62225, 5028 + "039a3a0817a48862f13d95a93553cdc0a19578e89b6c8c9668"); 5029 + FeedZipHtml(zip_buf, 62250, 5030 + "f47fa22fdd3d199c807ecece5e59af4fb0560c022cf8c43afd"); 5031 + FeedZipHtml(zip_buf, 62275, 5032 + "cbfa913edbe2d9781e85e385a957bde9f5aca6d3f339bb5f45"); 5033 + FeedZipHtml(zip_buf, 62300, 5034 + "2ce686b52a68ee84784a04354c31d7d048bcbb04bd76bc40dd"); 5035 + FeedZipHtml(zip_buf, 62325, 5036 + "c7b4117dfb14dc4f4c223eb23e53846e8c530eddf487e9d952"); 5037 + FeedZipHtml(zip_buf, 62350, 5038 + "eb41bddc8ff2273a7a2ed5dadf28ff934efb6407744a020dc1"); 5039 + FeedZipHtml(zip_buf, 62375, 5040 + "71c36daab134ad747a02381482f3e704f151dd5a29f405bd00"); 5041 + FeedZipHtml(zip_buf, 62400, 5042 + "f4a399b1abf38cb5a1b7afd19ed5818e69ce82460017c3a7c9"); 5043 + FeedZipHtml(zip_buf, 62425, 5044 + "aaa52d835528d044e79aa9e16fab8513936c8f812f7e40a794"); 5045 + FeedZipHtml(zip_buf, 62450, 5046 + "b3ce33b9555f9d30d3c1d07004bf5ed1d6f2fc76975d279a7c"); 5047 + FeedZipHtml(zip_buf, 62475, 5048 + "333e21f6f8be7bedde4d3cbf34f6b3e5dd5bf53ad71118075f"); 5049 + FeedZipHtml(zip_buf, 62500, 5050 + "26fd2572713bbe13335fc73feaf9828931e3762c4629d686b0"); 5051 + FeedZipHtml(zip_buf, 62525, 5052 + "1ce5aca15118729623f08cb49147943611430330cb7a6674e9"); 5053 + FeedZipHtml(zip_buf, 62550, 5054 + "527ee7fa613090f146c9d04ef4d2af5626b14ec702969b0520"); 5055 + FeedZipHtml(zip_buf, 62575, 5056 + "32105cf743c5b3e0522630f2380a01772ac7d7a380f06e1909"); 5057 + FeedZipHtml(zip_buf, 62600, 5058 + "902b6e293017e3cc5a8bf26cd55986218e43315ecd42328230"); 5059 + FeedZipHtml(zip_buf, 62625, 5060 + "96df91eb00db4127619c44e114176e87c418d1eb4f20bfa5d0"); 5061 + FeedZipHtml(zip_buf, 62650, 5062 + "ce116e71e54da6a5307cf73eb126821d4cfa43d918aac30888"); 5063 + FeedZipHtml(zip_buf, 62675, 5064 + "1a79249fdc2fe165495142e894dcf0969472931cfc2a5daa21"); 5065 + FeedZipHtml(zip_buf, 62700, 5066 + "becf079f75bfa945fb196fa0ecb05e043ac08b7275f31e6da4"); 5067 + FeedZipHtml(zip_buf, 62725, 5068 + "1fcd2d8639b34defd2e4c642d142ad590e1591cfae27694e58"); 5069 + FeedZipHtml(zip_buf, 62750, 5070 + "5a84e4e2030b2142d22033ef045ad5b377d69e40bd155f9b22"); 5071 + FeedZipHtml(zip_buf, 62775, 5072 + "c9ed17eac5e9b2e1897517e014d5142061d3798efa0dc2e1b8"); 5073 + FeedZipHtml(zip_buf, 62800, 5074 + "1fc1c140ce3f5149ada823397b517173da89de1f862a90718c"); 5075 + FeedZipHtml(zip_buf, 62825, 5076 + "4e0ce9a27023214c81f0ef85158951ddb9c9a30b6975450393"); 5077 + FeedZipHtml(zip_buf, 62850, 5078 + "dfc6c3690c418020653428748ce257f27df08d452f3db1ba18"); 5079 + FeedZipHtml(zip_buf, 62875, 5080 + "6a8620121d0e14f3afcc010df607437cff81ff3fb16ed19d4a"); 5081 + FeedZipHtml(zip_buf, 62900, 5082 + "f171b19ba0ecc9a3ff1ffa19ba32309768488dbb4ff01e79cf"); 5083 + FeedZipHtml(zip_buf, 62925, 5084 + "0becf2d3c74f67efaf3f7db8b05e1f9ff66ef11dca0004b516"); 5085 + FeedZipHtml(zip_buf, 62950, 5086 + "7297e572c16c945e54bf4e485a6d5e53c1e87b2300f0b6e8c3"); 5087 + FeedZipHtml(zip_buf, 62975, 5088 + "c730f1fad2f26d2bb5c09476c578f681790b138f303d1eb04c"); 5089 + FeedZipHtml(zip_buf, 63000, 5090 + "d369612657c69319b51d17cf53c9aae12c695a20d7196edd14"); 5091 + FeedZipHtml(zip_buf, 63025, 5092 + "147f56cb2b02e30dbd7bd5abb75c6418acce05ab58981b5b4c"); 5093 + FeedZipHtml(zip_buf, 63050, 5094 + "43b5ef697cb9b53e5dcb71413d6c16e6b66ac1798e8b81ec0b"); 5095 + FeedZipHtml(zip_buf, 63075, 5096 + "861b275338f7fd608fb7302b43eec6903dc6fb27692d837411"); 5097 + FeedZipHtml(zip_buf, 63100, 5098 + "58c54d943bc830203e390d7533baa2818bd98fd5938f95613d"); 5099 + FeedZipHtml(zip_buf, 63125, 5100 + "f0edb032a4a7e6859bad1fa70c191296377bab6141c898a9d1"); 5101 + FeedZipHtml(zip_buf, 63150, 5102 + "9c2cf82ca879825acd5537966303d7e958d6cdc91a9f991189"); 5103 + FeedZipHtml(zip_buf, 63175, 5104 + "caba688f2ef0fb48007200917594353ffed4f1061ea4882d49"); 5105 + FeedZipHtml(zip_buf, 63200, 5106 + "70665b371afaa97ba869859d7bb3f04e95f3485f791540ce0b"); 5107 + FeedZipHtml(zip_buf, 63225, 5108 + "14784e9b555ce419f7556b92941d4e32952fe624c698992629"); 5109 + FeedZipHtml(zip_buf, 63250, 5110 + "05cb96bf3423df70205403cba5bcd35905bda500dffc15dfb1"); 5111 + FeedZipHtml(zip_buf, 63275, 5112 + "e80439dee5f5daa9f5af4799edd48c3c527e75c16ea853e27f"); 5113 + FeedZipHtml(zip_buf, 63300, 5114 + "9e2cfb5fdbfa707a5d51dc49c7c4950fcf989e727015423e90"); 5115 + FeedZipHtml(zip_buf, 63325, 5116 + "2ea803923489387fef1adad51740b1e91c89b475096cba394a"); 5117 + FeedZipHtml(zip_buf, 63350, 5118 + "9e2ae3a2a52c302aa92285348b4684007498ab6c988cc31e03"); 5119 + FeedZipHtml(zip_buf, 63375, 5120 + "9984a0d992c19586e217f27294c6e22b6108aa48d691d30dfa"); 5121 + FeedZipHtml(zip_buf, 63400, 5122 + "ef8ec4fc08acc0051a4bf7a1ab22968131439954d93ecc3f88"); 5123 + FeedZipHtml(zip_buf, 63425, 5124 + "8f92c6917e118b161cf1ae07dbf39111ca4bd25949e7687ea7"); 5125 + FeedZipHtml(zip_buf, 63450, 5126 + "60f6da04a0696107f0236d1e2431bc0d3c161c7c1cc1f18d29"); 5127 + FeedZipHtml(zip_buf, 63475, 5128 + "40315221fd8ca1819de5ac3e13a42d354f8325b1ca5da3206e"); 5129 + FeedZipHtml(zip_buf, 63500, 5130 + "b55fc82f1cb1fc07310edd4ec837918a432d481764268fe0ec"); 5131 + FeedZipHtml(zip_buf, 63525, 5132 + "9875e4952ee486b384229bc19993c6ab438c4544b2728d686e"); 5133 + FeedZipHtml(zip_buf, 63550, 5134 + "fb09ad5a4e00b8503e86352ca0d80dbc985c2b2c4e7425ddd6"); 5135 + FeedZipHtml(zip_buf, 63575, 5136 + "f2f34a2a1ee6144aece5d8b93fd00e60f9d93f637750f830f1"); 5137 + FeedZipHtml(zip_buf, 63600, 5138 + "eee949b9c61fa02efb7843fae5d3b16ae7ad95bdd5ad5e130c"); 5139 + FeedZipHtml(zip_buf, 63625, 5140 + "ca6ad66dc7a5f8595d6ec18578b31a2f1a9d5ef52681f77d02"); 5141 + FeedZipHtml(zip_buf, 63650, 5142 + "a7a36226eba414714d23d2c0459dde4a4147501e29eddf313a"); 5143 + FeedZipHtml(zip_buf, 63675, 5144 + "2d5fbdca2a5f7cf6063f02ff9735126314462e844aee42adb2"); 5145 + FeedZipHtml(zip_buf, 63700, 5146 + "18adf1f7cf17f9be91631df04e1de7cf1f2e9c8f6c1b445d1c"); 5147 + FeedZipHtml(zip_buf, 63725, 5148 + "8a6fe7381b70feeca82056effcd95341addcf9c3725c9ff387"); 5149 + FeedZipHtml(zip_buf, 63750, 5150 + "65dd1ee70feb627f9c3fa46b76feb0f3879d3fecfc61e70f3b"); 5151 + FeedZipHtml(zip_buf, 63775, 5152 + "7fd8f9c3ce9f36387f6a06397923758d8a32ab5a70b397d00e"); 5153 + FeedZipHtml(zip_buf, 63800, 5154 + "ec891872051fc5e124eabbdb1dfe7415da4efe64b656e0238e"); 5155 + FeedZipHtml(zip_buf, 63825, 5156 + "1d92ec54f3e23937251b79b5c4fbc9f06b18f9ce3baf6ed68a"); 5157 + FeedZipHtml(zip_buf, 63850, 5158 + "967530bd2a5595a8690786804f8cb391b7fb38ca95c6091b44"); 5159 + FeedZipHtml(zip_buf, 63875, 5160 + "4e209671389ef8694aa9346216534919dced6e6a2c7b98b841"); 5161 + FeedZipHtml(zip_buf, 63900, 5162 + "2e747039978265cdd59024677524fe83c5f7c8baedbd7b7704"); 5163 + FeedZipHtml(zip_buf, 63925, 5164 + "60ff566cf3b0c3776fce7a3deb3212480f63585b18aa3c6bf3"); 5165 + FeedZipHtml(zip_buf, 63950, 5166 + "ca297f91db6759d826439ced1c0ad66d57714654a182bd9398"); 5167 + FeedZipHtml(zip_buf, 63975, 5168 + "be1c842edced80f414b493825216bc5147b69a21839299b809"); 5169 + FeedZipHtml(zip_buf, 64000, 5170 + "7416828b05c9ce26d59024b34818a1b5cc5d03f8b064a79ca5"); 5171 + FeedZipHtml(zip_buf, 64025, 5172 + "14fa3906160355d2bd947d107db4ef1054d385756455929109"); 5173 + FeedZipHtml(zip_buf, 64050, 5174 + "5a93da1f8accb03b30df23d1fbbe0da9c810388081c2930506"); 5175 + FeedZipHtml(zip_buf, 64075, 5176 + "ab1284610fe0e5f5a56aceefe5ed24c8c5f8a741f0c6156f33"); 5177 + FeedZipHtml(zip_buf, 64100, 5178 + "fb493e12debcd188f709df5aa1783e7af4e24280bdfecd2008"); 5179 + FeedZipHtml(zip_buf, 64125, 5180 + "a30c3b6863d07a39cc32b095239079115b29d4b3708e6df137"); 5181 + FeedZipHtml(zip_buf, 64150, 5182 + "65d8d6845673383778f0a2301851fa194142efe8c6c3cde7ee"); 5183 + FeedZipHtml(zip_buf, 64175, 5184 + "6daf7bd5bbbdf8767371f6e5ba77fbd7af9011e149de37209d"); 5185 + FeedZipHtml(zip_buf, 64200, 5186 + "9fa4c054e1d2427eb2529c16833ff5dc5b70ab1316346b9f43"); 5187 + FeedZipHtml(zip_buf, 64225, 5188 + "5f4f6cec3d4ba0b9b577b019ccd7d261ac1e196eed401bc08f"); 5189 + FeedZipHtml(zip_buf, 64250, 5190 + "3b2c8b55a34c828b96f214cf058bf1a26851622085550d4c4a"); 5191 + FeedZipHtml(zip_buf, 64275, 5192 + "db6118e99aa1505410dd600636bd736197a45ec2d693035f85"); 5193 + FeedZipHtml(zip_buf, 64300, 5194 + "cb63089a9d0c6aae51b273bd80352929c16258d71cd7917988"); 5195 + FeedZipHtml(zip_buf, 64325, 5196 + "21de0360102a51d823426b4623139d8c6daaa0c63d1695a0ad"); 5197 + FeedZipHtml(zip_buf, 64350, 5198 + "5e0bb54379cdee7e3b118f6a67dfc93fe381e1e43bb163bc4b"); 5199 + FeedZipHtml(zip_buf, 64375, 5200 + "7e581f4e31f266e4cdc89b9177bb90376083af1f6e16f43191"); 5201 + FeedZipHtml(zip_buf, 64400, 5202 + "81cc7a6480b1125f22bfea8105221d46f11f02c5ccc21aa3f8"); 5203 + FeedZipHtml(zip_buf, 64425, 5204 + "ca9ebad1ac0ea967f0cc77c64314de114623bb3263a978aa2c"); 5205 + FeedZipHtml(zip_buf, 64450, 5206 + "47bc7892d2c43f0ba5b1229ea588f71559fdb3ca30ba5f9ade"); 5207 + FeedZipHtml(zip_buf, 64475, 5208 + "7f11d5b1e6daab397c3a1cdbdf679686e639b9739a25c93fda"); 5209 + FeedZipHtml(zip_buf, 64500, 5210 + "e33fff62c5b3e2732e84287c9a96749bad82ada2a2db0bfb94"); 5211 + FeedZipHtml(zip_buf, 64525, 5212 + "6a14c079f6d1652162c3f41b09832c21c56d72ee10a795467e"); 5213 + FeedZipHtml(zip_buf, 64550, 5214 + "7d95f31454046c82c3ed583cad0314a1fe9383a3a5306ca4ed"); 5215 + FeedZipHtml(zip_buf, 64575, 5216 + "6e9ce4a3767e5969802829a85dd1a1e61ccf96bacfceedf2ef"); 5217 + FeedZipHtml(zip_buf, 64600, 5218 + "e49c2e7c9999cb85f84035d572deb842ad5f64b2df279e3016"); 5219 + FeedZipHtml(zip_buf, 64625, 5220 + "10a3ebbbf498f6b198a9049d69608fe49855c162d0c16c25eb"); 5221 + FeedZipHtml(zip_buf, 64650, 5222 + "445cc5c752d61fc713e9d041172a184fda07e953d2cacdc754"); 5223 + FeedZipHtml(zip_buf, 64675, 5224 + "0afde1af842ebd07cf8122d5d8c03c6da549c19535c9571cc4"); 5225 + FeedZipHtml(zip_buf, 64700, 5226 + "99f6954968d997ae90051d542d8e799dd40c6353cb633e1252"); 5227 + FeedZipHtml(zip_buf, 64725, 5228 + "45ce4ed17395782337ce684dac04a217b2980c05b58126ec27"); 5229 + FeedZipHtml(zip_buf, 64750, 5230 + "a8cf0b0fd57cbf5c7febbc1e9d2476dfcc4a06b18c28ee3b77"); 5231 + FeedZipHtml(zip_buf, 64775, 5232 + "0873ce863ad4eea310bad043e0268f61f42f3b9f5ae27caa19"); 5233 + FeedZipHtml(zip_buf, 64800, 5234 + "a328b4a077bcc7ccae8791cdc6794c6c75d21b1a9107953c9c"); 5235 + FeedZipHtml(zip_buf, 64825, 5236 + "c3ad8e59fc1a79892b0f8e5280b98a2b4520afd9e1604b5c24"); 5237 + FeedZipHtml(zip_buf, 64850, 5238 + "aa8f4ccbaa273fc763b6f382aaaa53590280abaa55b25cd721"); 5239 + FeedZipHtml(zip_buf, 64875, 5240 + "57e3987bd9080d167e23c2272a27647a9656a97db61f8075b4"); 5241 + FeedZipHtml(zip_buf, 64900, 5242 + "491de9c7a0fece4dfdc8984a564e60a38034f2f73f3d288666"); 5243 + FeedZipHtml(zip_buf, 64925, 5244 + "f26d75dedb9e023f7c0974298e4f86209e979a6d17d95ffeb6"); 5245 + FeedZipHtml(zip_buf, 64950, 5246 + "2496ff2bde0b5cd33dc8cc0d46a740b52b3a8733ec9715de58"); 5247 + FeedZipHtml(zip_buf, 64975, 5248 + "5c2e48271b57a1c22a84229f3cdf034b48636f9492b555d931"); 5249 + FeedZipHtml(zip_buf, 65000, 5250 + "92b29aa4b8b010ceb8a7f8f1d3c70be336e2f9c5bbabeeadf9"); 5251 + FeedZipHtml(zip_buf, 65025, 5252 + "c9d5df5f8dbf20aac5f8f35df7cfff64ae2d8a0f7e2cbfa9a8"); 5253 + FeedZipHtml(zip_buf, 65050, 5254 + "5f941b44059b86ebb92ac2280ef38b4c5ac401958c8e9558ac"); 5255 + FeedZipHtml(zip_buf, 65075, 5256 + "e75687729b7f9f40d04c82240fc367d4a5bdc37cbf7ef8e97f"); 5257 + FeedZipHtml(zip_buf, 65100, 5258 + "cd4eed3aa59e11ce81d00470c9edbbaf3b094d564a1e775950"); 5259 + FeedZipHtml(zip_buf, 65125, 5260 + "9b248f2cd745b1f14aa9098b7ff5e26f0debb0c6be2de0b366"); 5261 + FeedZipHtml(zip_buf, 65150, 5262 + "1ec65df6bb6905166176b24bec84a9c9ae5313e605cc0b1ae2"); 5263 + FeedZipHtml(zip_buf, 65175, 5264 + "053b090a564e0a76524a9b66042cd4cdd10196fd3e7001c6f9"); 5265 + FeedZipHtml(zip_buf, 65200, 5266 + "8cf319e733ce679cbfdf383ff2c6be7b2acc730b831444af7b"); 5267 + FeedZipHtml(zip_buf, 65225, 5268 + "623378ba965298f9d065e4baa561f9d9c74efd199703364533"); 5269 + FeedZipHtml(zip_buf, 65250, 5270 + "5849f594b47154c84add41a5ae3a648f35bf539a6f8085b381"); 5271 + FeedZipHtml(zip_buf, 65275, 5272 + "eca181acd9559026ea17501e927bd78b5ed4854dc52faa0a5b"); 5273 + FeedZipHtml(zip_buf, 65300, 5274 + "b01f616d7e84cc6ccb5ecfcb4fb20213cd4dafc22d3d2052a6"); 5275 + FeedZipHtml(zip_buf, 65325, 5276 + "9c9403c1336ede295340fb88139b6ee2e82b6db086c5d96367"); 5277 + FeedZipHtml(zip_buf, 65350, 5278 + "539e272fe41a5896871d536d45822c4223aa8c44eee620e4f5"); 5279 + FeedZipHtml(zip_buf, 65375, 5280 + "7f82e1fc7d71fd09bacf219fec6f5989bf85433ed9e5b3eb2e"); 5281 + FeedZipHtml(zip_buf, 65400, 5282 + "9f2d0cfeda3f970f2ba9dd148095ba834a6d92d3b3ee7742f7"); 5283 + FeedZipHtml(zip_buf, 65425, 5284 + "eda5ebf9a8df1c63e7286066f5ccea398462ef283df369e6d3"); 5285 + FeedZipHtml(zip_buf, 65450, 5286 + "8df36986756d27d3aca196026fd6e8ae69b4691acd8adf6ec5"); 5287 + FeedZipHtml(zip_buf, 65475, 5288 + "6f2d87667eccfc98f931f363e6c7cc8f991fcfe6c71fc220dc"); 5289 + FeedZipHtml(zip_buf, 65500, 5290 + "f258c6cbc89e563fb51952bbc362dd387c6535b4420db5a26b"); 5291 + FeedZipHtml(zip_buf, 65525, 5292 + "5957dba3abd5fb0358a5dba1d2f632fdb2e07650492c3888cb"); 5293 + FeedZipHtml(zip_buf, 65550, 5294 + "64bf3d649fe6c99c8156b1f554a3fbc4d939527d0f683b47aa"); 5295 + FeedZipHtml(zip_buf, 65575, 5296 + "b3e760b73d075b1c31d966cfc10e8a75e39899d5d00a353447"); 5297 + FeedZipHtml(zip_buf, 65600, 5298 + "34595b7c5a5cf7b4384b2339ee9aa9e6ee524de699bbce3399"); 5299 + FeedZipHtml(zip_buf, 65625, 5300 + "e431c96b98e4ed12aa6a0bc3db25996e1ca9b20e36af8366b9"); 5301 + FeedZipHtml(zip_buf, 65650, 5302 + "1dab8a89dd82c48e491b9336266d4cda98b43169db13d2d68d"); 5303 + FeedZipHtml(zip_buf, 65675, 5304 + "fb9e771979ce36c1a5cd70b17d17153ee6c5b85c9f09031580"); 5305 + FeedZipHtml(zip_buf, 65700, 5306 + "a2f4021c8b74e5223d02a93962391cd9feb937f092b859607d"); 5307 + FeedZipHtml(zip_buf, 65725, 5308 + "debded5e5ef7ce6700eaeecd59af6781eeb80acde6a1f38ae1"); 5309 + FeedZipHtml(zip_buf, 65750, 5310 + "64aadc7681cac28c9263dd30567c2b7edf4fec6030f1edc8c2"); 5311 + FeedZipHtml(zip_buf, 65775, 5312 + "4e220c090e922cd148e5fa4c7c69ccbab5a3ccc23a25dbeee4"); 5313 + FeedZipHtml(zip_buf, 65800, 5314 + "a68214e969188ae91920b13e4c152be6dc7d7e28680b6279f3"); 5315 + FeedZipHtml(zip_buf, 65825, 5316 + "01ba89973df97e1fdf620e6a9af9d00bc4a2653b12d5c20fc2"); 5317 + FeedZipHtml(zip_buf, 65850, 5318 + "2828fe20549f750c1408abd1e1b2a874183e0abd0460b2b82c"); 5319 + FeedZipHtml(zip_buf, 65875, 5320 + "0b11c3ba6c0ded07570a424f275c3cb363cec3d21f494d99b6"); 5321 + FeedZipHtml(zip_buf, 65900, 5322 + "f611a39682d4dfc7eee0f7cbad0ad5581b44dd17396df20480"); 5323 + FeedZipHtml(zip_buf, 65925, 5324 + "e5baa8ab58f071df4b4a7dd9ab43a997d7ddbf6eceba5717d6"); 5325 + FeedZipHtml(zip_buf, 65950, 5326 + "97dec7db37ca094c7f54235770697015f5bdc4b5a0fa7621da"); 5327 + FeedZipHtml(zip_buf, 65975, 5328 + "fd7493e2146c0cc02ee961343aa7973105753d824091c0fa6e"); 5329 + FeedZipHtml(zip_buf, 66000, 5330 + "3ad98f714978857f141c8e6f5eb1bf31bb95eee43eba6a1cb7"); 5331 + FeedZipHtml(zip_buf, 66025, 5332 + "9342da348863a1ee16826374c6e88cd119a3334667cf4067ea"); 5333 + FeedZipHtml(zip_buf, 66050, 5334 + "33b9b00de53f3ffc66762f96d3136c2bbf88e3f22e97e47b3c"); 5335 + FeedZipHtml(zip_buf, 66075, 5336 + "7aefdcb87d69c41ef86a9dc35f5e8a06ad72998691e30a91be"); 5337 + FeedZipHtml(zip_buf, 66100, 5338 + "ce8af7fede2d11af049343e351f715fcf73faad19f449bbfdd"); 5339 + FeedZipHtml(zip_buf, 66125, 5340 + "4c83c416ab5132acf3f06434b2612785a72b11ab1c52237949"); 5341 + FeedZipHtml(zip_buf, 66150, 5342 + "626abb775e09035a8231567a90ce12dd3014660534069b5798"); 5343 + FeedZipHtml(zip_buf, 66175, 5344 + "e48ab5b4312dad3e329d95d97665ae3976bd5e1eabb7840d31"); 5345 + FeedZipHtml(zip_buf, 66200, 5346 + "b4141196e341a80172333f0c0600cbe4d972ecfa44bb140653"); 5347 + FeedZipHtml(zip_buf, 66225, 5348 + "8ca72f509ce7c0913dd3e55da2cb9c13aa358c99734271e439"); 5349 + FeedZipHtml(zip_buf, 66250, 5350 + "479e2f761224b7a946d2b06c0d226a8257efb7445bc0ab5901"); 5351 + FeedZipHtml(zip_buf, 66275, 5352 + "2dbf26cc7adaa09e5ac3b30a77826b8483311f633ec67770f7"); 5353 + FeedZipHtml(zip_buf, 66300, 5354 + "958c31136226d42c13da532cd2140dda5371b68403b1f4b780"); 5355 + FeedZipHtml(zip_buf, 66325, 5356 + "00b19298fdf04913331b6636cc6c98d930b36984d9e85aef3b"); 5357 + FeedZipHtml(zip_buf, 66350, 5358 + "19ffb2ce82f06d2056accd556973e3a895b5bfcfdaaf153ec7"); 5359 + FeedZipHtml(zip_buf, 66375, 5360 + "26c226b2a97059b624b6a4167851962c420bbf802c58ec62d9"); 5361 + FeedZipHtml(zip_buf, 66400, 5362 + "21174b66eed2388ff2dfc9295b20e9b9c99a9312714c534e55"); 5363 + FeedZipHtml(zip_buf, 66425, 5364 + "b9aec1b0f629cb35473cef812b8a239ed91bb627deb09d0c40"); 5365 + FeedZipHtml(zip_buf, 66450, 5366 + "dc5b6f186b73db290a6b7f9fb5bf062f061bc99e18497b1d14"); 5367 + FeedZipHtml(zip_buf, 66475, 5368 + "1585b0948f8283e0d98fc17e0c8ea76127c6524e0cf620b007"); 5369 + FeedZipHtml(zip_buf, 66500, 5370 + "615d1e0446933be33e60556e2d3160d5efadead7e438600bd9"); 5371 + FeedZipHtml(zip_buf, 66525, 5372 + "750bd95aaf017b04d823c01e01f608b047803d02ec11d88047"); 5373 + FeedZipHtml(zip_buf, 66550, 5374 + "e04318843b1f267b19d9a5f5485a40e3f75afe1b87d7acafed"); 5375 + FeedZipHtml(zip_buf, 66575, 5376 + "d2971ce3aaef9db0525bafd4c65c25acfb5dd17d7b9d206577"); 5377 + FeedZipHtml(zip_buf, 66600, 5378 + "3b4025b120542efb4176d50f42b36ece40ab1c19a97dec933b"); 5379 + FeedZipHtml(zip_buf, 66625, 5380 + "832f6aec8147832f6ab053652f9c2a3b1db5bb054e95bd94ff"); 5381 + FeedZipHtml(zip_buf, 66650, 5382 + "c6313deb6bbbf4d538b566b5b658aded65cd15a10359e2ccd7"); 5383 + FeedZipHtml(zip_buf, 66675, 5384 + "0e985c33b9e6580166d64c6b99d6ae8fd6ae16cc31636d4cb4"); 5385 + FeedZipHtml(zip_buf, 66700, 5386 + "8c935959bba3acb57055d6691b75bae544954928935026a14c"); 5387 + FeedZipHtml(zip_buf, 66725, 5388 + "42998432096512fa7c12da8dfb9e771979ce1a51da3a60da46"); 5389 + FeedZipHtml(zip_buf, 66750, 5390 + "e9270bb51e4af562dc02ce84d1030aab894059f8eb12fe11c8"); 5391 + FeedZipHtml(zip_buf, 66775, 5392 + "d7118bf1c8f6cfbd8197c4cd9284f3ee6df7f2ba773e831c74"); 5393 + FeedZipHtml(zip_buf, 66800, 5394 + "6fce7a3d0bd4cbd5d2768d06ac181aa7a6d22e805c989f72ac"); 5395 + FeedZipHtml(zip_buf, 66825, 5396 + "1bc6bd6f2d9839763098f87664612711520507499634a5727d"); 5397 + FeedZipHtml(zip_buf, 66850, 5398 + "265636e6f0da117361d5936d777253418af4340cc5f40cd0e5"); 5399 + FeedZipHtml(zip_buf, 66875, 5400 + "70982a56ccb9fbfc50d016c462e9030c152f7bf2fd3ebec51c"); 5401 + FeedZipHtml(zip_buf, 66900, 5402 + "d434f3a1178825d0762442871f845150fc41a83eeb18881656"); 5403 + FeedZipHtml(zip_buf, 66925, 5404 + "a3c36511f6307c147a09c064719117228655de1ada0fae1484"); 5405 + FeedZipHtml(zip_buf, 66950, 5406 + "9e4eb81467c79c87d83f929a326ded23de9e05b87f1fbb83df"); 5407 + FeedZipHtml(zip_buf, 66975, 5408 + "2fd719bdb365e06436e26389b6f0048735d0800bffbb00295e"); 5409 + FeedZipHtml(zip_buf, 67000, 5410 + "527ac6b03ac47d79ddfdebe6ac7b75617de97dbc7da39cf3f4"); 5411 + FeedZipHtml(zip_buf, 67025, 5412 + "47350a07e71039e7395e8c31fa12181d0ca95de87c3fddd738"); 5413 + FeedZipHtml(zip_buf, 67050, 5414 + "a11b03e34b7a7e8dcee94551c1768fe05c24788b9b4ef6635c"); 5415 + FeedZipHtml(zip_buf, 67075, 5416 + "125ee11f0547f09b57ec072eddc2f775ff6e0893eeab385b02"); 5417 + FeedZipHtml(zip_buf, 67100, 5418 + "4859fc7b8746196932d264a4c9489391e6c691a6fcec450627"); 5419 + FeedZipHtml(zip_buf, 67125, "0d69957b79173a53f1f830190989fc3fb7a47b9d"); 5420 + 5421 +// uncompressing the ZIP payload 5422 + in = zip_buf; 5423 + html = (char *) malloc(uncompressed_len + 1); 5424 + if (html == NULL) 5425 + goto error; 5426 + out = (Bytef *) html; 5427 + if (uncompress(out, &outLen, in, inLen) != Z_OK) 5428 + goto error; 5429 + *(html + uncompressed_len) = '\0'; 5430 + free(zip_buf); 5431 + html_text = wxString::FromUTF8(html); 5432 + free(html); 5433 + return; 5434 + 5435 +error: 5436 + if (zip_buf != NULL) 5437 + free(zip_buf); 5438 + if (html != NULL) 5439 + free(html); 5440 + html_text = 5441 + wxT 5442 + ("<html><body><h1>Sorry, HTML Help is currently unavailable.</h1></body></html>"); 5443 +}
Changes to LayerTree.cpp.
1 1 /* 2 2 / LayerTree.cpp 3 3 / tree control to handle map layers 4 4 / 5 5 / version 2.0, 2017 January 8 6 6 / 7 -/ Author: Sandro Furieri a-furieri@lqt.it 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 8 / 9 9 / Copyright (C) 2017 Alessandro Furieri 10 10 / 11 11 / This program is free software: you can redistribute it and/or modify 12 12 / it under the terms of the GNU General Public License as published by 13 13 / the Free Software Foundation, either version 3 of the License, or 14 14 / (at your option) any later version. ................................................................................ 22 22 / along with this program. If not, see <http://www.gnu.org/licenses/>. 23 23 / 24 24 */ 25 25 26 26 #include "Classdef.h" 27 27 28 28 #include "wx/imaglist.h" 29 +#include "wx/spinctrl.h" 30 +#include "wx/colordlg.h" 31 +#include "wx/clipbrd.h" 29 32 30 33 // 31 34 // ICONs in XPM format [universally portable] 32 35 // 33 36 #include "icons/map_root.xpm" 34 37 #include "icons/wms.xpm" 35 38 #include "icons/wms_off.xpm" ................................................................................ 116 119 (wxObjectEventFunction) & MyLayerTree::OnCmdMapConfigure); 117 120 Connect(Tree_MapVisible, wxEVT_COMMAND_MENU_SELECTED, 118 121 (wxObjectEventFunction) & MyLayerTree::OnCmdVisible); 119 122 Connect(Tree_MapFullExtent, wxEVT_COMMAND_MENU_SELECTED, 120 123 (wxObjectEventFunction) & MyLayerTree::OnCmdMapFullExtent); 121 124 Connect(Tree_MapLayerFullExtent, wxEVT_COMMAND_MENU_SELECTED, 122 125 (wxObjectEventFunction) & MyLayerTree::OnCmdMapLayerFullExtent); 126 + Connect(Tree_SqlSample, wxEVT_COMMAND_MENU_SELECTED, 127 + (wxObjectEventFunction) & MyLayerTree::OnCmdMapSqlSample); 128 + Connect(Tree_UrlSample, wxEVT_COMMAND_MENU_SELECTED, 129 + (wxObjectEventFunction) & MyLayerTree::OnCmdMapUrlSample); 123 130 Connect(Tree_MapLayerConfigure, wxEVT_COMMAND_MENU_SELECTED, 124 131 (wxObjectEventFunction) & MyLayerTree::OnCmdMapLayerConfigure); 125 132 Connect(Tree_QuickStyleEdit, wxEVT_COMMAND_MENU_SELECTED, 126 133 (wxObjectEventFunction) & MyLayerTree::OnCmdQuickStyleEdit); 127 134 Connect(Tree_MapLayerInfo, wxEVT_COMMAND_MENU_SELECTED, 128 135 (wxObjectEventFunction) & MyLayerTree::OnCmdLayerInfo); 129 136 Connect(Tree_MapRemoveLayer, wxEVT_COMMAND_MENU_SELECTED, ................................................................................ 157 164 case MAP_LAYER_WMS: 158 165 if (layer->IsVisible() == false) 159 166 idx = 2; 160 167 else 161 168 idx = 1; 162 169 break; 163 170 case MAP_LAYER_VECTOR: 171 + case MAP_LAYER_VECTOR_VIEW: 172 + case MAP_LAYER_VECTOR_SHP: 164 173 switch (layer->GetGeometryType()) 165 174 { 166 175 case 1: 167 176 case 1001: 168 177 case 2001: 169 178 case 3001: 170 179 case 4: ................................................................................ 235 244 void MyLayerTree::AddLayer(MapLayer * layer) 236 245 { 237 246 // 238 247 // adds a layer to the TREE list 239 248 // 240 249 wxTreeItemId item; 241 250 wxString name = layer->GetDbPrefix(); 242 - if (layer->GetType() == MAP_LAYER_VECTOR) 251 + if (layer->GetType() == MAP_LAYER_VECTOR 252 + || layer->GetType() == MAP_LAYER_VECTOR_VIEW 253 + || layer->GetType() == MAP_LAYER_VECTOR_SHP) 243 254 name += wxT(".") + layer->GetVectorPrefix(); 244 255 name += wxT(".") + layer->GetName(); 245 256 if (GetChildrenCount(Root) == 0) 246 257 item = AppendItem(Root, name, 1); 247 258 else 248 259 item = InsertItem(Root, 0, name, 1); 249 260 MapLayerObject *obj = new MapLayerObject(layer); ................................................................................ 411 422 menuItem = new wxMenuItem(&menu, Tree_MapRemoveLayer, wxT("Remove")); 412 423 menu.Append(menuItem); 413 424 menu.AppendSeparator(); 414 425 menuItem = 415 426 new wxMenuItem(&menu, Tree_MapLayerFullExtent, 416 427 wxT("Zoom to Full Extent")); 417 428 menu.Append(menuItem); 429 + menu.AppendSeparator(); 430 + menuItem = new wxMenuItem(&menu, Tree_SqlSample, wxT("SQL sample")); 431 + menu.Append(menuItem); 432 + if (layer->GetType() == MAP_LAYER_WMS) 433 + { 434 + menuItem = 435 + new wxMenuItem(&menu, Tree_UrlSample, wxT("Request URL sample")); 436 + menu.Append(menuItem); 437 + } 418 438 menu.AppendSeparator(); 419 439 menuItem = new wxMenuItem(&menu, Tree_MapLayerInfo, wxT("Metadata")); 420 440 menu.Append(menuItem); 421 441 menuItem = 422 442 new wxMenuItem(&menu, Tree_MapLayerConfigure, wxT("Configure")); 423 443 menu.Append(menuItem); 424 444 menuItem = ................................................................................ 458 478 // 459 479 MapLayerObject *obj = (MapLayerObject *) GetItemData(CurrentItem); 460 480 if (obj == NULL) 461 481 return; 462 482 MapLayer *layer = obj->GetLayer(); 463 483 MapPanel->SetMapLayerToFullExtent(layer); 464 484 } 485 + 486 +void MyLayerTree::OnCmdMapSqlSample(wxCommandEvent & WXUNUSED(event)) 487 +{ 488 +// 489 +// menu event - showing an SQL sample corresponding to the current Map settings 490 +// 491 + MapLayerObject *obj = (MapLayerObject *) GetItemData(CurrentItem); 492 + if (obj == NULL) 493 + return; 494 + MapLayer *layer = obj->GetLayer(); 495 + switch (layer->GetType()) 496 + { 497 + case MAP_LAYER_WMS: 498 + DoWmsSqlSample(layer); 499 + break; 500 + case MAP_LAYER_VECTOR: 501 + case MAP_LAYER_VECTOR_VIEW: 502 + case MAP_LAYER_VECTOR_SHP: 503 + DoVectorSqlSample(layer); 504 + break; 505 + case MAP_LAYER_TOPOLOGY: 506 + case MAP_LAYER_NETWORK: 507 + DoVectorSqlSample(layer); 508 + break; 509 + case MAP_LAYER_RASTER: 510 + DoRasterSqlSample(layer); 511 + break; 512 + } 513 +} 514 + 515 +void MyLayerTree::OnCmdMapUrlSample(wxCommandEvent & WXUNUSED(event)) 516 +{ 517 +// 518 +// menu event - showing a Request URL sample corresponding to the current Map settings 519 +// 520 + MapLayerObject *obj = (MapLayerObject *) GetItemData(CurrentItem); 521 + if (obj == NULL) 522 + return; 523 + MapLayer *layer = obj->GetLayer(); 524 + if (layer->GetType() != MAP_LAYER_WMS) 525 + return; 526 + DoWmsUrlSample(layer); 527 +} 528 + 529 +void MyLayerTree::DoWmsSqlSample(MapLayer * lyr) 530 +{ 531 +// 532 +// WMS - showing an SQL sample corresponding to the current Map settings 533 +// 534 + WmsLayerSettings *conf = lyr->GetWmsConfig(); 535 + WmsSqlSampleDialog dlg; 536 + dlg.Create(MapPanel, lyr); 537 + dlg.ShowModal(); 538 +} 539 + 540 +void MyLayerTree::DoWmsUrlSample(MapLayer * lyr) 541 +{ 542 +// 543 +// WMS - showing a Request URL sample corresponding to the current Map settings 544 +// 545 + WmsLayerSettings *conf = lyr->GetWmsConfig(); 546 + WmsSqlSampleDialog dlg; 547 + dlg.Create(MapPanel, lyr, true); 548 + dlg.ShowModal(); 549 +} 550 + 551 +void MyLayerTree::DoVectorSqlSample(MapLayer * lyr) 552 +{ 553 +// 554 +// Vector - showing an SQL sample corresponding to the current Map settings 555 +// 556 +//fprintf(stderr, "Vector SQL\n"); 557 + VectorLayerConfig *conf = lyr->GetVectorConfig(); 558 + VectorSqlSampleDialog dlg; 559 + dlg.Create(MapPanel, lyr); 560 + dlg.ShowModal(); 561 +} 562 + 563 +void MyLayerTree::DoRasterSqlSample(MapLayer * lyr) 564 +{ 565 +// 566 +// Raster - showing an SQL sample corresponding to the current Map settings 567 +// 568 + RasterLayerConfig *conf = lyr->GetRasterConfig(); 569 + RasterSqlSampleDialog dlg; 570 + dlg.Create(MapPanel, lyr); 571 + dlg.ShowModal(); 572 +} 465 573 466 574 void MyLayerTree::OnCmdRemoveLayer(wxCommandEvent & WXUNUSED(event)) 467 575 { 468 576 // 469 577 // menu event - removing some Map layer (Step #1) 470 578 // 471 579 MapLayerObject *obj = (MapLayerObject *) GetItemData(CurrentItem); ................................................................................ 746 854 // 747 855 // menu event - editing Layer's Quick Style 748 856 // 749 857 MapLayerObject *obj = (MapLayerObject *) GetItemData(CurrentItem); 750 858 if (obj == NULL) 751 859 return; 752 860 MapLayer *layer = obj->GetLayer(); 753 - bool bboxChanged = false; 754 861 bool configChanged = false; 755 862 if (layer->GetType() == MAP_LAYER_VECTOR 756 863 || layer->GetType() == MAP_LAYER_VECTOR_VIEW 757 864 || layer->GetType() == MAP_LAYER_VECTOR_SHP) 758 865 { 759 866 QuickStyleVectorDialog dlg; 760 867 int type = layer->GetVectorConfig()->GetGeometryType(); ................................................................................ 765 872 } 766 873 if (layer->GetType() == MAP_LAYER_TOPOLOGY 767 874 || layer->GetType() == MAP_LAYER_NETWORK) 768 875 { 769 876 QuickStyleTopologyDialog dlg; 770 877 dlg.Create(MapPanel, layer); 771 878 int ret = dlg.ShowModal(); 879 + if (ret == wxID_OK) 880 + configChanged = dlg.ConfigChanged(); 881 + } 882 + if (layer->GetType() == MAP_LAYER_RASTER) 883 + { 884 + QuickStyleRasterDialog dlg; 885 + dlg.Create(MapPanel, layer); 886 + int ret = dlg.ShowModal(); 772 887 if (ret == wxID_OK) 773 888 configChanged = dlg.ConfigChanged(); 774 889 } 775 890 if (configChanged == true) 776 891 MapPanel->RefreshMap(); 777 892 } 778 893 ................................................................................ 802 917 wxTreeItemId currentItem = event.GetItem(); 803 918 MapLayer *layer = obj->GetLayer(); 804 919 // 805 920 // creating the new node 806 921 // 807 922 wxTreeItemId position; 808 923 wxString name = layer->GetDbPrefix(); 809 - if (layer->GetType() == MAP_LAYER_VECTOR) 924 + if (layer->GetType() == MAP_LAYER_VECTOR 925 + || layer->GetType() == MAP_LAYER_VECTOR_VIEW 926 + || layer->GetType() == MAP_LAYER_VECTOR_SHP) 810 927 name += wxT(".") + layer->GetVectorPrefix(); 811 928 name += wxT(".") + layer->GetName(); 812 929 wxColour color(0, 0, 0); 813 930 int idx = GetIconIndex(layer); 814 931 if (layer->IsVisible() == false) 815 932 { 816 933 color = wxColour(192, 192, 192); ................................................................................ 902 1019 wxT("SRID"), 903 1020 wxDefaultPosition, 904 1021 wxDefaultSize); 905 1022 wxBoxSizer *sridBoxSizer = new wxStaticBoxSizer(sridBox, wxVERTICAL); 906 1023 xxSizer->Add(sridBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 907 1024 wxComboBox *sridList = 908 1025 new wxComboBox(this, ID_RASTER_SRID, wxT(""), wxDefaultPosition, 909 - wxSize(350, 21), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); 1026 + wxSize(350, 21), 0, NULL, 1027 + wxCB_DROPDOWN | wxCB_READONLY); 910 1028 PopulateSRIDs(sridList); 911 1029 sridBoxSizer->Add(sridList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 912 1030 wxStaticBox *stlBox = new wxStaticBox(this, wxID_STATIC, 913 1031 wxT("Style"), 914 1032 wxDefaultPosition, 915 1033 wxDefaultSize); 916 1034 wxBoxSizer *stlBoxSizer = new wxStaticBoxSizer(stlBox, wxVERTICAL); 917 1035 xxSizer->Add(stlBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 918 1036 wxComboBox *stlList = 919 1037 new wxComboBox(this, ID_RASTER_STYLE, wxT(""), wxDefaultPosition, 920 - wxSize(350, 21), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); 1038 + wxSize(350, 21), 0, NULL, 1039 + wxCB_DROPDOWN | wxCB_READONLY); 921 1040 PopulateStyles(stlList); 922 1041 stlBoxSizer->Add(stlList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 923 1042 wxBoxSizer *buttonSizer = new wxBoxSizer(wxVERTICAL); 924 1043 rstSizer->Add(buttonSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 925 1044 wxButton *rst_ok = new wxButton(this, ID_RASTER_OK, wxT("&Apply Changes")); 926 1045 buttonSizer->Add(rst_ok, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 927 1046 wxButton *rst_quit = new wxButton(this, wxID_CANCEL, wxT("&Quit")); ................................................................................ 969 1088 "JOIN \"%s\".spatial_ref_sys AS y ON (r.srid = y.srid) " 970 1089 "WHERE r.coverage_name = %Q UNION " 971 1090 "SELECT s.srid, y.ref_sys_name FROM \"%s\".raster_coverages AS r " 972 1091 "JOIN \"%s\".raster_coverages_srid AS s ON (s.coverage_name = r.coverage_name) " 973 1092 "JOIN \"%s\".spatial_ref_sys AS y ON (s.srid = y.srid) " 974 1093 "WHERE r.coverage_name = %Q AND " 975 1094 "s.extent_miny IS NOT NULL AND s.extent_maxx IS NOT NULL AND " 976 - "s.extent_maxx IS NOT NULL ORDER BY s.srid", xdb_prefix, xdb_prefix, layer, 977 - xdb_prefix, xdb_prefix, xdb_prefix, layer); 1095 + "s.extent_maxx IS NOT NULL ORDER BY s.srid", xdb_prefix, xdb_prefix, 1096 + layer, xdb_prefix, xdb_prefix, xdb_prefix, layer); 978 1097 free(layer); 979 1098 free(xdb_prefix); 980 1099 ret = 981 - sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, 982 - NULL); 1100 + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, 1101 + &columns, NULL); 983 1102 sqlite3_free(sql); 984 1103 if (ret != SQLITE_OK) 985 1104 return; 986 1105 987 1106 for (int i = 1; i <= rows; i++) 988 1107 { 989 1108 // populating the list ................................................................................ 1010 1129 1011 1130 char *db_prefix = (char *) malloc((DbPrefix.Len() * 4) + 1); 1012 1131 strcpy(db_prefix, DbPrefix.ToUTF8()); 1013 1132 char *xdb_prefix = gaiaDoubleQuotedSql(db_prefix); 1014 1133 free(db_prefix); 1015 1134 char *layer = (char *) malloc((LayerName.Len() * 4) + 1); 1016 1135 strcpy(layer, LayerName.ToUTF8()); 1017 - sql = sqlite3_mprintf("SELECT s.style_name FROM \"%s\".raster_coverages AS r " 1018 - "JOIN \"%s\".SE_raster_styled_layers AS x ON (x.coverage_name = r.coverage_name) " 1019 - "JOIN \"%s\".SE_raster_styles AS s ON (s.style_id = x.style_id) " 1020 - "WHERE r.coverage_name = %Q ORDER BY s.style_name", 1021 - xdb_prefix, xdb_prefix, xdb_prefix, layer); 1136 + sql = 1137 + sqlite3_mprintf 1138 + ("SELECT s.style_name FROM \"%s\".raster_coverages AS r " 1139 + "JOIN \"%s\".SE_raster_styled_layers AS x ON (x.coverage_name = r.coverage_name) " 1140 + "JOIN \"%s\".SE_raster_styles AS s ON (s.style_id = x.style_id) " 1141 + "WHERE r.coverage_name = %Q ORDER BY s.style_name", xdb_prefix, 1142 + xdb_prefix, xdb_prefix, layer); 1022 1143 free(layer); 1023 1144 free(xdb_prefix); 1024 1145 ret = 1025 - sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, 1026 - NULL); 1146 + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, 1147 + &columns, NULL); 1027 1148 sqlite3_free(sql); 1028 1149 if (ret != SQLITE_OK) 1029 1150 return; 1030 1151 1031 1152 for (int i = 1; i <= rows; i++) 1032 1153 { 1033 1154 // populating the list ................................................................................ 1034 1155 const char *style = results[(i * columns) + 0]; 1035 1156 if (strcasecmp(style, "default") == 0) 1036 1157 has_default = 1; 1037 1158 wxString str = wxString::FromUTF8(style); 1038 1159 stlList->Append(str); 1039 1160 } 1040 1161 sqlite3_free_table(results); 1162 + 1163 + QuickStyleRasterObj *quickStyle = Layer->GetQuickStyleRaster(); 1164 + if (quickStyle != NULL) 1165 + { 1166 + wxString str = wxString::FromUTF8(quickStyle->GetUUID()); 1167 + stlList->Append(str); 1168 + } 1041 1169 1042 1170 if (!has_default) 1043 1171 stlList->Append(wxT("default")); 1044 1172 if (stlList->GetSelection() == wxNOT_FOUND) 1045 1173 { 1046 - for (int i = 0; i < stlList->GetCount(); i++) 1174 + for (int i = 0; i < (int) stlList->GetCount(); i++) 1047 1175 { 1048 1176 if (Style == NULL) 1049 1177 { 1050 1178 if (stlList->GetString(i).Cmp(wxT("default")) == 0) 1051 1179 stlList->SetSelection(i); 1052 1180 } else 1053 1181 { ................................................................................ 1178 1306 wxT("SRID"), 1179 1307 wxDefaultPosition, 1180 1308 wxDefaultSize); 1181 1309 wxBoxSizer *sridBoxSizer = new wxStaticBoxSizer(sridBox, wxVERTICAL); 1182 1310 xxSizer->Add(sridBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 1183 1311 wxComboBox *sridList = 1184 1312 new wxComboBox(this, ID_VECTOR_SRID, wxT(""), wxDefaultPosition, 1185 - wxSize(350, 21), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); 1313 + wxSize(350, 21), 0, NULL, 1314 + wxCB_DROPDOWN | wxCB_READONLY); 1186 1315 PopulateSRIDs(sridList); 1187 1316 sridBoxSizer->Add(sridList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 1188 1317 wxStaticBox *stlBox = new wxStaticBox(this, wxID_STATIC, 1189 1318 wxT("Style"), 1190 1319 wxDefaultPosition, 1191 1320 wxDefaultSize); 1192 1321 wxBoxSizer *stlBoxSizer = new wxStaticBoxSizer(stlBox, wxVERTICAL); 1193 1322 xxSizer->Add(stlBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 1194 1323 wxComboBox *stlList = 1195 1324 new wxComboBox(this, ID_VECTOR_STYLE, wxT(""), wxDefaultPosition, 1196 - wxSize(350, 21), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); 1325 + wxSize(350, 21), 0, NULL, 1326 + wxCB_DROPDOWN | wxCB_READONLY); 1197 1327 PopulateStyles(stlList); 1198 1328 stlBoxSizer->Add(stlList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 1199 1329 wxBoxSizer *buttonSizer = new wxBoxSizer(wxVERTICAL); 1200 1330 rstSizer->Add(buttonSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 1201 1331 wxButton *rst_ok = new wxButton(this, ID_VECTOR_OK, wxT("&Apply Changes")); 1202 1332 buttonSizer->Add(rst_ok, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 1203 1333 wxButton *rst_quit = new wxButton(this, wxID_CANCEL, wxT("&Quit")); ................................................................................ 1265 1395 "WHERE c.coverage_name = %Q AND s.extent_minx IS NOT NULL AND " 1266 1396 "s.extent_miny IS NOT NULL AND s.extent_maxx IS NOT NULL AND " 1267 1397 "s.extent_maxx IS NOT NULL ORDER BY s.srid", xdb_prefix, xdb_prefix, 1268 1398 xdb_prefix, layer, xdb_prefix, xdb_prefix, xdb_prefix, layer); 1269 1399 free(layer); 1270 1400 free(xdb_prefix); 1271 1401 ret = 1272 - sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, 1273 - NULL); 1402 + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, 1403 + &columns, NULL); 1274 1404 sqlite3_free(sql); 1275 1405 if (ret != SQLITE_OK) 1276 1406 return; 1277 1407 1278 1408 for (int i = 1; i <= rows; i++) 1279 1409 { 1280 1410 // populating the list ................................................................................ 1319 1449 "WHERE c.coverage_name = %Q AND s.extent_minx IS NOT NULL AND " 1320 1450 "s.extent_miny IS NOT NULL AND s.extent_maxx IS NOT NULL AND " 1321 1451 "s.extent_maxx IS NOT NULL ORDER BY s.srid", xdb_prefix, xdb_prefix, 1322 1452 xdb_prefix, xdb_prefix, layer, xdb_prefix, xdb_prefix, xdb_prefix, layer); 1323 1453 free(layer); 1324 1454 free(xdb_prefix); 1325 1455 ret = 1326 - sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, 1327 - NULL); 1456 + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, 1457 + &columns, NULL); 1328 1458 sqlite3_free(sql); 1329 1459 if (ret != SQLITE_OK) 1330 1460 return; 1331 1461 1332 1462 for (int i = 1; i <= rows; i++) 1333 1463 { 1334 1464 // populating the list ................................................................................ 1371 1501 "WHERE c.coverage_name = %Q AND " 1372 1502 "s.extent_miny IS NOT NULL AND s.extent_maxx IS NOT NULL AND " 1373 1503 "s.extent_maxx IS NOT NULL ORDER BY s.srid", xdb_prefix, xdb_prefix, 1374 1504 xdb_prefix, layer, xdb_prefix, xdb_prefix, xdb_prefix, layer); 1375 1505 free(layer); 1376 1506 free(xdb_prefix); 1377 1507 ret = 1378 - sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, 1379 - NULL); 1508 + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, 1509 + &columns, NULL); 1380 1510 sqlite3_free(sql); 1381 1511 if (ret != SQLITE_OK) 1382 1512 return; 1383 1513 1384 1514 for (int i = 1; i <= rows; i++) 1385 1515 { 1386 1516 // populating the list ................................................................................ 1422 1552 sqlite3_mprintf 1423 1553 ("SELECT f_table_name, f_geometry_column, view_name, view_geometry, " 1424 1554 "virt_name, virt_geometry, topology_name, network_name FROM \"%s\".vector_coverages " 1425 1555 "WHERE coverage_name = %Q", xdb_prefix, layer); 1426 1556 free(layer); 1427 1557 free(xdb_prefix); 1428 1558 ret = 1429 - sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, 1430 - NULL); 1559 + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, 1560 + &columns, NULL); 1431 1561 sqlite3_free(sql); 1432 1562 if (ret != SQLITE_OK) 1433 1563 return MAP_LAYER_UNKNOWN; 1434 1564 1435 1565 for (int i = 1; i <= rows; i++) 1436 1566 { 1437 1567 // populating the list ................................................................................ 1487 1617 1488 1618 char *db_prefix = (char *) malloc((DbPrefix.Len() * 4) + 1); 1489 1619 strcpy(db_prefix, DbPrefix.ToUTF8()); 1490 1620 char *xdb_prefix = gaiaDoubleQuotedSql(db_prefix); 1491 1621 free(db_prefix); 1492 1622 char *layer = (char *) malloc((LayerName.Len() * 4) + 1); 1493 1623 strcpy(layer, LayerName.ToUTF8()); 1494 - sql = sqlite3_mprintf("SELECT s.style_name FROM \"%s\".vector_coverages AS r " 1495 - "JOIN \"%s\".SE_vector_styled_layers AS x ON (x.coverage_name = r.coverage_name) " 1496 - "JOIN \"%s\".SE_vector_styles AS s ON (s.style_id = x.style_id) " 1497 - "WHERE r.coverage_name = %Q ORDER BY s.style_name", 1498 - xdb_prefix, xdb_prefix, xdb_prefix, layer); 1624 + sql = 1625 + sqlite3_mprintf 1626 + ("SELECT s.style_name FROM \"%s\".vector_coverages AS r " 1627 + "JOIN \"%s\".SE_vector_styled_layers AS x ON (x.coverage_name = r.coverage_name) " 1628 + "JOIN \"%s\".SE_vector_styles AS s ON (s.style_id = x.style_id) " 1629 + "WHERE r.coverage_name = %Q ORDER BY s.style_name", xdb_prefix, 1630 + xdb_prefix, xdb_prefix, layer); 1499 1631 free(layer); 1500 1632 free(xdb_prefix); 1501 1633 ret = 1502 - sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, 1503 - NULL); 1634 + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, 1635 + &columns, NULL); 1504 1636 sqlite3_free(sql); 1505 1637 if (ret != SQLITE_OK) 1506 1638 return; 1507 1639 1508 1640 for (int i = 1; i <= rows; i++) 1509 1641 { 1510 1642 // populating the list ................................................................................ 1523 1655 stlList->Append(str); 1524 1656 } 1525 1657 1526 1658 if (!has_default) 1527 1659 stlList->Append(wxT("default")); 1528 1660 if (stlList->GetSelection() == wxNOT_FOUND) 1529 1661 { 1530 - for (int i = 0; i < stlList->GetCount(); i++) 1662 + for (int i = 0; i < (int) stlList->GetCount(); i++) 1531 1663 { 1532 1664 if (Style == NULL) 1533 1665 { 1534 1666 if (stlList->GetString(i).Cmp(wxT("default")) == 0) 1535 1667 stlList->SetSelection(i); 1536 1668 } else 1537 1669 { ................................................................................ 1663 1795 wxT("SRID"), 1664 1796 wxDefaultPosition, 1665 1797 wxDefaultSize); 1666 1798 wxBoxSizer *sridBoxSizer = new wxStaticBoxSizer(sridBox, wxVERTICAL); 1667 1799 xxSizer->Add(sridBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 1668 1800 wxComboBox *sridList = 1669 1801 new wxComboBox(this, ID_TOPOGEO_SRID, wxT(""), wxDefaultPosition, 1670 - wxSize(350, 21), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); 1802 + wxSize(350, 21), 0, NULL, 1803 + wxCB_DROPDOWN | wxCB_READONLY); 1671 1804 PopulateSRIDs(sridList); 1672 1805 sridBoxSizer->Add(sridList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 1673 1806 wxStaticBox *stlBox = new wxStaticBox(this, wxID_STATIC, 1674 1807 wxT("Style"), 1675 1808 wxDefaultPosition, 1676 1809 wxDefaultSize); 1677 1810 wxBoxSizer *stlBoxSizer = new wxStaticBoxSizer(stlBox, wxVERTICAL); 1678 1811 xxSizer->Add(stlBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 1679 1812 wxComboBox *stlList = 1680 1813 new wxComboBox(this, ID_TOPOGEO_STYLE, wxT(""), wxDefaultPosition, 1681 - wxSize(350, 21), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); 1814 + wxSize(350, 21), 0, NULL, 1815 + wxCB_DROPDOWN | wxCB_READONLY); 1682 1816 PopulateStyles(stlList); 1683 1817 stlBoxSizer->Add(stlList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 1684 1818 // third row: Primitives Visibility 1685 1819 wxStaticBox *visBox = new wxStaticBox(this, wxID_STATIC, 1686 1820 wxT("TopoGeo Primitives Visibility"), 1687 1821 wxDefaultPosition, 1688 1822 wxDefaultSize); ................................................................................ 1705 1839 wxCheckBox *nodeCtrl = new wxCheckBox(this, ID_TOPOGEO_NODE, 1706 1840 wxT("Nodes"), 1707 1841 wxDefaultPosition, wxDefaultSize); 1708 1842 nodeCtrl->SetValue(config->AreNodesVisible()); 1709 1843 vis1BoxSizer->Add(nodeCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 1710 1844 wxCheckBox *faceSeedCtrl = new wxCheckBox(this, ID_TOPOGEO_FACE_SEED, 1711 1845 wxT("FaceSeeds"), 1712 - wxDefaultPosition, wxDefaultSize); 1846 + wxDefaultPosition, 1847 + wxDefaultSize); 1713 1848 faceSeedCtrl->SetValue(config->AreFaceSeedsVisible()); 1714 1849 vis2BoxSizer->Add(faceSeedCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 1715 1850 wxCheckBox *edgeSeedCtrl = new wxCheckBox(this, ID_TOPOGEO_EDGE_SEED, 1716 1851 wxT("EdgeSeeds"), 1717 - wxDefaultPosition, wxDefaultSize); 1852 + wxDefaultPosition, 1853 + wxDefaultSize); 1718 1854 edgeSeedCtrl->SetValue(config->AreEdgeSeedsVisible()); 1719 1855 vis2BoxSizer->Add(edgeSeedCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 1720 1856 // Apply/Quit buttons 1721 1857 wxBoxSizer *buttonSizer = new wxBoxSizer(wxVERTICAL); 1722 1858 rstSizer->Add(buttonSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 1723 1859 wxButton *rst_ok = new wxButton(this, ID_TOPOGEO_OK, wxT("&Apply Changes")); 1724 1860 buttonSizer->Add(rst_ok, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); ................................................................................ 1773 1909 "WHERE c.coverage_name = %Q AND " 1774 1910 "s.extent_miny IS NOT NULL AND s.extent_maxx IS NOT NULL AND " 1775 1911 "s.extent_maxx IS NOT NULL ORDER BY s.srid", xdb_prefix, xdb_prefix, 1776 1912 xdb_prefix, layer, xdb_prefix, xdb_prefix, xdb_prefix, layer); 1777 1913 free(layer); 1778 1914 free(xdb_prefix); 1779 1915 ret = 1780 - sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, 1781 - NULL); 1916 + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, 1917 + &columns, NULL); 1782 1918 sqlite3_free(sql); 1783 1919 if (ret != SQLITE_OK) 1784 1920 return; 1785 1921 1786 1922 for (int i = 1; i <= rows; i++) 1787 1923 { 1788 1924 // populating the list ................................................................................ 1809 1945 1810 1946 char *db_prefix = (char *) malloc((DbPrefix.Len() * 4) + 1); 1811 1947 strcpy(db_prefix, DbPrefix.ToUTF8()); 1812 1948 char *xdb_prefix = gaiaDoubleQuotedSql(db_prefix); 1813 1949 free(db_prefix); 1814 1950 char *layer = (char *) malloc((LayerName.Len() * 4) + 1); 1815 1951 strcpy(layer, LayerName.ToUTF8()); 1816 - sql = sqlite3_mprintf("SELECT s.style_name FROM \"%s\".vector_coverages AS r " 1817 - "JOIN \"%s\".SE_vector_styled_layers AS x ON (x.coverage_name = r.coverage_name) " 1818 - "JOIN \"%s\".SE_vector_styles AS s ON (s.style_id = x.style_id) " 1819 - "WHERE r.coverage_name = %Q ORDER BY s.style_name", 1820 - xdb_prefix, xdb_prefix, xdb_prefix, layer); 1952 + sql = 1953 + sqlite3_mprintf 1954 + ("SELECT s.style_name FROM \"%s\".vector_coverages AS r " 1955 + "JOIN \"%s\".SE_vector_styled_layers AS x ON (x.coverage_name = r.coverage_name) " 1956 + "JOIN \"%s\".SE_vector_styles AS s ON (s.style_id = x.style_id) " 1957 + "WHERE r.coverage_name = %Q ORDER BY s.style_name", xdb_prefix, 1958 + xdb_prefix, xdb_prefix, layer); 1821 1959 free(layer); 1822 1960 free(xdb_prefix); 1823 1961 ret = 1824 - sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, 1825 - NULL); 1962 + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, 1963 + &columns, NULL); 1826 1964 sqlite3_free(sql); 1827 1965 if (ret != SQLITE_OK) 1828 1966 return; 1829 1967 1830 1968 for (int i = 1; i <= rows; i++) 1831 1969 { 1832 1970 // populating the list ................................................................................ 1845 1983 stlList->Append(str); 1846 1984 } 1847 1985 1848 1986 if (!has_default) 1849 1987 stlList->Append(wxT("default")); 1850 1988 if (stlList->GetSelection() == wxNOT_FOUND) 1851 1989 { 1852 - for (int i = 0; i < stlList->GetCount(); i++) 1990 + for (int i = 0; i < (int) stlList->GetCount(); i++) 1853 1991 { 1854 1992 if (Style == NULL) 1855 1993 { 1856 1994 if (stlList->GetString(i).Cmp(wxT("default")) == 0) 1857 1995 stlList->SetSelection(i); 1858 1996 } else 1859 1997 { ................................................................................ 2026 2164 wxT("SRID"), 2027 2165 wxDefaultPosition, 2028 2166 wxDefaultSize); 2029 2167 wxBoxSizer *sridBoxSizer = new wxStaticBoxSizer(sridBox, wxVERTICAL); 2030 2168 xxSizer->Add(sridBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2031 2169 wxComboBox *sridList = 2032 2170 new wxComboBox(this, ID_TOPONET_SRID, wxT(""), wxDefaultPosition, 2033 - wxSize(350, 21), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); 2171 + wxSize(350, 21), 0, NULL, 2172 + wxCB_DROPDOWN | wxCB_READONLY); 2034 2173 PopulateSRIDs(sridList); 2035 2174 sridBoxSizer->Add(sridList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2036 2175 wxStaticBox *stlBox = new wxStaticBox(this, wxID_STATIC, 2037 2176 wxT("Style"), 2038 2177 wxDefaultPosition, 2039 2178 wxDefaultSize); 2040 2179 wxBoxSizer *stlBoxSizer = new wxStaticBoxSizer(stlBox, wxVERTICAL); 2041 2180 xxSizer->Add(stlBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2042 2181 wxComboBox *stlList = 2043 2182 new wxComboBox(this, ID_TOPONET_STYLE, wxT(""), wxDefaultPosition, 2044 - wxSize(350, 21), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); 2183 + wxSize(350, 21), 0, NULL, 2184 + wxCB_DROPDOWN | wxCB_READONLY); 2045 2185 PopulateStyles(stlList); 2046 2186 stlBoxSizer->Add(stlList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2047 2187 // third row: Primitives Visibility 2048 2188 wxStaticBox *visBox = new wxStaticBox(this, wxID_STATIC, 2049 2189 wxT("TopoNet Primitives Visibility"), 2050 2190 wxDefaultPosition, 2051 2191 wxDefaultSize); ................................................................................ 2064 2204 wxCheckBox *nodeCtrl = new wxCheckBox(this, ID_TOPONET_NODE, 2065 2205 wxT("Nodes"), 2066 2206 wxDefaultPosition, wxDefaultSize); 2067 2207 nodeCtrl->SetValue(config->AreNodesVisible()); 2068 2208 vis1BoxSizer->Add(nodeCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2069 2209 wxCheckBox *linkSeedCtrl = new wxCheckBox(this, ID_TOPONET_LINK_SEED, 2070 2210 wxT("LinkSeeds"), 2071 - wxDefaultPosition, wxDefaultSize); 2211 + wxDefaultPosition, 2212 + wxDefaultSize); 2072 2213 linkSeedCtrl->SetValue(config->AreLinkSeedsVisible()); 2073 2214 vis2BoxSizer->Add(linkSeedCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2074 2215 // Apply/Quit buttons 2075 2216 wxBoxSizer *buttonSizer = new wxBoxSizer(wxVERTICAL); 2076 2217 rstSizer->Add(buttonSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2077 2218 wxButton *rst_ok = new wxButton(this, ID_TOPONET_OK, wxT("&Apply Changes")); 2078 2219 buttonSizer->Add(rst_ok, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); ................................................................................ 2127 2268 "WHERE c.coverage_name = %Q AND " 2128 2269 "s.extent_miny IS NOT NULL AND s.extent_maxx IS NOT NULL AND " 2129 2270 "s.extent_maxx IS NOT NULL ORDER BY s.srid", xdb_prefix, xdb_prefix, 2130 2271 xdb_prefix, layer, xdb_prefix, xdb_prefix, xdb_prefix, layer); 2131 2272 free(layer); 2132 2273 free(xdb_prefix); 2133 2274 ret = 2134 - sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, 2135 - NULL); 2275 + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, 2276 + &columns, NULL); 2136 2277 sqlite3_free(sql); 2137 2278 if (ret != SQLITE_OK) 2138 2279 return; 2139 2280 2140 2281 for (int i = 1; i <= rows; i++) 2141 2282 { 2142 2283 // populating the list ................................................................................ 2163 2304 2164 2305 char *db_prefix = (char *) malloc((DbPrefix.Len() * 4) + 1); 2165 2306 strcpy(db_prefix, DbPrefix.ToUTF8()); 2166 2307 char *xdb_prefix = gaiaDoubleQuotedSql(db_prefix); 2167 2308 free(db_prefix); 2168 2309 char *layer = (char *) malloc((LayerName.Len() * 4) + 1); 2169 2310 strcpy(layer, LayerName.ToUTF8()); 2170 - sql = sqlite3_mprintf("SELECT s.style_name FROM \"%s\".vector_coverages AS r " 2171 - "JOIN \"%s\".SE_vector_styled_layers AS x ON (x.coverage_name = r.coverage_name) " 2172 - "JOIN \"%s\".SE_vector_styles AS s ON (s.style_id = x.style_id) " 2173 - "WHERE r.coverage_name = %Q ORDER BY s.style_name", 2174 - xdb_prefix, xdb_prefix, xdb_prefix, layer); 2311 + sql = 2312 + sqlite3_mprintf 2313 + ("SELECT s.style_name FROM \"%s\".vector_coverages AS r " 2314 + "JOIN \"%s\".SE_vector_styled_layers AS x ON (x.coverage_name = r.coverage_name) " 2315 + "JOIN \"%s\".SE_vector_styles AS s ON (s.style_id = x.style_id) " 2316 + "WHERE r.coverage_name = %Q ORDER BY s.style_name", xdb_prefix, 2317 + xdb_prefix, xdb_prefix, layer); 2175 2318 free(layer); 2176 2319 free(xdb_prefix); 2177 2320 ret = 2178 - sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, 2179 - NULL); 2321 + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, 2322 + &columns, NULL); 2180 2323 sqlite3_free(sql); 2181 2324 if (ret != SQLITE_OK) 2182 2325 return; 2183 2326 2184 2327 for (int i = 1; i <= rows; i++) 2185 2328 { 2186 2329 // populating the list ................................................................................ 2199 2342 stlList->Append(str); 2200 2343 } 2201 2344 2202 2345 if (!has_default) 2203 2346 stlList->Append(wxT("default")); 2204 2347 if (stlList->GetSelection() == wxNOT_FOUND) 2205 2348 { 2206 - for (int i = 0; i < stlList->GetCount(); i++) 2349 + for (int i = 0; i < (int) stlList->GetCount(); i++) 2207 2350 { 2208 2351 if (Style == NULL) 2209 2352 { 2210 2353 if (stlList->GetString(i).Cmp(wxT("default")) == 0) 2211 2354 stlList->SetSelection(i); 2212 2355 } else 2213 2356 { ................................................................................ 2298 2441 if (Style != NULL) 2299 2442 free(Style); 2300 2443 Style = (char *) malloc((stl.Len() * 4) + 1); 2301 2444 strcpy(Style, stl.ToUTF8()); 2302 2445 DoConfigureMapLayer(); 2303 2446 wxDialog::EndModal(wxID_OK); 2304 2447 } 2448 + 2449 +bool VectorSqlSampleDialog::Create(MyMapPanel * parent, MapLayer * layer) 2450 +{ 2451 +// 2452 +// creating the dialog 2453 +// 2454 + MainFrame = parent->GetParent(); 2455 + MapPanel = parent; 2456 + Layer = layer; 2457 + DbPrefix = layer->GetDbPrefix(); 2458 + LayerName = layer->GetName(); 2459 + BgColor = wxColour(255, 255, 255); 2460 + if (wxDialog::Create 2461 + (parent, wxID_ANY, wxT("SQL sample: Map Request configuration")) == false) 2462 + return false; 2463 +// populates individual controls 2464 + InitData(); 2465 + CreateControls(); 2466 +// sets dialog sizer 2467 + GetSizer()->Fit(this); 2468 + GetSizer()->SetSizeHints(this); 2469 +// centers the dialog window 2470 + Centre(); 2471 + DoUpdateSql(); 2472 + return true; 2473 +} 2474 + 2475 +void VectorSqlSampleDialog::CreateControls() 2476 +{ 2477 +// 2478 +// creating individual control and setting initial values 2479 +// 2480 + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 2481 + this->SetSizer(topSizer); 2482 + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 2483 + topSizer->Add(boxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2484 +// First row: Layer name 2485 + wxBoxSizer *lyrBoxSizer = new wxBoxSizer(wxVERTICAL); 2486 + boxSizer->Add(lyrBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2487 + wxBoxSizer *nameSizer = new wxBoxSizer(wxHORIZONTAL); 2488 + lyrBoxSizer->Add(nameSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2489 + wxStaticBox *nameBox = new wxStaticBox(this, wxID_ANY, 2490 + wxT("Layer FullName"), 2491 + wxDefaultPosition, 2492 + wxDefaultSize); 2493 + wxBoxSizer *nameBoxSizer = new wxStaticBoxSizer(nameBox, wxHORIZONTAL); 2494 + nameSizer->Add(nameBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2495 + wxString fullName = DbPrefix + wxT(".") + LayerName; 2496 + wxTextCtrl *nameCtrl = new wxTextCtrl(this, ID_VECTOR_LAYER, fullName, 2497 + wxDefaultPosition, wxSize(470, 22), 2498 + wxTE_READONLY); 2499 + nameBoxSizer->Add(nameCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2500 +// Second row: Vector options 2501 + wxBoxSizer *rstSizer = new wxBoxSizer(wxHORIZONTAL); 2502 + lyrBoxSizer->Add(rstSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2503 + wxBoxSizer *xxSizer = new wxBoxSizer(wxVERTICAL); 2504 + rstSizer->Add(xxSizer, 0, wxALIGN_TOP | wxALL, 5); 2505 +// Style 2506 + wxStaticBox *stlBox = new wxStaticBox(this, wxID_STATIC, 2507 + wxT("Style"), 2508 + wxDefaultPosition, 2509 + wxDefaultSize); 2510 + wxBoxSizer *stlBoxSizer = new wxStaticBoxSizer(stlBox, wxVERTICAL); 2511 + xxSizer->Add(stlBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2512 + wxComboBox *stlList = 2513 + new wxComboBox(this, ID_VECTOR_STYLE, wxT(""), wxDefaultPosition, 2514 + wxSize(350, 21), 0, NULL, 2515 + wxCB_DROPDOWN | wxCB_READONLY); 2516 + PopulateStyles(stlList); 2517 + stlBoxSizer->Add(stlList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2518 +// Third row: Image options 2519 + wxBoxSizer *imageSizer = new wxBoxSizer(wxHORIZONTAL); 2520 + boxSizer->Add(imageSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2521 +// MIME type 2522 + wxString mime[4]; 2523 + mime[0] = wxT("&PNG"); 2524 + mime[1] = wxT("&JPEG"); 2525 + mime[2] = wxT("&TIFF"); 2526 + mime[3] = wxT("PDF"); 2527 + wxRadioBox *mimeBox = new wxRadioBox(this, ID_MIME_TYPE, 2528 + wxT("&MIME Type"), 2529 + wxDefaultPosition, 2530 + wxDefaultSize, 4, 2531 + mime, 2, 2532 + wxRA_SPECIFY_COLS); 2533 + imageSizer->Add(mimeBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2534 + mimeBox->SetSelection(0); 2535 +// image Quality 2536 + wxStaticBox *qtyBox = new wxStaticBox(this, wxID_STATIC, 2537 + wxT("Quality"), 2538 + wxDefaultPosition, 2539 + wxDefaultSize); 2540 + wxBoxSizer *qtyBoxSizer = new wxStaticBoxSizer(qtyBox, wxVERTICAL); 2541 + imageSizer->Add(qtyBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2542 + wxSlider *qualityCtrl = new wxSlider(this, ID_IMAGE_QUALITY, 85, 0, 100, 2543 + wxDefaultPosition, wxSize(100, 50), 2544 + wxSL_HORIZONTAL | wxSL_LABELS); 2545 + qtyBoxSizer->Add(qualityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2546 + qualityCtrl->Enable(false); 2547 +// Map background 2548 + wxStaticBox *bgBox = new wxStaticBox(this, wxID_STATIC, 2549 + wxT("Map Background"), 2550 + wxDefaultPosition, 2551 + wxDefaultSize); 2552 + wxBoxSizer *bg1Sizer = new wxStaticBoxSizer(bgBox, wxVERTICAL); 2553 + imageSizer->Add(bg1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2554 + wxBoxSizer *bg2Sizer = new wxBoxSizer(wxHORIZONTAL); 2555 + bg1Sizer->Add(bg2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2556 + wxCheckBox *checkeredCtrl = 2557 + new wxCheckBox(this, ID_MAPOPT_CHECKERED_BACKGROUND, 2558 + wxT("&Transparent"), 2559 + wxDefaultPosition, wxDefaultSize); 2560 + checkeredCtrl->SetValue(true); 2561 + bg2Sizer->Add(checkeredCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2562 + wxStaticBox *bgColorBox = new wxStaticBox(this, wxID_ANY, 2563 + wxT("Background Color"), 2564 + wxDefaultPosition, 2565 + wxDefaultSize); 2566 + wxBoxSizer *bgColorBoxSizer = new wxStaticBoxSizer(bgColorBox, wxHORIZONTAL); 2567 + bg2Sizer->Add(bgColorBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2568 + wxBitmap bgColorBmp; 2569 + GetButtonBitmap(BgColor, bgColorBmp); 2570 + wxBitmapButton *bgColorCtrl = 2571 + new wxBitmapButton(this, ID_MAPOPT_SOLID_BACKGROUND, bgColorBmp); 2572 + bgColorCtrl->Enable(false); 2573 + bgColorBoxSizer->Add(bgColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2574 +// SQL sample 2575 + wxStaticBox *sqlBox = new wxStaticBox(this, wxID_STATIC, 2576 + wxT("SQL sample"), 2577 + wxDefaultPosition, 2578 + wxDefaultSize); 2579 + wxBoxSizer *sqlSizer = new wxStaticBoxSizer(sqlBox, wxVERTICAL); 2580 + boxSizer->Add(sqlSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2581 + wxTextCtrl *sqlCtrl = new wxTextCtrl(this, ID_SQL_SAMPLE, Sql, 2582 + wxDefaultPosition, wxSize(470, 100), 2583 + wxTE_MULTILINE | wxTE_WORDWRAP | 2584 + wxTE_READONLY); 2585 + sqlSizer->Add(sqlCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2586 +// buttons 2587 + wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); 2588 + boxSizer->Add(buttonSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2589 + wxButton *rst_ok = new wxButton(this, ID_VECTOR_COPY, wxT("&Copy")); 2590 + buttonSizer->Add(rst_ok, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2591 + wxButton *rst_quit = new wxButton(this, wxID_CANCEL, wxT("&Quit")); 2592 + buttonSizer->Add(rst_quit, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2593 +// appends event handlers 2594 + Connect(ID_VECTOR_COPY, wxEVT_COMMAND_BUTTON_CLICKED, 2595 + (wxObjectEventFunction) & VectorSqlSampleDialog::OnCopy); 2596 + Connect(wxID_CANCEL, wxEVT_COMMAND_BUTTON_CLICKED, 2597 + (wxObjectEventFunction) & VectorSqlSampleDialog::OnQuit); 2598 + Connect(ID_VECTOR_STYLE, wxEVT_COMMAND_COMBOBOX_SELECTED, 2599 + (wxObjectEventFunction) & VectorSqlSampleDialog::OnStyleChanged); 2600 + Connect(ID_MIME_TYPE, wxEVT_COMMAND_RADIOBOX_SELECTED, 2601 + (wxObjectEventFunction) & VectorSqlSampleDialog::OnMimeTypeChanged); 2602 + Connect(ID_IMAGE_QUALITY, wxEVT_SLIDER, 2603 + (wxObjectEventFunction) & VectorSqlSampleDialog::OnQualityChanged); 2604 + Connect(ID_MAPOPT_CHECKERED_BACKGROUND, wxEVT_COMMAND_CHECKBOX_CLICKED, 2605 + (wxObjectEventFunction) & 2606 + VectorSqlSampleDialog::OnTransparentChanged); 2607 + Connect(ID_MAPOPT_SOLID_BACKGROUND, wxEVT_COMMAND_BUTTON_CLICKED, 2608 + (wxObjectEventFunction) & VectorSqlSampleDialog::OnBackgroundChanged); 2609 +} 2610 + 2611 +void VectorSqlSampleDialog::GetButtonBitmap(wxColour & bgcolor, wxBitmap & bmp) 2612 +{ 2613 +// creating a Bitmap representing some Color 2614 + bmp = wxBitmap(96, 18); 2615 + wxMemoryDC *dc = new wxMemoryDC(bmp); 2616 + dc->SetBrush(wxBrush(bgcolor)); 2617 + dc->DrawRectangle(-1, -1, 98, 20); 2618 + delete dc; 2619 +} 2620 + 2621 +void VectorSqlSampleDialog::InitData() 2622 +{ 2623 +// initializing the current configuration 2624 + int len; 2625 + VectorLayerConfig *config = Layer->GetVectorConfig(); 2626 + Style = NULL; 2627 + if (config->GetStyle() != NULL) 2628 + { 2629 + len = strlen(config->GetStyle()); 2630 + Style = (char *) malloc(len + 1); 2631 + strcpy(Style, config->GetStyle()); 2632 + } 2633 +} 2634 + 2635 +void VectorSqlSampleDialog::PopulateStyles(wxComboBox * stlList) 2636 +{ 2637 +// populating the Styles List 2638 + int ret; 2639 + char *sql; 2640 + char **results; 2641 + int rows; 2642 + int columns; 2643 + int has_default = 0; 2644 + 2645 + char *db_prefix = (char *) malloc((DbPrefix.Len() * 4) + 1); 2646 + strcpy(db_prefix, DbPrefix.ToUTF8()); 2647 + char *xdb_prefix = gaiaDoubleQuotedSql(db_prefix); 2648 + free(db_prefix); 2649 + char *layer = (char *) malloc((LayerName.Len() * 4) + 1); 2650 + strcpy(layer, LayerName.ToUTF8()); 2651 + sql = 2652 + sqlite3_mprintf 2653 + ("SELECT s.style_name FROM \"%s\".vector_coverages AS r " 2654 + "JOIN \"%s\".SE_vector_styled_layers AS x ON (x.coverage_name = r.coverage_name) " 2655 + "JOIN \"%s\".SE_vector_styles AS s ON (s.style_id = x.style_id) " 2656 + "WHERE r.coverage_name = %Q ORDER BY s.style_name", xdb_prefix, 2657 + xdb_prefix, xdb_prefix, layer); 2658 + free(layer); 2659 + free(xdb_prefix); 2660 + ret = 2661 + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, 2662 + &columns, NULL); 2663 + sqlite3_free(sql); 2664 + if (ret != SQLITE_OK) 2665 + return; 2666 + 2667 + for (int i = 1; i <= rows; i++) 2668 + { 2669 + // populating the list 2670 + const char *style = results[(i * columns) + 0]; 2671 + if (strcasecmp(style, "default") == 0) 2672 + has_default = 1; 2673 + wxString str = wxString::FromUTF8(style); 2674 + stlList->Append(str); 2675 + } 2676 + sqlite3_free_table(results); 2677 + 2678 + if (!has_default) 2679 + stlList->Append(wxT("default")); 2680 + if (stlList->GetSelection() == wxNOT_FOUND) 2681 + { 2682 + for (int i = 0; i < (int) stlList->GetCount(); i++) 2683 + { 2684 + if (Style == NULL) 2685 + { 2686 + if (stlList->GetString(i).Cmp(wxT("default")) == 0) 2687 + stlList->SetSelection(i); 2688 + } else 2689 + { 2690 + if (stlList->GetString(i).Cmp(wxString::FromUTF8(Style)) == 0) 2691 + stlList->SetSelection(i); 2692 + } 2693 + } 2694 + } 2695 + if (stlList->GetSelection() == wxNOT_FOUND) 2696 + { 2697 + // the current Style probably is a QuickStyle 2698 + free(Style); 2699 + Style = NULL; 2700 + for (int i = 0; i < (int) stlList->GetCount(); i++) 2701 + { 2702 + if (stlList->GetString(i).Cmp(wxT("default")) == 0) 2703 + stlList->SetSelection(i); 2704 + } 2705 + } 2706 +} 2707 + 2708 +void VectorSqlSampleDialog::DoUpdateSql() 2709 +{ 2710 +// 2711 +// updating the SQL query 2712 +// 2713 + char *str; 2714 + char *buf; 2715 + wxString col; 2716 + wxTextCtrl *sqlCtrl = (wxTextCtrl *) FindWindow(ID_SQL_SAMPLE); 2717 + wxComboBox *stlList = (wxComboBox *) FindWindow(ID_VECTOR_STYLE); 2718 + wxRadioBox *mimeBox = (wxRadioBox *) FindWindow(ID_MIME_TYPE); 2719 + wxCheckBox *transparentCtrl = 2720 + (wxCheckBox *) FindWindow(ID_MAPOPT_CHECKERED_BACKGROUND); 2721 + wxSlider *qualityCtrl = (wxSlider *) FindWindow(ID_IMAGE_QUALITY); 2722 + Sql = wxT("SELECT RL2_GetMapImageFromVector("); 2723 + if (DbPrefix.Len() == 0) 2724 + Sql += wxT("NULL, "); 2725 + else 2726 + { 2727 + str = (char *) malloc((DbPrefix.Len() * 4) + 1); 2728 + strcpy(str, DbPrefix.ToUTF8()); 2729 + buf = sqlite3_mprintf("%Q, ", str); 2730 + free(str); 2731 + col = wxString::FromUTF8(buf); 2732 + sqlite3_free(buf); 2733 + Sql += col; 2734 + } 2735 +// coverage name 2736 + str = (char *) malloc((LayerName.Len() * 4) + 1); 2737 + strcpy(str, LayerName.ToUTF8()); 2738 + buf = sqlite3_mprintf("%Q, ", str); 2739 + free(str); 2740 + col = wxString::FromUTF8(buf); 2741 + sqlite3_free(buf); 2742 + Sql += col; 2743 +// bounding box 2744 + wxString bbox; 2745 + MapPanel->DoPrepareBBox(bbox); 2746 + Sql += bbox; 2747 +// image width and height 2748 + buf = 2749 + sqlite3_mprintf("%d, %d, ", MapPanel->GetImageWidth(), 2750 + MapPanel->GetImageHeight()); 2751 + col = wxString::FromUTF8(buf); 2752 + sqlite3_free(buf); 2753 + Sql += col; 2754 +// style 2755 + wxString style = stlList->GetValue(); 2756 + if (style.Len() == 0) 2757 + Sql += wxT("'default', "); 2758 + else 2759 + { 2760 + str = (char *) malloc((style.Len() * 4) + 1); 2761 + strcpy(str, style.ToUTF8()); 2762 + buf = sqlite3_mprintf("%Q, ", str); 2763 + free(str); 2764 + col = wxString::FromUTF8(buf); 2765 + sqlite3_free(buf); 2766 + Sql += col; 2767 + } 2768 +// MIME type 2769 + switch (mimeBox->GetSelection()) 2770 + { 2771 + case 1: 2772 + Sql += wxT("'image/jpeg', "); 2773 + break; 2774 + case 2: 2775 + Sql += wxT("'image/tiff', "); 2776 + break; 2777 + case 3: 2778 + Sql += wxT("'application/x-pdf', "); 2779 + break; 2780 + default: 2781 + Sql += wxT("'image/png', "); 2782 + break; 2783 + }; 2784 +// bgColor 2785 + buf = 2786 + sqlite3_mprintf("'#%02x%02x%02x', ", BgColor.Red(), BgColor.Green(), 2787 + BgColor.Blue()); 2788 + col = wxString::FromUTF8(buf); 2789 + sqlite3_free(buf); 2790 + Sql += col; 2791 +// transparent 2792 + if (transparentCtrl->GetValue()) 2793 + Sql += wxT("1, "); 2794 + else 2795 + Sql += wxT("0, "); 2796 +// quality 2797 + if (mimeBox->GetSelection() == 1) 2798 + { 2799 + buf = sqlite3_mprintf("%d", qualityCtrl->GetValue()); 2800 + col = wxString::FromUTF8(buf); 2801 + sqlite3_free(buf); 2802 + Sql += col; 2803 + } else 2804 + Sql += wxT("100"); 2805 + Sql += wxT(");"); 2806 + sqlCtrl->SetValue(Sql); 2807 +} 2808 + 2809 +void VectorSqlSampleDialog::OnStyleChanged(wxCommandEvent & WXUNUSED(event)) 2810 +{ 2811 +// 2812 +// Style selection changed 2813 +// 2814 + DoUpdateSql(); 2815 +} 2816 + 2817 +void VectorSqlSampleDialog::OnMimeTypeChanged(wxCommandEvent & WXUNUSED(event)) 2818 +{ 2819 +// 2820 +// MIME Type selection changed 2821 +// 2822 + wxRadioBox *mimeBox = (wxRadioBox *) FindWindow(ID_MIME_TYPE); 2823 + wxSlider *qualityCtrl = (wxSlider *) FindWindow(ID_IMAGE_QUALITY); 2824 + if (mimeBox->GetSelection() == 1) 2825 + qualityCtrl->Enable(true); 2826 + else 2827 + qualityCtrl->Enable(false); 2828 + DoUpdateSql(); 2829 +} 2830 + 2831 +void VectorSqlSampleDialog::OnQualityChanged(wxCommandEvent & WXUNUSED(event)) 2832 +{ 2833 +// 2834 +// Image Quality selection changed 2835 +// 2836 + DoUpdateSql(); 2837 +} 2838 + 2839 +void 2840 + VectorSqlSampleDialog::OnTransparentChanged(wxCommandEvent & WXUNUSED(event)) 2841 +{ 2842 +// 2843 +// Transparent Background selection changed 2844 +// 2845 + wxCheckBox *transparentCtrl = 2846 + (wxCheckBox *) FindWindow(ID_MAPOPT_CHECKERED_BACKGROUND); 2847 + wxBitmapButton *btn = 2848 + (wxBitmapButton *) FindWindow(ID_MAPOPT_SOLID_BACKGROUND); 2849 + if (transparentCtrl->GetValue() == false) 2850 + btn->Enable(true); 2851 + else 2852 + btn->Enable(false); 2853 + DoUpdateSql(); 2854 +} 2855 + 2856 +void 2857 + VectorSqlSampleDialog::OnBackgroundChanged(wxCommandEvent & WXUNUSED(event)) 2858 +{ 2859 +// Map Background Solid Color selection 2860 + wxColourData initColor; 2861 + int ret; 2862 + initColor.SetChooseFull(false); 2863 + initColor.SetColour(BgColor); 2864 + wxColourDialog colorDialog(this, &initColor); 2865 + ret = colorDialog.ShowModal(); 2866 + if (ret == wxID_OK) 2867 + { 2868 + wxColourData colorData = colorDialog.GetColourData(); 2869 + BgColor = colorData.GetColour(); 2870 + wxBitmap bmp; 2871 + GetButtonBitmap(BgColor, bmp); 2872 + wxBitmapButton *btn = 2873 + (wxBitmapButton *) FindWindow(ID_MAPOPT_SOLID_BACKGROUND); 2874 + btn->SetBitmapLabel(bmp); 2875 + DoUpdateSql(); 2876 + } 2877 +} 2878 + 2879 +void VectorSqlSampleDialog::OnCopy(wxCommandEvent & WXUNUSED(event)) 2880 +{ 2881 +// 2882 +// Copying the Map Request (SQL statement) 2883 +// 2884 + if (wxTheClipboard->Open()) 2885 + { 2886 + wxTheClipboard->SetData(new wxTextDataObject(Sql)); 2887 + wxTheClipboard->Close(); 2888 + } 2889 +} 2890 + 2891 +void VectorSqlSampleDialog::OnQuit(wxCommandEvent & WXUNUSED(event)) 2892 +{ 2893 +// 2894 +// all done: 2895 +// 2896 + wxDialog::EndModal(wxID_CANCEL); 2897 +} 2898 + 2899 +bool RasterSqlSampleDialog::Create(MyMapPanel * parent, MapLayer * layer) 2900 +{ 2901 +// 2902 +// creating the dialog 2903 +// 2904 + MainFrame = parent->GetParent(); 2905 + MapPanel = parent; 2906 + Layer = layer; 2907 + DbPrefix = layer->GetDbPrefix(); 2908 + LayerName = layer->GetName(); 2909 + BgColor = wxColour(255, 255, 255); 2910 + if (wxDialog::Create 2911 + (parent, wxID_ANY, wxT("SQL sample: Map Request configuration")) == false) 2912 + return false; 2913 +// populates individual controls 2914 + InitData(); 2915 + CreateControls(); 2916 +// sets dialog sizer 2917 + GetSizer()->Fit(this); 2918 + GetSizer()->SetSizeHints(this); 2919 +// centers the dialog window 2920 + Centre(); 2921 + DoUpdateSql(); 2922 + return true; 2923 +} 2924 + 2925 +void RasterSqlSampleDialog::CreateControls() 2926 +{ 2927 +// 2928 +// creating individual control and setting initial values 2929 +// 2930 + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 2931 + this->SetSizer(topSizer); 2932 + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 2933 + topSizer->Add(boxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2934 +// First row: Layer name 2935 + wxBoxSizer *lyrBoxSizer = new wxBoxSizer(wxVERTICAL); 2936 + boxSizer->Add(lyrBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2937 + wxBoxSizer *nameSizer = new wxBoxSizer(wxHORIZONTAL); 2938 + lyrBoxSizer->Add(nameSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2939 + wxStaticBox *nameBox = new wxStaticBox(this, wxID_ANY, 2940 + wxT("Layer FullName"), 2941 + wxDefaultPosition, 2942 + wxDefaultSize); 2943 + wxBoxSizer *nameBoxSizer = new wxStaticBoxSizer(nameBox, wxHORIZONTAL); 2944 + nameSizer->Add(nameBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2945 + wxString fullName = DbPrefix + wxT(".") + LayerName; 2946 + wxTextCtrl *nameCtrl = new wxTextCtrl(this, ID_VECTOR_LAYER, fullName, 2947 + wxDefaultPosition, wxSize(470, 22), 2948 + wxTE_READONLY); 2949 + nameBoxSizer->Add(nameCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2950 +// Second row: Raster options 2951 + wxBoxSizer *rstSizer = new wxBoxSizer(wxHORIZONTAL); 2952 + lyrBoxSizer->Add(rstSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2953 + wxBoxSizer *xxSizer = new wxBoxSizer(wxVERTICAL); 2954 + rstSizer->Add(xxSizer, 0, wxALIGN_TOP | wxALL, 5); 2955 +// Style 2956 + wxStaticBox *stlBox = new wxStaticBox(this, wxID_STATIC, 2957 + wxT("Style"), 2958 + wxDefaultPosition, 2959 + wxDefaultSize); 2960 + wxBoxSizer *stlBoxSizer = new wxStaticBoxSizer(stlBox, wxVERTICAL); 2961 + xxSizer->Add(stlBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2962 + wxComboBox *stlList = 2963 + new wxComboBox(this, ID_VECTOR_STYLE, wxT(""), wxDefaultPosition, 2964 + wxSize(350, 21), 0, NULL, 2965 + wxCB_DROPDOWN | wxCB_READONLY); 2966 + PopulateStyles(stlList); 2967 + stlBoxSizer->Add(stlList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2968 +// Third row: Image options 2969 + wxBoxSizer *imageSizer = new wxBoxSizer(wxHORIZONTAL); 2970 + boxSizer->Add(imageSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2971 +// MIME type 2972 + wxString mime[4]; 2973 + mime[0] = wxT("&PNG"); 2974 + mime[1] = wxT("&JPEG"); 2975 + mime[2] = wxT("&TIFF"); 2976 + mime[3] = wxT("PDF"); 2977 + wxRadioBox *mimeBox = new wxRadioBox(this, ID_MIME_TYPE, 2978 + wxT("&MIME Type"), 2979 + wxDefaultPosition, 2980 + wxDefaultSize, 4, 2981 + mime, 2, 2982 + wxRA_SPECIFY_COLS); 2983 + imageSizer->Add(mimeBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2984 + mimeBox->SetSelection(0); 2985 +// image Quality 2986 + wxStaticBox *qtyBox = new wxStaticBox(this, wxID_STATIC, 2987 + wxT("Quality"), 2988 + wxDefaultPosition, 2989 + wxDefaultSize); 2990 + wxBoxSizer *qtyBoxSizer = new wxStaticBoxSizer(qtyBox, wxVERTICAL); 2991 + imageSizer->Add(qtyBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2992 + wxSlider *qualityCtrl = new wxSlider(this, ID_IMAGE_QUALITY, 85, 0, 100, 2993 + wxDefaultPosition, wxSize(100, 50), 2994 + wxSL_HORIZONTAL | wxSL_LABELS); 2995 + qtyBoxSizer->Add(qualityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2996 + qualityCtrl->Enable(false); 2997 +// Map background 2998 + wxStaticBox *bgBox = new wxStaticBox(this, wxID_STATIC, 2999 + wxT("Map Background"), 3000 + wxDefaultPosition, 3001 + wxDefaultSize); 3002 + wxBoxSizer *bg1Sizer = new wxStaticBoxSizer(bgBox, wxVERTICAL); 3003 + imageSizer->Add(bg1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 3004 + wxBoxSizer *bg2Sizer = new wxBoxSizer(wxHORIZONTAL); 3005 + bg1Sizer->Add(bg2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3006 + wxCheckBox *checkeredCtrl = 3007 + new wxCheckBox(this, ID_MAPOPT_CHECKERED_BACKGROUND, 3008 + wxT("&Transparent"), 3009 + wxDefaultPosition, wxDefaultSize); 3010 + checkeredCtrl->SetValue(true); 3011 + bg2Sizer->Add(checkeredCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3012 + wxStaticBox *bgColorBox = new wxStaticBox(this, wxID_ANY, 3013 + wxT("Background Color"), 3014 + wxDefaultPosition, 3015 + wxDefaultSize); 3016 + wxBoxSizer *bgColorBoxSizer = new wxStaticBoxSizer(bgColorBox, wxHORIZONTAL); 3017 + bg2Sizer->Add(bgColorBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3018 + wxBitmap bgColorBmp; 3019 + GetButtonBitmap(BgColor, bgColorBmp); 3020 + wxBitmapButton *bgColorCtrl = 3021 + new wxBitmapButton(this, ID_MAPOPT_SOLID_BACKGROUND, bgColorBmp); 3022 + bgColorCtrl->Enable(false); 3023 + bgColorBoxSizer->Add(bgColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3024 +// SQL sample 3025 + wxStaticBox *sqlBox = new wxStaticBox(this, wxID_STATIC, 3026 + wxT("SQL sample"), 3027 + wxDefaultPosition, 3028 + wxDefaultSize); 3029 + wxBoxSizer *sqlSizer = new wxStaticBoxSizer(sqlBox, wxVERTICAL); 3030 + boxSizer->Add(sqlSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 3031 + wxTextCtrl *sqlCtrl = new wxTextCtrl(this, ID_SQL_SAMPLE, Sql, 3032 + wxDefaultPosition, wxSize(470, 100), 3033 + wxTE_MULTILINE | wxTE_WORDWRAP | 3034 + wxTE_READONLY); 3035 + sqlSizer->Add(sqlCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3036 +// buttons 3037 + wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); 3038 + boxSizer->Add(buttonSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3039 + wxButton *rst_ok = new wxButton(this, ID_VECTOR_COPY, wxT("&Copy")); 3040 + buttonSizer->Add(rst_ok, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 3041 + wxButton *rst_quit = new wxButton(this, wxID_CANCEL, wxT("&Quit")); 3042 + buttonSizer->Add(rst_quit, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 3043 +// appends event handlers 3044 + Connect(ID_VECTOR_COPY, wxEVT_COMMAND_BUTTON_CLICKED, 3045 + (wxObjectEventFunction) & RasterSqlSampleDialog::OnCopy); 3046 + Connect(wxID_CANCEL, wxEVT_COMMAND_BUTTON_CLICKED, 3047 + (wxObjectEventFunction) & RasterSqlSampleDialog::OnQuit); 3048 + Connect(ID_VECTOR_STYLE, wxEVT_COMMAND_COMBOBOX_SELECTED, 3049 + (wxObjectEventFunction) & RasterSqlSampleDialog::OnStyleChanged); 3050 + Connect(ID_MIME_TYPE, wxEVT_COMMAND_RADIOBOX_SELECTED, 3051 + (wxObjectEventFunction) & RasterSqlSampleDialog::OnMimeTypeChanged); 3052 + Connect(ID_IMAGE_QUALITY, wxEVT_SLIDER, 3053 + (wxObjectEventFunction) & RasterSqlSampleDialog::OnQualityChanged); 3054 + Connect(ID_MAPOPT_CHECKERED_BACKGROUND, wxEVT_COMMAND_CHECKBOX_CLICKED, 3055 + (wxObjectEventFunction) & 3056 + RasterSqlSampleDialog::OnTransparentChanged); 3057 + Connect(ID_MAPOPT_SOLID_BACKGROUND, wxEVT_COMMAND_BUTTON_CLICKED, 3058 + (wxObjectEventFunction) & RasterSqlSampleDialog::OnBackgroundChanged); 3059 +} 3060 + 3061 +void RasterSqlSampleDialog::GetButtonBitmap(wxColour & bgcolor, wxBitmap & bmp) 3062 +{ 3063 +// creating a Bitmap representing some Color 3064 + bmp = wxBitmap(96, 18); 3065 + wxMemoryDC *dc = new wxMemoryDC(bmp); 3066 + dc->SetBrush(wxBrush(bgcolor)); 3067 + dc->DrawRectangle(-1, -1, 98, 20); 3068 + delete dc; 3069 +} 3070 + 3071 +void RasterSqlSampleDialog::InitData() 3072 +{ 3073 +// initializing the current configuration 3074 + int len; 3075 + RasterLayerConfig *config = Layer->GetRasterConfig(); 3076 + Style = NULL; 3077 + if (config->GetStyle() != NULL) 3078 + { 3079 + len = strlen(config->GetStyle()); 3080 + Style = (char *) malloc(len + 1); 3081 + strcpy(Style, config->GetStyle()); 3082 + } 3083 +} 3084 + 3085 +void RasterSqlSampleDialog::PopulateStyles(wxComboBox * stlList) 3086 +{ 3087 +// populating the Styles List 3088 + int ret; 3089 + char *sql; 3090 + char **results; 3091 + int rows; 3092 + int columns; 3093 + int has_default = 0; 3094 + 3095 + char *db_prefix = (char *) malloc((DbPrefix.Len() * 4) + 1); 3096 + strcpy(db_prefix, DbPrefix.ToUTF8()); 3097 + char *xdb_prefix = gaiaDoubleQuotedSql(db_prefix); 3098 + free(db_prefix); 3099 + char *layer = (char *) malloc((LayerName.Len() * 4) + 1); 3100 + strcpy(layer, LayerName.ToUTF8()); 3101 + sql = 3102 + sqlite3_mprintf 3103 + ("SELECT s.style_name FROM \"%s\".raster_coverages AS r " 3104 + "JOIN \"%s\".SE_raster_styled_layers AS x ON (x.coverage_name = r.coverage_name) " 3105 + "JOIN \"%s\".SE_raster_styles AS s ON (s.style_id = x.style_id) " 3106 + "WHERE r.coverage_name = %Q ORDER BY s.style_name", xdb_prefix, 3107 + xdb_prefix, xdb_prefix, layer); 3108 + free(layer); 3109 + free(xdb_prefix); 3110 + ret = 3111 + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, 3112 + &columns, NULL); 3113 + sqlite3_free(sql); 3114 + if (ret != SQLITE_OK) 3115 + return; 3116 + 3117 + for (int i = 1; i <= rows; i++) 3118 + { 3119 + // populating the list 3120 + const char *style = results[(i * columns) + 0]; 3121 + if (strcasecmp(style, "default") == 0) 3122 + has_default = 1; 3123 + wxString str = wxString::FromUTF8(style); 3124 + stlList->Append(str); 3125 + } 3126 + sqlite3_free_table(results); 3127 + 3128 + if (!has_default) 3129 + stlList->Append(wxT("default")); 3130 + if (stlList->GetSelection() == wxNOT_FOUND) 3131 + { 3132 + for (int i = 0; i < (int) stlList->GetCount(); i++) 3133 + { 3134 + if (Style == NULL) 3135 + { 3136 + if (stlList->GetString(i).Cmp(wxT("default")) == 0) 3137 + stlList->SetSelection(i); 3138 + } else 3139 + { 3140 + if (stlList->GetString(i).Cmp(wxString::FromUTF8(Style)) == 0) 3141 + stlList->SetSelection(i); 3142 + } 3143 + } 3144 + } 3145 + if (stlList->GetSelection() == wxNOT_FOUND) 3146 + { 3147 + // the current Style probably is a QuickStyle 3148 + free(Style); 3149 + Style = NULL; 3150 + for (int i = 0; i < (int) stlList->GetCount(); i++) 3151 + { 3152 + if (stlList->GetString(i).Cmp(wxT("default")) == 0) 3153 + stlList->SetSelection(i); 3154 + } 3155 + } 3156 +} 3157 + 3158 +void RasterSqlSampleDialog::DoUpdateSql() 3159 +{ 3160 +// 3161 +// updating the SQL query 3162 +// 3163 + char *str; 3164 + char *buf; 3165 + wxString col; 3166 + wxTextCtrl *sqlCtrl = (wxTextCtrl *) FindWindow(ID_SQL_SAMPLE); 3167 + wxComboBox *stlList = (wxComboBox *) FindWindow(ID_VECTOR_STYLE); 3168 + wxRadioBox *mimeBox = (wxRadioBox *) FindWindow(ID_MIME_TYPE); 3169 + wxCheckBox *transparentCtrl = 3170 + (wxCheckBox *) FindWindow(ID_MAPOPT_CHECKERED_BACKGROUND); 3171 + wxSlider *qualityCtrl = (wxSlider *) FindWindow(ID_IMAGE_QUALITY); 3172 + Sql = wxT("SELECT RL2_GetMapImageFromRaster("); 3173 + if (DbPrefix.Len() == 0) 3174 + Sql += wxT("NULL, "); 3175 + else 3176 + { 3177 + str = (char *) malloc((DbPrefix.Len() * 4) + 1); 3178 + strcpy(str, DbPrefix.ToUTF8()); 3179 + buf = sqlite3_mprintf("%Q, ", str); 3180 + free(str); 3181 + col = wxString::FromUTF8(buf); 3182 + sqlite3_free(buf); 3183 + Sql += col; 3184 + } 3185 +// coverage name 3186 + str = (char *) malloc((LayerName.Len() * 4) + 1); 3187 + strcpy(str, LayerName.ToUTF8()); 3188 + buf = sqlite3_mprintf("%Q, ", str); 3189 + free(str); 3190 + col = wxString::FromUTF8(buf); 3191 + sqlite3_free(buf); 3192 + Sql += col; 3193 +// bounding box 3194 + wxString bbox; 3195 + MapPanel->DoPrepareBBox(bbox); 3196 + Sql += bbox; 3197 +// image width and height 3198 + buf = 3199 + sqlite3_mprintf("%d, %d, ", MapPanel->GetImageWidth(), 3200 + MapPanel->GetImageHeight()); 3201 + col = wxString::FromUTF8(buf); 3202 + sqlite3_free(buf); 3203 + Sql += col; 3204 +// style 3205 + wxString style = stlList->GetValue(); 3206 + if (style.Len() == 0) 3207 + Sql += wxT("'default', "); 3208 + else 3209 + { 3210 + str = (char *) malloc((style.Len() * 4) + 1); 3211 + strcpy(str, style.ToUTF8()); 3212 + buf = sqlite3_mprintf("%Q, ", str); 3213 + free(str); 3214 + col = wxString::FromUTF8(buf); 3215 + sqlite3_free(buf); 3216 + Sql += col; 3217 + } 3218 +// MIME type 3219 + switch (mimeBox->GetSelection()) 3220 + { 3221 + case 1: 3222 + Sql += wxT("'image/jpeg', "); 3223 + break; 3224 + case 2: 3225 + Sql += wxT("'image/tiff', "); 3226 + break; 3227 + case 3: 3228 + Sql += wxT("'application/x-pdf', "); 3229 + break; 3230 + default: 3231 + Sql += wxT("'image/png', "); 3232 + break; 3233 + }; 3234 +// bgColor 3235 + buf = 3236 + sqlite3_mprintf("'#%02x%02x%02x', ", BgColor.Red(), BgColor.Green(), 3237 + BgColor.Blue()); 3238 + col = wxString::FromUTF8(buf); 3239 + sqlite3_free(buf); 3240 + Sql += col; 3241 +// transparent 3242 + if (transparentCtrl->GetValue()) 3243 + Sql += wxT("1, "); 3244 + else 3245 + Sql += wxT("0, "); 3246 +// quality 3247 + if (mimeBox->GetSelection() == 1) 3248 + { 3249 + buf = sqlite3_mprintf("%d", qualityCtrl->GetValue()); 3250 + col = wxString::FromUTF8(buf); 3251 + sqlite3_free(buf); 3252 + Sql += col; 3253 + } else 3254 + Sql += wxT("100"); 3255 + Sql += wxT(");"); 3256 + sqlCtrl->SetValue(Sql); 3257 +} 3258 + 3259 +void RasterSqlSampleDialog::OnStyleChanged(wxCommandEvent & WXUNUSED(event)) 3260 +{ 3261 +// 3262 +// Style selection changed 3263 +// 3264 + DoUpdateSql(); 3265 +} 3266 + 3267 +void RasterSqlSampleDialog::OnMimeTypeChanged(wxCommandEvent & WXUNUSED(event)) 3268 +{ 3269 +// 3270 +// MIME Type selection changed 3271 +// 3272 + wxRadioBox *mimeBox = (wxRadioBox *) FindWindow(ID_MIME_TYPE); 3273 + wxSlider *qualityCtrl = (wxSlider *) FindWindow(ID_IMAGE_QUALITY); 3274 + if (mimeBox->GetSelection() == 1) 3275 + qualityCtrl->Enable(true); 3276 + else 3277 + qualityCtrl->Enable(false); 3278 + DoUpdateSql(); 3279 +} 3280 + 3281 +void RasterSqlSampleDialog::OnQualityChanged(wxCommandEvent & WXUNUSED(event)) 3282 +{ 3283 +// 3284 +// Image Quality selection changed 3285 +// 3286 + DoUpdateSql(); 3287 +} 3288 + 3289 +void 3290 + RasterSqlSampleDialog::OnTransparentChanged(wxCommandEvent & WXUNUSED(event)) 3291 +{ 3292 +// 3293 +// Transparent Background selection changed 3294 +// 3295 + wxCheckBox *transparentCtrl = 3296 + (wxCheckBox *) FindWindow(ID_MAPOPT_CHECKERED_BACKGROUND); 3297 + wxBitmapButton *btn = 3298 + (wxBitmapButton *) FindWindow(ID_MAPOPT_SOLID_BACKGROUND); 3299 + if (transparentCtrl->GetValue() == false) 3300 + btn->Enable(true); 3301 + else 3302 + btn->Enable(false); 3303 + DoUpdateSql(); 3304 +} 3305 + 3306 +void 3307 + RasterSqlSampleDialog::OnBackgroundChanged(wxCommandEvent & WXUNUSED(event)) 3308 +{ 3309 +// Map Background Solid Color selection 3310 + wxColourData initColor; 3311 + int ret; 3312 + initColor.SetChooseFull(false); 3313 + initColor.SetColour(BgColor); 3314 + wxColourDialog colorDialog(this, &initColor); 3315 + ret = colorDialog.ShowModal(); 3316 + if (ret == wxID_OK) 3317 + { 3318 + wxColourData colorData = colorDialog.GetColourData(); 3319 + BgColor = colorData.GetColour(); 3320 + wxBitmap bmp; 3321 + GetButtonBitmap(BgColor, bmp); 3322 + wxBitmapButton *btn = 3323 + (wxBitmapButton *) FindWindow(ID_MAPOPT_SOLID_BACKGROUND); 3324 + btn->SetBitmapLabel(bmp); 3325 + DoUpdateSql(); 3326 + } 3327 +} 3328 + 3329 +void RasterSqlSampleDialog::OnCopy(wxCommandEvent & WXUNUSED(event)) 3330 +{ 3331 +// 3332 +// Copying the Map Request (SQL statement) 3333 +// 3334 + if (wxTheClipboard->Open()) 3335 + { 3336 + wxTheClipboard->SetData(new wxTextDataObject(Sql)); 3337 + wxTheClipboard->Close(); 3338 + } 3339 +} 3340 + 3341 +void RasterSqlSampleDialog::OnQuit(wxCommandEvent & WXUNUSED(event)) 3342 +{ 3343 +// 3344 +// all done: 3345 +// 3346 + wxDialog::EndModal(wxID_CANCEL); 3347 +} 3348 + 3349 +bool 3350 + WmsSqlSampleDialog::Create(MyMapPanel * parent, MapLayer * layer, 3351 + bool request_url) 3352 +{ 3353 +// 3354 +// creating the dialog 3355 +// 3356 + MainFrame = parent->GetParent(); 3357 + MapPanel = parent; 3358 + Layer = layer; 3359 + RequestURL = request_url; 3360 + Url = wxString::FromUTF8(layer->GetWmsGetMapURL()); 3361 + DbPrefix = layer->GetDbPrefix(); 3362 + LayerName = layer->GetName(); 3363 + wxString title = wxT("SQL sample: Map Request configuration"); 3364 + if (RequestURL == true) 3365 + title = wxT("URL sample: Map Request configuration"); 3366 + if (wxDialog::Create(parent, wxID_ANY, title) == false) 3367 + return false; 3368 +// populates individual controls 3369 + InitData(); 3370 + CreateControls(); 3371 +// sets dialog sizer 3372 + GetSizer()->Fit(this); 3373 + GetSizer()->SetSizeHints(this); 3374 +// centers the dialog window 3375 + Centre(); 3376 + DoUpdateSql(); 3377 + return true; 3378 +} 3379 + 3380 +WmsSqlSampleDialog::~WmsSqlSampleDialog() 3381 +{ 3382 + if (Version != NULL) 3383 + free(Version); 3384 + if (MaxVersion != NULL) 3385 + free(MaxVersion); 3386 + if (Style != NULL) 3387 + free(Style); 3388 + if (ImageFormat != NULL) 3389 + free(ImageFormat); 3390 + if (BgColor != NULL) 3391 + free(BgColor); 3392 +} 3393 + 3394 +void WmsSqlSampleDialog::CreateControls() 3395 +{ 3396 +// 3397 +// creating individual control and setting initial values 3398 +// 3399 + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 3400 + this->SetSizer(topSizer); 3401 + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 3402 + topSizer->Add(boxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 3403 +// First row: URL 3404 + wxBoxSizer *lyrBoxSizer = new wxBoxSizer(wxVERTICAL); 3405 + boxSizer->Add(lyrBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3406 + wxBoxSizer *urlSizer = new wxBoxSizer(wxHORIZONTAL); 3407 + lyrBoxSizer->Add(urlSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3408 + wxStaticBox *urlBox = new wxStaticBox(this, wxID_ANY, 3409 + wxT("WMS GetMap URL"), 3410 + wxDefaultPosition, 3411 + wxDefaultSize); 3412 + wxBoxSizer *urlBoxSizer = new wxStaticBoxSizer(urlBox, wxHORIZONTAL); 3413 + urlSizer->Add(urlBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3414 + wxTextCtrl *urlCtrl = new wxTextCtrl(this, ID_WMS_URL, Url, 3415 + wxDefaultPosition, wxSize(800, 22), 3416 + wxTE_READONLY); 3417 + urlBoxSizer->Add(urlCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3418 +// Second row: WMS options 3419 + wxBoxSizer *optsSizer = new wxBoxSizer(wxHORIZONTAL); 3420 + lyrBoxSizer->Add(optsSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3421 +// WMS version 3422 + wxBoxSizer *wmsSizer = new wxBoxSizer(wxHORIZONTAL); 3423 + optsSizer->Add(wmsSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3424 + wxString ver[4]; 3425 + ver[0] = wxT("WMS &1.0.0"); 3426 + ver[1] = wxT("WMS &1.1.0"); 3427 + ver[2] = wxT("WMS &1.1.1"); 3428 + ver[3] = wxT("WMS &1.3.0"); 3429 + wxRadioBox *versionBox = new wxRadioBox(this, ID_WMS_VERSION, 3430 + wxT("WMS &Version"), 3431 + wxDefaultPosition, 3432 + wxDefaultSize, 4, 3433 + ver, 4, 3434 + wxRA_SPECIFY_ROWS); 3435 + FindMaxVersion(); 3436 + if (MaxVersion == NULL) 3437 + { 3438 + versionBox->Enable(1, false); 3439 + versionBox->Enable(2, false); 3440 + versionBox->Enable(3, false); 3441 + } else 3442 + { 3443 + if (strcmp(MaxVersion, "1.1.0") == 0) 3444 + { 3445 + versionBox->Enable(2, false); 3446 + versionBox->Enable(3, false); 3447 + } else if (strcmp(MaxVersion, "1.1.1") == 0) 3448 + { 3449 + versionBox->Enable(3, false); 3450 + } else if (strcmp(MaxVersion, "1.3.0") == 0) 3451 + ; 3452 + else 3453 + { 3454 + versionBox->Enable(1, false); 3455 + versionBox->Enable(2, false); 3456 + versionBox->Enable(3, false); 3457 + } 3458 + } 3459 + if (strcmp(Version, "1.0.0") == 0) 3460 + versionBox->SetSelection(0); 3461 + else if (strcmp(Version, "1.1.0") == 0) 3462 + versionBox->SetSelection(1); 3463 + else if (strcmp(Version, "1.1.1") == 0) 3464 + versionBox->SetSelection(2); 3465 + else 3466 + versionBox->SetSelection(3); 3467 + wmsSizer->Add(versionBox, 0, wxALIGN_TOP | wxALL, 5); 3468 +// layer Name 3469 + wxBoxSizer *opt2Sizer = new wxBoxSizer(wxVERTICAL); 3470 + optsSizer->Add(opt2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3471 + wxBoxSizer *nameSizer = new wxBoxSizer(wxHORIZONTAL); 3472 + opt2Sizer->Add(nameSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3473 + wxStaticBox *nameBox = new wxStaticBox(this, wxID_ANY, 3474 + wxT("Layer Name"), 3475 + wxDefaultPosition, 3476 + wxDefaultSize); 3477 + wxBoxSizer *nameBoxSizer = new wxStaticBoxSizer(nameBox, wxHORIZONTAL); 3478 + nameSizer->Add(nameBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3479 + wxTextCtrl *nameCtrl = new wxTextCtrl(this, ID_WMS_LAYER, LayerName, 3480 + wxDefaultPosition, wxSize(420, 22), 3481 + wxTE_READONLY); 3482 + nameBoxSizer->Add(nameCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3483 +// Style 3484 + wxBoxSizer *opt3Sizer = new wxBoxSizer(wxHORIZONTAL); 3485 + opt2Sizer->Add(opt3Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3486 + wxStaticBox *stlBox = new wxStaticBox(this, wxID_STATIC, 3487 + wxT("Style"), 3488 + wxDefaultPosition, 3489 + wxDefaultSize); 3490 + wxBoxSizer *stlBoxSizer = new wxStaticBoxSizer(stlBox, wxVERTICAL); 3491 + opt3Sizer->Add(stlBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3492 + wxComboBox *stlList = 3493 + new wxComboBox(this, ID_WMS_STYLE, wxT(""), wxDefaultPosition, 3494 + wxSize(250, 21), 0, NULL, 3495 + wxCB_DROPDOWN | wxCB_READONLY); 3496 + PopulateStyles(stlList); 3497 + stlBoxSizer->Add(stlList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 3498 +// image format 3499 + wxStaticBox *fmtBox = new wxStaticBox(this, wxID_STATIC, 3500 + wxT("Image Format"), 3501 + wxDefaultPosition, 3502 + wxDefaultSize); 3503 + wxBoxSizer *fmtBoxSizer = new wxStaticBoxSizer(fmtBox, wxVERTICAL); 3504 + opt3Sizer->Add(fmtBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3505 + wxComboBox *fmtList = 3506 + new wxComboBox(this, ID_WMS_FORMAT, wxT(""), wxDefaultPosition, 3507 + wxSize(150, 21), 0, NULL, 3508 + wxCB_DROPDOWN | wxCB_READONLY); 3509 + PopulateImageFormats(fmtList); 3510 + fmtBoxSizer->Add(fmtList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 3511 +// transparent / background color 3512 + wxStaticBox *bgColorBox = new wxStaticBox(this, wxID_ANY, 3513 + wxT("Background Color"), 3514 + wxDefaultPosition, 3515 + wxDefaultSize); 3516 + wxBoxSizer *bgColorBoxSizer = new wxStaticBoxSizer(bgColorBox, wxHORIZONTAL); 3517 + optsSizer->Add(bgColorBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3518 + wxCheckBox *enableBgColorCtrl = new wxCheckBox(this, ID_WMS_ENABLE_BGCOLOR, 3519 + wxT("Transparent"), 3520 + wxDefaultPosition, 3521 + wxDefaultSize); 3522 + if (BgColor == NULL) 3523 + { 3524 + Transparent = 1; 3525 + enableBgColorCtrl->SetValue(true); 3526 + } else 3527 + { 3528 + Transparent = 0; 3529 + enableBgColorCtrl->SetValue(false); 3530 + } 3531 + bgColorBoxSizer->Add(enableBgColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 3532 + 5); 3533 + wxBitmap bgColorBmp; 3534 + GetButtonBitmap(BgColor, bgColorBmp); 3535 + wxBitmapButton *bgColorCtrl = 3536 + new wxBitmapButton(this, ID_WMS_BGCOLOR, bgColorBmp); 3537 + if (Transparent) 3538 + bgColorCtrl->Enable(false); 3539 + else 3540 + bgColorCtrl->Enable(true); 3541 + bgColorBoxSizer->Add(bgColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3542 +// SQL sample 3543 + wxString title = wxT("SQL sample"); 3544 + if (RequestURL == true) 3545 + title = wxT("URL sample"); 3546 + wxStaticBox *sqlBox = new wxStaticBox(this, wxID_STATIC, 3547 + title, 3548 + wxDefaultPosition, 3549 + wxDefaultSize); 3550 + wxBoxSizer *sqlSizer = new wxStaticBoxSizer(sqlBox, wxVERTICAL); 3551 + lyrBoxSizer->Add(sqlSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 3552 + wxTextCtrl *sqlCtrl = new wxTextCtrl(this, ID_SQL_SAMPLE, Sql, 3553 + wxDefaultPosition, wxSize(800, 70), 3554 + wxTE_MULTILINE | wxTE_WORDWRAP | 3555 + wxTE_READONLY); 3556 + sqlSizer->Add(sqlCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3557 + 3558 + wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); 3559 + lyrBoxSizer->Add(buttonSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3560 + wxButton *wms_ok = new wxButton(this, ID_VECTOR_COPY, wxT("&Copy")); 3561 + buttonSizer->Add(wms_ok, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 3562 + wxButton *wms_quit = new wxButton(this, wxID_CANCEL, wxT("&Quit")); 3563 + buttonSizer->Add(wms_quit, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 3564 +// appends event handlers 3565 + Connect(ID_VECTOR_COPY, wxEVT_COMMAND_BUTTON_CLICKED, 3566 + (wxObjectEventFunction) & WmsSqlSampleDialog::OnCopy); 3567 + Connect(wxID_CANCEL, wxEVT_COMMAND_BUTTON_CLICKED, 3568 + (wxObjectEventFunction) & WmsSqlSampleDialog::OnQuit); 3569 + Connect(ID_WMS_VERSION, wxEVT_COMMAND_RADIOBOX_SELECTED, 3570 + (wxObjectEventFunction) & WmsSqlSampleDialog::OnVersionChanged); 3571 + Connect(ID_WMS_STYLE, wxEVT_COMMAND_COMBOBOX_SELECTED, 3572 + (wxObjectEventFunction) & WmsSqlSampleDialog::OnStyleChanged); 3573 + Connect(ID_WMS_FORMAT, wxEVT_COMMAND_COMBOBOX_SELECTED, 3574 + (wxObjectEventFunction) & WmsSqlSampleDialog::OnMimeTypeChanged); 3575 + Connect(ID_WMS_ENABLE_BGCOLOR, wxEVT_COMMAND_CHECKBOX_CLICKED, 3576 + (wxObjectEventFunction) & WmsSqlSampleDialog::OnTransparentChanged); 3577 + Connect(ID_WMS_BGCOLOR, wxEVT_COMMAND_BUTTON_CLICKED, 3578 + (wxObjectEventFunction) & WmsSqlSampleDialog::OnBgColorChanged); 3579 +} 3580 + 3581 +unsigned char WmsSqlSampleDialog::ParseHex(const char *byte) 3582 +{ 3583 +// parsing an Hex Byte 3584 + unsigned char value = 0; 3585 + switch (byte[0]) 3586 + { 3587 + case '0': 3588 + value = 16 * 0; 3589 + break; 3590 + case '1': 3591 + value = 16 * 1; 3592 + break; 3593 + case '2': 3594 + value = 16 * 2; 3595 + break; 3596 + case '3': 3597 + value = 16 * 3; 3598 + break; 3599 + case '4': 3600 + value = 16 * 4; 3601 + break; 3602 + case '5': 3603 + value = 16 * 5; 3604 + break; 3605 + case '6': 3606 + value = 16 * 6; 3607 + break; 3608 + case '7': 3609 + value = 16 * 7; 3610 + break; 3611 + case '8': 3612 + value = 16 * 8; 3613 + break; 3614 + case '9': 3615 + value = 16 * 9; 3616 + break; 3617 + case 'A': 3618 + case 'a': 3619 + value = 16 * 10; 3620 + break; 3621 + case 'B': 3622 + case 'b': 3623 + value = 16 * 11; 3624 + break; 3625 + case 'C': 3626 + case 'c': 3627 + value = 16 * 12; 3628 + break; 3629 + case 'D': 3630 + case 'd': 3631 + value = 16 * 13; 3632 + break; 3633 + case 'E': 3634 + case 'e': 3635 + value = 16 * 14; 3636 + break; 3637 + case 'F': 3638 + case 'f': 3639 + value = 16 * 15; 3640 + break; 3641 + }; 3642 + switch (byte[1]) 3643 + { 3644 + case '0': 3645 + value += 0; 3646 + break; 3647 + case '1': 3648 + value += 1; 3649 + break; 3650 + case '2': 3651 + value += 2; 3652 + break; 3653 + case '3': 3654 + value += 3; 3655 + break; 3656 + case '4': 3657 + value += 4; 3658 + break; 3659 + case '5': 3660 + value += 5; 3661 + break; 3662 + case '6': 3663 + value += 6; 3664 + break; 3665 + case '7': 3666 + value += 7; 3667 + break; 3668 + case '8': 3669 + value += 8; 3670 + break; 3671 + case '9': 3672 + value += 9; 3673 + break; 3674 + case 'A': 3675 + case 'a': 3676 + value += 10; 3677 + break; 3678 + case 'B': 3679 + case 'b': 3680 + value += 11; 3681 + break; 3682 + case 'C': 3683 + case 'c': 3684 + value += 12; 3685 + break; 3686 + case 'D': 3687 + case 'd': 3688 + value += 13; 3689 + break; 3690 + case 'E': 3691 + case 'e': 3692 + value += 14; 3693 + break; 3694 + case 'F': 3695 + case 'f': 3696 + value += 15; 3697 + break; 3698 + }; 3699 + return value; 3700 +} 3701 + 3702 +void 3703 + WmsSqlSampleDialog::ParseBgColor(const char *color, unsigned char *red, 3704 + unsigned char *green, unsigned char *blue) 3705 +{ 3706 +// parsing an Hex RGB color 3707 + char byte[2]; 3708 + *red = 0x80; 3709 + *green = 0x80; 3710 + *blue = 0x80; 3711 + if (color == NULL) 3712 + return; 3713 + 3714 + byte[0] = *(color + 0); 3715 + byte[1] = *(color + 1); 3716 + *red = ParseHex(byte); 3717 + byte[0] = *(color + 2); 3718 + byte[1] = *(color + 3); 3719 + *green = ParseHex(byte); 3720 + byte[0] = *(color + 4); 3721 + byte[1] = *(color + 5); 3722 + *blue = ParseHex(byte); 3723 +} 3724 + 3725 +void WmsSqlSampleDialog::GetButtonBitmap(const char *bgcolor, wxBitmap & bmp) 3726 +{ 3727 +// creating a Bitmap representing some Color 3728 + unsigned char red; 3729 + unsigned char green; 3730 + unsigned char blue; 3731 + ParseBgColor(bgcolor, &red, &green, &blue); 3732 + wxColour color = wxColour(red, green, blue); 3733 + bmp = wxBitmap(96, 64); 3734 + wxMemoryDC *dc = new wxMemoryDC(bmp); 3735 + dc->SetBrush(wxBrush(color)); 3736 + dc->DrawRectangle(-1, -1, 98, 66); 3737 + delete dc; 3738 +} 3739 + 3740 +void WmsSqlSampleDialog::InitData() 3741 +{ 3742 +// initializing the current configuration 3743 + int ret; 3744 + char *sql; 3745 + char **results; 3746 + int rows; 3747 + int columns; 3748 + 3749 + char *url = (char *) malloc((Url.Len() * 4) + 1); 3750 + strcpy(url, Url.ToUTF8()); 3751 + char *db_prefix = (char *) malloc((DbPrefix.Len() * 4) + 1); 3752 + strcpy(db_prefix, DbPrefix.ToUTF8()); 3753 + char *xdb_prefix = gaiaDoubleQuotedSql(db_prefix); 3754 + free(db_prefix); 3755 + char *layer = (char *) malloc((LayerName.Len() * 4) + 1); 3756 + strcpy(layer, LayerName.ToUTF8()); 3757 + sql = 3758 + sqlite3_mprintf 3759 + ("SELECT version, srs, format, style, is_queryable, flip_axes, " 3760 + "is_cached, tiled, tile_width, tile_height, bgcolor, transparent " 3761 + "FROM \"%s\".wms_getmap WHERE url = %Q AND layer_name = %Q", 3762 + xdb_prefix, url, layer); 3763 + free(url); 3764 + free(layer); 3765 + free(xdb_prefix); 3766 + ret = 3767 + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, 3768 + &columns, NULL); 3769 + sqlite3_free(sql); 3770 + if (ret != SQLITE_OK) 3771 + { 3772 + Version = NULL; 3773 + ImageFormat = NULL; 3774 + Style = NULL; 3775 + Transparent = 1; 3776 + BgColor = NULL; 3777 + return; 3778 + } 3779 + 3780 + for (int i = 1; i <= rows; i++) 3781 + { 3782 + // fetching data 3783 + int len; 3784 + const char *version = results[(i * columns) + 0]; 3785 + const char *ref_sys = results[(i * columns) + 1]; 3786 + const char *format = results[(i * columns) + 2]; 3787 + const char *style = results[(i * columns) + 3]; 3788 + const char *bgcolor = results[(i * columns) + 10]; 3789 + Transparent = atoi(results[(i * columns) + 11]); 3790 + if (version == NULL) 3791 + Version = NULL; 3792 + else 3793 + { 3794 + len = strlen(version); 3795 + Version = (char *) malloc(len + 1); 3796 + strcpy(Version, version); 3797 + } 3798 + if (format == NULL) 3799 + ImageFormat = NULL; 3800 + else 3801 + { 3802 + len = strlen(format); 3803 + ImageFormat = (char *) malloc(len + 1); 3804 + strcpy(ImageFormat, format); 3805 + } 3806 + if (style == NULL) 3807 + Style = NULL; 3808 + else 3809 + { 3810 + len = strlen(style); 3811 + Style = (char *) malloc(len + 1); 3812 + strcpy(Style, style); 3813 + } 3814 + if (bgcolor == NULL) 3815 + BgColor = NULL; 3816 + else 3817 + { 3818 + if (strlen(bgcolor) == 6) 3819 + { 3820 + BgColor = (char *) malloc(7); 3821 + strcpy(BgColor, bgcolor); 3822 + } else 3823 + BgColor = NULL; 3824 + } 3825 + } 3826 + sqlite3_free_table(results); 3827 +} 3828 + 3829 +void WmsSqlSampleDialog::FindMaxVersion() 3830 +{ 3831 +// identifying the Max WMS Version 3832 + int ret; 3833 + char *sql; 3834 + char **results; 3835 + int rows; 3836 + int columns; 3837 + MaxVersion = NULL; 3838 + 3839 + char *url = (char *) malloc((Url.Len() * 4) + 1); 3840 + strcpy(url, Url.ToUTF8()); 3841 + char *db_prefix = (char *) malloc((DbPrefix.Len() * 4) + 1); 3842 + strcpy(db_prefix, DbPrefix.ToUTF8()); 3843 + char *xdb_prefix = gaiaDoubleQuotedSql(db_prefix); 3844 + free(db_prefix); 3845 + char *layer = (char *) malloc((LayerName.Len() * 4) + 1); 3846 + strcpy(layer, LayerName.ToUTF8()); 3847 + sql = sqlite3_mprintf("SELECT Max(s.value) FROM \"%s\".wms_getmap AS m " 3848 + "JOIN \"%s\".wms_settings AS s ON (s.parent_id = m.id) " 3849 + "WHERE m.url = %Q AND m.layer_name = %Q AND s.key = 'version'", 3850 + xdb_prefix, xdb_prefix, url, layer); 3851 + free(url); 3852 + free(layer); 3853 + free(xdb_prefix); 3854 + ret = 3855 + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, 3856 + &columns, NULL); 3857 + sqlite3_free(sql); 3858 + if (ret != SQLITE_OK) 3859 + return; 3860 + 3861 + for (int i = 1; i <= rows; i++) 3862 + { 3863 + // fetching data 3864 + int len; 3865 + const char *version = results[(i * columns) + 0]; 3866 + if (version == NULL) 3867 + MaxVersion = NULL; 3868 + else 3869 + { 3870 + len = strlen(version); 3871 + MaxVersion = (char *) malloc(len + 1); 3872 + strcpy(MaxVersion, version); 3873 + } 3874 + } 3875 + sqlite3_free_table(results); 3876 +} 3877 + 3878 +void WmsSqlSampleDialog::PopulateStyles(wxComboBox * stlList) 3879 +{ 3880 +// populating the Styles List 3881 + int ret; 3882 + char *sql; 3883 + char **results; 3884 + int rows; 3885 + int columns; 3886 + 3887 + char *url = (char *) malloc((Url.Len() * 4) + 1); 3888 + strcpy(url, Url.ToUTF8()); 3889 + char *db_prefix = (char *) malloc((DbPrefix.Len() * 4) + 1); 3890 + strcpy(db_prefix, DbPrefix.ToUTF8()); 3891 + char *xdb_prefix = gaiaDoubleQuotedSql(db_prefix); 3892 + free(db_prefix); 3893 + char *layer = (char *) malloc((LayerName.Len() * 4) + 1); 3894 + strcpy(layer, LayerName.ToUTF8()); 3895 + sql = sqlite3_mprintf("SELECT s.value FROM \"%s\".wms_getmap AS m " 3896 + "JOIN \"%s\".wms_settings AS s ON (s.parent_id = m.id) " 3897 + "WHERE m.url = %Q AND m.layer_name = %Q AND s.key = 'style' ORDER BY s.id", 3898 + xdb_prefix, xdb_prefix, url, layer); 3899 + free(url); 3900 + free(layer); 3901 + free(xdb_prefix); 3902 + ret = 3903 + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, 3904 + &columns, NULL); 3905 + sqlite3_free(sql); 3906 + if (ret != SQLITE_OK) 3907 + return; 3908 + 3909 + for (int i = 1; i <= rows; i++) 3910 + { 3911 + // populating the list 3912 + const char *style = results[(i * columns) + 0]; 3913 + wxString str = wxString::FromUTF8(style); 3914 + stlList->Append(str); 3915 + if (strcmp(Style, style) == 0) 3916 + stlList->SetSelection(i - 1); 3917 + } 3918 + sqlite3_free_table(results); 3919 +} 3920 + 3921 +void WmsSqlSampleDialog::PopulateImageFormats(wxComboBox * fmtList) 3922 +{ 3923 +// populating the Image Formats List 3924 + int ret; 3925 + char *sql; 3926 + char **results; 3927 + int rows; 3928 + int columns; 3929 + 3930 + char *url = (char *) malloc((Url.Len() * 4) + 1); 3931 + strcpy(url, Url.ToUTF8()); 3932 + char *db_prefix = (char *) malloc((DbPrefix.Len() * 4) + 1); 3933 + strcpy(db_prefix, DbPrefix.ToUTF8()); 3934 + char *xdb_prefix = gaiaDoubleQuotedSql(db_prefix); 3935 + free(db_prefix); 3936 + char *layer = (char *) malloc((LayerName.Len() * 4) + 1); 3937 + strcpy(layer, LayerName.ToUTF8()); 3938 + sql = sqlite3_mprintf("SELECT s.value FROM \"%s\".wms_getmap AS m " 3939 + "JOIN \"%s\".wms_settings AS s ON (s.parent_id = m.id) " 3940 + "WHERE m.url = %Q AND m.layer_name = %Q AND s.key = 'format' ORDER BY s.id", 3941 + xdb_prefix, xdb_prefix, url, layer); 3942 + free(url); 3943 + free(layer); 3944 + free(xdb_prefix); 3945 + ret = 3946 + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, 3947 + &columns, NULL); 3948 + sqlite3_free(sql); 3949 + if (ret != SQLITE_OK) 3950 + return; 3951 + 3952 + for (int i = 1; i <= rows; i++) 3953 + { 3954 + // populating the list 3955 + const char *format = results[(i * columns) + 0]; 3956 + wxString str = wxString::FromUTF8(format); 3957 + fmtList->Append(str); 3958 + if (strcmp(ImageFormat, format) == 0) 3959 + fmtList->SetSelection(i - 1); 3960 + } 3961 + sqlite3_free_table(results); 3962 +} 3963 + 3964 +int WmsSqlSampleDialog::CheckMarker(wxString & url) 3965 +{ 3966 +// testing if some "?" marker is already defined 3967 + int ret = url.Find('?'); 3968 + if (ret == wxNOT_FOUND) 3969 + return 0; 3970 + return 1; 3971 +} 3972 + 3973 +int 3974 + WmsSqlSampleDialog::DoQueryWmsCoverage(const char *db_prefix, 3975 + const char *cvg_name, int srid, char **url, int *swap_axes) 3976 +{ 3977 +// querying the WMS Coverage definitions 3978 + int len; 3979 + int i; 3980 + char **results; 3981 + int rows; 3982 + int columns; 3983 + char *sql; 3984 + int ret; 3985 + char *xdb_prefix; 3986 + int ok = 0; 3987 + if (db_prefix == NULL) 3988 + db_prefix = "MAIN"; 3989 + xdb_prefix = gaiaDoubleQuotedSql(db_prefix); 3990 + sql = sqlite3_mprintf("SELECT w.url, s.has_flipped_axes " 3991 + "FROM \"%s\".wms_getmap AS w, \"%s\".spatial_ref_sys_aux AS s " 3992 + "WHERE w.layer_name = %Q AND s.srid = %d", 3993 + xdb_prefix, xdb_prefix, cvg_name, srid); 3994 + free(xdb_prefix); 3995 + ret = 3996 + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, 3997 + &columns, NULL); 3998 + sqlite3_free(sql); 3999 + if (ret != SQLITE_OK) 4000 + return 0; 4001 + if (rows < 1) 4002 + ; 4003 + else 4004 + { 4005 + for (i = 1; i <= rows; i++) 4006 + { 4007 + const char *val = results[(i * columns) + 0]; 4008 + if (*url != NULL) 4009 + free(*url); 4010 + len = strlen(val); 4011 + *url = (char *) malloc(len + 1); 4012 + strcpy(*url, val); 4013 + val = results[(i * columns) + 1]; 4014 + *swap_axes = atoi(val); 4015 + ok = 1; 4016 + } 4017 + } 4018 + sqlite3_free_table(results); 4019 + if (!ok) 4020 + return 0; 4021 + return 1; 4022 +} 4023 + 4024 +void WmsSqlSampleDialog::DoUpdateUrl() 4025 +{ 4026 +// 4027 +// updating the Request URL 4028 +// 4029 + char *str; 4030 + char *buf; 4031 + wxString col; 4032 + wxTextCtrl *sqlCtrl = (wxTextCtrl *) FindWindow(ID_SQL_SAMPLE); 4033 + wxRadioBox *versionBox = (wxRadioBox *) FindWindow(ID_WMS_VERSION); 4034 + wxComboBox *stlList = (wxComboBox *) FindWindow(ID_WMS_STYLE); 4035 + wxComboBox *mimeList = (wxComboBox *) FindWindow(ID_WMS_FORMAT); 4036 + wxCheckBox *transparentCtrl = 4037 + (wxCheckBox *) FindWindow(ID_WMS_ENABLE_BGCOLOR); 4038 + char *db_prefix; 4039 + int srid; 4040 + const char *crs_prefix = "CRS"; 4041 + char *crs = NULL; 4042 + char *url = (char *) malloc((Url.Len() * 4) + 1); 4043 + strcpy(url, Url.ToUTF8()); 4044 + const char *version = Version; 4045 + char *layer = (char *) malloc((LayerName.Len() * 4) + 1); 4046 + strcpy(layer, LayerName.ToUTF8()); 4047 + char *style; 4048 + char *format = ImageFormat; 4049 + int swap_xy; 4050 + double minx; 4051 + double miny; 4052 + double maxx; 4053 + double maxy; 4054 + int width = MapPanel->GetImageWidth(); 4055 + int height = MapPanel->GetImageHeight(); 4056 + int opaque; 4057 + char *bg_color; 4058 + int valid_bg_color = 1; 4059 + char *request; 4060 + int force_marker = CheckMarker(Url); 4061 + 4062 + MapPanel->GetBBox(&srid, &minx, &miny, &maxx, &maxy); 4063 + if (DbPrefix.Len() == 0) 4064 + db_prefix = NULL; 4065 + else 4066 + { 4067 + db_prefix = (char *) malloc((DbPrefix.Len() * 4) + 1); 4068 + strcpy(db_prefix, DbPrefix.ToUTF8()); 4069 + } 4070 + if (!DoQueryWmsCoverage(db_prefix, layer, srid, &url, &swap_xy)) 4071 + return; 4072 + 4073 +crs = sqlite3_mprintf("EPSG:%d", srid); 4074 + wxString xstyle = stlList->GetValue(); 4075 + if (xstyle.Len() == 0) 4076 + style = NULL; 4077 + else 4078 + { 4079 + style = (char *) malloc((xstyle.Len() * 4) + 1); 4080 + strcpy(style, xstyle.ToUTF8()); 4081 + } 4082 + wxString xformat = mimeList->GetValue(); 4083 + if (xformat.Len() == 0) 4084 + format = NULL; 4085 + else 4086 + { 4087 + format = (char *) malloc((xformat.Len() * 4) + 1); 4088 + strcpy(format, xformat.ToUTF8()); 4089 + } 4090 + 4091 +/* masking NULL arguments */ 4092 + if (version == NULL) 4093 + version = ""; 4094 + if (strcmp(version, "1.3.0") != 0) 4095 + swap_xy = 0; 4096 + if (style == NULL) 4097 + { 4098 + style = (char *) malloc(1); 4099 + *style = '\0'; 4100 + } 4101 + if (format == NULL) 4102 + { 4103 + format = (char *) malloc(1); 4104 + *format = '\0'; 4105 + } 4106 +/* validating the background color */ 4107 + if (BgColor == NULL) 4108 + valid_bg_color = 0; 4109 + else if (strlen(BgColor) != 6) 4110 + valid_bg_color = 0; 4111 + else 4112 + { 4113 + int i; 4114 + for (i = 0; i < 6; i++) 4115 + { 4116 + char h = *(BgColor + i); 4117 + if ((h >= '0' && h <= '9') || (h >= 'a' && h <= 'f') 4118 + || (h >= 'A' && h <= 'F')) 4119 + ; 4120 + else 4121 + valid_bg_color = 0; 4122 + } 4123 + } 4124 + if (valid_bg_color) 4125 + bg_color = sqlite3_mprintf("0x%s", BgColor); 4126 + else 4127 + bg_color = sqlite3_mprintf("0xFFFFFF"); 4128 + if (transparentCtrl->GetValue()) 4129 + opaque = 0; 4130 + else 4131 + opaque = 1; 4132 + 4133 +/* preparing the request URL */ 4134 + if (strcmp(version, "1.3.0") < 0) 4135 + { 4136 + /* earlier versions of the protocol require SRS instead of CRS */ 4137 + crs_prefix = "SRS"; 4138 + } 4139 + if (force_marker) 4140 + { 4141 + /* "?" marker not declared */ 4142 + if (swap_xy) 4143 + request = 4144 + sqlite3_mprintf("%s?SERVICE=WMS&REQUEST=GetMap&VERSION=%s" 4145 + "&LAYERS=%s&%s=%s&BBOX=%1.6f,%1.6f,%1.6f,%1.6f" 4146 + "&WIDTH=%d&HEIGHT=%d&STYLES=%s&FORMAT=%s" 4147 + "&TRANSPARENT=%s&BGCOLOR=%s", url, 4148 + version, layer, crs_prefix, crs, miny, 4149 + minx, maxy, maxx, width, height, style, 4150 + format, (opaque == 0) ? "TRUE" : "FALSE", bg_color); 4151 + else 4152 + request = 4153 + sqlite3_mprintf("%s?SERVICE=WMS&REQUEST=GetMap&VERSION=%s" 4154 + "&LAYERS=%s&%s=%s&BBOX=%1.6f,%1.6f,%1.6f,%1.6f" 4155 + "&WIDTH=%d&HEIGHT=%d&STYLES=%s&FORMAT=%s" 4156 + "&TRANSPARENT=%s&BGCOLOR=%s", url, 4157 + version, layer, crs_prefix, crs, minx, 4158 + miny, maxx, maxy, width, height, style, 4159 + format, (opaque == 0) ? "TRUE" : "FALSE", bg_color); 4160 + } else 4161 + { 4162 + /* "?" marker already defined */ 4163 + if (swap_xy) 4164 + request = 4165 + sqlite3_mprintf("%sSERVICE=WMS&REQUEST=GetMap&VERSION=%s" 4166 + "&LAYERS=%s&%s=%s&BBOX=%1.6f,%1.6f,%1.6f,%1.6f" 4167 + "&WIDTH=%d&HEIGHT=%d&STYLES=%s&FORMAT=%s" 4168 + "&TRANSPARENT=%s&BGCOLOR=%s", url, 4169 + version, layer, crs_prefix, crs, miny, 4170 + minx, maxy, maxx, width, height, style, 4171 + format, (opaque == 0) ? "TRUE" : "FALSE", bg_color); 4172 + else 4173 + request = 4174 + sqlite3_mprintf("%sSERVICE=WMS&REQUEST=GetMap&VERSION=%s" 4175 + "&LAYERS=%s&%s=%s&BBOX=%1.6f,%1.6f,%1.6f,%1.6f" 4176 + "&WIDTH=%d&HEIGHT=%d&STYLES=%s&FORMAT=%s" 4177 + "&TRANSPARENT=%s&BGCOLOR=%s", url, 4178 + version, layer, crs_prefix, crs, minx, 4179 + miny, maxx, maxy, width, height, style, 4180 + format, (opaque == 0) ? "TRUE" : "FALSE", bg_color); 4181 + } 4182 + Sql = wxString::FromUTF8(request); 4183 + sqlite3_free(request); 4184 + sqlCtrl->SetValue(Sql); 4185 + 4186 + if (url != NULL) 4187 + free(url); 4188 + if (layer != NULL) 4189 + free(layer); 4190 + if (db_prefix != NULL) 4191 + free(db_prefix); 4192 + if (crs != NULL) 4193 + sqlite3_free(crs); 4194 + if (style != NULL) 4195 + free(style); 4196 + if (format != NULL) 4197 + free(format); 4198 + if (bg_color != NULL) 4199 + sqlite3_free(bg_color); 4200 +} 4201 + 4202 +void WmsSqlSampleDialog::DoUpdateSql() 4203 +{ 4204 +// 4205 +// updating the SQL query 4206 +// 4207 + if (RequestURL == true) 4208 + { 4209 + DoUpdateUrl(); 4210 + return; 4211 + } 4212 + char *str; 4213 + char *buf; 4214 + wxString col; 4215 + wxTextCtrl *sqlCtrl = (wxTextCtrl *) FindWindow(ID_SQL_SAMPLE); 4216 + wxRadioBox *versionBox = (wxRadioBox *) FindWindow(ID_WMS_VERSION); 4217 + wxComboBox *stlList = (wxComboBox *) FindWindow(ID_WMS_STYLE); 4218 + wxComboBox *mimeList = (wxComboBox *) FindWindow(ID_WMS_FORMAT); 4219 + wxCheckBox *transparentCtrl = 4220 + (wxCheckBox *) FindWindow(ID_WMS_ENABLE_BGCOLOR); 4221 + Sql = wxT("SELECT RL2_GetMapImageFromWMS("); 4222 + if (DbPrefix.Len() == 0) 4223 + Sql += wxT("NULL, "); 4224 + else 4225 + { 4226 + str = (char *) malloc((DbPrefix.Len() * 4) + 1); 4227 + strcpy(str, DbPrefix.ToUTF8()); 4228 + buf = sqlite3_mprintf("%Q, ", str); 4229 + free(str); 4230 + col = wxString::FromUTF8(buf); 4231 + sqlite3_free(buf); 4232 + Sql += col; 4233 + } 4234 +// coverage name 4235 + str = (char *) malloc((LayerName.Len() * 4) + 1); 4236 + strcpy(str, LayerName.ToUTF8()); 4237 + buf = sqlite3_mprintf("%Q, ", str); 4238 + free(str); 4239 + col = wxString::FromUTF8(buf); 4240 + sqlite3_free(buf); 4241 + Sql += col; 4242 +// bounding box 4243 + wxString bbox; 4244 + MapPanel->DoPrepareBBox(bbox); 4245 + Sql += bbox; 4246 +// image width and height 4247 + buf = 4248 + sqlite3_mprintf("%d, %d, ", MapPanel->GetImageWidth(), 4249 + MapPanel->GetImageHeight()); 4250 + col = wxString::FromUTF8(buf); 4251 + sqlite3_free(buf); 4252 + Sql += col; 4253 +// WMS version 4254 + switch (versionBox->GetSelection()) 4255 + { 4256 + case 1: 4257 + Sql += wxT("'1.1.0', "); 4258 + break; 4259 + case 2: 4260 + Sql += wxT("'1.1.1', "); 4261 + break; 4262 + case 3: 4263 + Sql += wxT("'1.3.0', "); 4264 + break; 4265 + default: 4266 + Sql += wxT("'1.0.0', "); 4267 + break; 4268 + }; 4269 +// style 4270 + wxString style = stlList->GetValue(); 4271 + if (style.Len() == 0) 4272 + Sql += wxT("'default', "); 4273 + else 4274 + { 4275 + str = (char *) malloc((style.Len() * 4) + 1); 4276 + strcpy(str, style.ToUTF8()); 4277 + buf = sqlite3_mprintf("%Q, ", str); 4278 + free(str); 4279 + col = wxString::FromUTF8(buf); 4280 + sqlite3_free(buf); 4281 + Sql += col; 4282 + } 4283 +// MIME type 4284 + wxString format = mimeList->GetValue(); 4285 + if (format.Len() == 0) 4286 + Sql += wxT("'default', "); 4287 + else 4288 + { 4289 + str = (char *) malloc((format.Len() * 4) + 1); 4290 + strcpy(str, format.ToUTF8()); 4291 + buf = sqlite3_mprintf("%Q, ", str); 4292 + free(str); 4293 + col = wxString::FromUTF8(buf); 4294 + sqlite3_free(buf); 4295 + Sql += col; 4296 + } 4297 +// bgColor 4298 + if (BgColor == NULL) 4299 + Sql += wxT("'#ffffff', "); 4300 + else 4301 + { 4302 + buf = sqlite3_mprintf("'#%s', ", BgColor); 4303 + col = wxString::FromUTF8(buf); 4304 + sqlite3_free(buf); 4305 + Sql += col; 4306 + } 4307 +// transparent 4308 + if (transparentCtrl->GetValue()) 4309 + Sql += wxT("1"); 4310 + else 4311 + Sql += wxT("0"); 4312 + Sql += wxT(");"); 4313 + sqlCtrl->SetValue(Sql); 4314 +} 4315 + 4316 +void WmsSqlSampleDialog::OnVersionChanged(wxCommandEvent & WXUNUSED(event)) 4317 +{ 4318 +// 4319 +// WMS Version selection changed 4320 +// 4321 + DoUpdateSql(); 4322 +} 4323 + 4324 +void WmsSqlSampleDialog::OnStyleChanged(wxCommandEvent & WXUNUSED(event)) 4325 +{ 4326 +// 4327 +// Style selection changed 4328 +// 4329 + DoUpdateSql(); 4330 +} 4331 + 4332 +void WmsSqlSampleDialog::OnMimeTypeChanged(wxCommandEvent & WXUNUSED(event)) 4333 +{ 4334 +// 4335 +// MIME Type selection changed 4336 +// 4337 + DoUpdateSql(); 4338 +} 4339 + 4340 +void WmsSqlSampleDialog::OnTransparentChanged(wxCommandEvent & WXUNUSED(event)) 4341 +{ 4342 +// 4343 +// Transparent selection changed 4344 +// 4345 + wxBitmapButton *btn = (wxBitmapButton *) FindWindow(ID_WMS_BGCOLOR); 4346 + if (Transparent == 1) 4347 + { 4348 + Transparent = 0; 4349 + if (BgColor != NULL) 4350 + free(BgColor); 4351 + BgColor = (char *) malloc(7); 4352 + strcpy(BgColor, "ffffff"); 4353 + wxBitmap bmp; 4354 + GetButtonBitmap(BgColor, bmp); 4355 + btn->SetBitmapLabel(bmp); 4356 + btn->Enable(true); 4357 + } else 4358 + { 4359 + Transparent = 0; 4360 + btn->Enable(false); 4361 + if (BgColor != NULL) 4362 + { 4363 + free(BgColor); 4364 + BgColor = NULL; 4365 + } 4366 + } 4367 + DoUpdateSql(); 4368 +} 4369 + 4370 +void WmsSqlSampleDialog::OnBgColorChanged(wxCommandEvent & WXUNUSED(event)) 4371 +{ 4372 +// BgColor selection 4373 + wxColourData initColor; 4374 + int ret; 4375 + unsigned char red; 4376 + unsigned char green; 4377 + unsigned char blue; 4378 + ParseBgColor(BgColor, &red, &green, &blue); 4379 + wxColour color = wxColour(red, green, blue); 4380 + initColor.SetChooseFull(false); 4381 + initColor.SetColour(color); 4382 + wxColourDialog colorDialog(this, &initColor); 4383 + ret = colorDialog.ShowModal(); 4384 + if (ret == wxID_OK) 4385 + { 4386 + wxColourData colorData = colorDialog.GetColourData(); 4387 + color = colorData.GetColour(); 4388 + char byte[3]; 4389 + sprintf(byte, "%02x", color.Red()); 4390 + memcpy(BgColor, byte, 2); 4391 + sprintf(byte, "%02x", color.Green()); 4392 + memcpy(BgColor + 2, byte, 2); 4393 + sprintf(byte, "%02x", color.Blue()); 4394 + memcpy(BgColor + 4, byte, 2); 4395 + *(BgColor + 6) = '\0'; 4396 + wxBitmap bmp; 4397 + GetButtonBitmap(BgColor, bmp); 4398 + wxBitmapButton *bgColorCtrl = 4399 + (wxBitmapButton *) FindWindow(ID_WMS_BGCOLOR); 4400 + bgColorCtrl->SetBitmapLabel(bmp); 4401 + DoUpdateSql(); 4402 + } 4403 +} 4404 + 4405 +void WmsSqlSampleDialog::OnCopy(wxCommandEvent & WXUNUSED(event)) 4406 +{ 4407 +// 4408 +// Copying the Map Request (SQL statement) 4409 +// 4410 + if (wxTheClipboard->Open()) 4411 + { 4412 + wxTheClipboard->SetData(new wxTextDataObject(Sql)); 4413 + wxTheClipboard->Close(); 4414 + } 4415 +} 4416 + 4417 +void WmsSqlSampleDialog::OnQuit(wxCommandEvent & WXUNUSED(event)) 4418 +{ 4419 +// 4420 +// all done: 4421 +// 4422 + wxDialog::EndModal(wxID_CANCEL); 4423 +}
Changes to Main.cpp.
1 1 /* 2 2 / Main.cpp 3 3 / the main core of spatialite_gui - a SQLite /SpatiaLite GUI tool 4 4 / 5 5 / version 1.7, 2014 May 8 6 6 / 7 -/ Author: Sandro Furieri a-furieri@lqt.it 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 8 / 9 9 / Copyright (C) 2008-2014 Alessandro Furieri 10 10 / 11 11 / This program is free software: you can redistribute it and/or modify 12 12 / it under the terms of the GNU General Public License as published by 13 13 / the Free Software Foundation, either version 3 of the License, or 14 14 / (at your option) any later version. ................................................................................ 30 30 #include "wx/filename.h" 31 31 #include "wx/config.h" 32 32 #include "wx/tokenzr.h" 33 33 34 34 #include <spatialite.h> 35 35 #include <proj_api.h> 36 36 #include <geos_c.h> 37 + 38 +#include <virtualpg.h> 37 39 38 40 // 39 41 // ICONs in XPM format [universally portable] 40 42 // 41 43 #include "icons/icon.xpm" 42 44 #include "icons/icon_info.xpm" 43 45 #include "icons/create_new.xpm" ................................................................................ 75 77 #include "icons/sanegeom.xpm" 76 78 #include "icons/wfs.xpm" 77 79 #include "icons/dxf.xpm" 78 80 #include "icons/map_go.xpm" 79 81 #include "icons/security_lock.xpm" 80 82 #include "icons/security_relaxed.xpm" 81 83 #include "icons/security_rdonly.xpm" 82 - 84 +#include "icons/postgres.xpm" 83 85 84 86 #if defined(_WIN32) && !defined(__MINGW32__) 85 87 #define unlink _unlink 86 88 #endif 87 89 88 90 IMPLEMENT_APP(MyApp) 89 91 bool MyApp::OnInit() ................................................................................ 109 111 { 110 112 // 111 113 // main GUI frame constructor 112 114 // 113 115 setlocale(LC_ALL, ""); 114 116 // forcing DECIMAL POINT IS COMMA 115 117 setlocale(LC_NUMERIC, "C"); 118 + 119 +// setting up the LibPQ virtual API 120 + DoInitVirtualPQapi(); 116 121 117 122 // creating the internal WMS Cache 118 123 WmsCache = create_wms_cache(); 119 124 120 125 ::wxInitAllImageHandlers(); 121 126 122 127 MapPanel = NULL; ................................................................................ 339 344 BtnSqlLog = new wxBitmap(sql_log_xpm); 340 345 BtnDbStatus = new wxBitmap(db_status_xpm); 341 346 BtnCheckGeom = new wxBitmap(checkgeom_xpm); 342 347 BtnSaneGeom = new wxBitmap(sanegeom_xpm); 343 348 BtnWFS = new wxBitmap(wfs_xpm); 344 349 BtnDXF = new wxBitmap(dxf_xpm); 345 350 BtnMap = new wxBitmap(map_go_xpm); 351 + BtnPostgres = new wxBitmap(postgres_xpm); 346 352 347 353 // 348 354 // setting up the application icon 349 355 // 350 356 wxIcon MyIcon(icon_xpm); 351 357 SetIcon(MyIcon); 352 358 ................................................................................ 447 453 wxT("&Optimizing current SQLite DB [VACUUM]")); 448 454 menuItem->SetBitmap(*BtnVacuum); 449 455 menuFile->Append(menuItem); 450 456 menuItem = new wxMenuItem(menuFile, ID_Attach, wxT("&Attach DataBase")); 451 457 menuItem->SetBitmap(*BtnAttach); 452 458 menuFile->Append(menuItem); 453 459 menuFile->AppendSeparator(); 460 + menuItem = 461 + new wxMenuItem(menuFile, ID_Postgres, wxT("&Connecting to PostgreSQL")); 462 + menuItem->SetBitmap(*BtnPostgres); 463 + menuFile->Append(menuItem); 464 + menuFile->AppendSeparator(); 454 465 menuItem = 455 466 new wxMenuItem(menuFile, ID_MapPanel, wxT("Map &Panel"), wxT("Map &Panel"), 456 467 wxITEM_CHECK); 457 468 menuFile->Append(menuItem); 458 469 menuFile->AppendSeparator(); 459 470 wxMenu *advancedMenu = new wxMenu(); 460 471 menuItem = ................................................................................ 494 505 menuItem = new wxMenuItem(advancedMenu, ID_LoadXL, wxT("Load &XLS")); 495 506 menuItem->SetBitmap(*BtnLoadXL); 496 507 advancedMenu->Append(menuItem); 497 508 menuItem = new wxMenuItem(advancedMenu, ID_VirtualXL, wxT("Virtual &XLS")); 498 509 menuItem->SetBitmap(*BtnVirtualXL); 499 510 advancedMenu->Append(menuItem); 500 511 advancedMenu->AppendSeparator(); 501 - menuItem = new wxMenuItem(advancedMenu, ID_Network, wxT("Build &Network")); 512 + menuItem = new wxMenuItem(advancedMenu, ID_Network, wxT("Create &Network")); 502 513 menuItem->SetBitmap(*BtnNetwork); 503 514 advancedMenu->Append(menuItem); 504 515 advancedMenu->AppendSeparator(); 505 516 menuItem = new wxMenuItem(advancedMenu, ID_Exif, wxT("Import &EXIF photos")); 506 517 menuItem->SetBitmap(*BtnExif); 507 518 advancedMenu->Append(menuItem); 508 519 menuItem = ................................................................................ 561 572 // 562 573 // setting up menu initial state 563 574 // 564 575 menuBar->Enable(ID_Disconnect, false); 565 576 menuBar->Enable(ID_MemoryDbClock, false); 566 577 menuBar->Enable(ID_MemoryDbSave, false); 567 578 menuBar->Enable(ID_Vacuum, false); 579 + menuBar->Enable(ID_Postgres, false); 568 580 menuBar->Enable(ID_MapPanel, false); 569 581 menuBar->Enable(ID_SqlScript, false); 570 582 menuBar->Enable(ID_QueryViewComposer, false); 571 583 menuBar->Enable(ID_LoadShp, false); 572 584 menuBar->Enable(ID_VirtualShp, false); 573 585 menuBar->Enable(ID_LoadTxt, false); 574 586 menuBar->Enable(ID_VirtualTxt, false); ................................................................................ 621 633 wxT("Disconnecting current SQLite DB")); 622 634 toolBar->AddTool(ID_Vacuum, wxT("Optimizing current SQLite DB [VACUUM]"), 623 635 *BtnVacuum, wxNullBitmap, wxITEM_NORMAL, 624 636 wxT("Optimizing current SQLite DB [VACUUM]")); 625 637 toolBar->AddTool(ID_Attach, wxT("Attach DataBase"), 626 638 *BtnAttach, wxNullBitmap, wxITEM_NORMAL, 627 639 wxT("Attach DataBase")); 628 - toolBar->AddTool(ID_MapPanel, wxT("Map Panel"), 629 - *BtnMap, wxNullBitmap, wxITEM_CHECK, wxT("Map Panel")); 630 - toolBar->AddTool(ID_SqlLog, wxT("SQL Log"), 631 - *BtnSqlLog, wxNullBitmap, wxITEM_CHECK, wxT("SQL Log")); 632 - toolBar->AddTool(ID_DbStatus, wxT("DB Status"), 633 - *BtnDbStatus, wxNullBitmap, wxITEM_NORMAL, wxT("DB Status")); 634 - toolBar->AddTool(ID_CheckGeom, wxT("Check Geometries"), 635 - *BtnCheckGeom, wxNullBitmap, wxITEM_NORMAL, 636 - wxT("Check Geometries")); 640 + toolBar->AddTool(ID_Postgres, wxT("Connecting to PostgreSQL"), 641 + *BtnPostgres, wxNullBitmap, wxITEM_CHECK, 642 + wxT("Connecting to PostgreSQL")); 643 + toolBar->AddTool(ID_MapPanel, wxT("Map Panel"), *BtnMap, wxNullBitmap, 644 + wxITEM_CHECK, wxT("Map Panel")); 645 + toolBar->AddTool(ID_SqlLog, wxT("SQL Log"), *BtnSqlLog, wxNullBitmap, 646 + wxITEM_CHECK, wxT("SQL Log")); 647 + toolBar->AddTool(ID_DbStatus, wxT("DB Status"), *BtnDbStatus, wxNullBitmap, 648 + wxITEM_NORMAL, wxT("DB Status")); 649 + toolBar->AddTool(ID_CheckGeom, wxT("Check Geometries"), *BtnCheckGeom, 650 + wxNullBitmap, wxITEM_NORMAL, wxT("Check Geometries")); 637 651 toolBar->AddTool(ID_SaneGeom, wxT("Sanitize Geometries"), *BtnSaneGeom, 638 652 wxNullBitmap, wxITEM_NORMAL, wxT("Sanitize Geometries")); 639 653 toolBar->AddTool(ID_SqlScript, wxT("Execute SQL script"), *BtnSqlScript, 640 654 wxNullBitmap, wxITEM_NORMAL, wxT("Execute SQL script")); 641 655 toolBar->AddTool(ID_QueryViewComposer, wxT("Query/View Composer"), 642 656 *BtnQueryComposer, wxNullBitmap, wxITEM_NORMAL, 643 657 wxT("Query/View Composer")); ................................................................................ 653 667 wxITEM_NORMAL, wxT("Load DBF")); 654 668 toolBar->AddTool(ID_VirtualDbf, wxT("Virtual DBF"), *BtnVirtualDbf, 655 669 wxNullBitmap, wxITEM_NORMAL, wxT("Virtual DBF")); 656 670 toolBar->AddTool(ID_LoadXL, wxT("Load XLS"), *BtnLoadXL, wxNullBitmap, 657 671 wxITEM_NORMAL, wxT("Load XLS")); 658 672 toolBar->AddTool(ID_VirtualXL, wxT("Virtual XLS"), *BtnVirtualXL, 659 673 wxNullBitmap, wxITEM_NORMAL, wxT("Virtual XLS")); 660 - toolBar->AddTool(ID_Network, wxT("Build Network"), *BtnNetwork, wxNullBitmap, 661 - wxITEM_NORMAL, wxT("Build Network")); 674 + toolBar->AddTool(ID_Network, wxT("Create Network"), *BtnNetwork, wxNullBitmap, 675 + wxITEM_NORMAL, wxT("Create Network")); 662 676 toolBar->AddTool(ID_Exif, wxT("Import EXIF photos"), *BtnExif, wxNullBitmap, 663 677 wxITEM_NORMAL, wxT("Import EXIF photos")); 664 678 toolBar->AddTool(ID_GpsPics, wxT("Import GPS photos"), *BtnGpsPics, 665 679 wxNullBitmap, wxITEM_NORMAL, wxT("Import GPS photos")); 666 680 toolBar->AddTool(ID_LoadXml, wxT("Import XML Documents"), *BtnLoadXml, 667 681 wxNullBitmap, wxITEM_NORMAL, wxT("Import XML Documents")); 668 682 toolBar->AddTool(ID_WFS, wxT("Import data from WFS datasource"), *BtnWFS, ................................................................................ 686 700 // 687 701 // setting up the toolbar initial state 688 702 // 689 703 toolBar->EnableTool(ID_Disconnect, false); 690 704 toolBar->EnableTool(ID_MemoryDbClock, false); 691 705 toolBar->EnableTool(ID_MemoryDbSave, false); 692 706 toolBar->EnableTool(ID_Vacuum, false); 707 + toolBar->EnableTool(ID_Postgres, false); 693 708 toolBar->EnableTool(ID_MapPanel, false); 694 709 toolBar->EnableTool(ID_SqlScript, false); 695 710 toolBar->EnableTool(ID_QueryViewComposer, false); 696 711 toolBar->EnableTool(ID_LoadShp, false); 697 712 toolBar->EnableTool(ID_VirtualShp, false); 698 713 toolBar->EnableTool(ID_LoadTxt, false); 699 714 toolBar->EnableTool(ID_VirtualTxt, false); ................................................................................ 734 749 (wxObjectEventFunction) & MyFrame::OnMemoryDbNew); 735 750 Connect(ID_MemoryDbClock, wxEVT_COMMAND_MENU_SELECTED, 736 751 (wxObjectEventFunction) & MyFrame::OnMemoryDbClock); 737 752 Connect(ID_MemoryDbSave, wxEVT_COMMAND_MENU_SELECTED, 738 753 (wxObjectEventFunction) & MyFrame::OnMemoryDbSave); 739 754 Connect(ID_Vacuum, wxEVT_COMMAND_MENU_SELECTED, 740 755 (wxObjectEventFunction) & MyFrame::OnVacuum); 756 + Connect(ID_Postgres, wxEVT_COMMAND_MENU_SELECTED, 757 + (wxObjectEventFunction) & MyFrame::OnPostgreSQL); 741 758 Connect(ID_MapPanel, wxEVT_COMMAND_MENU_SELECTED, 742 759 (wxObjectEventFunction) & MyFrame::OnMapPanel); 743 760 Connect(ID_SqlScript, wxEVT_COMMAND_MENU_SELECTED, 744 761 (wxObjectEventFunction) & MyFrame::OnSqlScript); 745 762 Connect(ID_QueryViewComposer, wxEVT_COMMAND_MENU_SELECTED, 746 763 (wxObjectEventFunction) & MyFrame::OnQueryViewComposer); 747 764 Connect(ID_LoadShp, wxEVT_COMMAND_MENU_SELECTED, ................................................................................ 861 878 delete BtnMemDbClock; 862 879 if (BtnMemDbSave != NULL) 863 880 delete BtnMemDbSave; 864 881 if (BtnVacuum != NULL) 865 882 delete BtnVacuum; 866 883 if (BtnMap != NULL) 867 884 delete BtnMap; 885 + if (BtnPostgres != NULL) 886 + delete BtnPostgres; 868 887 if (BtnSqlScript != NULL) 869 888 delete BtnSqlScript; 870 889 if (BtnQueryComposer != NULL) 871 890 delete BtnQueryComposer; 872 891 if (BtnLoadShp != NULL) 873 892 delete BtnLoadShp; 874 893 if (BtnVirtualShp != NULL) ................................................................................ 921 940 delete[]Charsets; 922 941 if (CharsetsNames) 923 942 delete[]CharsetsNames; 924 943 if (WmsCache != NULL) 925 944 destroy_wms_cache(WmsCache); 926 945 if (RL2PrivateData) 927 946 rl2_cleanup_private(RL2PrivateData); 947 + if (DynamicLibPQ.IsLoaded() == true) 948 + DynamicLibPQ.Unload(); 928 949 } 929 950 930 951 void MyFrame::SaveConfig() 931 952 { 932 953 // 933 954 // saves layout configuration 934 955 // ................................................................................ 943 964 config->Write(wxT("WfsGetCapabilitiesURL"), WfsGetCapabilitiesURL); 944 965 config->Write(wxT("HttpProxy"), HttpProxy); 945 966 config->Write(wxT("ReadOnlyConnection"), ReadOnlyConnection); 946 967 config->Write(wxT("RL2MaxThreads"), RL2MaxThreads); 947 968 config->Write(wxT("MapMultiThreadingEnabled"), MapMultiThreadingEnabled); 948 969 config->Write(wxT("MapMaxThreads"), MapMaxThreads); 949 970 config->Write(wxT("MapAutoTransformEnabled"), MapAutoTransformEnabled); 971 + config->Write(wxT("PathLibPQ"), PathLibPQ); 950 972 delete config; 951 973 } 952 974 953 975 void MyFrame::LoadConfig(wxString & externalPath) 954 976 { 955 977 // 956 978 // loads layout configuration ................................................................................ 969 991 config->Read(wxT("WfsGetCapabilitiesURL"), &WfsGetCapabilitiesURL); 970 992 config->Read(wxT("HttpProxy"), &HttpProxy); 971 993 config->Read(wxT("ReadOnlyConnection"), &ReadOnlyConnection); 972 994 config->Read(wxT("RL2MaxThreads"), &RL2MaxThreads); 973 995 config->Read(wxT("MapMultiThreadingEnabled"), &MapMultiThreadingEnabled); 974 996 config->Read(wxT("MapMaxThreads"), &MapMaxThreads); 975 997 config->Read(wxT("MapAutoTransformEnabled"), &MapAutoTransformEnabled); 998 + config->Read(wxT("PathLibPQ"), &PathLibPQ); 976 999 delete config; 977 1000 Hide(); 978 1001 if (externalPath.Len() > 0) 979 1002 { 980 1003 // applying the external path 981 1004 wxFileName file(externalPath); 982 1005 ConfigDir = file.GetPath(); ................................................................................ 1010 1033 { 1011 1034 menuBar->Enable(ID_MemoryDbSave, false); 1012 1035 menuBar->Enable(ID_MemoryDbClock, false); 1013 1036 } 1014 1037 menuBar->Enable(ID_CreateNew, false); 1015 1038 menuBar->Enable(ID_Disconnect, true); 1016 1039 menuBar->Enable(ID_Vacuum, true); 1040 + menuBar->Enable(ID_Postgres, true); 1017 1041 menuBar->Enable(ID_MapPanel, true); 1018 1042 menuBar->Enable(ID_SqlScript, true); 1019 1043 menuBar->Enable(ID_QueryViewComposer, HasViewsMetadata()); 1020 1044 menuBar->Enable(ID_LoadShp, true); 1021 1045 menuBar->Enable(ID_VirtualShp, true); 1022 1046 menuBar->Enable(ID_LoadTxt, true); 1023 1047 menuBar->Enable(ID_VirtualTxt, true); ................................................................................ 1052 1076 { 1053 1077 toolBar->EnableTool(ID_MemoryDbSave, false); 1054 1078 toolBar->EnableTool(ID_MemoryDbClock, false); 1055 1079 } 1056 1080 toolBar->EnableTool(ID_CreateNew, false); 1057 1081 toolBar->EnableTool(ID_Disconnect, true); 1058 1082 toolBar->EnableTool(ID_Vacuum, true); 1083 + toolBar->EnableTool(ID_Postgres, true); 1059 1084 toolBar->EnableTool(ID_MapPanel, true); 1060 1085 toolBar->EnableTool(ID_SqlScript, true); 1061 1086 toolBar->EnableTool(ID_QueryViewComposer, HasViewsMetadata()); 1062 1087 toolBar->EnableTool(ID_LoadShp, true); 1063 1088 toolBar->EnableTool(ID_VirtualShp, true); 1064 1089 toolBar->EnableTool(ID_LoadTxt, true); 1065 1090 toolBar->EnableTool(ID_VirtualTxt, true); ................................................................................ 1079 1104 toolBar->ToggleTool(ID_SqlLog, SqlLogEnabled); 1080 1105 toolBar->EnableTool(ID_DbStatus, true); 1081 1106 toolBar->EnableTool(ID_CheckGeom, true); 1082 1107 toolBar->EnableTool(ID_SaneGeom, true); 1083 1108 UpdateStatusBar(); 1084 1109 } 1085 1110 } 1111 + if (VirtualPQapiOK == false) 1112 + { 1113 + // attempting to attempting to load LibPQ 1114 + if (PathLibPQ.Len() > 0) 1115 + { 1116 + // using the same path from the previous session 1117 + DoLoadLibPQ(PathLibPQ); 1118 + } 1119 + if (VirtualPQapiOK == false) 1120 + { 1121 + // using just the library name 1122 + wxString path; 1123 +#ifdef _WIN32 1124 + path = wxDynamicLibrary::CanonicalizeName(wxT("libpq")); 1125 +#else 1126 + path = wxDynamicLibrary::CanonicalizeName(wxT("pq")); 1127 +#endif 1128 + DoLoadLibPQ(path); 1129 + } 1130 + } 1086 1131 Show(); 1087 1132 if (AutoFDOmsg.Len() > 0) 1088 1133 { 1089 1134 wxMessageBox(AutoFDOmsg, wxT("spatialite_gui"), wxOK | wxICON_INFORMATION, 1090 1135 this); 1091 1136 AutoFDOmsg = wxT(""); 1092 1137 } ................................................................................ 1102 1147 { 1103 1148 // 1104 1149 // EXIT - event handler 1105 1150 // 1106 1151 Close(true); 1107 1152 } 1108 1153 1109 -void MyFrame::OnClose(wxCloseEvent & event) 1154 +void MyFrame::OnClose(wxCloseEvent & WXUNUSED(event)) 1110 1155 { 1111 1156 // 1112 1157 // immedtiately before closing the main window 1113 1158 // 1114 1159 wxString db_path = SqlitePath; 1115 1160 CloseDB(); 1116 1161 SqlitePath = db_path; ................................................................................ 1450 1495 str += wxT("RTTOPO version ") + wxString::FromUTF8(ver) + wxT("\n"); 1451 1496 } 1452 1497 if (GetLibXml2Version(ver)) 1453 1498 { 1454 1499 // printing out the LIBXML2 version if supported 1455 1500 str += wxT("LIBXML2 version ") + wxString::FromUTF8(ver) + wxT("\n"); 1456 1501 } 1502 + strcpy(ver, virtualpg_version()); 1503 + str += wxT("VirtualPG version ") + wxString::FromUTF8(ver) + wxT("\n"); 1504 + wxString pqver; 1505 + GetPQlibVersion(pqver); 1506 + str += wxT("PQlib (PostgreSQL client) version ") + pqver + wxT("\n"); 1457 1507 str += 1458 1508 wxT("\nSQLite's extensions: 'SpatiaLite', 'VirtualShape', 'VirtualDbf',\n"); 1459 1509 str += wxT("'VirtualXL', 'VirtualText', 'VirtualXPath', 'VirtualNetwork',\n"); 1460 1510 str += 1461 1511 wxT("'RTree', 'MbrCache', 'VirtualBBox', 'VirtualFDO', 'VirtualGPKG',\n"); 1462 1512 str += wxT("'RasterLite2'\n\n"); 1463 1513 strcpy(ver, spatialite_target_cpu()); ................................................................................ 1591 1641 menuBar->Enable(ID_MemoryDbClock, true); 1592 1642 } else 1593 1643 { 1594 1644 menuBar->Enable(ID_MemoryDbSave, false); 1595 1645 menuBar->Enable(ID_MemoryDbClock, false); 1596 1646 } 1597 1647 menuBar->Enable(ID_Vacuum, true); 1648 + menuBar->Enable(ID_Postgres, true); 1598 1649 menuBar->Enable(ID_MapPanel, true); 1599 1650 menuBar->Enable(ID_SqlScript, true); 1600 1651 menuBar->Enable(ID_QueryViewComposer, HasViewsMetadata()); 1601 1652 menuBar->Enable(ID_LoadShp, true); 1602 1653 menuBar->Enable(ID_VirtualShp, true); 1603 1654 menuBar->Enable(ID_LoadTxt, true); 1604 1655 menuBar->Enable(ID_VirtualTxt, true); ................................................................................ 1633 1684 toolBar->EnableTool(ID_MemoryDbClock, true); 1634 1685 } else 1635 1686 { 1636 1687 toolBar->EnableTool(ID_MemoryDbSave, false); 1637 1688 toolBar->EnableTool(ID_MemoryDbClock, false); 1638 1689 } 1639 1690 toolBar->EnableTool(ID_Vacuum, true); 1691 + toolBar->EnableTool(ID_Postgres, true); 1640 1692 toolBar->EnableTool(ID_MapPanel, true); 1641 1693 toolBar->EnableTool(ID_SqlScript, true); 1642 1694 toolBar->EnableTool(ID_QueryViewComposer, HasViewsMetadata()); 1643 1695 toolBar->EnableTool(ID_LoadShp, true); 1644 1696 toolBar->EnableTool(ID_VirtualShp, true); 1645 1697 toolBar->EnableTool(ID_LoadTxt, true); 1646 1698 toolBar->EnableTool(ID_VirtualTxt, true); ................................................................................ 1695 1747 mode2 = false; 1696 1748 mode3 = false; 1697 1749 } 1698 1750 1699 1751 wxMenuBar *menuBar = GetMenuBar(); 1700 1752 menuBar->Enable(ID_Disconnect, mode); 1701 1753 menuBar->Enable(ID_Vacuum, mode); 1754 + menuBar->Enable(ID_Postgres, mode); 1702 1755 menuBar->Enable(ID_MapPanel, mode); 1703 1756 menuBar->Enable(ID_SqlScript, mode); 1704 1757 menuBar->Enable(ID_QueryViewComposer, mode2); 1705 1758 menuBar->Enable(ID_LoadShp, mode); 1706 1759 menuBar->Enable(ID_VirtualShp, mode); 1707 1760 menuBar->Enable(ID_LoadTxt, mode); 1708 1761 menuBar->Enable(ID_VirtualTxt, mode); ................................................................................ 1721 1774 menuBar->Enable(ID_SqlLog, mode); 1722 1775 menuBar->Enable(ID_DbStatus, mode); 1723 1776 menuBar->Enable(ID_CheckGeom, mode); 1724 1777 menuBar->Enable(ID_SaneGeom, mode); 1725 1778 wxToolBar *toolBar = GetToolBar(); 1726 1779 toolBar->EnableTool(ID_Disconnect, mode); 1727 1780 toolBar->EnableTool(ID_Vacuum, mode); 1781 + toolBar->EnableTool(ID_Postgres, mode); 1728 1782 toolBar->EnableTool(ID_MapPanel, mode); 1729 1783 toolBar->EnableTool(ID_SqlScript, mode); 1730 1784 toolBar->EnableTool(ID_QueryViewComposer, mode2); 1731 1785 toolBar->EnableTool(ID_LoadShp, mode); 1732 1786 toolBar->EnableTool(ID_VirtualShp, mode); 1733 1787 toolBar->EnableTool(ID_LoadTxt, mode); 1734 1788 toolBar->EnableTool(ID_VirtualTxt, mode); ................................................................................ 1802 1856 menuBar->Enable(ID_MemoryDbClock, true); 1803 1857 } else 1804 1858 { 1805 1859 menuBar->Enable(ID_MemoryDbSave, false); 1806 1860 menuBar->Enable(ID_MemoryDbClock, false); 1807 1861 } 1808 1862 menuBar->Enable(ID_Vacuum, true); 1863 + menuBar->Enable(ID_Postgres, true); 1809 1864 menuBar->Enable(ID_MapPanel, true); 1810 1865 menuBar->Enable(ID_SqlScript, true); 1811 1866 menuBar->Enable(ID_QueryViewComposer, HasViewsMetadata()); 1812 1867 menuBar->Enable(ID_LoadShp, true); 1813 1868 menuBar->Enable(ID_VirtualShp, true); 1814 1869 menuBar->Enable(ID_LoadTxt, true); 1815 1870 menuBar->Enable(ID_VirtualTxt, true); ................................................................................ 1844 1899 toolBar->EnableTool(ID_MemoryDbClock, true); 1845 1900 } else 1846 1901 { 1847 1902 toolBar->EnableTool(ID_MemoryDbSave, false); 1848 1903 toolBar->EnableTool(ID_MemoryDbClock, false); 1849 1904 } 1850 1905 toolBar->EnableTool(ID_Vacuum, true); 1906 + toolBar->EnableTool(ID_Postgres, true); 1851 1907 toolBar->EnableTool(ID_MapPanel, true); 1852 1908 toolBar->EnableTool(ID_SqlScript, true); 1853 1909 toolBar->EnableTool(ID_QueryViewComposer, HasViewsMetadata()); 1854 1910 toolBar->EnableTool(ID_LoadShp, true); 1855 1911 toolBar->EnableTool(ID_VirtualShp, true); 1856 1912 toolBar->EnableTool(ID_LoadTxt, true); 1857 1913 toolBar->EnableTool(ID_VirtualTxt, true); ................................................................................ 1909 1965 menuBar->Enable(ID_CreateNew, true); 1910 1966 menuBar->Enable(ID_Disconnect, false); 1911 1967 menuBar->Enable(ID_MemoryDbLoad, true); 1912 1968 menuBar->Enable(ID_MemoryDbNew, true); 1913 1969 menuBar->Enable(ID_MemoryDbSave, false); 1914 1970 menuBar->Enable(ID_MemoryDbClock, false); 1915 1971 menuBar->Enable(ID_Vacuum, false); 1972 + menuBar->Enable(ID_Postgres, false); 1916 1973 menuBar->Enable(ID_MapPanel, false); 1917 1974 menuBar->Enable(ID_SqlScript, false); 1918 1975 menuBar->Enable(ID_QueryViewComposer, false); 1919 1976 menuBar->Enable(ID_LoadShp, false); 1920 1977 menuBar->Enable(ID_VirtualShp, false); 1921 1978 menuBar->Enable(ID_LoadTxt, false); 1922 1979 menuBar->Enable(ID_VirtualTxt, false); ................................................................................ 1943 2000 toolBar->EnableTool(ID_CreateNew, true); 1944 2001 toolBar->EnableTool(ID_Disconnect, false); 1945 2002 toolBar->EnableTool(ID_MemoryDbLoad, true); 1946 2003 toolBar->EnableTool(ID_MemoryDbNew, true); 1947 2004 toolBar->EnableTool(ID_MemoryDbSave, false); 1948 2005 toolBar->EnableTool(ID_MemoryDbClock, false); 1949 2006 toolBar->EnableTool(ID_Vacuum, false); 2007 + toolBar->EnableTool(ID_Postgres, false); 1950 2008 toolBar->EnableTool(ID_MapPanel, false); 1951 2009 toolBar->EnableTool(ID_SqlScript, false); 1952 2010 toolBar->EnableTool(ID_QueryViewComposer, false); 1953 2011 toolBar->EnableTool(ID_LoadShp, false); 1954 2012 toolBar->EnableTool(ID_VirtualShp, false); 1955 2013 toolBar->EnableTool(ID_LoadTxt, false); 1956 2014 toolBar->EnableTool(ID_VirtualTxt, false); ................................................................................ 2013 2071 menuBar->Enable(ID_CreateNew, false); 2014 2072 menuBar->Enable(ID_Disconnect, true); 2015 2073 menuBar->Enable(ID_MemoryDbLoad, false); 2016 2074 menuBar->Enable(ID_MemoryDbNew, false); 2017 2075 menuBar->Enable(ID_MemoryDbSave, false); 2018 2076 menuBar->Enable(ID_MemoryDbClock, false); 2019 2077 menuBar->Enable(ID_Vacuum, true); 2078 + menuBar->Enable(ID_Postgres, true); 2020 2079 menuBar->Enable(ID_MapPanel, true); 2021 2080 menuBar->Enable(ID_SqlScript, true); 2022 2081 menuBar->Enable(ID_QueryViewComposer, HasViewsMetadata()); 2023 2082 menuBar->Enable(ID_LoadShp, true); 2024 2083 menuBar->Enable(ID_VirtualShp, true); 2025 2084 menuBar->Enable(ID_LoadTxt, true); 2026 2085 menuBar->Enable(ID_VirtualTxt, true); ................................................................................ 2048 2107 toolBar->EnableTool(ID_CreateNew, false); 2049 2108 toolBar->EnableTool(ID_Disconnect, true); 2050 2109 toolBar->EnableTool(ID_MemoryDbLoad, false); 2051 2110 toolBar->EnableTool(ID_MemoryDbNew, false); 2052 2111 toolBar->EnableTool(ID_MemoryDbSave, false); 2053 2112 toolBar->EnableTool(ID_MemoryDbClock, false); 2054 2113 toolBar->EnableTool(ID_Vacuum, true); 2114 + toolBar->EnableTool(ID_Postgres, true); 2055 2115 toolBar->EnableTool(ID_MapPanel, true); 2056 2116 toolBar->EnableTool(ID_SqlScript, true); 2057 2117 toolBar->EnableTool(ID_QueryViewComposer, HasViewsMetadata()); 2058 2118 toolBar->EnableTool(ID_LoadShp, true); 2059 2119 toolBar->EnableTool(ID_VirtualShp, true); 2060 2120 toolBar->EnableTool(ID_LoadTxt, true); 2061 2121 toolBar->EnableTool(ID_VirtualTxt, true); ................................................................................ 2154 2214 } 2155 2215 ret = sqlite3_backup_finish(backup); 2156 2216 sqlite3_close(extSqlite); 2157 2217 // setting up the internal cache 2158 2218 SpliteInternalCache = spatialite_alloc_connection(); 2159 2219 spatialite_init_ex(SqliteHandle, SpliteInternalCache, 0); 2160 2220 rl2_init(SqliteHandle, RL2PrivateData, 0); 2221 + DoInitVirtualPG(); 2161 2222 // enabling LOAD_EXTENSION 2162 2223 ret = sqlite3_enable_load_extension(SqliteHandle, 1); 2163 2224 if (ret != SQLITE_OK) 2164 2225 { 2165 2226 wxMessageBox(wxT("Unable to enable LOAD_EXTENSION"), 2166 2227 wxT("spatialite_gui"), wxOK | wxICON_INFORMATION, this); 2167 2228 sqlite3_free(errMsg); ................................................................................ 2198 2259 menuBar->Enable(ID_MemoryDbClock, true); 2199 2260 } else 2200 2261 { 2201 2262 menuBar->Enable(ID_MemoryDbSave, false); 2202 2263 menuBar->Enable(ID_MemoryDbClock, false); 2203 2264 } 2204 2265 menuBar->Enable(ID_Vacuum, true); 2266 + menuBar->Enable(ID_Postgres, true); 2205 2267 menuBar->Enable(ID_MapPanel, true); 2206 2268 menuBar->Enable(ID_SqlScript, true); 2207 2269 menuBar->Enable(ID_QueryViewComposer, HasViewsMetadata()); 2208 2270 menuBar->Enable(ID_LoadShp, true); 2209 2271 menuBar->Enable(ID_VirtualShp, true); 2210 2272 menuBar->Enable(ID_LoadTxt, true); 2211 2273 menuBar->Enable(ID_VirtualTxt, true); ................................................................................ 2240 2302 toolBar->EnableTool(ID_MemoryDbClock, true); 2241 2303 } else 2242 2304 { 2243 2305 toolBar->EnableTool(ID_MemoryDbSave, false); 2244 2306 toolBar->EnableTool(ID_MemoryDbClock, false); 2245 2307 } 2246 2308 toolBar->EnableTool(ID_Vacuum, true); 2309 + toolBar->EnableTool(ID_Postgres, true); 2247 2310 toolBar->EnableTool(ID_MapPanel, true); 2248 2311 toolBar->EnableTool(ID_SqlScript, true); 2249 2312 toolBar->EnableTool(ID_QueryViewComposer, HasViewsMetadata()); 2250 2313 toolBar->EnableTool(ID_LoadShp, true); 2251 2314 toolBar->EnableTool(ID_VirtualShp, true); 2252 2315 toolBar->EnableTool(ID_LoadTxt, true); 2253 2316 toolBar->EnableTool(ID_VirtualTxt, true); ................................................................................ 2343 2406 menuBar->Enable(ID_CreateNew, false); 2344 2407 menuBar->Enable(ID_Disconnect, true); 2345 2408 menuBar->Enable(ID_MemoryDbLoad, false); 2346 2409 menuBar->Enable(ID_MemoryDbNew, false); 2347 2410 menuBar->Enable(ID_MemoryDbSave, true); 2348 2411 menuBar->Enable(ID_MemoryDbClock, true); 2349 2412 menuBar->Enable(ID_Vacuum, true); 2413 + menuBar->Enable(ID_Postgres, true); 2350 2414 menuBar->Enable(ID_MapPanel, true); 2351 2415 menuBar->Enable(ID_SqlScript, true); 2352 2416 menuBar->Enable(ID_QueryViewComposer, HasViewsMetadata()); 2353 2417 menuBar->Enable(ID_LoadShp, true); 2354 2418 menuBar->Enable(ID_VirtualShp, true); 2355 2419 menuBar->Enable(ID_LoadTxt, true); 2356 2420 menuBar->Enable(ID_VirtualTxt, true); ................................................................................ 2378 2442 toolBar->EnableTool(ID_CreateNew, false); 2379 2443 toolBar->EnableTool(ID_Disconnect, true); 2380 2444 toolBar->EnableTool(ID_MemoryDbLoad, false); 2381 2445 toolBar->EnableTool(ID_MemoryDbNew, false); 2382 2446 toolBar->EnableTool(ID_MemoryDbSave, true); 2383 2447 toolBar->EnableTool(ID_MemoryDbClock, true); 2384 2448 toolBar->EnableTool(ID_Vacuum, true); 2449 + toolBar->EnableTool(ID_Postgres, true); 2385 2450 toolBar->EnableTool(ID_MapPanel, true); 2386 2451 toolBar->EnableTool(ID_SqlScript, true); 2387 2452 toolBar->EnableTool(ID_QueryViewComposer, HasViewsMetadata()); 2388 2453 toolBar->EnableTool(ID_LoadShp, true); 2389 2454 toolBar->EnableTool(ID_VirtualShp, true); 2390 2455 toolBar->EnableTool(ID_LoadTxt, true); 2391 2456 toolBar->EnableTool(ID_VirtualTxt, true); ................................................................................ 2740 2805 ok = true; 2741 2806 } 2742 2807 } 2743 2808 } 2744 2809 sqlite3_free_table(results); 2745 2810 return ok; 2746 2811 } 2812 + 2813 +void MyFrame::CreateNetwork(wxString & table, wxString & from, wxString & to, 2814 + bool isNoGeometry, wxString & geom, 2815 + bool isNameEnabled, wxString & name, 2816 + bool isGeomLength, wxString & cost, 2817 + bool isBidirectional, bool isOneWays, 2818 + wxString & oneWayFromTo, wxString & oneWayToFrom, 2819 + bool aStarSupported, wxString & dataTableName, 2820 + wxString & virtualTableName, bool overwrite) 2821 +{ 2822 +// 2823 +// creating VirtualRouting tables 2824 +// 2825 + char *xtable = (char *) malloc(table.Len() * 4); 2826 + strcpy(xtable, table.ToUTF8()); 2827 + char *xfrom = (char *) malloc(from.Len() * 4); 2828 + strcpy(xfrom, from.ToUTF8()); 2829 + char *xto = (char *) malloc(to.Len() * 4); 2830 + strcpy(xto, to.ToUTF8()); 2831 + char *xgeom = NULL; 2832 + if (isNoGeometry == false && geom.Len() > 0) 2833 + { 2834 + xgeom = (char *) malloc(geom.Len() * 4); 2835 + strcpy(xgeom, geom.ToUTF8()); 2836 + } 2837 + char *xname = NULL; 2838 + if (isNameEnabled == true && name.Len() > 0) 2839 + { 2840 + xname = (char *) malloc(name.Len() * 4); 2841 + strcpy(xname, name.ToUTF8()); 2842 + } 2843 + char *xcost = NULL; 2844 + if (isGeomLength == false && cost.Len() > 0) 2845 + { 2846 + xcost = (char *) malloc(cost.Len() * 4); 2847 + strcpy(xcost, cost.ToUTF8()); 2848 + } 2849 + int xbidirectional = 0; 2850 + if (isBidirectional == true) 2851 + xbidirectional = 1; 2852 + char *xonewayfrom = NULL; 2853 + char *xonewayto = NULL; 2854 + if (isOneWays == true && oneWayFromTo.Len() > 0 && oneWayToFrom.Len() > 0) 2855 + { 2856 + xonewayfrom = (char *) malloc(oneWayFromTo.Len() * 4); 2857 + strcpy(xonewayfrom, oneWayFromTo.ToUTF8()); 2858 + xonewayto = (char *) malloc(oneWayToFrom.Len() * 4); 2859 + strcpy(xonewayto, oneWayToFrom.ToUTF8()); 2860 + } 2861 + int xastarsupported = 0; 2862 + if (aStarSupported == true) 2863 + xastarsupported = 1; 2864 + char *xdatatablename = (char *) malloc(dataTableName.Len() * 4); 2865 + strcpy(xdatatablename, dataTableName.ToUTF8()); 2866 + char *xvirtualtablename = (char *) malloc(virtualTableName.Len() * 4); 2867 + strcpy(xvirtualtablename, virtualTableName.ToUTF8()); 2868 + int xoverwrite = 0; 2869 + if (overwrite == true) 2870 + xoverwrite = 1; 2871 + 2872 +// preparing the SQL statement 2873 + char *sql = sqlite3_mprintf("SELECT CreateRouting(%Q, %Q, %Q, %Q, %Q", 2874 + xdatatablename, xvirtualtablename, xtable, xfrom, 2875 + xto); 2876 + char *prev = sql; 2877 + if (xgeom == NULL) 2878 + sql = sqlite3_mprintf("%s, NULL", prev); 2879 + else 2880 + sql = sqlite3_mprintf("%s, %Q", prev, xgeom); 2881 + sqlite3_free(prev); 2882 + prev = sql; 2883 + if (xcost == NULL) 2884 + sql = sqlite3_mprintf("%s, NULL", prev); 2885 + else 2886 + sql = sqlite3_mprintf("%s, %Q", prev, xcost); 2887 + sqlite3_free(prev); 2888 + prev = sql; 2889 + if (xname == NULL) 2890 + sql = sqlite3_mprintf("%s, NULL", prev); 2891 + else 2892 + sql = sqlite3_mprintf("%s, %Q", prev, xname); 2893 + sqlite3_free(prev); 2894 + prev = sql; 2895 + sql = sqlite3_mprintf("%s, %d, %d", prev, xastarsupported, xbidirectional); 2896 + sqlite3_free(prev); 2897 + prev = sql; 2898 + if (xonewayfrom != NULL && xonewayto != NULL) 2899 + sql = sqlite3_mprintf("%s, %Q, %Q", prev, xonewayfrom, xonewayto); 2900 + else 2901 + sql = sqlite3_mprintf("%s, NULL, NULL", prev); 2902 + sqlite3_free(prev); 2903 + prev = sql; 2904 + sql = sqlite3_mprintf("%s, %d)", prev, xoverwrite); 2905 + sqlite3_free(prev); 2906 + 2907 +// executing the SQL statement 2908 + int i; 2909 + char **results; 2910 + int rows; 2911 + int columns; 2912 + int success = 0; 2913 + int ret = 2914 + sqlite3_get_table(SqliteHandle, sql, &results, &rows, &columns, NULL); 2915 + sqlite3_free(sql); 2916 + if (ret != SQLITE_OK) 2917 + goto end; 2918 + if (rows < 1) 2919 + ; 2920 + else 2921 + { 2922 + for (i = 1; i <= rows; i++) 2923 + success = atoi(results[(i * columns) + 0]); 2924 + } 2925 + sqlite3_free_table(results); 2926 + 2927 +end: 2928 + free(xtable); 2929 + free(xfrom); 2930 + free(xto); 2931 + if (xgeom != NULL) 2932 + free(xgeom); 2933 + if (xname != NULL) 2934 + free(xname); 2935 + if (xcost != NULL) 2936 + free(xcost); 2937 + if (xonewayfrom != NULL) 2938 + free(xonewayfrom); 2939 + if (xonewayto != NULL) 2940 + free(xonewayto); 2941 + free(xdatatablename); 2942 + free(xvirtualtablename); 2943 + if (success) 2944 + { 2945 + wxString msg = wxT("The VirtualRouting Tables were succesfully created"); 2946 + wxMessageBox(msg, wxT("spatialite_gui"), wxOK | wxICON_INFORMATION, this); 2947 + InitTableTree(); 2948 + } else 2949 + { 2950 + // failure: reporting the error cause 2951 + wxString errCause = wxT("Unknown Cause"); 2952 + GetLastRoutingError(errCause); 2953 + wxString msg = 2954 + wxT 2955 + ("Some error occurred forbidding to create the VirtualRouting Tables\n\n") 2956 + + errCause; 2957 + wxMessageBox(msg, wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 2958 + } 2959 + 2960 +} 2961 + 2962 +void MyFrame::GetLastRoutingError(wxString & msg) 2963 +{ 2964 +// 2965 +// attempting to retrieve the most recent failure cause - CreateRouting 2966 +// 2967 + int i; 2968 + char **results; 2969 + int rows; 2970 + int columns; 2971 + int ret = 2972 + sqlite3_get_table(SqliteHandle, "SELECT CreateRouting_GetLastError()", 2973 + &results, &rows, &columns, NULL); 2974 + if (ret != SQLITE_OK) 2975 + return; 2976 + if (rows < 1) 2977 + ; 2978 + else 2979 + { 2980 + for (i = 1; i <= rows; i++) 2981 + { 2982 + const char *message = results[(i * columns) + 0]; 2983 + msg = wxString::FromUTF8(message); 2984 + } 2985 + } 2986 + sqlite3_free_table(results); 2987 +} 2747 2988 2748 2989 void MyFrame::OnVacuum(wxCommandEvent & WXUNUSED(event)) 2749 2990 { 2750 2991 // 2751 2992 // performing a VACUUM in order to reorganize the current DB 2752 2993 // 2753 2994 char *errMsg = NULL; ................................................................................ 3867 4108 NetworkDialog dlg; 3868 4109 int ret; 3869 4110 wxString table; 3870 4111 wxString from; 3871 4112 wxString to; 3872 4113 bool isNoGeometry; 3873 4114 wxString geom; 4115 + bool isNameEnabled; 3874 4116 wxString name; 3875 4117 bool isGeomLength; 3876 4118 wxString cost; 3877 4119 bool isBidirectional; 3878 4120 bool isOneWays; 3879 4121 wxString oneWayToFrom; 3880 4122 wxString oneWayFromTo; 3881 4123 bool aStarSupported; 3882 4124 wxString dataTableName; 3883 4125 wxString virtualTableName; 4126 + bool overwrite; 3884 4127 dlg.Create(this); 3885 4128 ret = dlg.ShowModal(); 3886 4129 if (ret == wxID_OK) 3887 4130 { 3888 4131 table = dlg.GetTableName(); 3889 4132 from = dlg.GetFromColumn(); 3890 4133 to = dlg.GetToColumn(); 3891 4134 isNoGeometry = dlg.IsNoGeometry(); 3892 4135 geom = dlg.GetGeomColumn(); 4136 + isNameEnabled = dlg.IsNameEnabled(); 3893 4137 name = dlg.GetNameColumn(); 3894 4138 isGeomLength = dlg.IsGeomLength(); 3895 4139 cost = dlg.GetCostColumn(); 3896 4140 isBidirectional = dlg.IsBidirectional(); 3897 4141 isOneWays = dlg.IsOneWays(); 3898 4142 oneWayToFrom = dlg.GetOneWayToFrom(); 3899 4143 oneWayFromTo = dlg.GetOneWayFromTo(); 3900 4144 aStarSupported = dlg.IsAStarSupported(); 3901 4145 dataTableName = dlg.GetDataTable(); 3902 4146 virtualTableName = dlg.GetVirtualTable(); 3903 - BuildNetwork(table, from, to, isNoGeometry, geom, name, isGeomLength, 3904 - cost, isBidirectional, isOneWays, oneWayFromTo, oneWayToFrom, 3905 - aStarSupported, dataTableName, virtualTableName); 4147 + overwrite = dlg.IsOverwriteEnabled(); 4148 + ::wxBeginBusyCursor(); 4149 + CreateNetwork(table, from, to, isNoGeometry, geom, isNameEnabled, name, 4150 + isGeomLength, cost, isBidirectional, isOneWays, 4151 + oneWayFromTo, oneWayToFrom, aStarSupported, dataTableName, 4152 + virtualTableName, overwrite); 4153 + ::wxEndBusyCursor(); 3906 4154 } 3907 4155 } 3908 4156 3909 4157 void MyFrame::OnImportXmlDocuments(wxCommandEvent & WXUNUSED(event)) 3910 4158 { 3911 4159 // 3912 4160 // importing XML Documents ................................................................................ 4468 4716 4469 4717 if (NoData.Len() == 0) 4470 4718 { 4471 4719 // creating a default NO-DATA value 4472 4720 no_data = DefaultNoData(SampleType, PixelType, NumBands); 4473 4721 } else 4474 4722 { 4475 - no_data = ParseNoData(NoData, SampleType, PixelType, NumBands); 4723 + if (NoData.CmpNoCase(wxT("NONE")) == 0) 4724 + { 4725 + // creating a NoData pixel of the NONE type 4726 + no_data = rl2_create_pixel_none(); 4727 + } else 4728 + { 4729 + // creating the NoData pixel 4730 + no_data = ParseNoData(NoData, SampleType, PixelType, NumBands); 4731 + } 4476 4732 if (no_data == NULL) 4477 4733 { 4478 4734 wxMessageBox(wxT("ERROR: invalid NO-DATA string"), 4479 4735 wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 4480 4736 return false; 4481 4737 } 4482 4738 } ................................................................................ 5469 5725 MemoryDatabase = false; 5470 5726 return false; 5471 5727 } 5472 5728 // setting up the internal cache 5473 5729 SpliteInternalCache = spatialite_alloc_connection(); 5474 5730 spatialite_init_ex(SqliteHandle, SpliteInternalCache, 0); 5475 5731 rl2_init(SqliteHandle, RL2PrivateData, 0); 5732 + DoInitVirtualPG(); 5476 5733 // enabling LOAD_EXTENSION 5477 5734 ret = sqlite3_enable_load_extension(SqliteHandle, 1); 5478 5735 if (ret != SQLITE_OK) 5479 5736 { 5480 5737 wxMessageBox(wxT("Unable to enable LOAD_EXTENSION"), 5481 5738 wxT("spatialite_gui"), wxOK | wxICON_INFORMATION, this); 5482 5739 sqlite3_free(errMsg); ................................................................................ 5488 5745 wxMessageBox(wxT("Unable to activate FOREIGN_KEY constraints"), 5489 5746 wxT("spatialite_gui"), wxOK | wxICON_INFORMATION, this); 5490 5747 sqlite3_free(errMsg); 5491 5748 } 5492 5749 // setting RL2 MaxThreads 5493 5750 char sqlmax[1024]; 5494 5751 sprintf(sqlmax, "SELECT RL2_SetMaxThreads(%d)", RL2MaxThreads); 5495 - sqlite3_exec(SqliteHandle, sqlmax, NULL, 0, &errMsg); 5752 + sqlite3_exec(SqliteHandle, sqlmax, NULL, 0, NULL); 5753 +// creating POSTGIS_GEOMETRY_COLUMNS (Temporary Table) 5754 + const char *sql = 5755 + "CREATE TEMPORARY TABLE IF NOT EXISTS postgis_geometry_columns (\n" 5756 + "\tf_table_name TEXT NOT NULL,\n\tf_geometry_column TEXT NOT NULL,\n" 5757 + "\tcoord_dimension INTEGER NOT NULL,\n\tsrid INTEGER NOT NULL,\n" 5758 + "\tgeometry_type TEXT NOT NULL,\n\tCONSTRAINT tmp_postgis_pk PRIMARY " 5759 + "KEY (f_table_name, f_geometry_column))"; 5760 + sqlite3_exec(SqliteHandle, sql, NULL, 0, NULL); 5761 +// creating TMP_VECTOR_COVERAGES (Temporary Table) 5762 + sql = 5763 + "CREATE TEMPORARY TABLE IF NOT EXISTS tmp_vector_coverages (\n" 5764 + "\tcoverage_name TEXT NOT NULL PRIMARY KEY,\n" 5765 + "\tf_table_name TEXT,\n\tf_geometry_column TEXT,\n" 5766 + "\tview_name TEXT,\n\tview_geometry TEXT,\n\tvirt_name TEXT,\n" 5767 + "\tvirt_geometry TEXT,\n\ttopology_name TEXT,\n\tnetwork_name TEXT,\n" 5768 + "\tpostgis_table TEXT,\n\tpostgis_geometry TEXT,\n" 5769 + "\tgeo_minx DOUBLE,\n\tgeo_miny DOUBLE,\n\tgeo_maxx DOUBLE,\n" 5770 + "\tgeo_maxy DOUBLE,\n\textent_minx DOUBLE,\n\textent_miny DOUBLE,\n" 5771 + "\textent_maxx DOUBLE,\n\textent_maxy DOUBLE)"; 5772 + sqlite3_exec(SqliteHandle, sql, NULL, 0, NULL); 5773 + 5496 5774 AutoFDOStart(); 5497 5775 AutoGPKGStart(); 5498 5776 InitTableTree(); 5499 5777 LoadHistory(); 5500 5778 return true; 5501 5779 } 5502 5780 ................................................................................ 5680 5958 void MyFrame::CloseDB() 5681 5959 { 5682 5960 // 5683 5961 // disconnecting current SQLite DB 5684 5962 // 5685 5963 if (!SqliteHandle) 5686 5964 return; 5965 + AutoPostgresStop(); 5687 5966 AutoFDOStop(); 5688 5967 AutoGPKGStop(); 5689 5968 if (AutoFDOmsg.Len() > 0) 5690 5969 wxMessageBox(AutoFDOmsg, wxT("spatialite_gui"), wxOK | wxICON_INFORMATION, 5691 5970 this); 5692 5971 if (AutoGPKGmsg.Len() > 0) 5693 5972 wxMessageBox(AutoGPKGmsg, wxT("spatialite_gui"), wxOK | wxICON_INFORMATION, ................................................................................ 5701 5980 SpliteInternalCache = NULL; 5702 5981 SqlitePath = wxT(""); 5703 5982 ReadOnlyConnection = false; 5704 5983 MemoryDatabase = false; 5705 5984 ResetSecurity(); 5706 5985 AttachedList.Flush(); 5707 5986 ClearTableTree(); 5987 +// dropping POSTGIS_GEOMETRY_COLUMNS (Temporary Table) 5988 + const char *sql = "DROP TABLE IF EXISTS temp.postgis_geometry_columns"; 5989 + sqlite3_exec(SqliteHandle, sql, NULL, 0, NULL); 5990 +// dropping TMP_VECTOR_COVERAGES (Temporary Table) 5991 + sql = "DROP TABLE IF EXISTS temp.tmp_vector_coverages"; 5992 + sqlite3_exec(SqliteHandle, sql, NULL, 0, NULL); 5708 5993 } 5709 5994 5710 5995 bool MyFrame::CreateDB() 5711 5996 { 5712 5997 // creating a new, empty SQLite DB 5713 5998 int ret; 5714 5999 char path[1024]; ................................................................................ 5740 6025 MemoryDatabase = false; 5741 6026 return false; 5742 6027 } 5743 6028 // setting up the internal cache 5744 6029 SpliteInternalCache = spatialite_alloc_connection(); 5745 6030 spatialite_init_ex(SqliteHandle, SpliteInternalCache, 0); 5746 6031 rl2_init(SqliteHandle, RL2PrivateData, 0); 6032 + DoInitVirtualPG(); 5747 6033 // enabling LOAD_EXTENSION 5748 6034 ret = sqlite3_enable_load_extension(SqliteHandle, 1); 5749 6035 if (ret != SQLITE_OK) 5750 6036 { 5751 6037 wxMessageBox(wxT("Unable to enable LOAD_EXTENSION"), 5752 6038 wxT("spatialite_gui"), wxOK | wxICON_INFORMATION, this); 5753 6039 sqlite3_free(errMsg); ................................................................................ 5803 6089 } 5804 6090 sqlite3_free_table(results); 5805 6091 5806 6092 if (count > 0) 5807 6093 return; 5808 6094 5809 6095 // all right, it's empty: proceding to initialize 5810 - strcpy(sql, "SELECT InitSpatialMetadata(1)"); 6096 + strcpy(sql, "SELECT InitSpatialMetadataFull(1)"); 5811 6097 ret = sqlite3_exec(SqliteHandle, sql, NULL, NULL, &errMsg); 5812 6098 if (ret != SQLITE_OK) 5813 6099 { 5814 - wxMessageBox(wxT("Unable to initialite SpatialMetadata: ") + 6100 + wxMessageBox(wxT("Unable to initialite SpatialMetadataFull: ") + 5815 6101 wxString::FromUTF8(errMsg), wxT("spatialite_gui"), 5816 6102 wxOK | wxICON_ERROR, this); 5817 6103 sqlite3_free(errMsg); 5818 6104 return; 5819 6105 } 5820 6106 } 5821 6107 ................................................................................ 5927 6213 wxString tblName; 5928 6214 wxString sql; 5929 6215 char *xsql; 5930 6216 bool status = false; 5931 6217 // fetching any defined Spatial Index 5932 6218 sql = 5933 6219 wxT 5934 - ("SELECT f_table_name, f_geometry_column FROM main.geometry_columns WHERE spatial_index_enabled = 1"); 6220 + ("SELECT f_table_name, f_geometry_column FROM main.geometry_columns WHERE spatial_index_enabled IN (1,3)"); 5935 6221 xsql = (char *) malloc((sql.Len() * 4) + 1); 5936 6222 strcpy(xsql, sql.ToUTF8()); 5937 6223 int ret = sqlite3_get_table(SqliteHandle, xsql, &results, 5938 6224 &rows, &columns, &errMsg); 5939 6225 free(xsql); 5940 6226 if (ret != SQLITE_OK) 5941 6227 { ................................................................................ 8034 8320 } 8035 8321 } 8036 8322 sqlite3_finalize(stmt); 8037 8323 if (success == false) 8038 8324 return false; 8039 8325 return true; 8040 8326 } 8327 + 8328 +void MyFrame::DoCreatePostgreSqlNodes() 8329 +{ 8330 +// initializing the PostgreSQL nodes 8331 + int c = 0; 8332 + MyPostgresConn *pC = PostgresList.GetFirst(); 8333 + while (pC != NULL) 8334 + { 8335 + // adding a Connection node 8336 + wxTreeItemId connId; 8337 + TableTree->AddPostgresConnection(c++, pC, connId); 8338 + MyPostgresSchema *pS = pC->GetFirst(); 8339 + while (pS != NULL) 8340 + { 8341 + // adding a Schema node 8342 + wxTreeItemId schemaId; 8343 + TableTree->AddPostgresSchema(connId, pC, pS->GetName(), schemaId); 8344 + pS->SetTreeNode(schemaId); 8345 + pS = pS->GetNext(); 8346 + } 8347 + pC = pC->GetNext(); 8348 + } 8349 +} 8041 8350 8042 8351 void MyFrame::InitTableTree() 8043 8352 { 8044 8353 // loads the table TREE list 8045 8354 int i; 8046 8355 char **results; 8047 8356 int rows; ................................................................................ 8060 8369 if (MemoryDatabase == true) 8061 8370 { 8062 8371 wxString memory = wxT("MEMORY-DB"); 8063 8372 TableTree->SetPath(memory); 8064 8373 } else 8065 8374 TableTree->SetPath(SqlitePath); 8066 8375 TableTree->FlushAll(); 8376 + DoCreatePostgreSqlNodes(); 8067 8377 if (ExistsTopologies()) 8068 8378 { 8069 8379 // fetching topologies 8070 8380 sql = wxT("SELECT topology_name, srid, has_z "); 8071 8381 sql += wxT(" FROM main.topologies"); 8072 8382 xsql = (char *) malloc((sql.Len() * 4) + 1); 8073 8383 strcpy(xsql, sql.ToUTF8()); ................................................................................ 8164 8474 int srid = atoi(results[(i * columns) + 1]); 8165 8475 RasterCoverageSet coverage(name, srid); 8166 8476 TableTree->AddRasterCoverage(&coverage); 8167 8477 } 8168 8478 } 8169 8479 sqlite3_free_table(results); 8170 8480 } 8171 - if (ExistsVectorCoverages()) 8481 + if (ExistsVectorCoverages() && ExistsTopologies() && ExistsNetworks()) 8172 8482 { 8173 8483 // fetching Vector Coverages 8174 8484 sql = wxT("SELECT 'table', c.coverage_name, g.srid, g.geometry_type "); 8175 8485 sql += wxT("FROM main.vector_coverages AS c "); 8176 8486 sql += wxT("JOIN main.geometry_columns AS g ON ("); 8177 8487 sql += wxT("c.topology_name IS NULL AND c.network_name IS NULL AND "); 8178 8488 sql += wxT("Lower(c.f_table_name) = Lower(g.f_table_name) AND "); ................................................................................ 8264 8574 } 8265 8575 } 8266 8576 sqlite3_free_table(results); 8267 8577 } 8268 8578 // fetching persistent tables and views 8269 8579 sql = 8270 8580 wxT 8271 - ("SELECT name, sql, type FROM main.sqlite_master WHERE (type = 'table' OR type = 'view') ORDER BY name"); 8581 + ("SELECT 'main', name, sql, type FROM main.sqlite_master WHERE (type = 'table' OR type = 'view') " 8582 + "UNION SELECT 'temp', name, sql, type FROM temp.sqlite_master WHERE type = 'table' " 8583 + "AND name IN ('postgis_geometry_columns', 'tmp_vector_coverages') ORDER BY name"); 8272 8584 xsql = (char *) malloc((sql.Len() * 4) + 1); 8273 8585 strcpy(xsql, sql.ToUTF8()); 8274 8586 int ret = sqlite3_get_table(SqliteHandle, xsql, &results, 8275 8587 &rows, &columns, &errMsg); 8276 8588 free(xsql); 8277 8589 if (ret != SQLITE_OK) 8278 8590 { ................................................................................ 8284 8596 list = new TableViewList(); 8285 8597 if (rows < 1) 8286 8598 ; 8287 8599 else 8288 8600 { 8289 8601 for (i = 1; i <= rows; i++) 8290 8602 { 8291 - name = results[(i * columns) + 0]; 8292 - createSql = results[(i * columns) + 1]; 8293 - type = results[(i * columns) + 2]; 8603 + const char *db = results[(i * columns) + 0]; 8604 + name = results[(i * columns) + 1]; 8605 + createSql = results[(i * columns) + 2]; 8606 + type = results[(i * columns) + 3]; 8294 8607 if (strstr(createSql, " VIRTUAL ") || strstr(createSql, " virtual ")) 8295 8608 virtualTable = true; 8296 8609 else 8297 8610 virtualTable = false; 8298 8611 tblName = wxString::FromUTF8(name); 8612 + wxString dbName = wxString::FromUTF8(db); 8613 + if (dbName.Cmp(wxT("temp")) == 0 8614 + && (tblName.Cmp(wxT("postgis_geometry_columns")) == 0 || 8615 + tblName.Cmp(wxT("tmp_vector_coverages")) == 0)) 8616 + { 8617 + list->Add(dbName, tblName); 8618 + continue; 8619 + } 8299 8620 if (strcmp(type, "view") == 0) 8300 8621 list->Add(tblName, true, false); 8301 8622 else 8302 8623 list->Add(tblName, false, virtualTable); 8303 8624 } 8304 8625 } 8305 8626 sqlite3_free_table(results); ................................................................................ 8310 8631 FindFdoOgrGeometries(list); 8311 8632 else 8312 8633 FindGeometries(list); 8313 8634 ptv = list->GetFirst(); 8314 8635 while (ptv != NULL) 8315 8636 { 8316 8637 // inserting items into the Tree Control View 8317 - if (ptv->IsView() == true) 8638 + if (ptv->IsTmpMetadata() == true) 8639 + TableTree->AddTmpMetadata(ptv->GetName()); 8640 + else if (ptv->IsPostgresTable(&PostgresList) == true) 8641 + TableTree->AddPostgresTable(&PostgresList, ptv->GetName()); 8642 + else if (ptv->IsView() == true) 8318 8643 TableTree->AddView(ptv->GetName(), ptv->IsGeometry()); 8319 8644 else if (ptv->IsGeoPackageGeometry() == true) 8320 8645 TableTree->AddGeoPackageTable(ptv->GetName()); 8321 8646 else if (ptv->IsGeoPackageVirtualGeometry() == true) 8322 8647 TableTree->AddGeoPackageVirtualTable(ptv->GetName()); 8323 8648 else if (ptv->IsFdoOgrGeometry() == true) 8324 8649 TableTree->AddFdoOgrTable(ptv->GetName()); ................................................................................ 8330 8655 ptv = ptv->GetNext(); 8331 8656 } 8332 8657 delete list; 8333 8658 8334 8659 // fetching temporary tables and views 8335 8660 sql = 8336 8661 wxT 8337 - ("SELECT name, sql, type FROM sqlite_temp_master WHERE (type = 'table' OR type = 'view') ORDER BY name"); 8662 + ("SELECT name, sql, type FROM sqlite_temp_master WHERE (type = 'table' OR type = 'view') " 8663 + "AND name NOT IN ('postgis_geometry_columns', 'tmp_vector_coverages') ORDER BY name"); 8338 8664 xsql = (char *) malloc((sql.Len() * 4) + 1); 8339 8665 strcpy(xsql, sql.ToUTF8()); 8340 8666 ret = sqlite3_get_table(SqliteHandle, xsql, &results, 8341 8667 &rows, &columns, &errMsg); 8342 8668 free(xsql); 8343 8669 if (ret != SQLITE_OK) 8344 8670 { ................................................................................ 9097 9423 if (rows < 1) 9098 9424 ; 9099 9425 else 9100 9426 { 9101 9427 for (i = 1; i <= rows; i++) 9102 9428 { 9103 9429 column = results[(i * columns) + 0]; 9104 - if (atoi(results[(i * columns) + 1]) == 1) 9430 + if (atoi(results[(i * columns) + 1]) == 1 9431 + || atoi(results[(i * columns) + 1]) == 3) 9105 9432 index = true; 9106 9433 else 9107 9434 index = false; 9108 9435 if (atoi(results[(i * columns) + 1]) == 2) 9109 9436 cached = true; 9110 9437 else 9111 9438 cached = false; ................................................................................ 10862 11189 ("were native SpatiaLite ones in a completely transparent way.\n"); 10863 11190 TableTree->SetFdoOgrMode(true); 10864 11191 } 10865 11192 return; 10866 11193 } 10867 11194 TableTree->SetFdoOgrMode(false); 10868 11195 } 11196 + 11197 +void MyFrame::AutoPostgresStop() 11198 +{ 11199 +// 11200 +// trying to stop the PostgreSQL auto-wrapper 11201 +// 11202 + DoDropPostgresTables(); 11203 + PostgresList.Clear(); 11204 +} 10869 11205 10870 11206 void MyFrame::AutoFDOStop() 10871 11207 { 10872 11208 // 10873 11209 // trying to stop the FDO-OGR auto-wrapper 10874 11210 // 10875 11211 int ret; ................................................................................ 11284 11620 // creating the VirtualGPKG table 11285 11621 // 11286 11622 xname = sqlite3_mprintf("vgpkg_%s", p->GetName()); 11287 11623 xname2 = gaiaDoubleQuotedSql(xname); 11288 11624 xname3 = gaiaDoubleQuotedSql(p->GetName()); 11289 11625 sprintf(sql, "CREATE VIRTUAL TABLE \"%s\" USING VirtualGPKG(\"%s\")", 11290 11626 xname2, xname3); 11291 - free(xname); 11627 + sqlite3_free(xname); 11292 11628 free(xname2); 11293 11629 free(xname3); 11294 11630 ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, NULL); 11295 11631 if (ret != SQLITE_OK) 11296 11632 goto error; 11297 11633 if (count < 5) 11298 11634 gpkgNames[count] = ................................................................................ 11434 11770 free(db_prefix); 11435 11771 xname = sqlite3_mprintf("vgpkg_%s", p->GetName()); 11436 11772 xname2 = gaiaDoubleQuotedSql(xname); 11437 11773 xname3 = gaiaDoubleQuotedSql(p->GetName()); 11438 11774 sprintf(sql, 11439 11775 "CREATE VIRTUAL TABLE \"%s\".\"%s\" USING VirtualGPKG(\"%s\", \"%s\")", 11440 11776 xdb_prefix, xname2, xdb_prefix, xname3); 11441 - free(xname); 11777 + sqlite3_free(xname); 11442 11778 free(xname2); 11443 11779 free(xname3); 11444 11780 free(xdb_prefix); 11445 11781 ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, NULL); 11446 11782 if (ret != SQLITE_OK) 11447 11783 goto error; 11448 11784 wxString tbl_name = wxString::FromUTF8(p->GetName()); ................................................................................ 13003 13339 wxT 13004 13340 ("The currently connected DB-file contains one or more harmful Triggers.\n"); 13005 13341 msg += 13006 13342 wxT("Such a condition could eventually cause serious security breaches."); 13007 13343 wxMessageBox(msg, wxT("spatialite_gui"), wxOK | wxICON_EXCLAMATION, this); 13008 13344 return false; 13009 13345 } 13346 + 13347 +void MyFrame::FeedZipHtml(unsigned char *zip, int offset, const char *data) 13348 +{ 13349 +// 13350 +// feeding data into the Html ZIP buffer 13351 +// 13352 + int i; 13353 + int j; 13354 + for (i = 0, j = 0; i < (int) strlen(data); i += 2, j++) 13355 + { 13356 + char byte_hi; 13357 + char byte_lo; 13358 + byte_hi = *(data + i); 13359 + byte_lo = *(data + i + 1); 13360 + *(zip + offset + j) = ColorMapEntry::ParseHex(byte_hi, byte_lo); 13361 + } 13362 +} 13010 13363 13011 13364 MyStatusBar::MyStatusBar(MyFrame * parent):wxStatusBar(parent) 13012 13365 { 13013 13366 // constructor 13014 13367 Parent = parent; 13015 13368 int widths[2]; 13016 13369 widths[0] = 20; ................................................................................ 13057 13410 void MyStatusBar::SetText(wxString & msg) 13058 13411 { 13059 13412 wxStatusBar *sb = Parent->GetStatusBar(); 13060 13413 if (!sb) 13061 13414 return; 13062 13415 sb->SetStatusText(msg, 1); 13063 13416 } 13064 - 13065 -void MyFrame::GetHelp(wxString & html) 13066 -{ 13067 -// 13068 -// return the HTML Help 13069 -// 13070 - html = 13071 - wxT("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"); 13072 - html += wxT("<html>"); 13073 - html += wxT("<head>"); 13074 - html += 13075 - wxT 13076 - ("<meta content=\"text/html; charset=UTF-8\" http-equiv=\"content-type\">"); 13077 - html += wxT("<title>SQLite + SpatiaLite quick Help</title>"); 13078 - html += wxT("</head>"); 13079 - html += wxT("<body bgcolor=\"#e8e8e8\">"); 13080 - html += wxT("<h1><a name=\"index\">SQLite + SpatiaLite quick Help</a></h1>"); 13081 - html += wxT("<table cellspacing=\"2\" cellpadding=\"2\">"); 13082 - html += 13083 - wxT 13084 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\">Index of contents</td></tr>"); 13085 - html += 13086 - wxT 13087 - ("<tr><td bgcolor=\"#fffff0\">1.</td><td bgcolor=\"#f0fff0\"><a href=\"#c1\">SQLite SQL syntax</a></td></tr>"); 13088 - html += 13089 - wxT 13090 - ("<tr><td bgcolor=\"#fffff0\">2.</td><td bgcolor=\"#f0fff0\"><a href=\"#c2\">SQLite SQL functions</a><ul>"); 13091 - html += wxT("<li><a href=\"#c21\">ordinary functions</a></li>"); 13092 - html += wxT("<li><a href=\"#c22\">aggregate functions</a></li>"); 13093 - html += wxT("</ul></td></tr>"); 13094 - html += 13095 - wxT 13096 - ("<tr><td bgcolor=\"#fffff0\">3.</td><td bgcolor=\"#f0fff0\"><a href=\"#c3\">SpatiaLite SQL Spatial functions</a><ul>"); 13097 - html += 13098 - wxT 13099 - ("<li><a href=\"#version\">version info [and build options] functions</a></li>"); 13100 - html += wxT("<li><a href=\"#generic\">generic functions</a></li>"); 13101 - html += wxT("<li><a href=\"#math\">math functions</a></li>"); 13102 - html += 13103 - wxT 13104 - ("<li><a href=\"#error\">SQL functions reporting GEOS / RTTOPO errors and warnings</a></li>"); 13105 - html += 13106 - wxT 13107 - ("<li><a href=\"#length_cvt\">length/distance unit-conversion functions</a></li>"); 13108 - html += 13109 - wxT 13110 - ("<li><a href=\"#dms_cvt\">DD/DMS conversion functions (longitude/latitude)</a></li>"); 13111 - html += 13112 - wxT("<li><a href=\"#blob\">utility functions for BLOB objects</a></li>"); 13113 - html += 13114 - wxT 13115 - ("<li><a href=\"#c30\">utility functions [non-standard] for geometric objects</a></li>"); 13116 - html += 13117 - wxT 13118 - ("<li><a href=\"#c31\">functions for constructing a geometric object given its Well-known Text Representation</a></li>"); 13119 - html += 13120 - wxT 13121 - ("<li><a href=\"#c32\">functions for constructing a geometric object given its Well-known Binary Representation</a></li>"); 13122 - html += 13123 - wxT 13124 - ("<li><a href=\"#c33\">functions for obtaining the Well-known Text / Well-known Binary Representation of a geometric object</a></li>"); 13125 - html += 13126 - wxT 13127 - ("<li><a href=\"#c33misc\">functions supporting exotic geometric formats</a></li>"); 13128 - html += wxT("<li><a href=\"#c34\">functions on type Geometry</a></li>"); 13129 - html += 13130 - wxT 13131 - ("<li><a href=\"#repair\">Functions attempting to repair malformed Geometries</a></li>"); 13132 - html += 13133 - wxT("<li><a href=\"#compress\">Geometry-compression functions</a></li>"); 13134 - html += wxT("<li><a href=\"#cast\">Geometry-type casting functions</a></li>"); 13135 - html += 13136 - wxT 13137 - ("<li><a href=\"#dims-cast\">Space-dimensions casting functions</a></li>"); 13138 - html += wxT("<li><a href=\"#c35\">functions on type Point</a></li>"); 13139 - html += 13140 - wxT 13141 - ("<li><a href=\"#c361\">functions on type Curve [Linestring or Ring]</a></li>"); 13142 - html += 13143 - wxT 13144 - ("<li><a href=\"#c36\">functions on type Surface [Polygon or Ring]</a></li>"); 13145 - html += wxT("<li><a href=\"#c37\">functions on type Polygon</a></li>"); 13146 - html += wxT("<li><a href=\"#c38\">functions on type GeomCollection</a></li>"); 13147 - html += 13148 - wxT 13149 - ("<li><a href=\"#c39\">functions testing approximative spatial relationships via MBRs</a></li>"); 13150 - html += 13151 - wxT 13152 - ("<li><a href=\"#c40\">functions testing spatial relationships</a></li>"); 13153 - html += 13154 - wxT 13155 - ("<li><a href=\"#c41\">functions implementing spatial operators</a></li>"); 13156 - html += 13157 - wxT 13158 - ("<li><a href=\"#c42\">functions for coordinate transformations</a></li>"); 13159 - html += 13160 - wxT 13161 - ("<li><a href=\"#c43\">functions for Spatial-MetaData and Spatial-Index handling</a></li>"); 13162 - html += 13163 - wxT 13164 - ("<li><a href=\"#c43metacatalog\">functions for MetaCatalog and related Statistics</a></li>"); 13165 - html += 13166 - wxT 13167 - ("<li><a href=\"#c43style\">functions supporting SLD/SE Styled Layers</a></li>"); 13168 - html += 13169 - wxT 13170 - ("<li><a href=\"#c43isometa\">functions supporting ISO Metadata</a></li>"); 13171 - html += 13172 - wxT 13173 - ("<li><a href=\"#c43fdo\">functions implementing FDO/OGR compatibily</a></li>"); 13174 - html += 13175 - wxT("<li><a href=\"#c44\">functions for MbrCache-based queries</a></li>"); 13176 - html += 13177 - wxT 13178 - ("<li><a href=\"#c45\">functions for R*Tree-based queries (Geometry Callbacks)</a></li>"); 13179 - html += 13180 - wxT("<li><a href=\"#xmlBlob\">SQL functions supporting XmlBLOB</a></li>"); 13181 - html += wxT("</ul></td></tr>"); 13182 - html += wxT("</table>"); 13183 - html += wxT("<h3><a name=\"c1\">SQLite SQL syntax</a></h3>"); 13184 - html += wxT("<table cellspacing=\"4\" cellpadding=\"2\"width=\"100%\">"); 13185 - html += 13186 - wxT 13187 - ("<tr><td bgcolor=\"#fffff0\">ALTER TABLE</td><td bgcolor=\"#f0fff0\">sql-statement ::= ALTER TABLE [database-name .] table-name alteration<br>"); 13188 - html += wxT("alteration ::= RENAME TO new-table-name<br>"); 13189 - html += wxT("alteration ::= ADD [COLUMN] column-def<br></td></tr>"); 13190 - html += 13191 - wxT 13192 - ("<tr><td bgcolor=\"#fffff0\">ANALYZE</td><td bgcolor=\"#f0fff0\">sql-statement ::= ANALYZE<br>"); 13193 - html += wxT("sql-statement ::= ANALYZE database-name<br>"); 13194 - html += 13195 - wxT("sql-statement ::= ANALYZE [database-name .] table-name<br></td></tr>"); 13196 - html += 13197 - wxT 13198 - ("<tr><td bgcolor=\"#fffff0\">ATTACH DATABASE</td><td bgcolor=\"#f0fff0\">sql-statement ::= ATTACH [DATABASE] database-filename AS database-name</td></tr>"); 13199 - html += 13200 - wxT 13201 - ("<tr><td bgcolor=\"#fffff0\">BEGIN TRANSACTION</td><td bgcolor=\"#f0fff0\">sql-statement ::= BEGIN [ DEFERRED | IMMEDIATE | EXCLUSIVE ] [TRANSACTION [name]]<br>"); 13202 - html += wxT("sql-statement ::= END [TRANSACTION [name]]<br>"); 13203 - html += wxT("sql-statement ::= COMMIT [TRANSACTION [name]]<br>"); 13204 - html += wxT("sql-statement ::= ROLLBACK [TRANSACTION [name]]<br></td></tr>"); 13205 - html += 13206 - wxT 13207 - ("<tr><td bgcolor=\"#fffff0\">COMMIT TRANSACTION</td><td bgcolor=\"#f0fff0\">sql-statement ::= BEGIN [ DEFERRED | IMMEDIATE | EXCLUSIVE ] [TRANSACTION [name]]<br>"); 13208 - html += wxT("sql-statement ::= END [TRANSACTION [name]]<br>"); 13209 - html += wxT("sql-statement ::= COMMIT [TRANSACTION [name]]<br>"); 13210 - html += wxT("sql-statement ::= ROLLBACK [TRANSACTION [name]]<br></td></tr>"); 13211 - html += 13212 - wxT 13213 - ("<tr><td bgcolor=\"#fffff0\">CREATE INDEX</td><td bgcolor=\"#f0fff0\">sql-statement ::= CREATE [UNIQUE] INDEX [IF NOT EXISTS] [database-name .] index-name<br>"); 13214 - html += wxT("ON table-name ( column-name [, column-name]* )<br>"); 13215 - html += 13216 - wxT 13217 - ("column-name ::= name [ COLLATE collation-name] [ ASC | DESC ]</td></tr>"); 13218 - html += 13219 - wxT 13220 - ("<tr><td bgcolor=\"#fffff0\">CREATE TABLE</td><td bgcolor=\"#f0fff0\">sql-command ::= CREATE [TEMP | TEMPORARY] TABLE [IF NOT EXISTS] [database-name .] table-name (<br>"); 13221 - html += wxT("column-def [, column-def]*<br>"); 13222 - html += wxT("[, constraint]*<br>"); 13223 - html += wxT(")<br>"); 13224 - html += 13225 - wxT 13226 - ("sql-command ::= CREATE [TEMP | TEMPORARY] TABLE [database-name.] table-name AS select-statement<br>"); 13227 - html += 13228 - wxT 13229 - ("column-def ::= name [type] [[CONSTRAINT name] column-constraint]*<br>"); 13230 - html += wxT("type ::= typename |<br>"); 13231 - html += wxT("typename ( number ) |<br>"); 13232 - html += wxT("typename ( number , number )<br>"); 13233 - html += wxT("column-constraint ::= NOT NULL [ conflict-clause ] |<br>"); 13234 - html += 13235 - wxT("PRIMARY KEY [sort-order] [ conflict-clause ] [AUTOINCREMENT] |<br>"); 13236 - html += wxT("UNIQUE [ conflict-clause ] |<br>"); 13237 - html += wxT("CHECK ( expr ) |<br>"); 13238 - html += wxT("DEFAULT value |<br>"); 13239 - html += wxT("COLLATE collation-name<br>"); 13240 - html += 13241 - wxT("constraint ::= PRIMARY KEY ( column-list ) [ conflict-clause ] |<br>"); 13242 - html += wxT("UNIQUE ( column-list ) [ conflict-clause ] |<br>"); 13243 - html += wxT("CHECK ( expr )<br>"); 13244 - html += wxT("conflict-clause ::= ON CONFLICT conflict-algorithm</td></tr>"); 13245 - html += 13246 - wxT 13247 - ("<tr><td bgcolor=\"#fffff0\">CREATE TRIGGER</td><td bgcolor=\"#f0fff0\">sql-statement ::= CREATE [TEMP | TEMPORARY] TRIGGER [IF NOT EXISTS] trigger-name [ BEFORE | AFTER ]<br>"); 13248 - html += wxT("database-event ON [database-name .] table-name<br>"); 13249 - html += wxT("trigger-action<br>"); 13250 - html += 13251 - wxT 13252 - ("sql-statement ::= CREATE [TEMP | TEMPORARY] TRIGGER [IF NOT EXISTS] trigger-name INSTEAD OF<br>"); 13253 - html += wxT("database-event ON [database-name .] view-name<br>"); 13254 - html += wxT("trigger-action<br>"); 13255 - html += wxT("database-event ::= DELETE |<br>"); 13256 - html += wxT("INSERT |<br>"); 13257 - html += wxT("UPDATE |<br>"); 13258 - html += wxT("UPDATE OF column-list<br>"); 13259 - html += wxT("trigger-action ::= [ FOR EACH ROW ] [ WHEN expression ]<br>"); 13260 - html += wxT("BEGIN<br>"); 13261 - html += wxT("trigger-step ; [ trigger-step ; ]*<br>"); 13262 - html += wxT("END<br>"); 13263 - html += wxT("trigger-step ::= update-statement | insert-statement |<br>"); 13264 - html += wxT("delete-statement | select-statement</td></tr>"); 13265 - html += 13266 - wxT 13267 - ("<tr><td bgcolor=\"#fffff0\">CREATE VIEW</td><td bgcolor=\"#f0fff0\">sql-command ::= CREATE [TEMP | TEMPORARY] VIEW [IF NOT EXISTS] [database-name.] view-name AS select-statement</td></tr>"); 13268 - html += 13269 - wxT 13270 - ("<tr><td bgcolor=\"#fffff0\">CREATE VIRTUAL TABLE</td><td bgcolor=\"#f0fff0\">sql-command ::= CREATE VIRTUAL TABLE [database-name .] table-name USING module-name [( arguments )]</td></tr>"); 13271 - html += 13272 - wxT 13273 - ("<tr><td bgcolor=\"#fffff0\">DELETE</td><td bgcolor=\"#f0fff0\">sql-statement ::= DELETE FROM [database-name .] table-name [WHERE expr]</td></tr>"); 13274 - html += 13275 - wxT 13276 - ("<tr><td bgcolor=\"#fffff0\">DETACH DATABASE</td><td bgcolor=\"#f0fff0\">sql-command ::= DETACH [DATABASE] database-name</td></tr>"); 13277 - html += 13278 - wxT 13279 - ("<tr><td bgcolor=\"#fffff0\">DROP INDEX</td><td bgcolor=\"#f0fff0\">sql-command ::= DROP INDEX [IF EXISTS] [database-name .] index-name</td></tr>"); 13280 - html += 13281 - wxT 13282 - ("<tr><td bgcolor=\"#fffff0\">DROP TABLE</td><td bgcolor=\"#f0fff0\">sql-command ::= DROP TABLE [IF EXISTS] [database-name.] table-name</td></tr>"); 13283 - html += 13284 - wxT 13285 - ("<tr><td bgcolor=\"#fffff0\">DROP TRIGGER</td><td bgcolor=\"#f0fff0\">sql-statement ::= DROP TRIGGER [IF EXISTS] [database-name .] trigger-name</td></tr>"); 13286 - html += 13287 - wxT 13288 - ("<tr><td bgcolor=\"#fffff0\">DROP VIEW</td><td bgcolor=\"#f0fff0\">sql-command ::= DROP VIEW [IF EXISTS] view-name</td></tr>"); 13289 - html += 13290 - wxT 13291 - ("<tr><td bgcolor=\"#fffff0\">END TRANSACTION</td><td bgcolor=\"#f0fff0\">sql-statement ::= BEGIN [ DEFERRED | IMMEDIATE | EXCLUSIVE ] [TRANSACTION [name]]<br>"); 13292 - html += wxT("sql-statement ::= END [TRANSACTION [name]]<br>"); 13293 - html += wxT("sql-statement ::= COMMIT [TRANSACTION [name]]<br>"); 13294 - html += wxT("sql-statement ::= ROLLBACK [TRANSACTION [name]]<br></td></tr>"); 13295 - html += 13296 - wxT 13297 - ("<tr><td bgcolor=\"#fffff0\">EXPLAIN</td><td bgcolor=\"#f0fff0\">sql-statement ::= EXPLAIN sql-statement</td></tr>"); 13298 - html += 13299 - wxT 13300 - ("<tr><td bgcolor=\"#fffff0\">INSERT</td><td bgcolor=\"#f0fff0\">sql-statement ::= INSERT [OR conflict-algorithm] INTO [database-name .] table-name [(column-list)] VALUES(value-list) |<br>"); 13301 - html += 13302 - wxT 13303 - ("INSERT [OR conflict-algorithm] INTO [database-name .] table-name [(column-list)] select-statement</td></tr>"); 13304 - html += 13305 - wxT 13306 - ("<tr><td bgcolor=\"#fffff0\">ON CONFLICT clause</td><td bgcolor=\"#f0fff0\">conflict-clause ::= ON CONFLICT conflict-algorithm<br>"); 13307 - html += 13308 - wxT 13309 - ("conflict-algorithm ::= ROLLBACK | ABORT | FAIL | IGNORE | REPLACE</td></tr>"); 13310 - html += 13311 - wxT 13312 - ("<tr><td bgcolor=\"#fffff0\">PRAGMA</td><td bgcolor=\"#f0fff0\">sql-statement ::= PRAGMA name [= value] |<br>"); 13313 - html += wxT("PRAGMA function(arg)<hr>"); 13314 - html += wxT("PRAGMA auto_vacuum;<br>"); 13315 - html += 13316 - wxT("PRAGMA auto_vacuum = 0 | none | 1 | full | 2 | incremental;<hr>"); 13317 - html += wxT("PRAGMA cache_size;<br>"); 13318 - html += wxT("PRAGMA cache_size = Number-of-pages;<hr>"); 13319 - html += wxT("PRAGMA case_sensitive_like;<br>"); 13320 - html += wxT("PRAGMA case_sensitive_like = 0 | 1;<hr>"); 13321 - html += wxT("PRAGMA count_changes;<br>"); 13322 - html += wxT("PRAGMA count_changes = 0 | 1;<hr>"); 13323 - html += wxT("PRAGMA default_cache_size;<br>"); 13324 - html += wxT("PRAGMA default_cache_size = Number-of-pages;<hr>"); 13325 - html += wxT("PRAGMA empty_result_callbacks;<br>"); 13326 - html += wxT("PRAGMA empty_result_callbacks = 0 | 1;<hr>"); 13327 - html += wxT("PRAGMA encoding;<br>"); 13328 - html += wxT("PRAGMA encoding = \"UTF-8\";<br>"); 13329 - html += wxT("PRAGMA encoding = \"UTF-16\";<br>"); 13330 - html += wxT("PRAGMA encoding = \"UTF-16le\";<br>"); 13331 - html += wxT("PRAGMA encoding = \"UTF-16be\";<hr>"); 13332 - html += wxT("PRAGMA foreign_keys;<br>"); 13333 - html += wxT("PRAGMA foreign_keys = 0 | 1;<hr>"); 13334 - html += wxT("PRAGMA full_column_names;<br>"); 13335 - html += wxT("PRAGMA full_column_names = 0 | 1;<hr>"); 13336 - html += wxT("PRAGMA fullfsync;<br>"); 13337 - html += wxT("PRAGMA fullfsync = 0 | 1;<hr>"); 13338 - html += wxT("PRAGMA journal_mode;<br>"); 13339 - html += wxT("PRAGMA database.journal_mode;<br>"); 13340 - html += 13341 - wxT("PRAGMA journal_mode = DELETE | TRUNCATE | PERSIST | MEMORY | OFF<br>"); 13342 - html += 13343 - wxT 13344 - ("PRAGMA database.journal_mode = DELETE | TRUNCATE | PERSIST | MEMORY | OFF<hr>"); 13345 - html += wxT("PRAGMA journal_size_limit;<br>"); 13346 - html += wxT("PRAGMA journal_size_limit = N<hr>"); 13347 - html += wxT("PRAGMA legacy_file_format;<br>"); 13348 - html += wxT("PRAGMA legacy_file_format = 0 | 1<hr>"); 13349 - html += wxT("PRAGMA locking_mode;<br>"); 13350 - html += wxT("PRAGMA locking_mode = NORMAL | EXCLUSIVE<hr>"); 13351 - html += wxT("PRAGMA page_size;<br>"); 13352 - html += wxT("PRAGMA page_size = bytes;<hr>"); 13353 - html += wxT("PRAGMA max_page_count;<br>"); 13354 - html += wxT("PRAGMA max_page_count = N;<hr>"); 13355 - html += wxT("PRAGMA read_uncommitted;<br>"); 13356 - html += wxT("PRAGMA read_uncommitted = 0 | 1;<hr>"); 13357 - html += wxT("PRAGMA recursive_triggers;<br>"); 13358 - html += wxT("PRAGMA recursive_triggers = 0 | 1;<hr>"); 13359 - html += wxT("PRAGMA reverse_unordered_selects;<br>"); 13360 - html += wxT("PRAGMA reverse_unordered_selects = 0 | 1;<hr>"); 13361 - html += wxT("PRAGMA short_column_names;<br>"); 13362 - html += wxT("PRAGMA short_column_names = 0 | 1;<hr>"); 13363 - html += wxT("PRAGMA synchronous;<br>"); 13364 - html += wxT("PRAGMA synchronous = FULL; (2)<br>"); 13365 - html += wxT("PRAGMA synchronous = NORMAL; (1)<br>"); 13366 - html += wxT("PRAGMA synchronous = OFF; (0)<hr>"); 13367 - html += wxT("PRAGMA temp_store;<br>"); 13368 - html += wxT("PRAGMA temp_store = DEFAULT; (0)<br>"); 13369 - html += wxT("PRAGMA temp_store = FILE; (1)<br>"); 13370 - html += wxT("PRAGMA temp_store = MEMORY; (2)<hr>"); 13371 - html += wxT("PRAGMA temp_store_directory;<br>"); 13372 - html += wxT("PRAGMA temp_store_directory = 'directory-name';<hr>"); 13373 - html += wxT("PRAGMA database_list;<hr>"); 13374 - html += wxT("PRAGMA foreign_key_list(table-name);<hr>"); 13375 - html += wxT("PRAGMA [database].freelist_count;<hr>"); 13376 - html += wxT("PRAGMA index_info(index-name);<hr>"); 13377 - html += wxT("PRAGMA index_list(table-name);<hr>"); 13378 - html += wxT("PRAGMA table_info(table-name);<hr>"); 13379 - html += wxT("PRAGMA [database.]schema_version;<br>"); 13380 - html += wxT("PRAGMA [database.]schema_version = integer ;<br>"); 13381 - html += wxT("PRAGMA [database.]user_version;<br>"); 13382 - html += wxT("PRAGMA [database.]user_version = integer ;<hr>"); 13383 - html += wxT("PRAGMA integrity_check;<br>"); 13384 - html += wxT("PRAGMA integrity_check(integer)<hr>"); 13385 - html += wxT("PRAGMA quick_check;<br>"); 13386 - html += wxT("PRAGMA quick_check(integer)<hr>"); 13387 - html += wxT("PRAGMA parser_trace = ON; (1)<br>"); 13388 - html += wxT("PRAGMA parser_trace = OFF; (0)<hr>"); 13389 - html += wxT("PRAGMA vdbe_trace = ON; (1)<br>"); 13390 - html += wxT("PRAGMA vdbe_trace = OFF; (0)<hr>"); 13391 - html += wxT("PRAGMA vdbe_listing = ON; (1)<br>"); 13392 - html += wxT("PRAGMA vdbe_listing = OFF; (0)</td></tr>"); 13393 - html += 13394 - wxT 13395 - ("<tr><td bgcolor=\"#fffff0\">REINDEX</td><td bgcolor=\"#f0fff0\">sql-statement ::= REINDEX collation name<br>"); 13396 - html += 13397 - wxT 13398 - ("sql-statement ::= REINDEX [database-name .] table/index-name</td></tr>"); 13399 - html += 13400 - wxT 13401 - ("<tr><td bgcolor=\"#fffff0\">REPLACE</td><td bgcolor=\"#f0fff0\">sql-statement ::= REPLACE INTO [database-name .] table-name [( column-list )] VALUES ( value-list ) |<br>"); 13402 - html += 13403 - wxT 13404 - ("REPLACE INTO [database-name .] table-name [( column-list )] select-statement</td></tr>"); 13405 - html += 13406 - wxT 13407 - ("<tr><td bgcolor=\"#fffff0\">ROLLBACK TRANSACTION</td><td bgcolor=\"#f0fff0\">sql-statement ::= BEGIN [ DEFERRED | IMMEDIATE | EXCLUSIVE ] [TRANSACTION [name]]<br>"); 13408 - html += wxT("sql-statement ::= END [TRANSACTION [name]]<br>"); 13409 - html += wxT("sql-statement ::= COMMIT [TRANSACTION [name]]<br>"); 13410 - html += wxT("sql-statement ::= ROLLBACK [TRANSACTION [name]]<br></td></tr>"); 13411 - html += 13412 - wxT 13413 - ("<tr><td bgcolor=\"#fffff0\">SELECT</td><td bgcolor=\"#f0fff0\">sql-statement ::= SELECT [ALL | DISTINCT] result [FROM table-list]<br>"); 13414 - html += wxT("[WHERE expr]<br>"); 13415 - html += wxT("[GROUP BY expr-list]<br>"); 13416 - html += wxT("[HAVING expr]<br>"); 13417 - html += wxT("[compound-op select]*<br>"); 13418 - html += wxT("[ORDER BY sort-expr-list]<br>"); 13419 - html += wxT("[LIMIT integer [( OFFSET | , ) integer]]<br>"); 13420 - html += wxT("result ::= result-column [, result-column]*<br>"); 13421 - html += 13422 - wxT("result-column ::= * | table-name . * | expr [ [AS] string ]<br>"); 13423 - html += wxT("table-list ::= table [join-op table join-args]*<br>"); 13424 - html += wxT("table ::= table-name [AS alias] |<br>"); 13425 - html += wxT("( select ) [AS alias]<br>"); 13426 - html += 13427 - wxT 13428 - ("join-op ::= , | [NATURAL] [LEFT | RIGHT | FULL] [OUTER | INNER | CROSS] JOIN<br>"); 13429 - html += wxT("join-args ::= [ON expr] [USING ( id-list )]<br>"); 13430 - html += 13431 - wxT("sort-expr-list ::= expr [sort-order] [, expr [sort-order]]*<br>"); 13432 - html += wxT("sort-order ::= [ COLLATE collation-name ] [ ASC | DESC ]<br>"); 13433 - html += 13434 - wxT("compound_op ::= UNION | UNION ALL | INTERSECT | EXCEPT</td></tr>"); 13435 - html += 13436 - wxT 13437 - ("<tr><td bgcolor=\"#fffff0\">UPDATE</td><td bgcolor=\"#f0fff0\">sql-statement ::= UPDATE [ OR conflict-algorithm ] [database-name .] table-name<br>"); 13438 - html += wxT("SET assignment [, assignment]*<br>"); 13439 - html += wxT("[WHERE expr]<br>"); 13440 - html += wxT("assignment ::= column-name = expr</td></tr>"); 13441 - html += 13442 - wxT 13443 - ("<tr><td bgcolor=\"#fffff0\">VACUUM</td><td bgcolor=\"#f0fff0\">sql-statement ::= VACUUM</td></tr>"); 13444 - html += wxT("</table>"); 13445 - html += wxT("<a href=\"#index\">back to index</a>"); 13446 - html += 13447 - wxT 13448 - ("<h3><a align=\"center\" bgcolor=\"#e0ffe0\" name=\"c2\">SQLite SQL functions</a></h3>"); 13449 - html += wxT("<table cellspacing=\"4\" cellpadding=\"2\" width=\"100%\">"); 13450 - html += 13451 - wxT 13452 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"c21\">ordinary functions</a><br><a href=\"#index\">back to index</a></td></tr>"); 13453 - html += 13454 - wxT 13455 - ("<tr><td bgcolor=\"#fffff0\">abs(X)</td><td bgcolor=\"#f0fff0\">Return the absolute value of the numeric argument X. "); 13456 - html += 13457 - wxT 13458 - ("Return NULL if X is NULL. Return 0.0 if X is not a numeric value.</td></tr>"); 13459 - html += 13460 - wxT 13461 - ("<tr><td bgcolor=\"#fffff0\">changes()</td><td bgcolor=\"#f0fff0\">Returns the number of database rows that were changed or inserted or deleted "); 13462 - html += 13463 - wxT 13464 - ("by the most recently completed INSERT, DELETE, or UPDATE statement, exclusive of statements in lower-level triggers.</td></tr>"); 13465 - html += 13466 - wxT 13467 - ("<tr><td bgcolor=\"#fffff0\">char(X1,X2,...,XN)</td><td bgcolor=\"#f0fff0\">The char(X1,X2,...,XN) function returns a string "); 13468 - html += 13469 - wxT 13470 - ("composed of characters having the unicode code point values of integers X1 through XN, respectively.</td></tr>"); 13471 - html += 13472 - wxT 13473 - ("<tr><td bgcolor=\"#fffff0\">coalesce(X,Y,...)</td><td bgcolor=\"#f0fff0\">Return a copy of the first non-NULL argument. "); 13474 - html += 13475 - wxT 13476 - ("If all arguments are NULL then NULL is returned. There must be at least 2 arguments.</td></tr>"); 13477 - html += 13478 - wxT 13479 - ("<tr><td bgcolor=\"#fffff0\">glob(X,Y)</td><td bgcolor=\"#f0fff0\">This function is used to implement the \"X GLOB Y\" syntax of SQLite. "); 13480 - html += 13481 - wxT 13482 - ("The sqlite3_create_function() interface can be used to override this function and thereby change the operation of the GLOB operator.</td></tr>"); 13483 - html += 13484 - wxT 13485 - ("<tr><td bgcolor=\"#fffff0\">ifnull(X,Y)</td><td bgcolor=\"#f0fff0\">Return a copy of the first non-NULL argument. "); 13486 - html += 13487 - wxT 13488 - ("If both arguments are NULL then NULL is returned. This behaves the same as coalesce().</td></tr>"); 13489 - html += 13490 - wxT 13491 - ("<tr><td bgcolor=\"#fffff0\">instr(X,Y)</td><td bgcolor=\"#f0fff0\">The instr(X,Y) function finds the first occurrence of string Y within string X and returns the "); 13492 - html += 13493 - wxT 13494 - ("number of prior characters plus 1, or 0 if Y is nowhere found within X. Or, if X and Y are both BLOBs, then instr(X,Y) returns one more than "); 13495 - html += 13496 - wxT 13497 - ("the number bytes prior to the first occurrence of Y, or 0 if Y does not occur anywhere within X. If both arguments X and Y to instr(X,Y) "); 13498 - html += 13499 - wxT 13500 - ("are non-NULL and are not BLOBs then both are interpreted as strings. If either X or Y are NULL in instr(X,Y) then the result is NULL. </td></tr>"); 13501 - html += 13502 - wxT 13503 - ("<tr><td bgcolor=\"#fffff0\">hex(X)</td><td bgcolor=\"#f0fff0\">The argument is interpreted as a BLOB. "); 13504 - html += 13505 - wxT 13506 - ("The result is a hexadecimal rendering of the content of that blob.</td></tr>"); 13507 - html += 13508 - wxT 13509 - ("<tr><td bgcolor=\"#fffff0\">last_insert_rowid()</td><td bgcolor=\"#f0fff0\">Return the ROWID of the last row insert from this connection to the database. "); 13510 - html += 13511 - wxT 13512 - ("This is the same value that would be returned from the sqlite3_last_insert_rowid() API function.</td></tr>"); 13513 - html += 13514 - wxT 13515 - ("<tr><td bgcolor=\"#fffff0\">length(X)</td><td bgcolor=\"#f0fff0\">Return the string length of X in characters. "); 13516 - html += 13517 - wxT 13518 - ("If SQLite is configured to support UTF-8, then the number of UTF-8 characters is returned, not the number of bytes.</td></tr>"); 13519 - html += 13520 - wxT 13521 - ("<tr><td bgcolor=\"#fffff0\">like(X,Y)<br>like(X,Y,Z)</td><td bgcolor=\"#f0fff0\">This function is used to implement the \"X LIKE Y [ESCAPE Z]\" syntax of SQL."); 13522 - html += 13523 - wxT 13524 - ("If the optional ESCAPE clause is present, then the user-function is invoked with three arguments. "); 13525 - html += wxT("Otherwise, it is invoked with two arguments only. "); 13526 - html += 13527 - wxT 13528 - ("The sqlite3_create_function() interface can be used to override this function and thereby change the operation of the LIKE operator. "); 13529 - html += 13530 - wxT 13531 - ("When doing this, it may be important to override both the two and three argument versions of the like() function. "); 13532 - html += 13533 - wxT 13534 - ("Otherwise, different code may be called to implement the LIKE operator depending on whether or not an ESCAPE clause was specified.</td></tr>"); 13535 - html += 13536 - wxT 13537 - ("<tr><td bgcolor=\"#fffff0\">load_extension(X)</br>load_extension(X,Y)</td><td bgcolor=\"#f0fff0\">Load SQLite extensions "); 13538 - html += 13539 - wxT("out of the shared library file named X using the entry point Y. "); 13540 - html += 13541 - wxT 13542 - ("The result is a NULL. If Y is omitted then the default entry point of sqlite3_extension_init is used. "); 13543 - html += 13544 - wxT 13545 - ("This function raises an exception if the extension fails to load or initialize correctly.</td></tr>"); 13546 - html += 13547 - wxT 13548 - ("<tr><td bgcolor=\"#fffff0\">lower(X)</td><td bgcolor=\"#f0fff0\">Return a copy of string X will all ASCII characters converted to lower case. "); 13549 - html += 13550 - wxT 13551 - ("The C library tolower() routine is used for the conversion, which means that this function might not work correctly on non-ASCII UTF-8 characters.</td></tr>"); 13552 - html += 13553 - wxT 13554 - ("<tr><td bgcolor=\"#fffff0\">ltrim(X)<br>ltrim(X,Y)</td><td bgcolor=\"#f0fff0\">Return a string formed by removing any and all characters "); 13555 - html += 13556 - wxT 13557 - ("that appear in Y from the left side of X. If the Y argument is omitted, spaces are removed.</td></tr>"); 13558 - html += 13559 - wxT 13560 - ("<tr><td bgcolor=\"#fffff0\">max(X,Y,...)</td><td bgcolor=\"#f0fff0\">Return the argument with the maximum value. "); 13561 - html += wxT("Arguments may be strings in addition to numbers. "); 13562 - html += wxT("The maximum value is determined by the usual sort order. "); 13563 - html += 13564 - wxT 13565 - ("Note that max() is a simple function when it has 2 or more arguments but converts to an aggregate function if given only a single argument.</td></tr>"); 13566 - html += 13567 - wxT 13568 - ("<tr><td bgcolor=\"#fffff0\">min(X,Y,...)</td><td bgcolor=\"#f0fff0\">Return the argument with the minimum value. "); 13569 - html += wxT("Arguments may be strings in addition to numbers. "); 13570 - html += wxT("The minimum value is determined by the usual sort order. "); 13571 - html += 13572 - wxT 13573 - ("Note that min() is a simple function when it has 2 or more arguments but converts to an aggregate function if given only a single argument.</td></tr>"); 13574 - html += 13575 - wxT 13576 - ("<tr><td bgcolor=\"#fffff0\">nullif(X,Y)</td><td bgcolor=\"#f0fff0\">Return the first argument if the arguments are different, otherwise return NULL.</td></tr>"); 13577 - html += 13578 - wxT 13579 - ("<tr><td bgcolor=\"#fffff0\">quote(X)</td><td bgcolor=\"#f0fff0\">This routine return a string which is the value of its argument suitable for inclusion "); 13580 - html += 13581 - wxT 13582 - ("into another SQL statement. Strings are surrounded by single-quotes with escapes on interior quotes as needed. "); 13583 - html += 13584 - wxT 13585 - ("BLOBs are encoded as hexadecimal literals. The implementation of VACUUM uses this function. "); 13586 - html += 13587 - wxT 13588 - ("The function is also useful when writing triggers to implement undo/redo functionality.</td></tr>"); 13589 - html += 13590 - wxT 13591 - ("<tr><td bgcolor=\"#fffff0\">random()</td><td bgcolor=\"#f0fff0\">Return a pseudo-random integer between -9223372036854775808 and +9223372036854775807.</td></tr>"); 13592 - html += 13593 - wxT 13594 - ("<tr><td bgcolor=\"#fffff0\">randomblob(N)</td><td bgcolor=\"#f0fff0\">Return an N-byte blob containing pseudo-random bytes. N should be a postive integer.</td></tr>"); 13595 - html += 13596 - wxT 13597 - ("<tr><td bgcolor=\"#fffff0\">replace(X,Y,Z)</td><td bgcolor=\"#f0fff0\">Return a string formed by substituting string Z for every occurrance of string Y in string X. "); 13598 - html += 13599 - wxT("The BINARY collating sequence is used for comparisons.</td></tr>"); 13600 - html += 13601 - wxT 13602 - ("<tr><td bgcolor=\"#fffff0\">round(X)<br>round(X,Y)</td><td bgcolor=\"#f0fff0\">Round off the number X to Y digits to the right of the decimal point. "); 13603 - html += wxT("If the Y argument is omitted, 0 is assumed.</td></tr>"); 13604 - html += 13605 - wxT 13606 - ("<tr><td bgcolor=\"#fffff0\">rtrim(X)<br>rtrim(X,Y)</td><td bgcolor=\"#f0fff0\">Return a string formed by removing any and all characters "); 13607 - html += 13608 - wxT 13609 - ("that appear in Y from the right side of X. If the Y argument is omitted, spaces are removed.</td></tr>"); 13610 - html += 13611 - wxT 13612 - ("<tr><td bgcolor=\"#fffff0\">sqlite_version(X)</td><td bgcolor=\"#f0fff0\">Return the version string for the SQLite library that is running. Example: \"3.5.9\"</td></tr>"); 13613 - html += 13614 - wxT 13615 - ("<tr><td bgcolor=\"#fffff0\">substr(X,Y,Z)<br>substr(X,Y)</td><td bgcolor=\"#f0fff0\">Return a substring of input string X that begins with the Y-th character "); 13616 - html += 13617 - wxT 13618 - ("and which is Z characters long. If Z is omitted then all character through the end of the string are returned. "); 13619 - html += wxT("The left-most character of X is number 1. "); 13620 - html += 13621 - wxT 13622 - ("If Y is negative the the first character of the substring is found by counting from the right rather than the left. "); 13623 - html += 13624 - wxT 13625 - ("If X is string then characters indices refer to actual UTF-8 characters. If X is a BLOB then the indices refer to bytes.</td></tr>"); 13626 - html += 13627 - wxT 13628 - ("<tr><td bgcolor=\"#fffff0\">trim(X)<br>trim(X,Y)</td><td bgcolor=\"#f0fff0\">Return a string formed by removing any and all characters that appear in Y from both ends of X. "); 13629 - html += wxT("If the Y argument is omitted, spaces are removed.</td></tr>"); 13630 - html += 13631 - wxT 13632 - ("<tr><td bgcolor=\"#fffff0\">typeof(X)</td><td bgcolor=\"#f0fff0\">Return the type of the expression X. "); 13633 - html += 13634 - wxT 13635 - ("The only return values are \"null\", \"integer\", \"real\", \"text\", and \"blob\".</td></tr>"); 13636 - html += 13637 - wxT 13638 - ("<tr><td bgcolor=\"#fffff0\">unicode(X)</td><td bgcolor=\"#f0fff0\">The unicode(X) function returns the numeric unicode code point corresponding to the first "); 13639 - html += 13640 - wxT 13641 - ("character of the string X. If the argument to unicode(X) is not a string then the result is undefined. </td></tr>"); 13642 - html += 13643 - wxT 13644 - ("<tr><td bgcolor=\"#fffff0\">upper(X)</td><td bgcolor=\"#f0fff0\">Return a copy of input string X converted to all upper-case letters. "); 13645 - html += 13646 - wxT 13647 - ("The implementation of this function uses the C library routine toupper() which means it may not work correctly on non-ASCII UTF-8 strings.</td></tr>"); 13648 - html += 13649 - wxT 13650 - ("<tr><td bgcolor=\"#fffff0\">zeroblob(N)</td><td bgcolor=\"#f0fff0\">Return a BLOB consisting of N bytes of 0x00. "); 13651 - html += wxT("SQLite manages these zeroblobs very efficiently. "); 13652 - html += 13653 - wxT 13654 - ("Zeroblobs can be used to reserve space for a BLOB that is later written using incremental BLOB I/O.</td></tr> "); 13655 - html += 13656 - wxT 13657 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"c22\">aggregate functions</a><br><a href=\"#index\">back to index</a></td></tr>"); 13658 - html += 13659 - wxT 13660 - ("<tr><td bgcolor=\"#fffff0\">avg(X)</td><td bgcolor=\"#f0fff0\">Return the average value of all non-NULL X within a group. "); 13661 - html += 13662 - wxT 13663 - ("String and BLOB values that do not look like numbers are interpreted as 0. "); 13664 - html += 13665 - wxT 13666 - ("The result of avg() is always a floating point value even if all inputs are integers.</td></tr>"); 13667 - html += 13668 - wxT 13669 - ("<tr><td bgcolor=\"#fffff0\">count(X)<br>count(*)</td><td bgcolor=\"#f0fff0\">The first form return a count of the number of times that X is not NULL in a group. "); 13670 - html += 13671 - wxT 13672 - ("The second form (with no argument) return the total number of rows in the group.</td></tr>"); 13673 - html += 13674 - wxT 13675 - ("<tr><td bgcolor=\"#fffff0\">group_concat(X)<br>group_concat(X,Y)</td><td bgcolor=\"#f0fff0\">The result is a string which is the concatenation of all non-NULL values of X. "); 13676 - html += 13677 - wxT 13678 - ("If parameter Y is the separator between instances of X. A comma (\",\") is used as the separator if Y is omitted.</td></tr>"); 13679 - html += 13680 - wxT 13681 - ("<tr><td bgcolor=\"#fffff0\">max(X)</td><td bgcolor=\"#f0fff0\">Return the maximum value of all values in the group. "); 13682 - html += 13683 - wxT("The usual sort order is used to determine the maximum.</td></tr>"); 13684 - html += 13685 - wxT 13686 - ("<tr><td bgcolor=\"#fffff0\">min(X)</td><td bgcolor=\"#f0fff0\">Return the minimum non-NULL value of all values in the group. "); 13687 - html += 13688 - wxT 13689 - ("The usual sort order is used to determine the minimum. NULL is only returned if all values in the group are NULL.</td></tr>"); 13690 - html += 13691 - wxT 13692 - ("<tr><td bgcolor=\"#fffff0\">sum(X)<br>total(X)</td><td bgcolor=\"#f0fff0\">Return the numeric sum of all non-NULL values in the group. "); 13693 - html += 13694 - wxT 13695 - ("If there are no non-NULL input rows then sum() return NULL but total() return 0.0. "); 13696 - html += 13697 - wxT 13698 - ("NULL is not normally a helpful result for the sum of no rows but the SQL standard requires it and most other SQL "); 13699 - html += 13700 - wxT 13701 - ("database engines implement sum() that way so SQLite does it in the same way in order to be compatible. "); 13702 - html += 13703 - wxT 13704 - ("The non-standard total() function is provided as a convenient way to work around this design problem in the SQL language.<br>"); 13705 - html += 13706 - wxT 13707 - ("The result of total() is always a floating point value. The result of sum() is an integer value if all non-NULL inputs are integers. "); 13708 - html += 13709 - wxT 13710 - ("If any input to sum() is neither an integer or a NULL then sum() return a floating point value which might be an approximation to the true sum.<br>"); 13711 - html += 13712 - wxT 13713 - ("Sum() will throw an \"integer overflow\" exception if all inputs are integers or NULL and an integer overflow occurs at any point during the computation."); 13714 - html += wxT("Total() never throws an exception.</td></tr> "); 13715 - html += wxT("</table>"); 13716 - html += wxT("<a href=\"#index\">back to index</a>"); 13717 - html += wxT("<h3><a name=\"c3\">SpatiaLite SQL Spatial functions</a></h3>"); 13718 - html += wxT("<table cellspacing=\"4\" cellpadding=\"2\" width=\"100%\">"); 13719 - html += 13720 - wxT 13721 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"version\">SQL version info [and build options] functions</a></a>"); 13722 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 13723 - html += 13724 - wxT("<tr><td bgcolor=\"#fffff0\">spatialite_version( void ) : String</td>"); 13725 - html += 13726 - wxT 13727 - ("<td bgcolor=\"#f0fff0\">returns the current SpatiaLite version</td></tr>"); 13728 - html += 13729 - wxT 13730 - ("<tr><td bgcolor=\"#fffff0\">spatialite_target_cpu( void ) : String</td>"); 13731 - html += 13732 - wxT 13733 - ("<td bgcolor=\"#f0fff0\">returns the current SpatiaLite Target CPU</td></tr>"); 13734 - html += 13735 - wxT("<tr><td bgcolor=\"#fffff0\">proj4_version( void ) : String</td>"); 13736 - html += 13737 - wxT 13738 - ("<td bgcolor=\"#f0fff0\">returns the current PROJ.4 version, or NULL if PROJ.4 is currently unsupported</td></tr>"); 13739 - html += wxT("<tr><td bgcolor=\"#fffff0\">geos_version( void ) : String</td>"); 13740 - html += 13741 - wxT 13742 - ("<td bgcolor=\"#f0fff0\">returns the current GEOS version, or NULL if GEOS is currently unsupported</td></tr>"); 13743 - html += 13744 - wxT("<tr><td bgcolor=\"#fffff0\">rttopo_version( void ) : String</td>"); 13745 - html += 13746 - wxT 13747 - ("<td bgcolor=\"#f0fff0\">returns the current RTTOPO version, or NULL if RTTOPO is currently unsupported</td></tr>"); 13748 - html += 13749 - wxT("<tr><td bgcolor=\"#fffff0\">libxml2_version( void ) : String</td>"); 13750 - html += 13751 - wxT 13752 - ("<td bgcolor=\"#f0fff0\">returns the current LibXML2 version, or NULL if LibXML2 is currently unsupported</td></tr>"); 13753 - html += wxT("<tr><td bgcolor=\"#fffff0\">HasIconv( void ) : Boolean</td>"); 13754 - html += 13755 - wxT 13756 - ("<td bgcolor=\"#f0fff0\">TRUE if the underlaying library was built enabling ICONV</td></tr>"); 13757 - html += wxT("<tr><td bgcolor=\"#fffff0\">HasMathSQL( void ) : Boolean</td>"); 13758 - html += 13759 - wxT 13760 - ("<td bgcolor=\"#f0fff0\">TRUE if the underlaying library was built enabling MATHSQL</td></tr>"); 13761 - html += 13762 - wxT("<tr><td bgcolor=\"#fffff0\">HasGeoCallbacks( void ) : Boolean</td>"); 13763 - html += 13764 - wxT 13765 - ("<td bgcolor=\"#f0fff0\">TRUE if the underlaying library was built enabling GEOCALLBACKS</td></tr>"); 13766 - html += wxT("<tr><td bgcolor=\"#fffff0\">HasProj( void ) : Boolean</td>"); 13767 - html += 13768 - wxT 13769 - ("<td bgcolor=\"#f0fff0\">TRUE if the underlaying library was built enabling PROJ</td></tr>"); 13770 - html += wxT("<tr><td bgcolor=\"#fffff0\">HasGeos( void ) : Boolean</td>"); 13771 - html += 13772 - wxT 13773 - ("<td bgcolor=\"#f0fff0\">TRUE if the underlaying library was built enabling GEOS</td></tr>"); 13774 - html += 13775 - wxT("<tr><td bgcolor=\"#fffff0\">HasGeosAdvanced( void ) : Boolean</td>"); 13776 - html += 13777 - wxT 13778 - ("<td bgcolor=\"#f0fff0\">TRUE if the underlaying library was built enabling GEOSADVANCED</td></tr>"); 13779 - html += 13780 - wxT("<tr><td bgcolor=\"#fffff0\">HasGeosTrunk( void ) : Boolean</td>"); 13781 - html += 13782 - wxT 13783 - ("<td bgcolor=\"#f0fff0\">TRUE if the underlaying library was built enabling GEOSTRUNK</td></tr>"); 13784 - html += wxT("<tr><td bgcolor=\"#fffff0\">HasRtTopo( void ) : Boolean</td>"); 13785 - html += 13786 - wxT 13787 - ("<td bgcolor=\"#f0fff0\">TRUE if the underlaying library was built enabling RTTOPO</td></tr>"); 13788 - html += wxT("<tr><td bgcolor=\"#fffff0\">HasLibXML2( void ) : Boolean</td>"); 13789 - html += 13790 - wxT 13791 - ("<td bgcolor=\"#f0fff0\">TRUE if the underlaying library was built enabling LibXML2</td></tr>"); 13792 - html += wxT("<tr><td bgcolor=\"#fffff0\">HasEpsg( void ) : Boolean</td>"); 13793 - html += 13794 - wxT 13795 - ("<td bgcolor=\"#f0fff0\">TRUE if the underlaying library was built enabling EPSG</td></tr>"); 13796 - html += wxT("<tr><td bgcolor=\"#fffff0\">HasFreeXL( void ) : Boolean</td>"); 13797 - html += 13798 - wxT 13799 - ("<td bgcolor=\"#f0fff0\">TRUE if the underlaying library was built enabling FreeXL</td></tr>"); 13800 - html += 13801 - wxT 13802 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"generic\">generic SQL functions</a></a>"); 13803 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 13804 - html += 13805 - wxT 13806 - ("<tr><td bgcolor=\"#fffff0\">CastToInteger( value Generic ) : Integer</td>"); 13807 - html += 13808 - wxT 13809 - ("<td bgcolor=\"#f0fff0\">returns the intput value possibly casted to the Integer data-type: NULL if no conversion is possible.</td></tr>"); 13810 - html += 13811 - wxT 13812 - ("<tr><td bgcolor=\"#fffff0\">CastToDouble( value Generic ) : Double precision</td>"); 13813 - html += 13814 - wxT 13815 - ("<td bgcolor=\"#f0fff0\">returns the intput value possibly casted to the Double data-type: NULL if no conversion is possible.</td></tr>"); 13816 - html += 13817 - wxT 13818 - ("<tr><td bgcolor=\"#fffff0\">CastToText( value Generic ) : Text<hr>CastToText( value Generic ) : Text</td>"); 13819 - html += 13820 - wxT 13821 - ("<td bgcolor=\"#f0fff0\">returns the intput value possibly casted to the Text data-type: NULL if no conversion is possible.<br>"); 13822 - html += 13823 - wxT 13824 - ("If an optional argument \"zero_pad\" is passed and the input value is of the Integer or Double type, then the returned string will be padded using as much trailing ZEROs so to ensure the required length.</td></tr>"); 13825 - html += 13826 - wxT("<tr><td bgcolor=\"#fffff0\">CastToBlob( value Generic ) : Blob<hr>"); 13827 - html += wxT("(CastToBlob (value Generic , hex_input Boolean ) : Blob</td>"); 13828 - html += 13829 - wxT 13830 - ("<td bgcolor=\"#f0fff0\">returns the intput value possibly casted to the Blob data-type: NULL if no conversion is possible.</td></tr>"); 13831 - html += 13832 - wxT 13833 - ("<tr><td bgcolor=\"#fffff0\">ForceAsNull( val1 Generic , val2 Generic ) : Generic</td>"); 13834 - html += 13835 - wxT 13836 - ("<td bgcolor=\"#f0fff0\">if \"val1\" and \"val2\" are equal (and exactly of the same data-type) NULL will be returned; "); 13837 - html += 13838 - wxT 13839 - ("otherwise \"val1\" will be returned absolutely untouched and still preserving its originale data-type.</td></tr>"); 13840 - html += wxT("<tr><td bgcolor=\"#fffff0\">CreateUUID( void ) : Text</td>"); 13841 - html += 13842 - wxT 13843 - ("<td bgcolor=\"#f0fff0\">returns a Version 4 (random) UUID (<b>Universally unique identifier</b>).</td></tr>"); 13844 - html += 13845 - wxT("<tr><td bgcolor=\"#fffff0\">MD5Checksum( BLOB | TEXT ) : Text</td>"); 13846 - html += 13847 - wxT 13848 - ("<td bgcolor=\"#f0fff0\">returns the MD5 checksum corresponding to the input value.<br>Will return NULL for non-BLOB input.</td></tr>"); 13849 - html += 13850 - wxT 13851 - ("<tr><td bgcolor=\"#fffff0\">MD5TotalChecksum( BLOB | TEXT ) : Text</td>"); 13852 - html += 13853 - wxT 13854 - ("<td bgcolor=\"#f0fff0\">returns a cumulative MD5 checksum.<br><b><u>Aggregate function</u></b>.</td></tr>"); 13855 - html += 13856 - wxT 13857 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"error\">SQL functions reporting "); 13858 - html += wxT("GEOS / RTTOPO errors and warnings</a></a>"); 13859 - html += 13860 - wxT 13861 - ("<tr><td bgcolor=\"#fffff0\">GEOS_GetLastWarningMsg( void ) : <i>String</td>"); 13862 - html += 13863 - wxT 13864 - ("<td bgcolor=\"#f0fff0\">Will return the most recent warning message returned by GEOS (if any).<hr>"); 13865 - html += 13866 - wxT("NULL will be returned if there is no pending GEOS warning.</td></tr>"); 13867 - html += 13868 - wxT 13869 - ("<tr><td bgcolor=\"#fffff0\">GEOS_GetLastErrorMsg( void ) : String</td>"); 13870 - html += 13871 - wxT 13872 - ("<td bgcolor=\"#f0fff0\">Will return the most recent error message returned by GEOS (if any).<hr>"); 13873 - html += 13874 - wxT("NULL will be returned if there is no pending GEOS error.</td></tr>"); 13875 - html += 13876 - wxT 13877 - ("<tr><td bgcolor=\"#fffff0\">GEOS_GetLastAuxErrorMsg( void ) : String</td>"); 13878 - html += 13879 - wxT 13880 - ("<td bgcolor=\"#f0fff0\">Will return the most recent (auxiliary) error message returned by GEOS (if any).<hr>"); 13881 - html += 13882 - wxT 13883 - ("NULL will be returned if there is no pending GEOS (auxiliary) error.</td></tr>"); 13884 - html += 13885 - wxT 13886 - ("<tr><td bgcolor=\"#fffff0\">GEOS_GetCriticalPointFromMsg( void ) : Point<hr>"); 13887 - html += wxT("GEOS_GetCriticalPointFromMsg( SRID Integer ) : Point</td>"); 13888 - html += 13889 - wxT 13890 - ("<td bgcolor=\"#f0fff0\">Will (possibly) return a Point Geometry extracted from the latest error / warning "); 13891 - html += 13892 - wxT 13893 - ("message returned by GEOS.<hr>NULL will be returned if there is no pending GEOS message, or if the "); 13894 - html += 13895 - wxT("current GEOS message doesn't contain a critical Point.</td></tr>"); 13896 - html += 13897 - wxT 13898 - ("<tr><td bgcolor=\"#fffff0\">RTTOPO_GetLastWarningMsg( void ) : String</td>"); 13899 - html += 13900 - wxT 13901 - ("<td bgcolor=\"#f0fff0\">Will return the most recent warning message returned by RTTOPO (if any).<hr>"); 13902 - html += 13903 - wxT("NULL will be returned if there is no pending RTTOPO error.</td></tr>"); 13904 - html += 13905 - wxT 13906 - ("<tr><td bgcolor=\"#fffff0\">RTTOPO_GetLastErrorMsg( void ) : String</td>"); 13907 - html += 13908 - wxT 13909 - ("<td bgcolor=\"#f0fff0\">Will return the most recent error message returned by RTTOPO (if any).<hr>"); 13910 - html += 13911 - wxT("NULL will be returned if there is no pending RTTOPO error.</td></tr>"); 13912 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 13913 - html += 13914 - wxT 13915 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"math\">SQL math functions</a></a>"); 13916 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 13917 - html += 13918 - wxT 13919 - ("<tr><td bgcolor=\"#fffff0\">Abs( x Double precision ) : Double precision</td>"); 13920 - html += 13921 - wxT 13922 - ("<td bgcolor=\"#f0fff0\">returns the absolute value of <i>x</i></td></tr>"); 13923 - html += 13924 - wxT 13925 - ("<tr><td bgcolor=\"#fffff0\">Acos( x Double precision ) : Double precision</td>"); 13926 - html += 13927 - wxT 13928 - ("<td bgcolor=\"#f0fff0\">returns the arc cosine of <i>x</i>, that is, the value whose cosine is <i>x</i><br>"); 13929 - html += wxT("returns NULL if <i>x</i> is not in the range -1 to 1</td></tr>"); 13930 - html += 13931 - wxT 13932 - ("<tr><td bgcolor=\"#fffff0\">Asin( x Double precision ) : Double precision</td>"); 13933 - html += 13934 - wxT 13935 - ("<td bgcolor=\"#f0fff0\">returns the arc sine of <i>x</i>, that is, the value whose sine is <i>x</i><br>"); 13936 - html += wxT("returns NULL if <i>x</i> is not in the range -1 to 1</td></tr>"); 13937 - html += 13938 - wxT 13939 - ("<tr><td bgcolor=\"#fffff0\">Atan( x Double precision ) : Double precision</td>"); 13940 - html += 13941 - wxT 13942 - ("<td bgcolor=\"#f0fff0\">returns the arc tangent of <i>x</i>, that is, the value whose tangent is <i>x</i></td></tr>"); 13943 - html += 13944 - wxT 13945 - ("<tr><td bgcolor=\"#fffff0\">Ceil( x Double precision ) : Double precision<hr>"); 13946 - html += wxT("Ceiling( x Double precision ) : Double precision</td>"); 13947 - html += 13948 - wxT 13949 - ("<td bgcolor=\"#f0fff0\">returns the smallest integer value not less than <i>x</i></td></tr>"); 13950 - html += 13951 - wxT 13952 - ("<tr><td bgcolor=\"#fffff0\">Cos( x Double precision ) : Double precision</td>"); 13953 - html += 13954 - wxT 13955 - ("<td bgcolor=\"#f0fff0\">returns the cosine of <i>x</i>, where <i>x</i> is given in <u>radians</u></td></tr>"); 13956 - html += 13957 - wxT 13958 - ("<tr><td bgcolor=\"#fffff0\">Cot( x Double precision ) : Double precision</td>"); 13959 - html += 13960 - wxT 13961 - ("<td bgcolor=\"#f0fff0\">returns the cotangent of <i>x</i>, where <i>x</i> is given in <u>radians</u></td></tr>"); 13962 - html += 13963 - wxT 13964 - ("<tr><td bgcolor=\"#fffff0\">Degrees( x Double precision ) : Double precision</td>"); 13965 - html += 13966 - wxT 13967 - ("<td bgcolor=\"#f0fff0\">returns the argument <i>x</i>, converted from radians to degrees</td></tr>"); 13968 - html += 13969 - wxT 13970 - ("<tr><td bgcolor=\"#fffff0\">Exp( x Double precision ) : Double precision</td>"); 13971 - html += 13972 - wxT 13973 - ("<td bgcolor=\"#f0fff0\">returns the value of <b><i>e</i></b> (the base of natural logarithms) raised to the power of <i>x</i><hr>"); 13974 - html += 13975 - wxT 13976 - ("the inverse of this function is <i>Log()</i> (using a single argument only) or <i>Ln()</i></td></tr>"); 13977 - html += 13978 - wxT 13979 - ("<tr><td bgcolor=\"#fffff0\">Floor( x Double precision ) : Double precision</td>"); 13980 - html += 13981 - wxT 13982 - ("<td bgcolor=\"#f0fff0\">returns the largest integer value not greater than <i>x</i></td></tr>"); 13983 - html += 13984 - wxT 13985 - ("<tr><td bgcolor=\"#fffff0\">Ln( x Double precision ) : Double precision<hr>"); 13986 - html += wxT("Log( x Double precision ) : Double precision</td>"); 13987 - html += 13988 - wxT 13989 - ("<td bgcolor=\"#f0fff0\">returns the natural logarithm of <i>x</i>; that is, the base-<b><i>e</i></b> logarithm of <i>x</i><br>"); 13990 - html += 13991 - wxT 13992 - ("If <i>x</i> is less than or equal to 0, then NULL is returned</td></tr>"); 13993 - html += 13994 - wxT 13995 - ("<tr><td bgcolor=\"#fffff0\">Log( b Double precision, x Double precision ) : Double precision</td>"); 13996 - html += 13997 - wxT 13998 - ("<td bgcolor=\"#f0fff0\">returns the logarithm of <i>x</i> to the base <i>b</i><br>"); 13999 - html += 14000 - wxT 14001 - ("If <i>x</i> is less than or equal to 0, or if <i>b</i> is less than or equal to 1, then NULL is returned<hr>"); 14002 - html += 14003 - wxT 14004 - ("<i>Log(b, x)</i> is equivalent to <i>Log(x)</i> / <i>Log(b)</i></td></tr>"); 14005 - html += 14006 - wxT 14007 - ("<tr><td bgcolor=\"#fffff0\">Log2( x Double precision ) : Double precision</td>"); 14008 - html += 14009 - wxT("<td bgcolor=\"#f0fff0\">returns the base-2 logarithm of <i>x</i><hr>"); 14010 - html += 14011 - wxT 14012 - ("<i>Log2(x)</i> is equivalent to <i>Log(x)</i> / <i>Log(2)</i></td></tr>"); 14013 - html += 14014 - wxT 14015 - ("<tr><td bgcolor=\"#fffff0\">Log10( x Double precision ) : Double precision</td>"); 14016 - html += 14017 - wxT 14018 - ("<td bgcolor=\"#f0fff0\">returns the base-10 logarithm of <i>x</i><hr>"); 14019 - html += 14020 - wxT 14021 - ("<i>Log10(x)</i> is equivalent to <i>Log(x)</i> / <i>Log(10)</i></td></tr>"); 14022 - html += wxT("<tr><td bgcolor=\"#fffff0\">PI( void ) : Double precision</td>"); 14023 - html += 14024 - wxT("<td bgcolor=\"#f0fff0\">returns the value of <i>PI</i></td></tr>"); 14025 - html += 14026 - wxT 14027 - ("<tr><td bgcolor=\"#fffff0\">Pow( x Double precision, y Double precision ) : Double precision<hr>"); 14028 - html += 14029 - wxT 14030 - ("Power( x Double precision, y Double precision ) : Double precision</td>"); 14031 - html += 14032 - wxT 14033 - ("<td bgcolor=\"#f0fff0\">returns the value of <i>x</i> raised to the power of <i>y</i></td></tr>"); 14034 - html += 14035 - wxT 14036 - ("<tr><td bgcolor=\"#fffff0\">Radians( x Double precision ) : Double precision</td>"); 14037 - html += 14038 - wxT 14039 - ("<td bgcolor=\"#f0fff0\">returns the argument <i>x</i>, converted from degrees to radians</td></tr>"); 14040 - html += 14041 - wxT 14042 - ("<tr><td bgcolor=\"#fffff0\">Sign( x Double precision ) : Double precision</td>"); 14043 - html += 14044 - wxT 14045 - ("<td bgcolor=\"#f0fff0\">returns the sign of the argument as -1, 0, or 1, "); 14046 - html += 14047 - wxT 14048 - ("depending on whether <i>x</i> is negative, zero, or positive.</td></tr>"); 14049 - html += 14050 - wxT 14051 - ("<tr><td bgcolor=\"#fffff0\">Sin( x Double precision ) : Double precision</td>"); 14052 - html += 14053 - wxT 14054 - ("<td bgcolor=\"#f0fff0\">returns the sine of <i>x</i>, where <i>x</i> is given in <u>radians</u></td></tr>"); 14055 - html += 14056 - wxT 14057 - ("<tr><td bgcolor=\"#fffff0\">Sqrt( x Double precision ) : Double precision</td>"); 14058 - html += 14059 - wxT 14060 - ("<td bgcolor=\"#f0fff0\">returns the square root of a non-negative number <i>x</i></td></tr>"); 14061 - html += 14062 - wxT 14063 - ("<tr><td bgcolor=\"#fffff0\">Stddev_pop( x Double precision ) : Double precision</td>"); 14064 - html += 14065 - wxT 14066 - ("<td bgcolor=\"#f0fff0\">returns the population standard deviation of the input values<br>"); 14067 - html += wxT("<b><u>aggregate function</u></b></u></td></tr>"); 14068 - html += 14069 - wxT 14070 - ("<tr><td bgcolor=\"#fffff0\">Stddev_samp( x Double precision ) : Double precision</td>"); 14071 - html += 14072 - wxT 14073 - ("<td bgcolor=\"#f0fff0\">returns the sample standard deviation of the input values<br>"); 14074 - html += wxT("<b><u>aggregate function</u></b></u></td></tr>"); 14075 - html += 14076 - wxT 14077 - ("<tr><td bgcolor=\"#fffff0\">Tan( x Double precision ) : Double precision</td>"); 14078 - html += 14079 - wxT 14080 - ("<td bgcolor=\"#f0fff0\">returns the tangent of <i>x</i>, where <i>x</i> is given in <u>radians</u></td></tr>"); 14081 - html += 14082 - wxT 14083 - ("<tr><td bgcolor=\"#fffff0\">Var_pop( x Double precision ) : Double precision</td>"); 14084 - html += 14085 - wxT 14086 - ("<td bgcolor=\"#f0fff0\">returns the population variance of the input values (<i>square of the population standard deviation</i>)<br>"); 14087 - html += wxT("<b><u>aggregate function</u></b></u></td></tr>"); 14088 - html += 14089 - wxT 14090 - ("<tr><td bgcolor=\"#fffff0\">Var_samp( x Double precision ) : Double precision</td>"); 14091 - html += 14092 - wxT 14093 - ("<td bgcolor=\"#f0fff0\">returns the sample variance of the input values (<i>square of the sample standard deviation</i>)<br>"); 14094 - html += wxT("<b><u>aggregate function</u></b></u></td></tr>"); 14095 - html += 14096 - wxT 14097 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"length_cvt\">SQL length/distance unit-conversion functions</a></a>"); 14098 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 14099 - html += 14100 - wxT 14101 - ("<tr><td bgcolor=\"#fffff0\">CvtToKm( x Double precision ) : Double precision<hr>CvtFromKm( x Double precision ) : Double precision</td>"); 14102 - html += wxT("<td bgcolor=\"#f0fff0\">meters / kilometers</td></tr>"); 14103 - html += 14104 - wxT 14105 - ("<tr><td bgcolor=\"#fffff0\">CvtToDm( x Double precision ) : Double precision<hr>CvtFromDm( x Double precision ) : Double precision</td>"); 14106 - html += wxT("<td bgcolor=\"#f0fff0\">meters / decimeters</td></tr>"); 14107 - html += 14108 - wxT 14109 - ("<tr><td bgcolor=\"#fffff0\">CvtToCm( x Double precision ) : Double precision<hr>CvtFromCm( x Double precision ) : Double precision</td>"); 14110 - html += wxT("<td bgcolor=\"#f0fff0\">meters / centimeters</td></tr>"); 14111 - html += 14112 - wxT 14113 - ("<tr><td bgcolor=\"#fffff0\">CvtToMm( x Double precision ) : Double precision<hr>CvtFromMm( x Double precision ) : Double precision</td>"); 14114 - html += wxT("<td bgcolor=\"#f0fff0\">meters / millimeters</td></tr>"); 14115 - html += 14116 - wxT 14117 - ("<tr><td bgcolor=\"#fffff0\">CvtToKmi( x Double precision ) : Double precision<hr>CvtFromKmi( x Double precision ) : Double precision</td>"); 14118 - html += 14119 - wxT 14120 - ("<td bgcolor=\"#f0fff0\">meters / internation nautical miles</td></tr>"); 14121 - html += 14122 - wxT 14123 - ("<tr><td bgcolor=\"#fffff0\">CvtToIn( x Double precision ) : Double precision<hr>CvtFromIn( x Double precision ) : Double precision</td>"); 14124 - html += 14125 - wxT("<td bgcolor=\"#f0fff0\">meters / international inches</td></tr>"); 14126 - html += 14127 - wxT 14128 - ("<tr><td bgcolor=\"#fffff0\">CvtToFt( x Double precision ) : Double precision<hr>CvtFromFt( x Double precision ) : Double precision</td>"); 14129 - html += wxT("<td bgcolor=\"#f0fff0\">meters / international feet</td></tr>"); 14130 - html += 14131 - wxT 14132 - ("<tr><td bgcolor=\"#fffff0\">CvtToYd( x Double precision ) : Double precision<hr>CvtFromYd( x Double precision ) : Double precision</td>"); 14133 - html += wxT("<td bgcolor=\"#f0fff0\">meters / international yards</td></tr>"); 14134 - html += 14135 - wxT 14136 - ("<tr><td bgcolor=\"#fffff0\">CvtToMi( x Double precision ) : Double precision<hr>CvtFromMi( x Double precision ) : Double precision</td>"); 14137 - html += 14138 - wxT 14139 - ("<td bgcolor=\"#f0fff0\">meters / international statute miles</td></tr>"); 14140 - html += 14141 - wxT 14142 - ("<tr><td bgcolor=\"#fffff0\">CvtToFath( x Double precision ) : Double precision<hr>CvtFromFath( x Double precision ) : Double precision</td>"); 14143 - html += 14144 - wxT("<td bgcolor=\"#f0fff0\">meters / international fathoms</td></tr>"); 14145 - html += 14146 - wxT 14147 - ("<tr><td bgcolor=\"#fffff0\">CvtToCh( x Double precision ) : Double precision<hr>CvtFromCh( x Double precision ) : Double precision</td>"); 14148 - html += 14149 - wxT("<td bgcolor=\"#f0fff0\">meters / international chains</td></tr>"); 14150 - html += 14151 - wxT 14152 - ("<tr><td bgcolor=\"#fffff0\">CvtToLink( x Double precision ) : Double precision<hr>CvtFromLink( x Double precision ) : Double precision</td>"); 14153 - html += wxT("<td bgcolor=\"#f0fff0\">meters / international links</td></tr>"); 14154 - html += 14155 - wxT 14156 - ("<tr><td bgcolor=\"#fffff0\">CvtToUsIn( x Double precision ) : Double precision<hr>CvtFromUsIn( x Double precision ) : Double precision</td>"); 14157 - html += wxT("<td bgcolor=\"#f0fff0\">meters / U.S. inches</td></tr>"); 14158 - html += 14159 - wxT 14160 - ("<tr><td bgcolor=\"#fffff0\">CvtToUsFt( x Double precision ) : Double precision<hr>CvtFromUsFt( x Double precision ) : Double precision</td>"); 14161 - html += wxT("<td bgcolor=\"#f0fff0\">meters / U.S. feet</td></tr>"); 14162 - html += 14163 - wxT 14164 - ("<tr><td bgcolor=\"#fffff0\">CvtToUsYd( x Double precision ) : Double precision<hr>CvtFromUsYd( x Double precision ) : Double precision</td>"); 14165 - html += wxT("<td bgcolor=\"#f0fff0\">meters / U.S. yards</td></tr>"); 14166 - html += 14167 - wxT 14168 - ("<tr><td bgcolor=\"#fffff0\">CvtToUsMi( x Double precision ) : Double precision<hr>CvtFromUsMi( x Double precision ) : Double precision</td>"); 14169 - html += wxT("<td bgcolor=\"#f0fff0\">meters / U.S. statute miles</td></tr>"); 14170 - html += 14171 - wxT 14172 - ("<tr><td bgcolor=\"#fffff0\">CvtToUsCh( x Double precision ) : Double precision<hr>CvtFromUsCh( x Double precision ) : Double precision</td>"); 14173 - html += wxT("<td bgcolor=\"#f0fff0\">meters / U.S. chains</td></tr>"); 14174 - html += 14175 - wxT 14176 - ("<tr><td bgcolor=\"#fffff0\">CvtToIndFt( x Double precision ) : Double precision<hr>CvtFromIndFt( x Double precision ) : Double precision</td>"); 14177 - html += wxT("<td bgcolor=\"#f0fff0\">meters / indian feet</td></tr>"); 14178 - html += 14179 - wxT 14180 - ("<tr><td bgcolor=\"#fffff0\">CvtToIndYd( x Double precision ) : Double precision<hr>CvtFromIndYd( x Double precision ) : Double precision</td>"); 14181 - html += wxT("<td bgcolor=\"#f0fff0\">meters / indian yards</td></tr>"); 14182 - html += 14183 - wxT 14184 - ("<tr><td bgcolor=\"#fffff0\">CvtToIndCh( x Double precision ) : Double precision<hr>CvtFromIndCh( x Double precision ) : Double precision</td>"); 14185 - html += wxT("<td bgcolor=\"#f0fff0\">meters / indian chains</td></tr>"); 14186 - html += 14187 - wxT 14188 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"dms_cvt\">DD/DMS conversion functions (longitude/latitude)</a></a>"); 14189 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 14190 - html += 14191 - wxT 14192 - ("<tr><td bgcolor=\"#fffff0\">LongLatToDMS( longitude Double precision , latitude Double precision ) : String</td>"); 14193 - html += 14194 - wxT 14195 - ("<td bgcolor=\"#f0fff0\">will return a DMS string (Degrees, Minutes and Seconds) starting from DD (Decimal Degrees) input coordinates<hr>"); 14196 - html += wxT("NULL will be returned on invalid input.</td></tr>"); 14197 - html += 14198 - wxT 14199 - ("<tr><td bgcolor=\"#fffff0\">LongitudeFromDMS( dms_expression String ) : Double precision<hr>LatitudeFromDMS( dms_expression String ) : Double precision</td>"); 14200 - html += 14201 - wxT 14202 - ("<td bgcolor=\"#f0fff0\">will return the DD coordinates from within a DMS expression<hr>"); 14203 - html += wxT("NULL will be returned on invalid input.</td></tr>"); 14204 - html += 14205 - wxT 14206 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"blob\">SQL utility functions for BLOB objects</a></a>"); 14207 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 14208 - html += 14209 - wxT("<tr><td bgcolor=\"#fffff0\">IsZipBlob( content Blob ) : Integer</td>"); 14210 - html += 14211 - wxT 14212 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.<br>"); 14213 - html += 14214 - wxT 14215 - ("TRUE if this BLOB object corresponds to a valid ZIP-compressed file</td></tr>"); 14216 - html += 14217 - wxT("<tr><td bgcolor=\"#fffff0\">IsPdfBlob( content Blob ) : Integer</td>"); 14218 - html += 14219 - wxT 14220 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.<br>"); 14221 - html += 14222 - wxT 14223 - ("TRUE if this BLOB object corresponds to a valid PDF document</td></tr>"); 14224 - html += 14225 - wxT("<tr><td bgcolor=\"#fffff0\">IsGifBlob( image Blob ) : Integer</td>"); 14226 - html += 14227 - wxT 14228 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.<br>"); 14229 - html += 14230 - wxT("TRUE if this BLOB object corresponds to a valid GIF image</td></tr>"); 14231 - html += 14232 - wxT("<tr><td bgcolor=\"#fffff0\">IsPngBlob( image Blob ) : Integer</td>"); 14233 - html += 14234 - wxT 14235 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.<br>"); 14236 - html += 14237 - wxT("TRUE if this BLOB object corresponds to a valid PNG image</td></tr>"); 14238 - html += 14239 - wxT("<tr><td bgcolor=\"#fffff0\">IsTiffBlob( image Blob ) : Integer</td>"); 14240 - html += 14241 - wxT 14242 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.<br>"); 14243 - html += 14244 - wxT("TRUE if this BLOB object corresponds to a valid TIFF image</td></tr>"); 14245 - html += 14246 - wxT("<tr><td bgcolor=\"#fffff0\">IsJpegBlob( image Blob ) : Integer</td>"); 14247 - html += 14248 - wxT 14249 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.<br>"); 14250 - html += 14251 - wxT("TRUE if this BLOB object corresponds to a valid JPEG image</td></tr>"); 14252 - html += 14253 - wxT("<tr><td bgcolor=\"#fffff0\">IsExifBlob( image Blob ) : Integer</td>"); 14254 - html += 14255 - wxT 14256 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.<br>"); 14257 - html += wxT("TRUE if this BLOB object corresponds to a valid EXIF image<br>"); 14258 - html += 14259 - wxT 14260 - ("<u>Please note:</u> any valid EXIF image is a valid JPEG as well</td></tr>"); 14261 - html += 14262 - wxT 14263 - ("<tr><td bgcolor=\"#fffff0\">IsExifGpsBlob( image Blob ) : Integer</td>"); 14264 - html += 14265 - wxT 14266 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.<br>"); 14267 - html += 14268 - wxT("TRUE if this BLOB object corresponds to a valid EXIF-GPS image<br>"); 14269 - html += 14270 - wxT 14271 - ("<u>Please note:</u> any valid EXIF-GPS image is a valid EXIF and JPEG as well</td></tr>"); 14272 - html += 14273 - wxT("<tr><td bgcolor=\"#fffff0\">IsWebpBlob( image Blob ) : Integer</td>"); 14274 - html += 14275 - wxT 14276 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.<br>"); 14277 - html += 14278 - wxT("TRUE if this BLOB object corresponds to a valid WebP image</td></tr>"); 14279 - html += 14280 - wxT 14281 - ("<tr><td bgcolor=\"#fffff0\">GetMimeType( payload Blob ) : String</td>"); 14282 - html += wxT("<td bgcolor=\"#f0fff0\">The return type is Text.<br>"); 14283 - html += 14284 - wxT 14285 - ("NULL could be returned for an invalid argument or if no valid mime-type is detected.</td></tr>"); 14286 - html += 14287 - wxT 14288 - ("<tr><td bgcolor=\"#fffff0\">BlobFromFile( filepath String ) : BLOB</td>"); 14289 - html += 14290 - wxT 14291 - ("<td bgcolor=\"#f0fff0\">If filepath corresponds to some valid pathname, and the corresponding file "); 14292 - html += 14293 - wxT 14294 - ("can be actually accessed in read mode, then the whole file content will be returned as a BLOB value.<br>"); 14295 - html += 14296 - wxT 14297 - ("Otherwise NULL will be returned.<br><u>Please note:</u> SQLite doesn't support BLOB values bigger than SQLITE_MAX_LENGTH (usually, 1 GB).<hr>"); 14298 - html += 14299 - wxT 14300 - ("<u>Please note</u>: security restrictions apply to this function, which is really supported only when the environment variable \"SPATIALTE_SECURITY=relaxed\" is explicitly set.</td></tr>"); 14301 - html += 14302 - wxT 14303 - ("<tr><td bgcolor=\"#fffff0\">BlobToFile( payload BLOB , filepath String ) : Integer</td>"); 14304 - html += 14305 - wxT 14306 - ("<td bgcolor=\"#f0fff0\">If payload is of the BLOB-type, and if filepath corresponds to some valid pathname "); 14307 - html += 14308 - wxT 14309 - ("(accessible in write/create mode), then the corresponding file will be created/overwritten so to contain the payload.<br>"); 14310 - html += 14311 - wxT 14312 - ("The return type is Integer, with a return value of 1 for success, 0 for failure.<hr>"); 14313 - html += 14314 - wxT 14315 - ("<u>Please note</u>: security restrictions apply to this function, which is really supported only when the environment variable \"SPATIALTE_SECURITY=relaxed\" is explicitly set.</td></tr>"); 14316 - html += 14317 - wxT("<tr><td bgcolor=\"#fffff0\">CountUnsafeTriggers( ) : Integer</td>"); 14318 - html += 14319 - wxT 14320 - ("<td bgcolor=\"#f0fff0\">This SQL function checks if the currently connected DB does contain any potentially malicious Trigger; "); 14321 - html += 14322 - wxT 14323 - ("carefully checking this conditions is a minimal precaution expected to be always verified before eventually activating the \"SPATIALITE_SECURITY=relaxed\" mode.<hr>"); 14324 - html += 14325 - wxT 14326 - ("The return type is Integer (total count of suspected Triggers); 0 means that the currently connected DB should be considered absolutely safe.</td></tr>"); 14327 - html += 14328 - wxT 14329 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"c30\">SQL utility functions [<i>non-standard</i>] for geometric objects</a></a>"); 14330 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 14331 - html += 14332 - wxT 14333 - ("<tr><td bgcolor=\"#fffff0\">GeomFromExifGpsBlob( image Blob ) : Geometry</td>"); 14334 - html += 14335 - wxT 14336 - ("<td bgcolor=\"#f0fff0\">a POINT Geometry will be returned representing the GPS long/lat contained within EXIF-GPS <i>metadata</i> for the BLOB image<br>"); 14337 - html += 14338 - wxT 14339 - ("NULL will be returned if for any reason it's not possible to build such a POINT</td></tr>"); 14340 - html += 14341 - wxT 14342 - ("<tr><td bgcolor=\"#fffff0\">ST_Point( x Double precision , y Double precision ) : Geometry</td>"); 14343 - html += 14344 - wxT 14345 - ("<td bgcolor=\"#f0fff0\">simply an alias-name for MakePoint() (SRID is never supported).</td></tr>"); 14346 - html += 14347 - wxT 14348 - ("<tr><td bgcolor=\"#fffff0\">MakePoint( x Double precision , y Double precision [ , SRID Integer] ) : Geometry</td>"); 14349 - html += 14350 - wxT 14351 - ("<td bgcolor=\"#f0fff0\">a Geometry will be returned representing the POINT defined by [x y] coordinates</td></tr>"); 14352 - html += 14353 - wxT 14354 - ("<tr><td bgcolor=\"#fffff0\">MakePointZ( x Double precision , y Double precision , z Double precision [ , SRID Integer] ) : Geometry</td>"); 14355 - html += 14356 - wxT 14357 - ("<td bgcolor=\"#f0fff0\">a Geometry will be returned representing the POINT Z defined by [x y z] coordinates</td></tr>"); 14358 - html += 14359 - wxT 14360 - ("<tr><td bgcolor=\"#fffff0\">MakePointM( x Double precision , y Double precision , m Double precision [ , SRID Integer] ) : Geometry</td>"); 14361 - html += 14362 - wxT 14363 - ("<td bgcolor=\"#f0fff0\">a Geometry will be returned representing the POINT M defined by [x y m] coordinates</td></tr>"); 14364 - html += 14365 - wxT 14366 - ("<tr><td bgcolor=\"#fffff0\">MakePointZM( x Double precision , y Double precision , z Double precision , m Double precision "); 14367 - html += wxT("[ , SRID Integer] ) : Geometry</td>"); 14368 - html += 14369 - wxT 14370 - ("<td bgcolor=\"#f0fff0\">a Geometry will be returned representing the POINT ZM defined by [x y z m] coordinates</td></tr>"); 14371 - html += 14372 - wxT 14373 - ("<tr><td bgcolor=\"#fffff0\">MakeLine( pt1 PointGeometry , pt2 PointGeometry ) : LinestringGeometry</td>"); 14374 - html += 14375 - wxT 14376 - ("<td bgcolor=\"#f0fff0\">a Linestring Geometry will be returned representing the segment connecting pt1 to pt2<br>"); 14377 - html += wxT("NULL will be returned if any error is encountered</td></tr>"); 14378 - html += 14379 - wxT 14380 - ("<tr><td bgcolor=\"#fffff0\">MakeLine( geom PointGeometry ) : LinestringGeometry</td>"); 14381 - html += 14382 - wxT 14383 - ("<td bgcolor=\"#f0fff0\">a Linestring Geometry will be returned connecting all the input Points (accordingly to input sequence)<br>"); 14384 - html += wxT("<b><u>aggregate function</u></b><br>"); 14385 - html += wxT("NULL will be returned if any error is encountered</td></tr>"); 14386 - html += 14387 - wxT 14388 - ("<tr><td bgcolor=\"#fffff0\">MakeLine( geom MultiPointGeometry , direction Boolean ) : LinestringGeometry</td>"); 14389 - html += 14390 - wxT 14391 - ("<td bgcolor=\"#f0fff0\">a Linestring Geometry will be returned connecting all the input Points (accordingly to input sequence); \"direction=FALSE\" implies reverse order.<br>"); 14392 - html += 14393 - wxT 14394 - ("<u>Please note</u>: similar to the previuous one, but this one is an ordinary (not aggregate) function; a MultiPoint input is always expected.<hr>"); 14395 - html += wxT("NULL will be returned if any error is encountered</td></tr>"); 14396 - html += 14397 - wxT 14398 - ("<tr><td bgcolor=\"#fffff0\">MakeCircle( cx Double , cy Double , radius Double [ , SRID Integer [ , step Double ] ] ) : LinestringGeometry</td>"); 14399 - html += 14400 - wxT 14401 - ("<td bgcolor=\"#f0fff0\">will return a closed LINESTRING approximating the Circle defined by \"cx\", \"cy\" and \"radius\".<br>"); 14402 - html += 14403 - wxT 14404 - ("The optional argument \"step\" if specified defines how many points will be interpolated on the circumference; a point will be set every \"step\" degrees.<br>"); 14405 - html += 14406 - wxT 14407 - ("The implicit default setting corresponds to a point every 10 degrees.</td></tr>"); 14408 - html += 14409 - wxT 14410 - ("<tr><td bgcolor=\"#fffff0\">MakeEllipse( cx Double , cy Double , x_axis Double , y_axus Double [ , SRID Integer [ , step Double ] ] ) : LinestringGeometry</td>"); 14411 - html += 14412 - wxT 14413 - ("<td bgcolor=\"#f0fff0\">will return a closed LINESTRING approximating the Ellipsee defined by \"cx\", \"cy\" and \"x_axis\", \"y_axis\".<br>"); 14414 - html += 14415 - wxT 14416 - ("The optional argument \"step\" if specified defines how many points will be interpolated on the ellipse; a point will be set every \"step\" degrees.<br>"); 14417 - html += 14418 - wxT 14419 - ("The implicit default setting corresponds to a point every 10 degrees.</td></tr>"); 14420 - html += 14421 - wxT 14422 - ("<tr><td bgcolor=\"#fffff0\">MakeArc( cx Double , cy Double , radius Double , start Double , stop Double [ , SRID Integer [ , step Double ] ] ) : LinestringGeometry</td>"); 14423 - html += 14424 - wxT 14425 - ("<td bgcolor=\"#f0fff0\">will return a LINESTRING approximating the Circular Arc defined by \"cx\", \"cy\" and \"radius\"; the arc's extremities will be defined by \"start\", \"stop\" angles expressed in degrees.<br>"); 14426 - html += 14427 - wxT 14428 - ("The optional argument \"step\" if specified defines how many points will be interpolated on the circumference; a point will be set every \"step\" degrees.<br>"); 14429 - html += 14430 - wxT 14431 - ("The implicit default setting corresponds to a point every 10 degrees.</td></tr>"); 14432 - html += 14433 - wxT 14434 - ("<tr><td bgcolor=\"#fffff0\">MakeEllipticArc( cx Double , cy Double , x_axis Double , y_axis Double, start Double , stop Double [ , SRID Integer [ , step Double ] ] ) : LinestringGeometry</td>"); 14435 - html += 14436 - wxT 14437 - ("<td bgcolor=\"#f0fff0\">will return a LINESTRING approximating the Elliptic Arc defined by \"cx\", \"cy\" and \"x_axis\", \"y_axis\"; the arc's extremities will be defined by \"start\", \"stop\" angles expressed in degrees.<br>"); 14438 - html += 14439 - wxT 14440 - ("The optional argument \"step\" if specified defines how many points will be interpolated on the ellipse; a point will be set every \"step\" degrees.<br>"); 14441 - html += 14442 - wxT 14443 - ("The implicit default setting corresponds to a point every 10 degrees.</td></tr>"); 14444 - html += 14445 - wxT 14446 - ("<tr><td bgcolor=\"#fffff0\">MakeCircularSector( cx Double , cy Double , radius Double , start Double , stop Double [ , SRID Integer [ , step Double ] ] ) : PolygonGeometry</td>"); 14447 - html += 14448 - wxT 14449 - ("<td bgcolor=\"#f0fff0\">will return a POLYGON approximating the Circular Sector defined by \"cx\", \"cy\" and \"radius\"; the arc's extremities will be defined by \"start\", \"stop\" angles expressed in degrees.<br>"); 14450 - html += 14451 - wxT 14452 - ("The optional argument \"step\" if specified defines how many points will be interpolated on the circumference; a point will be set every \"step\" degrees.<br>"); 14453 - html += 14454 - wxT 14455 - ("The implicit default setting corresponds to a point every 10 degrees.</td></tr>"); 14456 - html += 14457 - wxT 14458 - ("<tr><td bgcolor=\"#fffff0\">MakeEllipticSector( cx Double , cy Double , x_axis Double , y_axis Double, start Double , stop Double [ , SRID Integer [ , step Double ] ] ) : PolygonGeometry</td>"); 14459 - html += 14460 - wxT 14461 - ("<td bgcolor=\"#f0fff0\">will return a POLYGON approximating the Elliptic Sector defined by \"cx\", \"cy\" and \"x_axis\", \"y_axis\"; the arc's extremities will be defined by \"start\", \"stop\" angles expressed in degrees.<br>"); 14462 - html += 14463 - wxT 14464 - ("The optional argument \"step\" if specified defines how many points will be interpolated on the ellipse; a point will be set every \"step\" degrees.<br>"); 14465 - html += 14466 - wxT 14467 - ("The implicit default setting corresponds to a point every 10 degrees.</td></tr>"); 14468 - html += 14469 - wxT 14470 - ("<tr><td bgcolor=\"#fffff0\">MakeCircularStripe( cx Double , cy Double , radius_1 Double , radius_2 Double, start Double , stop Double [ , SRID Integer [ , step Double ] ] ) : PolygonGeometry</td>"); 14471 - html += 14472 - wxT 14473 - ("<td bgcolor=\"#f0fff0\">will return a POLYGON approximating the Circular Stripe delimited by two arcs sharing the same Centre \"cx\", \"cy\" "); 14474 - html += 14475 - wxT 14476 - ("but having different radii \"radius_1\", \"radius_2\"; the arc's extremities will be defined by \"start\", \"stop\" angles expressed in degrees.<br>"); 14477 - html += 14478 - wxT 14479 - ("The optional argument \"step\" if specified defines how many points will be interpolated on the circumference; a point will be set every \"step\" degrees.<br>"); 14480 - html += 14481 - wxT 14482 - ("The implicit default setting corresponds to a point every 10 degrees.</td></tr>"); 14483 - html += 14484 - wxT 14485 - ("<tr><td bgcolor=\"#fffff0\">Collect( geom1 Geometry , geom2 Geometry ) : Geometry<hr>"); 14486 - html += wxT("ST_Collect( geom1 Geometry , geom2 Geometry ) : Geometry</td>"); 14487 - html += 14488 - wxT 14489 - ("<td bgcolor=\"#f0fff0\">a generic Geometry (possibly a GEOMETRYCOLLECTION) will be returned merging geom1 and geom2<br>"); 14490 - html += wxT("NULL will be returned if any error is encountered</td></tr>"); 14491 - html += 14492 - wxT("<tr><td bgcolor=\"#fffff0\">Collect( geom Geometry ) : Geometry<hr>"); 14493 - html += wxT("ST_Collect( geom1 Geometry , geom2 Geometry ) : Geometry</td>"); 14494 - html += 14495 - wxT 14496 - ("<td bgcolor=\"#f0fff0\">a generic Geometry (possibly a GEOMETRYCOLLECTION) will be returned merging input Geometries all together<br>"); 14497 - html += wxT("<b><u>aggregate function</u></b><br>"); 14498 - html += wxT("NULL will be returned if any error is encountered</td></tr>"); 14499 - html += 14500 - wxT 14501 - ("<tr><td bgcolor=\"#fffff0\">BuildArea( geom Geometry ) : Geometry<hr>"); 14502 - html += wxT("ST_BuildArea( geom Geometry ) : Geometry</td>"); 14503 - html += 14504 - wxT 14505 - ("<td bgcolor=\"#f0fff0\">a Geometry (actually corresponding to a POLYGON or MULTIPOLYGON) will be returned.<br>"); 14506 - html += wxT 14507 - ("The input Geometry is expected to represent a LINESTRING or a MULTILINESTRING.<br>The input Geometry can be an arbitrary collection "); 14508 - html += wxT 14509 - ("of sparse Linestrings: this function will then try to (possibly) reassemble them into one (or more) polygon(s)."); 14510 - html += wxT 14511 - ("<br>If the second [optional] argument is TRUE then a MULTIPOLYGON will be returned anyway.<br>"); 14512 - html += wxT("NULL will be returned if any error is encountered</td></tr>"); 14513 - html += 14514 - wxT 14515 - ("<tr><td bgcolor=\"#fffff0\">Polygonize( geom Geometry ) : Geometry<hr>"); 14516 - html += wxT("ST_Polygonize( geom Geometry ) : Geometry</td>"); 14517 - html += 14518 - wxT 14519 - ("<td bgcolor=\"#f0fff0\">Exactly the same as ST_BuildArea, but implemented as an <u>aggregate function</u>.<br>"); 14520 - html += wxT("NULL will be returned if any error is encountered</td></tr>"); 14521 - html += 14522 - wxT 14523 - ("<tr><td bgcolor=\"#fffff0\">LineMerge( geom Geometry ) : Geometry<hr>"); 14524 - html += wxT("ST_LineMerge( geom Geometry ) : Geometry</td>"); 14525 - html += 14526 - wxT 14527 - ("<td bgcolor=\"#f0fff0\">a Geometry (actually corresponding to a LINESTRING or MULTILINESTRING) will be returned.<br>"); 14528 - html += wxT 14529 - ("The input Geometry is expected to represent a LINESTRING or a MULTILINESTRING.<br>The input Geometry can be an arbitrary collection "); 14530 - html += wxT 14531 - ("of sparse Linestrings: this function will then try to (possibly) reassemble them into one (or more) polygon(s)."); 14532 - html += wxT 14533 - ("<br>If the second [optional] argument is TRUE then a MULTIPOLYGON will be returned anyway.<br>"); 14534 - html += wxT("NULL will be returned if any error is encountered</td></tr>"); 14535 - html += 14536 - wxT 14537 - ("<tr><td bgcolor=\"#fffff0\">MakePolygon( geom1 Geometry [ , geom2 Geometry ] ) : Geometry<hr>"); 14538 - html += 14539 - wxT 14540 - ("ST_MakePolygon( geom1 Geometry [ , geom2 Geometry ] ) : Geometry</td>"); 14541 - html += 14542 - wxT 14543 - ("<td bgcolor=\"#f0fff0\">Kind of lightweight/simplified ST_BuildArea: the first input Geometry is always "); 14544 - html += 14545 - wxT 14546 - ("expected to represent a closed LINESTRING assumed to identify the output polygon's Exterior Ring.<br>"); 14547 - html += 14548 - wxT 14549 - ("The second input Geometry (if any) is expected to be a LINESTRING or MULTILINESTRING identifying any "); 14550 - html += 14551 - wxT 14552 - ("polygon's Interior Ring (and all them are expected to be correctly closed).<br>"); 14553 - html += 14554 - wxT 14555 - ("<b><u>Please note well</u></b>: this function doesn't perform any internal topology check, so it could "); 14556 - html += 14557 - wxT 14558 - ("possibly return an invalid polygon on invalid input.<hr>NULL will be returned if any error is encountered</td></tr>"); 14559 - html += 14560 - wxT 14561 - ("<tr><td bgcolor=\"#fffff0\">LinesFromRings( geom Geometry ) : Geometry<hr>"); 14562 - html += wxT("ST_LinesFromRings( geom Geometry ) : Geometry</td>"); 14563 - html += 14564 - wxT 14565 - ("<td bgcolor=\"#f0fff0\">a Geometry (actually corresponding to a LINESTRING or MULTILINESTRING) will be returned.<br>"); 14566 - html += 14567 - wxT 14568 - ("The input Geometry is expected to be a POLYGON or MULTIPOLYGON; any RING will then be transformed into the corresponding LINESTRING.<br>"); 14569 - html += wxT("NULL will be returned if any error is encountered</td></tr>"); 14570 - html += 14571 - wxT 14572 - ("<tr><td bgcolor=\"#fffff0\">LinesCutAtNodes( geom1 Geometry , geom2 Geometry ) : Geometry<hr>"); 14573 - html += 14574 - wxT 14575 - ("ST_LinesCutAtNodes( geom1 Geometry , geom2 Geometry ) : Geometry</td>"); 14576 - html += 14577 - wxT 14578 - ("<td bgcolor=\"#f0fff0\">a Geometry (actually corresponding to a LINESTRING or MULTILINESTRING) will be returned.<br>"); 14579 - html += 14580 - wxT 14581 - ("The first input Geometry is expected to be a LINESTRING or MULTILINESTRING (Lines); "); 14582 - html += 14583 - wxT 14584 - ("the second input Geometry is expected to be a POINT or MULTIPOINT (Nodes).<br>"); 14585 - html += 14586 - wxT 14587 - ("any Line will then be possibly split in two halves where some vertex exactely intercepts a Node.<br>"); 14588 - html += wxT("NULL will be returned if any error is encountered</td></tr>"); 14589 - html += 14590 - wxT 14591 - ("<tr><td bgcolor=\"#fffff0\">RingsCutAtNodes( geom Geometry ) : Geometry<hr>"); 14592 - html += wxT("ST_RingsCutAtNodes( geom Geometry ) : Geometry</td>"); 14593 - html += 14594 - wxT 14595 - ("<td bgcolor=\"#f0fff0\">a Geometry (actually corresponding to a LINESTRING or MULTILINESTRING) will be returned.<br>"); 14596 - html += 14597 - wxT 14598 - ("The input Geometry is expected to be a POLYGON or MULTIPOLYGON (Rings); "); 14599 - html += 14600 - wxT 14601 - ("any self-intersection or intersection between Rings is assumed to represent a Node.<br>"); 14602 - html += 14603 - wxT 14604 - ("any Ring will then be possibly split in two halves where some vertex exactely intercepts a Node.<br>"); 14605 - html += wxT("NULL will be returned if any error is encountered</td></tr>"); 14606 - html += 14607 - wxT 14608 - ("<tr><td bgcolor=\"#fffff0\">DissolveSegments( geom Geometry ) : Geometry<hr>"); 14609 - html += wxT("ST_DissolveSegments( geom Geometry ) : Geometry</td>"); 14610 - html += 14611 - wxT 14612 - ("<td bgcolor=\"#f0fff0\">a Geometry (actually corresponding to a LINESTRING, MULTILINESTRING or GEOMETRYCOLLECTION) will be returned.<br>"); 14613 - html += 14614 - wxT 14615 - ("The input Geometry is arbitrary: any POINT will remain unaffected, but any LINESTRING or RING will be dissolved into elementary segments.<br>"); 14616 - html += wxT("NULL will be returned if any error is encountered</td></tr>"); 14617 - html += 14618 - wxT 14619 - ("<tr><td bgcolor=\"#fffff0\">DissolvePoints( geom Geometry ) : Geometry<hr>"); 14620 - html += wxT("ST_DissolvePoints( geom Geometry ) : Geometry</td>"); 14621 - html += 14622 - wxT 14623 - ("<td bgcolor=\"#f0fff0\">a Geometry (actually corresponding to a POINT or MULTIPOINT) will be returned.<br>"); 14624 - html += 14625 - wxT 14626 - ("The input Geometry is arbitrary: any POINT will remain unaffected, but any LINESTRING or RING will be dissolved into elementary Points corresponding to each Vertex.<br>"); 14627 - html += wxT("NULL will be returned if any error is encountered</td></tr>"); 14628 - html += 14629 - wxT 14630 - ("<tr><td bgcolor=\"#fffff0\">CollectionExtract( geom Geometry, type Integer ) : Geometry<hr>"); 14631 - html += 14632 - wxT("ST_CollectionExtract( geom Geometry, type Integer ) : Geometry</td>"); 14633 - html += 14634 - wxT 14635 - ("<td bgcolor=\"#f0fff0\">Given a GEOMETRYCOLLECTION, returns a MULTI* geometry consisting only of the specified type.<br>"); 14636 - html += 14637 - wxT 14638 - ("Sub-geometries that are not the specified type are ignored.<br>(1=POINT-type, 2=LINESTRING-type, 3=POLYGON-type)<br>"); 14639 - html += 14640 - wxT 14641 - ("NULL will be returned if any error is encountered (or when no item of required type is found)</td></tr>"); 14642 - html += 14643 - wxT 14644 - ("<tr><td bgcolor=\"#fffff0\">ST_Locate_Along_Measure( geom Geometry, m_value Double precision ) : Geometry</td>"); 14645 - html += 14646 - wxT 14647 - ("<td bgcolor=\"#f0fff0\">Return a derived geometry collection value with elements that match the specified measure.<br>"); 14648 - html += 14649 - wxT 14650 - ("NULL will be returned if any error is encountered (or when no element corresponding to the given measure is found).<br>"); 14651 - html += 14652 - wxT 14653 - ("Please note: NULL will be returned anyway if Geometry doesn't support M-dimension, or if it contains any Polygon, or if it's of the GeometryCollection type.</td></tr>"); 14654 - html += 14655 - wxT 14656 - ("<tr><td bgcolor=\"#fffff0\">ST_Locate_Between_Measures( geom Geometry, m_start Double precision , m_end Double precision ) : Geometry</td>"); 14657 - html += 14658 - wxT 14659 - ("<td bgcolor=\"#f0fff0\">Return a derived geometry collection value with elements that match the specified range of measures.<br>"); 14660 - html += 14661 - wxT 14662 - ("NULL will be returned if any error is encountered (or when no element corresponding to the given range if measures is found).<br>"); 14663 - html += 14664 - wxT 14665 - ("Please note: NULL will be returned anyway if Geometry doesn't support M-dimension, or if it contains any Polygon, or if it's of the GeometryCollection type.</td></tr>"); 14666 - html += 14667 - wxT 14668 - ("<tr><td bgcolor=\"#fffff0\">SquareGrid( geom Geometry [ , size Double precision [ , edges_only Boolean [ , origin Geometry ]] ) : Geometry<hr>"); 14669 - html += 14670 - wxT 14671 - ("ST_SquareGrid( geom Geometry [ , size Double precision [ , edges_only Boolean [ , origin Geometry ]] ) : Geometry</td>"); 14672 - html += 14673 - wxT 14674 - ("<td bgcolor=\"#f0fff0\">return a grid of square cells (having the edge length of size) precisely covering the input Geometry (expected to be a Polygon or MultiPolygon).<br>"); 14675 - html += 14676 - wxT 14677 - ("The returned Geometry will usually be of the MultiPolygon type (a collection of Squares), but will be a MultiLinestring if the optional edges_only argument is set to TRUE<br>"); 14678 - html += 14679 - wxT 14680 - ("If the optional origin argument (expected to be a Point) is not specified then the (0,0) grid origin will be assumed by default.<br>"); 14681 - html += wxT("NULL will be returned if any error is encountered.</td></tr>"); 14682 - html += 14683 - wxT 14684 - ("<tr><td bgcolor=\"#fffff0\">TriangularGrid( geom Geometry [ , size Double precision [ , edges_only Boolean [ , origin Geometry ]] ) : Geometry<hr>"); 14685 - html += 14686 - wxT 14687 - ("ST_TriangularGrid( geom Geometry [ , size Double precision [ , edges_only Boolean [ , origin Geometry ]] ) : Geometry</td>"); 14688 - html += 14689 - wxT 14690 - ("<td bgcolor=\"#f0fff0\">return a grid of square cells (having the edge length of size) precisely covering the input Geometry (expected to be a Polygon or MultiPolygon).<br>"); 14691 - html += 14692 - wxT 14693 - ("The returned Geometry will usually be of the MultiPolygon type (a collection of Triangles), but will be a MultiLinestring if the optional edges_only argument is set to TRUE<br>"); 14694 - html += 14695 - wxT 14696 - ("If the optional origin argument (expected to be a Point) is not specified then the (0,0) grid origin will be assumed by default.<br>"); 14697 - html += wxT("NULL will be returned if any error is encountered.</td></tr>"); 14698 - html += 14699 - wxT 14700 - ("<tr><td bgcolor=\"#fffff0\">HexagonalGrid( geom Geometry [ , size Double precision [ , edges_only Boolean [ , origin Geometry ]] ) : Geometry<hr>"); 14701 - html += 14702 - wxT 14703 - ("ST_HexagonalGrid( geom Geometry [ , size Double precision [ , edges_only Boolean [ , origin Geometry ]] ) : Geometry</td>"); 14704 - html += 14705 - wxT 14706 - ("<td bgcolor=\"#f0fff0\">return a grid of square cells (having the edge length of size) precisely covering the input Geometry (expected to be a Polygon or MultiPolygon).<br>"); 14707 - html += 14708 - wxT 14709 - ("The returned Geometry will usually be of the MultiPolygon type (a collection of Hexagons), but will be a MultiLinestring if the optional edges_only argument is set to TRUE<br>"); 14710 - html += 14711 - wxT 14712 - ("If the optional origin argument (expected to be a Point) is not specified then the (0,0) grid origin will be assumed by default.<br>"); 14713 - html += wxT("NULL will be returned if any error is encountered.</td></tr>"); 14714 - html += 14715 - wxT 14716 - ("<tr><td bgcolor=\"#fffff0\">DelaunayTriangulation( geom Geometry [ , edges_only Boolean [ , tolerance Double precision ]] ) : Geometry<hr>"); 14717 - html += 14718 - wxT 14719 - ("ST_DelaunayTriangulation( geom Geometry [ , edges_only Boolean [ , tolerance Double precision ]] ) : Geometry</td>"); 14720 - html += 14721 - wxT 14722 - ("<td bgcolor=\"#f0fff0\">Return the Delaunay Triangulation corresponding to the input Geometry.<br>"); 14723 - html += wxT("NULL will be returned if any error is encountered.</td></tr>"); 14724 - html += 14725 - wxT 14726 - ("<tr><td bgcolor=\"#fffff0\">VoronojDiagram( geom Geometry [ , edges_only Boolean [ , extra_frame_size Double precision [ , tolerance Double precision ]]] ) : Geometry<hr>"); 14727 - html += 14728 - wxT 14729 - ("ST_VoronojDiagram( geom Geometry [ , edges_only Boolean [ , extra_frame_size Double precision [ , tolerance Double precision ]]] ) : Geometry</td>"); 14730 - html += 14731 - wxT 14732 - ("<td bgcolor=\"#f0fff0\">Return the Voronoj Diagram corresponding to the input Geometry.<br>"); 14733 - html += wxT("NULL will be returned if any error is encountered.</td></tr>"); 14734 - html += 14735 - wxT 14736 - ("<tr><td bgcolor=\"#fffff0\">ConcaveHull( geom Geometry [ , factor Double precision [ , allow_hols Boolean [ , tolerance Double precision ]]] ) : Geometry<hr>"); 14737 - html += 14738 - wxT 14739 - ("ST_ConcaveHull( geom Geometry [ , factor Double precision [ , allow_hols Boolean [ , tolerance Double precision ]]] ) : Geometry</td>"); 14740 - html += 14741 - wxT 14742 - ("<td bgcolor=\"#f0fff0\">Return the ConcaveHull corresponding to the input Geometry.<br>"); 14743 - html += wxT("NULL will be returned if any error is encountered.</td></tr>"); 14744 - html += 14745 - wxT 14746 - ("<tr><td bgcolor=\"#fffff0\">MakeValid( geom Geometry ) : Geometry<hr>"); 14747 - html += wxT("ST_MakeValid( geom Geometry ) : Geometry</td>"); 14748 - html += 14749 - wxT 14750 - ("<td bgcolor=\"#f0fff0\">Return a surely valid version of the input Geometry.<br>"); 14751 - html += 14752 - wxT 14753 - ("If the input Geometry was already valid, then it will be returned exactly as it was.<br>"); 14754 - html += wxT("NULL will be returned if any error is encountered.</td></tr>"); 14755 - html += 14756 - wxT 14757 - ("<tr><td bgcolor=\"#fffff0\">MakeValidDiscarded( geom Geometry ) : Geometry<hr>"); 14758 - html += wxT("ST_MakeValidDiscarded( geom Geometry ) : Geometry</td>"); 14759 - html += 14760 - wxT 14761 - ("<td bgcolor=\"#f0fff0\">Return all elements that would be eventually discarded by ST_MakeValid() while validating the same input Geometry.<br>"); 14762 - html += 14763 - wxT 14764 - ("NULL will be returned if any error is encountered, or if no discarded item exists.</td></tr>"); 14765 - html += 14766 - wxT 14767 - ("<tr><td bgcolor=\"#fffff0\">Segmentize( geom Geometry , dist Double precision ) : Geometry<hr>"); 14768 - html += 14769 - wxT 14770 - ("ST_Segmentize( geom Geometry , dist Double precision ) : Geometry</td>"); 14771 - html += 14772 - wxT 14773 - ("<td bgcolor=\"#f0fff0\">return a new Geometry corresponding to the input Geometry; as much Linestring / Ring vertices "); 14774 - html += 14775 - wxT 14776 - ("as required will be eventually interpolated so to ensure that no segment will be longer than dist.<br>"); 14777 - html += wxT("NULL will be returned if any error is encountered.</td></tr>"); 14778 - html += 14779 - wxT 14780 - ("<tr><td bgcolor=\"#fffff0\">Split( geom Geometry , blade Geometry ) : Geometry<hr>"); 14781 - html += wxT("ST_Split( geom Geometry , blade Geometry ) : Geometry</td>"); 14782 - html += 14783 - wxT 14784 - ("<td bgcolor=\"#f0fff0\">return a new Geometry collecting all items resulting by splitting the input Geometry by the blade.<br>"); 14785 - html += wxT("NULL will be returned if any error is encountered.</td></tr>"); 14786 - html += 14787 - wxT 14788 - ("<tr><td bgcolor=\"#fffff0\">SplitLeft( geom Geometry , blade Geometry ) : Geometry<hr>"); 14789 - html += wxT("ST_SplitLeft( geom Geometry , blade Geometry ) : Geometry</td>"); 14790 - html += 14791 - wxT 14792 - ("<td bgcolor=\"#f0fff0\">return a new Geometry collecting all items resulting by splitting the input Geometry by the blade and falling on the left side.<br>"); 14793 - html += 14794 - wxT 14795 - ("All items not affected by the split operation (i.e. not intersecting the blade) will be returned into the left collection.<br>"); 14796 - html += wxT("NULL will be returned if any error is encountered.</td></tr>"); 14797 - html += 14798 - wxT 14799 - ("<tr><td bgcolor=\"#fffff0\">SplitRight( geom Geometry , blade Geometry ) : Geometry<hr>"); 14800 - html += 14801 - wxT("ST_SplitRight( geom Geometry , blade Geometry ) : Geometry</td>"); 14802 - html += 14803 - wxT 14804 - ("<td bgcolor=\"#f0fff0\">return a new Geometry collecting all items resulting by splitting the input Geometry by the blade and falling on the right side.<br>"); 14805 - html += 14806 - wxT 14807 - ("NULL will be returned if any error is encountered (or if the right side is empty).</td></tr>"); 14808 - html += 14809 - wxT 14810 - ("<tr><td bgcolor=\"#fffff0\">Azimuth( pt1 Geometry , pt2 Geometry ) : Double precision<hr>"); 14811 - html += 14812 - wxT("ST_Azimuth( pt1 Geometry , pt2 Geometry ) : Double precision</td>"); 14813 - html += 14814 - wxT 14815 - ("<td bgcolor=\"#f0fff0\">return the angle (in radians) from the horizontal of the vector defined by pt1 and pt2.<br>"); 14816 - html += wxT("Both pt1 and pt2 are expected to be simple Points.<br>"); 14817 - html += 14818 - wxT 14819 - ("Starting since 4.1.0 if both points supports \"long/lat\" coords the returned Azimuth will be precisely computed on the ellipsoid.<br>"); 14820 - html += wxT("NULL will be returned if any error is encountered.<hr>"); 14821 - html += wxT("On the clock: 12=0; 3=PI/2; 6=PI; 9=3PI/2</td></tr>"); 14822 - html += 14823 - wxT 14824 - ("<tr><td bgcolor=\"#fffff0\">Project( start_point Geometry, distance Double precision, azimuth Double precision ) : Geometry<hr>"); 14825 - html += 14826 - wxT 14827 - ("Project( start_point Geometry, distance Double precision, azimuth Double precision ) : Geometry</td>"); 14828 - html += 14829 - wxT 14830 - ("<td bgcolor=\"#f0fff0\">return a new Point projected from a start point using a bearing and distance.<br>"); 14831 - html += 14832 - wxT 14833 - ("start_point is expected to be simple long/lat Point.<br>distance is expected to be measured in meters; "); 14834 - html += 14835 - wxT 14836 - ("azimuth (aka bearing or heading) has the same identical meaning as in ST_Azimuth().<br>"); 14837 - html += wxT("NULL is returned on failure or on invalid arguments.</td></tr>"); 14838 - html += 14839 - wxT 14840 - ("<tr><td bgcolor=\"#fffff0\">SnapToGrid( geom Geometry , size Double precision ) : Geometry<br>"); 14841 - html += 14842 - wxT 14843 - ("SnapToGrid( geom Geometry , size_x Double precision , size_y Double precision ) : Geometry<br>"); 14844 - html += 14845 - wxT 14846 - ("SnapToGrid( geom Geometry , origin_x Double precision , origin_y Double precision , size_x Double precision , size_y Double precision ) : Geometry<br>"); 14847 - html += 14848 - wxT 14849 - ("SnapToGrid( geom Geometry , origin Geometry , size_x Double precision , size_y Double precision , size_z Double precision , size_m Double precision ) : Geometry<hr>"); 14850 - html += 14851 - wxT 14852 - ("ST_SnapToGrid( geom Geometry , size Double precision ) : Geometry<br>"); 14853 - html += 14854 - wxT 14855 - ("ST_SnapToGrid( geom Geometry , size_x Double precision , size_y Double precision ) ) : Geometry<br>"); 14856 - html += 14857 - wxT 14858 - ("ST_SnapToGrid( geom Geometry , origin_x Double precision , origin_y Double precision , size_x Double precision , size_y Double precision ) ) : Geometry<br>"); 14859 - html += 14860 - wxT 14861 - ("ST_SnapToGrid( geom Geometry , origin Geometry , size_x Double precision , size_y Double precision, size_z Double precision , size_m Double precision ) : Geometry</td>"); 14862 - html += 14863 - wxT 14864 - ("<td bgcolor=\"#f0fff0\">return a new Geometry corresponding to the input Geometry; all points and vertices will be snapped to the grid defined by its origin and size(s).<br>"); 14865 - html += wxT("Removes all consecutive points falling on the same cell.<br>"); 14866 - html += 14867 - wxT 14868 - ("All collapsed geometries will be stripped from the returned Geometry.<br>"); 14869 - html += wxT("NULL will be returned if any error is encountered.</td></tr>"); 14870 - html += 14871 - wxT("<tr><td bgcolor=\"#fffff0\">GeoHash( geom Geometry ) : String<hr>"); 14872 - html += wxT("ST_GeoHash( geom Geometry ) : String</td>"); 14873 - html += 14874 - wxT 14875 - ("<td bgcolor=\"#f0fff0\">Return a GeoHash representation (geohash.org) of the geometry.<br>"); 14876 - html += 14877 - wxT 14878 - ("A GeoHash encodes a point into a text form that is sortable and searchable based on prefixing.<hr>"); 14879 - html += 14880 - wxT 14881 - ("ST_GeoHash will not work with geometries that are not in geographic (lon/lat) coordinates</td></tr>"); 14882 - html += 14883 - wxT 14884 - ("<tr><td bgcolor=\"#fffff0\">AsX3D( geom Geometry [ , precision Integer [ , options Integer [ , refid String ]]] ) : String<hr>"); 14885 - html += 14886 - wxT 14887 - ("ST_AsX3D( geom Geometry [ , precision Integer [ , options Integer [ , refid String ]]] ) : String</td>"); 14888 - html += 14889 - wxT 14890 - ("<td bgcolor=\"#f0fff0\">Returns a geometry as an X3D XML formatted node element</td></tr>"); 14891 - html += 14892 - wxT 14893 - ("<tr><td bgcolor=\"#fffff0\">MaxDistance( geom1 Geometry , geom2 Geometry ) : Double precision<hr>"); 14894 - html += 14895 - wxT 14896 - ("ST_MaxDistance( geom1 Geometry , geom2 Geometry ) : Double precision</td>"); 14897 - html += 14898 - wxT 14899 - ("<td bgcolor=\"#f0fff0\">return the max distance between geom1 and geom2</td></tr>"); 14900 - html += 14901 - wxT 14902 - ("<tr><td bgcolor=\"#fffff0\">ST_3DDistance( geom1 Geometry , geom2 Geometry ) : Double precision</td>"); 14903 - html += 14904 - wxT 14905 - ("<td bgcolor=\"#f0fff0\">return the 3D-distance between geom1 and geom2 (considering Z coordinates)</td></tr>"); 14906 - html += 14907 - wxT 14908 - ("<tr><td bgcolor=\"#fffff0\">ST_Max3DDistance( geom1 Geometry , geom2 Geometry ) : Double precision</td>"); 14909 - html += 14910 - wxT 14911 - ("<td bgcolor=\"#f0fff0\">return the max 3D-distance between geom1 and geom2 (considering Z coordinates)</td></tr>"); 14912 - html += 14913 - wxT("<tr><td bgcolor=\"#fffff0\">ST_Node( geom Geometry ) : Geometry</td>"); 14914 - html += 14915 - wxT 14916 - ("<td bgcolor=\"#f0fff0\">Fully nodes a set of linestrings using the least possible number of nodes while preserving all of the input ones.<br>"); 14917 - html += 14918 - wxT 14919 - ("NULL will be returned if the input Geometry isn't a set of linestrings or if any other error occurs.</td></tr>"); 14920 - html += 14921 - wxT 14922 - ("<tr><td bgcolor=\"#fffff0\">SelfIntersections( geom Geometry ) : Geometry<hr>ST_SelffIntersections( geom Geometry ) : Geometry</td>"); 14923 - html += 14924 - wxT 14925 - ("<td bgcolor=\"#f0fff0\">Returns a MultiPoint Geometry representing any self-intersection found within the input geometry "); 14926 - html += 14927 - wxT("[Expected to be of the Linestring or MultiLinestring type].<br>"); 14928 - html += 14929 - wxT 14930 - ("NULL will be returned for invalid arguments, or when no self-intersections were found.</td></tr>"); 14931 - html += 14932 - wxT 14933 - ("<tr><td bgcolor=\"#fffff0\">BuildMbr( x1 Double precision , y1 Double precision , x2 Double precision , y2 Double precision, [ , SRID Integer] ) : Geometry</td>"); 14934 - html += 14935 - wxT 14936 - ("<td bgcolor=\"#f0fff0\">[x1 y1] and [x2 y2] are assumed to be Points identifying a line segment;"); 14937 - html += 14938 - wxT 14939 - ("then a Geometry will be returned representing the MBR for this line segment</td></tr>"); 14940 - html += 14941 - wxT 14942 - ("<tr><td bgcolor=\"#fffff0\">BuildCircleMbr( x Double precision , y Double precision , radius Double precision [ , SRID Integer] ) : Geometry</td>"); 14943 - html += 14944 - wxT 14945 - ("<td bgcolor=\"#f0fff0\">[x y] is assumed to be the center of a circle of given radius; then a Geometry will be returned representing the MBR for this circle</td></tr>"); 14946 - html += 14947 - wxT("<tr><td bgcolor=\"#fffff0\">Extent( geom Geometry ) : Geometry</td>"); 14948 - html += 14949 - wxT 14950 - ("<td bgcolor=\"#f0fff0\">return a geometric object representing the bounding box that encloses a set of input values<br>"); 14951 - html += wxT("<b><u>aggregate function</u></b></td></tr>"); 14952 - html += 14953 - wxT("<tr><td bgcolor=\"#fffff0\">ToGARS( geom Geometry ) : String</td>"); 14954 - html += 14955 - wxT 14956 - ("<td bgcolor=\"#f0fff0\">geom is expected to represent a POINT (longitude and latitude coords); "); 14957 - html += 14958 - wxT("the corresponding GARS area designation code will be returned.<hr>"); 14959 - html += wxT("NULL will be returned if any error is encountered.</td></tr>"); 14960 - html += 14961 - wxT 14962 - ("<tr><td bgcolor=\"#fffff0\">GARSMbr( GARS_code String ) : Geometry</td>"); 14963 - html += 14964 - wxT 14965 - ("<td bgcolor=\"#f0fff0\">code is assumed to represent a valid GARS area designation code; "); 14966 - html += 14967 - wxT 14968 - ("a Geometry will be returned representing the MBR for the corresponding GARS area.<hr>"); 14969 - html += wxT("NULL will be returned if any error is encountered.</td></tr>"); 14970 - html += 14971 - wxT 14972 - ("<tr><td bgcolor=\"#fffff0\">MbrMinX( geom Geometry) : Double precision<hr>"); 14973 - html += wxT("ST_MinX( geom Geometry) : Double precision</td>"); 14974 - html += 14975 - wxT 14976 - ("<td bgcolor=\"#f0fff0\">return the x-coordinate for geom MBR's leftmost side as a double precision number.<br>"); 14977 - html += 14978 - wxT("NULL will be returned if geom isn't a valid Geometry.</td></tr>"); 14979 - html += 14980 - wxT 14981 - ("<tr><td bgcolor=\"#fffff0\">MbrMinY( geom Geometry) : Double precision<hr>"); 14982 - html += wxT("ST_MinY( geom Geometry) : Double precision</td>"); 14983 - html += 14984 - wxT 14985 - ("<td bgcolor=\"#f0fff0\">return the y-coordinate for geom MBR's lowermost side as a double precision number.<br>"); 14986 - html += 14987 - wxT("NULL will be returned if geom isn't a valid Geometry.</td></tr>"); 14988 - html += 14989 - wxT 14990 - ("<tr><td bgcolor=\"#fffff0\">MbrMaxX( geom Geometry) : Double precision<hr>"); 14991 - html += wxT("ST_MaxX( geom Geometry) : Double precision</td>"); 14992 - html += 14993 - wxT 14994 - ("<td bgcolor=\"#f0fff0\">return the x-coordinate for geom MBR's rightmost side as a double precision number.<br>"); 14995 - html += 14996 - wxT("NULL will be returned if geom isn't a valid Geometry.</td></tr>"); 14997 - html += 14998 - wxT 14999 - ("<tr><td bgcolor=\"#fffff0\">MbrMaxY( geom Geometry) : Double precision<hr>"); 15000 - html += wxT("ST_MaxY( geom Geometry) : Double precision</td>"); 15001 - html += 15002 - wxT 15003 - ("<td bgcolor=\"#f0fff0\">return the y-coordinate for geom MBR's uppermost side as a double precision number.<br>"); 15004 - html += 15005 - wxT("NULL will be returned if geom isn't a valid Geometry.</td></tr>"); 15006 - html += 15007 - wxT 15008 - ("<tr><td bgcolor=\"#fffff0\">ST_MinZ( geom Geometry) : Double precision</td>"); 15009 - html += 15010 - wxT 15011 - ("<td bgcolor=\"#f0fff0\">return the minimum Z-coordinate value for geom as a double precision number.<br>"); 15012 - html += 15013 - wxT 15014 - ("NULL will be returned if geom isn't a valid Geometry or if geom has no Z dimension.</td></tr>"); 15015 - html += 15016 - wxT 15017 - ("<tr><td bgcolor=\"#fffff0\">ST_MaxZ( geom Geometry) : Double precision</td>"); 15018 - html += 15019 - wxT 15020 - ("<td bgcolor=\"#f0fff0\">return the maximum Z-coordinate value for geom as a double precision number.<br>"); 15021 - html += 15022 - wxT 15023 - ("NULL will be returned if geom isn't a valid Geometry or if geom has no Z dimension.</td></tr>"); 15024 - html += 15025 - wxT 15026 - ("<tr><td bgcolor=\"#fffff0\">ST_MinM( geom Geometry) : Double precision</td>"); 15027 - html += 15028 - wxT 15029 - ("<td bgcolor=\"#f0fff0\">return the minimum M-coordinate value for geom as a double precision number.<br>"); 15030 - html += 15031 - wxT 15032 - ("NULL will be returned if geom isn't a valid Geometry or if geom has no M dimension.</td></tr>"); 15033 - html += 15034 - wxT 15035 - ("<tr><td bgcolor=\"#fffff0\">ST_MaxM( geom Geometry) : Double precision</td>"); 15036 - html += 15037 - wxT 15038 - ("<td bgcolor=\"#f0fff0\">return the maximum M-coordinate value for geom as a double precision number.<br>"); 15039 - html += 15040 - wxT 15041 - ("NULL will be returned if geom isn't a valid Geometry or if geom has no M dimension.</td></tr>"); 15042 - html += 15043 - wxT 15044 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"c31\">functions for constructing a geometric object given its Well-known Text Representation</a>"); 15045 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 15046 - html += 15047 - wxT 15048 - ("<tr><td bgcolor=\"#fffff0\">GeomFromText( wkt String [ , SRID Integer] ) : Geometry<hr>"); 15049 - html += 15050 - wxT("ST_GeomFromText( wkt String [ , SRID Integer] ) : Geometry</td>"); 15051 - html += 15052 - wxT 15053 - ("<td bgcolor=\"#f0fff0\">construct a geometric object given its Well-known text Representation</td></tr>"); 15054 - html += 15055 - wxT 15056 - ("<tr><td bgcolor=\"#fffff0\">ST_WKTToSQL( wkt String ) : Geometry</td>"); 15057 - html += 15058 - wxT 15059 - ("<td bgcolor=\"#f0fff0\">SQL/MM alias name for ST_GeomFromText: SRID=0 is assumed.</td></tr>"); 15060 - html += 15061 - wxT 15062 - ("<tr><td bgcolor=\"#fffff0\">PointFromText( wktPoint String [ , SRID Integer] ) : Point<hr>"); 15063 - html += 15064 - wxT("ST_PointFromText( wktPoint String [ , SRID Integer] ) : Point</td>"); 15065 - html += wxT("<td bgcolor=\"#f0fff0\">construct a Point</td></tr>"); 15066 - html += 15067 - wxT 15068 - ("<tr><td bgcolor=\"#fffff0\">LineFromText( wktLineString String [ , SRID Integer] ) : Linestring<hr>"); 15069 - html += 15070 - wxT 15071 - ("ST_LineFromText( wktLineString String [ , SRID Integer] ) : Linestring<hr>"); 15072 - html += 15073 - wxT 15074 - ("LineStringFromText( wktLineString String [ , SRID Integer] ) : Linestring<hr>"); 15075 - html += 15076 - wxT 15077 - ("ST_LineStringFromText( wktLineString String [ , SRID Integer] ) : Linestring</td>"); 15078 - html += wxT("<td bgcolor=\"#f0fff0\">construct a Linestring</td></tr>"); 15079 - html += 15080 - wxT 15081 - ("<tr><td bgcolor=\"#fffff0\">PolyFromText( wktPolygon String [ , SRID Integer] ) : Polygon<hr>"); 15082 - html += 15083 - wxT("ST_PolyFromText( wktPolygon String [ , SRID Integer] ) : Polygon<hr>"); 15084 - html += 15085 - wxT("PolygonFromText( wktPolygon String [ , SRID Integer] ) : Polygon<hr>"); 15086 - html += 15087 - wxT 15088 - ("ST_PolygonFromText( wktPolygon String [ , SRID Integer] ) : Polygon</td>"); 15089 - html += wxT("<td bgcolor=\"#f0fff0\">construct a Polygon</td></tr>"); 15090 - html += 15091 - wxT 15092 - ("<tr><td bgcolor=\"#fffff0\">MPointFromText( wktMultiPoint String [ , SRID Integer] ) : MultiPoint<hr>"); 15093 - html += 15094 - wxT 15095 - ("ST_MPointFromText( wktMultiPoint String [ , SRID Integer] ) : MultiPoint<hr>"); 15096 - html += 15097 - wxT 15098 - ("MultiPointFromText( wktMultiPoint String [ , SRID Integer] ) : MultiPoint<hr>"); 15099 - html += 15100 - wxT 15101 - ("ST_MultiPointFromText( wktMultiPoint String [ , SRID Integer] ) : MultiPoint</td>"); 15102 - html += wxT("<td bgcolor=\"#f0fff0\">construct a MultiPoint</td></tr>"); 15103 - html += 15104 - wxT 15105 - ("<tr><td bgcolor=\"#fffff0\">MLineFromText( wktMultiLineString String [ , SRID Integer] ) : MultiLinestring<hr>"); 15106 - html += 15107 - wxT 15108 - ("ST_MLineFromText( wktMultiLineString String [ , SRID Integer] ) : MultiLinestring<hr>"); 15109 - html += 15110 - wxT 15111 - ("MultiLineStringFromText( wktMultiLineString String [ , SRID Integer] ) : MultiLinestring<hr>"); 15112 - html += 15113 - wxT 15114 - ("ST_MultiLineStringFromText( wktMultiLineString String [ , SRID Integer] ) : MultiLinestring</td>"); 15115 - html += wxT("<td bgcolor=\"#f0fff0\">construct a MultiLinestring</td></tr>"); 15116 - html += 15117 - wxT 15118 - ("<tr><td bgcolor=\"#fffff0\">MPolyFromText( wktMultiPolygon String [ , SRID Integer] ) : MultiPolygon<hr>"); 15119 - html += 15120 - wxT 15121 - ("ST_MPolyFromText( wktMultiPolygon String [ , SRID Integer] ) : MultiPolygon<hr>"); 15122 - html += 15123 - wxT 15124 - ("MultiPolygonFromText( wktMultiPolygon String [ , SRID Integer] ) : MultiPolygon<hr>"); 15125 - html += 15126 - wxT 15127 - ("ST_MultiPolygonFromText( wktMultiPolygon String [ , SRID Integer] ) : MultiPolygon</td>"); 15128 - html += wxT("<td bgcolor=\"#f0fff0\">construct a MultiPolygon</td></tr>"); 15129 - html += 15130 - wxT 15131 - ("<tr><td bgcolor=\"#fffff0\">GeomCollFromText( wktGeometryCollection String [ , SRID Integer] ) : GeometryCollection<hr>"); 15132 - html += 15133 - wxT 15134 - ("ST_GeomCollFromText( wktGeometryCollection String [ , SRID Integer] ) : GeometryCollection<hr>"); 15135 - html += 15136 - wxT 15137 - ("GeometryCollectionFromText( wktGeometryCollection String [ , SRID Integer] ) : GeometryCollection<hr>"); 15138 - html += 15139 - wxT 15140 - ("ST_GeometryCollectionFromText( wktGeometryCollection String [ , SRID Integer] ) : GeometryCollection</td>"); 15141 - html += 15142 - wxT("<td bgcolor=\"#f0fff0\">construct a GeometryCollection</td></tr>"); 15143 - html += 15144 - wxT 15145 - ("<tr><td bgcolor=\"#fffff0\">BdPolyFromText( wktMultilinestring String [ , SRID Integer] ) : Polygon<hr>"); 15146 - html += 15147 - wxT 15148 - ("ST_BdPolyFromText( wktMultilinestring String [ , SRID Integer] ) : Polygon</td>"); 15149 - html += 15150 - wxT 15151 - ("<td bgcolor=\"#f0fff0\">Construct a Polygon given an arbitrary collection of closed "); 15152 - html += 15153 - wxT 15154 - ("linestrings as a MultiLineString text representation.<hr>see also: BuildArea(), Polygonize()</td></tr>"); 15155 - html += 15156 - wxT 15157 - ("<tr><td bgcolor=\"#fffff0\">BdMPolyFromText( wktMultilinestring String [ , SRID Integer] ) : MultiPolygon<hr>"); 15158 - html += 15159 - wxT 15160 - ("ST_BdMPolyFromText( wktMultilinestring String [ , SRID Integer] ) : MultiPolygon</td>"); 15161 - html += 15162 - wxT 15163 - ("<td bgcolor=\"#f0fff0\">Construct a MultiPolygon given an arbitrary collection of closed "); 15164 - html += 15165 - wxT 15166 - ("linestrings as a MultiLineString text representation.<hr>see also: BuildArea(), Polygonize()</td></tr>"); 15167 - html += 15168 - wxT 15169 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"c32\">functions for constructing a geometric object given its Well-known Binary Representation</a>"); 15170 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 15171 - html += 15172 - wxT 15173 - ("<tr><td bgcolor=\"#fffff0\">GeomFromWKB( wkbGeometry Binary [ , SRID Integer] ) : Geometry<hr>"); 15174 - html += 15175 - wxT 15176 - ("ST_GeomFromWKB( wkbGeometry Binary [ , SRID Integer] ) : Geometry</td>"); 15177 - html += 15178 - wxT 15179 - ("<td bgcolor=\"#f0fff0\">construct a geometric object given its Well-known binary Representation</td></tr>"); 15180 - html += 15181 - wxT 15182 - ("<tr><td bgcolor=\"#fffff0\">ST_WKBToSQL( wkbGeometry Binary ) : Geometry</td>"); 15183 - html += 15184 - wxT 15185 - ("<td bgcolor=\"#f0fff0\">SQL/MM alias name for ST_GeomFromWKB: SRID=0 is assumed.</td></tr>"); 15186 - html += 15187 - wxT 15188 - ("<tr><td bgcolor=\"#fffff0\">PointFromWKB( wkbPoint Binary [ , SRID Integer] ) : Point<hr>"); 15189 - html += 15190 - wxT("ST_PointFromWKB( wkbPoint Binary [ , SRID Integer] ) : Point</td>"); 15191 - html += wxT("<td bgcolor=\"#f0fff0\">construct a Point</td></tr>"); 15192 - html += 15193 - wxT 15194 - ("<tr><td bgcolor=\"#fffff0\">LineFromWKB( wkbLineString Binary [ , SRID Integer] ) : Linestring<hr>"); 15195 - html += 15196 - wxT 15197 - ("ST_LineFromWKB( wkbLineString Binary [ , SRID Integer] ) : Linestring<hr>"); 15198 - html += 15199 - wxT 15200 - ("LineStringFromWKB( wkbLineString Binary [ , SRID Integer] ) : Linestring<hr>"); 15201 - html += 15202 - wxT 15203 - ("ST_LineStringFromWKB ( wkbLineString Binary [ , SRID Integer] ) : Linestring</td>"); 15204 - html += wxT("<td bgcolor=\"#f0fff0\">construct a Linestring</td></tr>"); 15205 - html += 15206 - wxT 15207 - ("<tr><td bgcolor=\"#fffff0\">PolyFromWKB( wkbPolygon Binary [ , SRID Integer] ) : Polygon<hr>"); 15208 - html += 15209 - wxT("ST_PolyFromWKB( wkbPolygon Binary [ , SRID Integer] ) : Polygon<hr>"); 15210 - html += 15211 - wxT("PolygonFromWKB( wkbPolygon Binary [ , SRID Integer] ) : Polygon<hr>"); 15212 - html += 15213 - wxT 15214 - ("ST_PolygonFromWKB( wkbPolygon Binary [ , SRID Integer] ) : Polygon</td>"); 15215 - html += wxT("<td bgcolor=\"#f0fff0\">construct a Polygon</td></tr>"); 15216 - html += 15217 - wxT 15218 - ("<tr><td bgcolor=\"#fffff0\">MPointFromWKB( wkbMultiPoint Binary [ , SRID Integer] ) : MultiPoint<hr>"); 15219 - html += 15220 - wxT 15221 - ("ST_MPointFromWKB( wkbMultiPoint Binary [ , SRID Integer] ) : MultiPoint<hr>"); 15222 - html += 15223 - wxT 15224 - ("MultiPointFromWKB( wkbMultiPoint Binary [ , SRID Integer] ) : MultiPoint<hr>"); 15225 - html += 15226 - wxT 15227 - ("ST_MultiPointFromWKB( wkbMultiPoint Binary [ , SRID Integer] ) : MultiPoint</td>"); 15228 - html += wxT("<td bgcolor=\"#f0fff0\">construct a MultiPoint</td></tr>"); 15229 - html += 15230 - wxT 15231 - ("<tr><td bgcolor=\"#fffff0\">MLineFromWKB( wkbMultiLineString Binary [ , SRID Integer] ) : MultiLinestring<hr>"); 15232 - html += 15233 - wxT 15234 - ("ST_MLineFromWKB( wkbMultiLineString Binary [ , SRID Integer] ) : MultiLinestring<hr>"); 15235 - html += 15236 - wxT 15237 - ("MultiLineStringFromWKB( wkbMultiLineString Binary [ , SRID Integer] ) : MultiLinestring<hr>"); 15238 - html += 15239 - wxT 15240 - ("ST_MultiLineStringFromWKB( wkbMultiLineString Binary [ , SRID Integer] ) : MultiLinestring</td>"); 15241 - html += wxT("<td bgcolor=\"#f0fff0\">construct a MultiLinestring</td></tr>"); 15242 - html += 15243 - wxT 15244 - ("<tr><td bgcolor=\"#fffff0\">MPolyFromWKB( wkbMultiPolygon Binary [ , SRID Integer] ) : MultiPolygon<hr>"); 15245 - html += 15246 - wxT 15247 - ("ST_MPolyFromWKB( wkbMultiPolygon Binary [ , SRID Integer] ) : MultiPolygon<hr>"); 15248 - html += 15249 - wxT 15250 - ("MultiPolygonFromWKB( wkbMultiPolygon Binary [ , SRID Integer] ) : MultiPolygon<hr>"); 15251 - html += 15252 - wxT 15253 - ("ST_MultiPolygonFromWKB( wkbMultiPolygon Binary [ , SRID Integer] ) : MultiPolygon</td>"); 15254 - html += wxT("<td bgcolor=\"#f0fff0\">construct a MultiPolygon</td></tr>"); 15255 - html += 15256 - wxT 15257 - ("<tr><td bgcolor=\"#fffff0\">GeomCollFromWKB( wkbGeometryCollection Binary [ , SRID Integer] ) : GeometryCollection<hr>"); 15258 - html += 15259 - wxT 15260 - ("ST_GeomCollFromWKB( wkbGeometryCollection Binary [ , SRID Integer] ) : GeometryCollection<hr>"); 15261 - html += 15262 - wxT 15263 - ("GeometryCollectionFromWKB( wkbGeometryCollection Binary [ , SRID Integer] ) : GeometryCollection<hr>"); 15264 - html += 15265 - wxT 15266 - ("ST_GeometryCollectionFromWKB( wkbGeometryCollection Binary [ , SRID Integer] ) : GeometryCollection</td>"); 15267 - html += 15268 - wxT("<td bgcolor=\"#f0fff0\">construct a GeometryCollection</td></tr>"); 15269 - html += 15270 - wxT 15271 - ("<tr><td bgcolor=\"#fffff0\">BdPolyFromWKB( wkbMultilinestring Binary [ , SRID Integer] ) : Polygon<hr>"); 15272 - html += 15273 - wxT 15274 - ("ST_BdPolyFromWKB( wkbMultilinestring Binary [ , SRID Integer] ) : Polygon</td>"); 15275 - html += 15276 - wxT 15277 - ("<td bgcolor=\"#f0fff0\">Construct a Polygon given an arbitrary collection of closed "); 15278 - html += 15279 - wxT 15280 - ("linestrings as a MultiLineString binary representation.<hr>see also: BuildArea(), Polygonize()</td></tr>"); 15281 - html += 15282 - wxT 15283 - ("<tr><td bgcolor=\"#fffff0\">BdMPolyFromWKB( wkbMultilinestring Binary [ , SRID Integer] ) : MultiPolygon<hr>"); 15284 - html += 15285 - wxT 15286 - ("ST_BdMPolyFromWKB( wkbMultilinestring Binary [ , SRID Integer] ) : MultiPolygon</td>"); 15287 - html += 15288 - wxT 15289 - ("<td bgcolor=\"#f0fff0\">Construct a MultiPolygon given an arbitrary collection of closed "); 15290 - html += 15291 - wxT 15292 - ("linestrings as a MultiLineString binary representation.<hr>see also: BuildArea(), Polygonize()</td></tr>"); 15293 - html += 15294 - wxT 15295 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"c33\">functions for obtaining the Well-known Text / Well-known Binary Representation of a geometric object</a>"); 15296 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 15297 - html += 15298 - wxT("<tr><td bgcolor=\"#fffff0\">AsText( geom Geometry ) : String<hr>"); 15299 - html += 15300 - wxT 15301 - ("ST_AsText( geom Geometry ) : String</td><td bgcolor=\"#f0fff0\">return the Well-known Text representation</td></tr>"); 15302 - html += 15303 - wxT 15304 - ("<tr><td bgcolor=\"#fffff0\">AsWKT( geom Geometry [ , precision Integer ] ) : String</td>"); 15305 - html += 15306 - wxT 15307 - ("<td bgcolor=\"#f0fff0\">return the Well-known Text representation<hr>always return strictly conformant 2D WKT</td></tr>"); 15308 - html += 15309 - wxT("<tr><td bgcolor=\"#fffff0\">AsBinary( geom Geometry ) : Binary<hr>"); 15310 - html += 15311 - wxT 15312 - ("ST_AsBinary( geom Geometry ) : Binary</td><td bgcolor=\"#f0fff0\">return the Well-known Binary representation</td></tr>"); 15313 - html += 15314 - wxT 15315 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"c33misc\">SQL functions supporting exotic geometric formats</a>"); 15316 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 15317 - html += 15318 - wxT 15319 - ("<tr><td bgcolor=\"#fffff0\">AsSVG( geom Geometry, [ , relative Integer [ , precision Integer ] ] ) : String</td>"); 15320 - html += 15321 - wxT 15322 - ("<td bgcolor=\"#f0fff0\">returns the SVG [<i>Scalable Vector Graphics</i>] representation</td></tr>"); 15323 - html += 15324 - wxT 15325 - ("<tr><td bgcolor=\"#fffff0\">AsKML( geom Geometry [ , precision Integer ] ) : String<br>"); 15326 - html += 15327 - wxT 15328 - ("AsKML( name String, description String, geom Geometry [ , precision Integer ] ) : String</td>"); 15329 - html += 15330 - wxT 15331 - ("<td bgcolor=\"#f0fff0\">returns the KML [<i>Keyhole Markup Language</i>] representation</td></tr>"); 15332 - html += 15333 - wxT 15334 - ("<tr><td bgcolor=\"#fffff0\">GeomFromKml( KmlGeometry String ) : Geometry</td><td bgcolor=\"#f0fff0\">construct a geometric object given its KML Representation</td></tr>"); 15335 - html += 15336 - wxT 15337 - ("<tr><td bgcolor=\"#fffff0\">AsGML( geom Geometry [ , precision Integer ] ) : String<br>"); 15338 - html += 15339 - wxT 15340 - ("AsGML( version Integer, geom Geometry [ , precision Integer ] ) : String</td>"); 15341 - html += 15342 - wxT 15343 - ("<td bgcolor=\"#f0fff0\">returns the GML [<i>Geography Markup Language</i>] representation</td></tr>"); 15344 - html += 15345 - wxT 15346 - ("<tr><td bgcolor=\"#fffff0\">GeomFromGML( gmlGeometry String ) : Geometry</td><td bgcolor=\"#f0fff0\">construct a geometric object given its GML Representation</td></tr>"); 15347 - html += 15348 - wxT 15349 - ("<tr><td bgcolor=\"#fffff0\">AsGeoJSON( geom Geometry [ , precision Integer [ , options Integer ] ] ) : String</td>"); 15350 - html += 15351 - wxT 15352 - ("<td bgcolor=\"#f0fff0\">returns the GeoJSON [<i>Geographic JavaScript Object Notation</i>] representation</td></tr>"); 15353 - html += 15354 - wxT 15355 - ("<tr><td bgcolor=\"#fffff0\">GeomFromGeoJSON( GeoJSONGeometry String ) : Geometry</td><td bgcolor=\"#f0fff0\">construct a geometric object given its GeoJSON Representation</td></tr>"); 15356 - html += 15357 - wxT 15358 - ("<tr><td bgcolor=\"#fffff0\">AsEWKB( geom Geometry ) : String</td><td bgcolor=\"#f0fff0\">returns the EWKB [<i>Extended Well Known Binary</i>] representation</td></tr>"); 15359 - html += 15360 - wxT 15361 - ("<tr><td bgcolor=\"#fffff0\">GeomFromEWKB( ewkbGeometry String ) : Geometry</td><td bgcolor=\"#f0fff0\">construct a geometric object given its EWKB Representation</td></tr>"); 15362 - html += 15363 - wxT 15364 - ("<tr><td bgcolor=\"#fffff0\">AsEWKT( geom Geometry ) : String</td><td bgcolor=\"#f0fff0\">returns the EWKT [<i>Extended Well Known Text</i>] representation</td></tr>"); 15365 - html += 15366 - wxT 15367 - ("<tr><td bgcolor=\"#fffff0\">GeomFromEWKT( ewktGeometry String ) : Geometry</td><td bgcolor=\"#f0fff0\">construct a geometric object given its EWKT Representation</td></tr>"); 15368 - html += 15369 - wxT 15370 - ("<tr><td bgcolor=\"#fffff0\">AsFGF( geom Geometry ) : String</td><td bgcolor=\"#f0fff0\">returns the FGF [<i>FDO Geometry Binary Format</i>] representation</td></tr>"); 15371 - html += 15372 - wxT 15373 - ("<tr><td bgcolor=\"#fffff0\">GeomFromFGF( fgfGeometry Binary [ , SRID Integer] ) : Geometry</td><td bgcolor=\"#f0fff0\">construct a geometric object given its FGF binary Representation</td></tr>"); 15374 - html += 15375 - wxT 15376 - ("<tr><td bgcolor=\"#fffff0\">ExportDXF( out_dir String , filename String , sql_query String , layer_col_name String , "); 15377 - html += 15378 - wxT 15379 - ("geom_col_name String , label_col_name String , text_height_col_name String , text_rotation_col_name String , geom_filter Geometry [ , precision Integer ] ) : Integer</td>"); 15380 - html += 15381 - wxT 15382 - ("<td bgcolor=\"#f0fff0\">Exports a whole DXF file.<br>Will return 0 (i.e. FALSE) on failure, any other value (i.e. TRUE) on success.<hr>"); 15383 - html += 15384 - wxT 15385 - ("Please note this SQL function open the doors to many potential security issues, and thus is always disabled by default.<br>"); 15386 - html += 15387 - wxT 15388 - ("Explicitly setting the environment variable SPATIALITE_SECURITY=relaxed is absolutely required in order to effectively enable this function.</td></tr>"); 15389 - html += 15390 - wxT 15391 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"c34\">functions on type Geometry</a>"); 15392 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 15393 - html += 15394 - wxT("<tr><td bgcolor=\"#fffff0\">Dimension( geom Geometry ) : Integer<hr>"); 15395 - html += wxT("ST_Dimension( geom Geometry ) : Integer</td>"); 15396 - html += 15397 - wxT 15398 - ("<td bgcolor=\"#f0fff0\">return the dimension of the geometric object, which is less than or equal to the dimension of the coordinate space</td></tr>"); 15399 - html += 15400 - wxT 15401 - ("<tr><td bgcolor=\"#fffff0\">CoordDimension( geom Geometry ) : String</td>"); 15402 - html += 15403 - wxT 15404 - ("<td bgcolor=\"#f0fff0\">return the dimension model used by the geometric object as:<br>'XY', 'XYZ', 'XYM' or 'XYZM'</td></tr>"); 15405 - html += 15406 - wxT("<tr><td bgcolor=\"#fffff0\">ST_NDims( geom Geometry ) : Integer</td>"); 15407 - html += 15408 - wxT 15409 - ("<td bgcolor=\"#f0fff0\">return the number of dimensions used by the geometric object as:<br>2, 3 or 4</td></tr>"); 15410 - html += 15411 - wxT("<tr><td bgcolor=\"#fffff0\">ST_Is3D( geom Geometry ) : Integer</td>"); 15412 - html += 15413 - wxT("<td bgcolor=\"#f0fff0\">Checks if geom has the Z dimension.<br>"); 15414 - html += 15415 - wxT 15416 - ("The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a "); 15417 - html += wxT("function invocation on invalid arguments.</td></tr>"); 15418 - html += 15419 - wxT 15420 - ("<tr><td bgcolor=\"#fffff0\">ST_IsMeasured( geom Geometry ) : Integer</td>"); 15421 - html += 15422 - wxT("<td bgcolor=\"#f0fff0\">Checks if geom has the M dimension.<br>"); 15423 - html += 15424 - wxT 15425 - ("The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a "); 15426 - html += wxT("function invocation on invalid arguments.</td></tr>"); 15427 - html += 15428 - wxT 15429 - ("<tr><td bgcolor=\"#fffff0\">GeometryType( geom Geometry ) : String<hr>"); 15430 - html += wxT("ST_GeometryType( geom Geometry ) : String</td>"); 15431 - html += 15432 - wxT 15433 - ("<td bgcolor=\"#f0fff0\">return the name of the instantiable subtype of Geometry of which this geometric object is a member, as a string</td></tr>"); 15434 - html += 15435 - wxT("<tr><td bgcolor=\"#fffff0\">SRID( geom Geometry ) : Integer<hr>"); 15436 - html += wxT("ST_SRID( geom <i>Geometry</i> ) : <i>Integer</i></td>"); 15437 - html += 15438 - wxT 15439 - ("<td bgcolor=\"#f0fff0\">return the Spatial Reference System ID for this geometric object</td></tr>"); 15440 - html += 15441 - wxT 15442 - ("<tr><td bgcolor=\"#fffff0\">SetSRID( geom Geometry , SRID Integer ) : Integer</td>"); 15443 - html += 15444 - wxT 15445 - ("<td bgcolor=\"#f0fff0\">directly sets the Spatial Reference System ID for this geometric object [no reprojection is applied].<br>"); 15446 - html += 15447 - wxT 15448 - ("The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a "); 15449 - html += wxT("function invocation on NULL arguments</td></tr>"); 15450 - html += 15451 - wxT("<tr><td bgcolor=\"#fffff0\">IsEmpty( geom Geometry ) : Integer<hr>"); 15452 - html += wxT("ST_IsEmpty( geom Geometry ) : Integer</td>"); 15453 - html += 15454 - wxT 15455 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.<br>"); 15456 - html += 15457 - wxT("TRUE if this geometric object corresponds to the empty set</td></tr>"); 15458 - html += 15459 - wxT("<tr><td bgcolor=\"#fffff0\">IsSimple( geom Geometry ) : Integer<hr>"); 15460 - html += wxT("ST_IsSimple( geom <i>Geometry</i> ) : <i>Integer</i></td>"); 15461 - html += 15462 - wxT 15463 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.<br>"); 15464 - html += 15465 - wxT 15466 - ("TRUE if this geometric object is simple, as defined in the Geometry Model</td></tr>"); 15467 - html += 15468 - wxT("<tr><td bgcolor=\"#fffff0\">IsValid( geom Geometry ) : Integer<hr>"); 15469 - html += wxT("ST_IsValid( geom Geometry ) : Integer</td>"); 15470 - html += 15471 - wxT 15472 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.<br>"); 15473 - html += 15474 - wxT 15475 - ("TRUE if this geometric object does not contains any topological error</td></tr>"); 15476 - html += 15477 - wxT("<tr><td bgcolor=\"#fffff0\">Boundary( geom Geometry ) : Geometry<hr>"); 15478 - html += wxT("ST_Boundary( geom Geometry ) : Geometry</td>"); 15479 - html += 15480 - wxT 15481 - ("<td bgcolor=\"#f0fff0\">return a geometric object that is the combinatorial boundary of g as defined in the Geometry Model</td></tr>"); 15482 - html += 15483 - wxT("<tr><td bgcolor=\"#fffff0\">Envelope( geom Geometry ) : Geometry<hr>"); 15484 - html += wxT("ST_Envelope( geom Geometry ) : Geometry</td>"); 15485 - html += 15486 - wxT 15487 - ("<td bgcolor=\"#f0fff0\">return the rectangle bounding g as a Polygon. "); 15488 - html += 15489 - wxT 15490 - ("The Polygon is defined by the corner points of the bounding box [(MINX, MINY),(MAXX, MINY), (MAXX, MAXY), (MINX, MAXY), (MINX, MINY)].</td></tr>"); 15491 - html += 15492 - wxT 15493 - ("<tr><td bgcolor=\"#fffff0\">ST_Expand( geom Geometry , amount Double ) : Geometry</td>"); 15494 - html += 15495 - wxT 15496 - ("<td bgcolor=\"#f0fff0\">return the rectangle bounding g as a Polygon.<br>"); 15497 - html += 15498 - wxT 15499 - ("The bounding rectangle is expanded in all directions by an amount specified by the second argument.</td></tr>"); 15500 - html += 15501 - wxT 15502 - ("<tr><td bgcolor=\"#fffff0\">ST_NPoints( geom Geometry ) : Integer</td>"); 15503 - html += 15504 - wxT 15505 - ("<td bgcolor=\"#f0fff0\">return the total number of Points (this including any Linestring/Polygon vertex)</td></tr>"); 15506 - html += 15507 - wxT 15508 - ("<tr><td bgcolor=\"#fffff0\">ST_NRings( geom Geometry ) : Integer</td>"); 15509 - html += 15510 - wxT 15511 - ("<td bgcolor=\"#f0fff0\">return the total number of Rings (this including both Exterior and Interior Rings)</td></tr>"); 15512 - html += 15513 - wxT 15514 - ("<tr><td bgcolor=\"#fffff0\">ST_Reverse( geom Geometry ) : geom Geometry</td>"); 15515 - html += 15516 - wxT 15517 - ("<td bgcolor=\"#f0fff0\">returns a new Geometry [if possible] or NULL<hr>"); 15518 - html += wxT("Any Linestring or Ring will be in reverse order.</td></tr>"); 15519 - html += 15520 - wxT 15521 - ("<tr><td bgcolor=\"#fffff0\">ST_ForceLHR( geom Geometry ) : geom Geometry</td>"); 15522 - html += 15523 - wxT 15524 - ("<td bgcolor=\"#f0fff0\">returns a new Geometry [if possible] or NULL<hr>"); 15525 - html += 15526 - wxT 15527 - ("Any Polygon will be oriented accordingly to Left Hand Rule (Exterior Ring clockwise, "); 15528 - html += wxT("Interior Rings counter-clockwise).</td></tr>"); 15529 - html += 15530 - wxT 15531 - ("<tr><td bgcolor=\"#fffff0\">AddPoint( line Linestring , point Point [ , position Integer ] ) : Linestring<hr>"); 15532 - html += 15533 - wxT 15534 - ("ST_AddPoint( line Linestring , point Point [ , position Integer ] ) : Linestring</td>"); 15535 - html += 15536 - wxT 15537 - ("<td bgcolor=\"#f0fff0\">Adds a new Point into the input Linestring immediately before \"position\" (zero-based index)<br>"); 15538 - html += 15539 - wxT 15540 - ("A negative \"position\" (default) means appending the new Point to the end of the input Linestring.<br>"); 15541 - html += wxT("NULL will be returned if any error is encountered.</td></tr>"); 15542 - html += 15543 - wxT 15544 - ("<tr><td bgcolor=\"#fffff0\">SetPoint( line Linestring , position Integer , point Point ) : Linestring<hr>"); 15545 - html += 15546 - wxT 15547 - ("ST_SetPoint( line Linestring , position Integer , point Point ) : Linestring</td>"); 15548 - html += 15549 - wxT 15550 - ("<td bgcolor=\"#f0fff0\">Replaces the Point into the input Linestring at \"position\" (zero-based index)<br>"); 15551 - html += wxT("NULL will be returned if any error is encountered.</td></tr>"); 15552 - html += 15553 - wxT("ST_SetStartPoint( line Linestring , point Point ) : Linestring</td>"); 15554 - html += 15555 - wxT 15556 - ("<td bgcolor=\"#f0fff0\">Replaces the StartPoint into the input Linestring<br>"); 15557 - html += wxT("NULL will be returned if any error is encountered.</td></tr>"); 15558 - html += 15559 - wxT("ST_SetEndtPoint( line Linestring , point Point ) : Linestring</td>"); 15560 - html += 15561 - wxT 15562 - ("<td bgcolor=\"#f0fff0\">Replaces the EndPoint into the input Linestring<br>"); 15563 - html += wxT("NULL will be returned if any error is encountered.</td></tr>"); 15564 - html += 15565 - wxT 15566 - ("<tr><td bgcolor=\"#fffff0\">RemovePoint( line Linestring , position Integer ) : Linestring<hr>"); 15567 - html += 15568 - wxT 15569 - ("ST_RemovePoint( line Linestring , position Integer ) : Linestring</td>"); 15570 - html += 15571 - wxT 15572 - ("<td bgcolor=\"#f0fff0\">Removes the Point into the input Linestring at \"position\" (zero-based index)<br>"); 15573 - html += wxT("NULL will be returned if any error is encountered.</td></tr>"); 15574 - html += 15575 - wxT 15576 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"repair\">Functions attempting to repair malformed Geometries</a>"); 15577 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 15578 - html += 15579 - wxT 15580 - ("<tr><td bgcolor=\"#fffff0\">SanitizeGeometry( geom Geometry ) : geom Geometry</td>"); 15581 - html += 15582 - wxT 15583 - ("<td bgcolor=\"#f0fff0\">returns a (possibly) sanitized Geometry or NULL</td></tr>"); 15584 - html += 15585 - wxT 15586 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"compress\">Geometry-compression functions</a>"); 15587 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 15588 - html += 15589 - wxT 15590 - ("<tr><td bgcolor=\"#fffff0\">CompressGeometry( geom Geometry ) : geom Geometry</td>"); 15591 - html += 15592 - wxT 15593 - ("<td bgcolor=\"#f0fff0\">returns a compressed Geometry or NULL</td></tr>"); 15594 - html += 15595 - wxT 15596 - ("<tr><td bgcolor=\"#fffff0\">UncompressGeometry( geom Geometry ) : geom Geometry</td>"); 15597 - html += 15598 - wxT 15599 - ("<td bgcolor=\"#f0fff0\">returns an uncompressed Geometry or NULL</td></tr>"); 15600 - html += 15601 - wxT 15602 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"cast\">Geometry-type casting functions</a>"); 15603 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 15604 - html += 15605 - wxT 15606 - ("<tr><td bgcolor=\"#fffff0\">CastToPoint( geom Geometry ) : geom Geometry</td>"); 15607 - html += 15608 - wxT 15609 - ("<td bgcolor=\"#f0fff0\">returns a POINT-type Geometry [if possible] or NULL</td></tr>"); 15610 - html += 15611 - wxT 15612 - ("<tr><td bgcolor=\"#fffff0\">CastToLinestring( geom Geometry ) : geom Geometry</td>"); 15613 - html += 15614 - wxT 15615 - ("<td bgcolor=\"#f0fff0\">returns a LINESTRING-type Geometry [if possible] or NULL</td></tr>"); 15616 - html += 15617 - wxT 15618 - ("<tr><td bgcolor=\"#fffff0\">CastToPolygon( geom Geometry ) : geom Geometry</td>"); 15619 - html += 15620 - wxT 15621 - ("<td bgcolor=\"#f0fff0\">returns a POLYGON-type Geometry [if possible] or NULL</td></tr>"); 15622 - html += 15623 - wxT 15624 - ("<tr><td bgcolor=\"#fffff0\">CastToMultiPoint( geom Geometry ) : geom Geometry</td>"); 15625 - html += 15626 - wxT 15627 - ("<td bgcolor=\"#f0fff0\">returns a MULTIPOINT-type Geometry [if possible] or NULL</td></tr>"); 15628 - html += 15629 - wxT 15630 - ("<tr><td bgcolor=\"#fffff0\">CastToMultiLinestring( geom Geometry ) : geom Geometry</td>"); 15631 - html += 15632 - wxT 15633 - ("<td bgcolor=\"#f0fff0\">returns a MULTILINESTRING-type Geometry [if possible] or NULL</td></tr>"); 15634 - html += 15635 - wxT 15636 - ("<tr><td bgcolor=\"#fffff0\">CastToMultiPolygon( geom Geometry ) : geom Geometry</td>"); 15637 - html += 15638 - wxT 15639 - ("<td bgcolor=\"#f0fff0\">returns a MULTIPOLYGON-type Geometry [if possible] or NULL</td></tr>"); 15640 - html += 15641 - wxT 15642 - ("<tr><td bgcolor=\"#fffff0\">CastToGeometryCollection( geom Geometry ) : geom Geometry</td>"); 15643 - html += 15644 - wxT 15645 - ("<td bgcolor=\"#f0fff0\">returns a GEOMETRYCOLLECTION-type Geometry [if possible] or NULL</td></tr>"); 15646 - html += 15647 - wxT 15648 - ("<tr><td bgcolor=\"#fffff0\">CastToMulti( geom Geometry ) : geom Geometry<hr>"); 15649 - html += wxT("ST_Multi( geom Geometry ) : geom Geometry</td>"); 15650 - html += 15651 - wxT 15652 - ("<td bgcolor=\"#f0fff0\">returns a MULTIPOINT-, MULTILINESTRING- or MULTIPOLYGON-type Geometry [if possible]: NULL in any other case</td></tr>"); 15653 - html += 15654 - wxT 15655 - ("<tr><td bgcolor=\"#fffff0\">CastToSingle( geom Geometry ) : geom Geometry</td>"); 15656 - html += 15657 - wxT 15658 - ("<td bgcolor=\"#f0fff0\">returns a POINT-, LINESTRING- or POLYGON-type Geometry [if possible]: NULL in any other case</td></tr>"); 15659 - html += 15660 - wxT 15661 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"dims-cast\">Space-dimensions casting functions</a>"); 15662 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 15663 - html += 15664 - wxT 15665 - ("<tr><td bgcolor=\"#fffff0\">CastToXY( geom Geometry ) : geom Geometry</td>"); 15666 - html += 15667 - wxT 15668 - ("<td bgcolor=\"#f0fff0\">returns a Geometry using the [XY] space dimension</td></tr>"); 15669 - html += 15670 - wxT 15671 - ("<tr><td bgcolor=\"#fffff0\">CastToXYZ( geom Geometry ) : geom Geometry</td>"); 15672 - html += 15673 - wxT 15674 - ("<td bgcolor=\"#f0fff0\">returns a Geometry using the [XYZ] space dimension</td></tr>"); 15675 - html += 15676 - wxT 15677 - ("<tr><td bgcolor=\"#fffff0\">CastToXYM( geom Geometry ) : geom Geometry</td>"); 15678 - html += 15679 - wxT 15680 - ("<td bgcolor=\"#f0fff0\">returns a Geometry using the [XYM] space dimension</td></tr>"); 15681 - html += 15682 - wxT 15683 - ("<tr><td bgcolor=\"#fffff0\">CastToXYZM( geom Geometry ) : geom Geometry</td>"); 15684 - html += 15685 - wxT 15686 - ("<td bgcolor=\"#f0fff0\">returns a Geometry using the [XYZM] space dimension</td></tr>"); 15687 - html += 15688 - wxT 15689 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"c35\">functions on type Point</a>"); 15690 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 15691 - html += 15692 - wxT("<tr><td bgcolor=\"#fffff0\">X( pt Point ) : Double precision<hr>"); 15693 - html += 15694 - wxT 15695 - ("ST_X( pt Point ) : Double precision</td><td bgcolor=\"#f0fff0\">return the x-coordinate of Point p as a double precision number</td></tr>"); 15696 - html += 15697 - wxT("<tr><td bgcolor=\"#fffff0\">Y( pt Point ) : Double precision<hr>"); 15698 - html += 15699 - wxT 15700 - ("ST_Y( pt Point ) : Double precision</td><td bgcolor=\"#f0fff0\">return the y-coordinate of Point p as a double precision number</td></tr>"); 15701 - html += 15702 - wxT("<tr><td bgcolor=\"#fffff0\">Z( pt Point ) : Double precision<hr>"); 15703 - html += 15704 - wxT 15705 - ("ST_Z( pt Point ) : Double precision</td><td bgcolor=\"#f0fff0\">return the z-coordinate of Point p as a double precision number"); 15706 - html += wxT("or NULL if no z-coordinate is available</td></tr>"); 15707 - html += 15708 - wxT("<tr><td bgcolor=\"#fffff0\">M( pt Point ) : Double precision<hr>"); 15709 - html += 15710 - wxT 15711 - ("ST_M( pt Point ) : Double precision</td><td bgcolor=\"#f0fff0\">return the m-coordinate of Point p as a double precision number<br>"); 15712 - html += wxT("or NULL if no m-coordinate is available</td></tr>"); 15713 - html += 15714 - wxT 15715 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"c361\">functions on type Curve [Linestring or Ring]</a></td></tr>"); 15716 - html += wxT("<tr><td bgcolor=\"#fffff0\">StartPoint( c Curve ) : Point<hr>"); 15717 - html += 15718 - wxT 15719 - ("ST_StartPoint( c Curve ) : Point</td><td bgcolor=\"#f0fff0\">return a Point containing the first Point of c</td></tr>"); 15720 - html += wxT("<tr><td bgcolor=\"#fffff0\">EndPoint( c Curve ) : Point<hr>"); 15721 - html += 15722 - wxT 15723 - ("ST_EndPoint( c Curve ) : Point</td><td bgcolor=\"#f0fff0\">return a Point containing the last Point of c</td></tr>"); 15724 - html += 15725 - wxT 15726 - ("<tr><td bgcolor=\"#fffff0\">NumPoints( line LineString ) : Integer<hr>"); 15727 - html += 15728 - wxT 15729 - ("ST_NumPoints( line LineString ) : Integer</td><td bgcolor=\"#f0fff0\">return the number of Points in the LineString</td></tr>"); 15730 - html += 15731 - wxT 15732 - ("<tr><td bgcolor=\"#fffff0\">PointN( line LineString , n Integer ) : Point<hr>"); 15733 - html += 15734 - wxT 15735 - ("ST_PointN( line LineString , n Integer ) : Point</td><td bgcolor=\"#f0fff0\">return a Point containing Point n of line</td></tr>"); 15736 - html += 15737 - wxT 15738 - ("<tr><td bgcolor=\"#fffff0\">GLength( c Curve [ , use_ellipsoid Boolean ] ) : Double precision<hr>"); 15739 - html += 15740 - wxT 15741 - ("ST_Length( c Curve [ , use_ellipsoid Boolean ] ) : Double precision</td><td bgcolor=\"#f0fff0\">return the length of c</td></tr>"); 15742 - html += 15743 - wxT 15744 - ("<tr><td bgcolor=\"#fffff0\">Perimeter( s Surface [ , use_ellipsoid Boolean ] ) : Double precision<hr>"); 15745 - html += 15746 - wxT 15747 - ("ST_Perimeter( s Surface [ , use_ellipsoid Boolean ] ) : Double precision</td><td bgcolor=\"#f0fff0\">return the perimeter of s</td></tr>"); 15748 - html += 15749 - wxT 15750 - ("<tr><td bgcolor=\"#fffff0\">GeodesicLength( c Curve ) : Double precision</td><td bgcolor=\"#f0fff0\">return the geodesic length of c"); 15751 - html += 15752 - wxT 15753 - (" measured on the Ellipsoid [<i>only for <b>geographic</b> SRIDs</i>]</td></tr>"); 15754 - html += 15755 - wxT 15756 - ("<tr><td bgcolor=\"#fffff0\">GreatCircleLength( c Curve ) : Double precision</td><td bgcolor=\"#f0fff0\">return the Great Circle length of c"); 15757 - html += wxT(" [<i>only for <b>geographic</b> SRIDs</i>]</td></tr>"); 15758 - html += wxT("<tr><td bgcolor=\"#fffff0\">IsClosed( c Curve ) : Integer<hr>"); 15759 - html += wxT("ST_IsClosed( c Curve ) : Integer</td>"); 15760 - html += 15761 - wxT 15762 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments<br>"); 15763 - html += 15764 - wxT 15765 - ("return TRUE if c is closed, i.e., if StartPoint(c) = EndPoint(c)</td></tr>"); 15766 - html += wxT("<tr><td bgcolor=\"#fffff0\">IsRing( c Curve ) : Integer<hr>"); 15767 - html += wxT("ST_IsRing( c Curve ) : Integer</td>"); 15768 - html += 15769 - wxT 15770 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments<br>"); 15771 - html += 15772 - wxT 15773 - ("return TRUE if c is a ring, i.e., if c is closed and simple. A simple Curve does not pass through the same Point more than once.</td></tr>"); 15774 - html += 15775 - wxT 15776 - ("<tr><td bgcolor=\"#fffff0\">PointOnSurface( s Surface/Curve ) : Point<hr>"); 15777 - html += 15778 - wxT 15779 - ("ST_PointOnSurface( s Surface ) : Point</td><td bgcolor=\"#f0fff0\">return a Point guaranteed to lie on the Surface (or Curve)</td></tr>"); 15780 - html += 15781 - wxT 15782 - ("<tr><td bgcolor=\"#fffff0\">Simplify( c Curve , tolerance Double precision ) : Curve<hr>"); 15783 - html += 15784 - wxT("ST_Simplify( c Curve , tolerance Double precision ) : Curve<hr>"); 15785 - html += 15786 - wxT("ST_Generalize( c Curve , tolerance Double precision ) : Curve</td>"); 15787 - html += 15788 - wxT 15789 - ("<td bgcolor=\"#f0fff0\">return a geometric object representing a simplified version of c applying the Douglas-Peukert algorithm with given tolerance</td></tr>"); 15790 - html += 15791 - wxT 15792 - ("<tr><td bgcolor=\"#fffff0\">SimplifyPreserveTopology( c Curve , tolerance Double precision ) : Curve<hr>"); 15793 - html += 15794 - wxT 15795 - ("ST_SimplifyPreserveTopology( c Curve , tolerance Double precision ) : Curve</td>"); 15796 - html += 15797 - wxT 15798 - ("<td bgcolor=\"#f0fff0\">return a geometric object representing a simplified version of c "); 15799 - html += 15800 - wxT 15801 - ("applying the Douglas-Peukert algorithm with given tolerance and respecting topology</td></tr>"); 15802 - html += 15803 - wxT 15804 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"c36\">functions on type Surface [Polygon or Ring]</a>"); 15805 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 15806 - html += wxT("<tr><td bgcolor=\"#fffff0\">Centroid( s Surface ) : Point<hr>"); 15807 - html += 15808 - wxT 15809 - ("ST_Centroid( s Surface ) : Point</td><td bgcolor=\"#f0fff0\">return the centroid of s, which may lie outside s</td></tr>"); 15810 - html += 15811 - wxT 15812 - ("<tr><td bgcolor=\"#fffff0\">Area( s Surface [ , use_ellipsoid Boolean ] ) : Double precision<hr>"); 15813 - html += 15814 - wxT 15815 - ("ST_Area( s Surface [ , use_ellipsoid Boolean ] ) : Double precision</td><td bgcolor=\"#f0fff0\">return the area of s</td></tr>"); 15816 - html += 15817 - wxT 15818 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"c37\">functions on type Polygon</a>"); 15819 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 15820 - html += 15821 - wxT 15822 - ("<tr><td bgcolor=\"#fffff0\">ExteriorRing( polyg Polygon ) : LineString<hr>"); 15823 - html += 15824 - wxT 15825 - ("ST_ExteriorRing( polyg Polygon ) : LineString</td><td bgcolor=\"#f0fff0\">return the exteriorRing of p</td></tr>"); 15826 - html += 15827 - wxT 15828 - ("<tr><td bgcolor=\"#fffff0\">NumInteriorRing( polyg Polygon ) : Integer<hr>NumInteriorRings( polyg Polygon ) : Integer<hr>"); 15829 - html += wxT("ST_NumInteriorRing( polyg Polygon ) : Integer</td>"); 15830 - html += 15831 - wxT("<td bgcolor=\"#f0fff0\">return the number of interiorRings</td></tr>"); 15832 - html += 15833 - wxT 15834 - ("<tr><td bgcolor=\"#fffff0\">InteriorRingN( polyg Polygon , n Integer ) : LineString<hr>"); 15835 - html += 15836 - wxT("ST_InteriorRingN( polyg Polygon , n Integer ) : LineString</td>"); 15837 - html += 15838 - wxT 15839 - ("<td bgcolor=\"#f0fff0\">return the nth interiorRing. The order of Rings is not geometrically significant.</td></tr>"); 15840 - html += 15841 - wxT 15842 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"c38\">functions on type GeomCollection</a>"); 15843 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 15844 - html += 15845 - wxT 15846 - ("<tr><td bgcolor=\"#fffff0\">NumGeometries( geom GeomCollection ) : Integer<hr>"); 15847 - html += 15848 - wxT 15849 - ("ST_NumGeometries( geom GeomCollection ) : Integer</td><td bgcolor=\"#f0fff0\">return the number of geometries</td></tr>"); 15850 - html += 15851 - wxT 15852 - ("<tr><td bgcolor=\"#fffff0\">GeometryN( geom GeomCollection , n Integer ) : Geometry<hr>"); 15853 - html += 15854 - wxT("ST_GeometryN( geom GeomCollection , n Integer ) : Geometry</td>"); 15855 - html += 15856 - wxT 15857 - ("<td bgcolor=\"#f0fff0\">return the nth geometric object in the collection. The order of the elements in the collection is not geometrically significant.</td></tr>"); 15858 - html += 15859 - wxT 15860 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"c39\">functions testing approximative spatial relationships via MBRs</a>"); 15861 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 15862 - html += 15863 - wxT 15864 - ("<tr><td bgcolor=\"#fffff0\">MbrEqual( geom1 Geometry , geom2 Geometry ) : Integer</td>"); 15865 - html += 15866 - wxT 15867 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.<br>"); 15868 - html += wxT("TRUE if g1 and g2 have equal MBRs</td></tr>"); 15869 - html += 15870 - wxT 15871 - ("<tr><td bgcolor=\"#fffff0\">MbrDisjoint( geom1 Geometry , geom2 Geometry ) : Integer</td>"); 15872 - html += 15873 - wxT 15874 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.<br>"); 15875 - html += 15876 - wxT 15877 - ("TRUE if the intersection of g1 and g2 MBRs is the empty set</td></tr>"); 15878 - html += 15879 - wxT 15880 - ("<tr><td bgcolor=\"#fffff0\">MbrTouches( geom1 Geometry , geom2 Geometry ) : Integer</td>"); 15881 - html += 15882 - wxT 15883 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.<br>"); 15884 - html += 15885 - wxT 15886 - ("TRUE if the only Points in common between g1 and g2 MBRs lie in the union of the boundaries of g1 and g2</td></tr>"); 15887 - html += 15888 - wxT 15889 - ("<tr><td bgcolor=\"#fffff0\">MbrWithin( geom1 Geometry , geom2 Geometry ) : Integer</td>"); 15890 - html += 15891 - wxT 15892 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.<br>"); 15893 - html += wxT("TRUE if g1 MBR is completely contained in g2 MBR</td></tr>"); 15894 - html += 15895 - wxT 15896 - ("<tr><td bgcolor=\"#fffff0\">MbrOverlaps( geom1 Geometry , geom2 Geometry ) : Integer</td>"); 15897 - html += 15898 - wxT 15899 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.<br>"); 15900 - html += 15901 - wxT 15902 - ("TRUE if the intersection of g1 and g2 MBRs results in a value of the same dimension as g1 and g2 that is different from both g1 and g2</td></tr>"); 15903 - html += 15904 - wxT 15905 - ("<tr><td bgcolor=\"#fffff0\">MbrIntersects( geom1 Geometry , geom2 Geometry ) : Integer</td>"); 15906 - html += 15907 - wxT 15908 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments<br>"); 15909 - html += 15910 - wxT 15911 - ("convenience predicate: TRUE if the intersection of g1 and g2 MBRs is not empty</td></tr>"); 15912 - html += 15913 - wxT 15914 - ("<tr><td bgcolor=\"#fffff0\">ST_EnvIntersects( geom1 Geometry , geom2 Geometry ) : Integer<hr>"); 15915 - html += 15916 - wxT 15917 - ("ST_EnvelopesIntersects( geom1 Geometry , geom2 Geometry ) : Integer<hr>"); 15918 - html += 15919 - wxT 15920 - ("ST_EnvIntersects( geom1 Geometry , x1 Double precision , y1 Double precision , x2 Double precision , y2 Double precision ) : Integer<hr>"); 15921 - html += 15922 - wxT 15923 - ("ST_EnvelopesIntersects( geom1 Geometry , x1 Double precision , y1 Double precision , x2 Double precision , y2 Double precision ) : Integer</td>"); 15924 - html += 15925 - wxT 15926 - ("<td bgcolor=\"#f0fff0\">The first form simply is an alias name for MbrIntersects; the other form allows to define the second MBR by two extreme points [x1, y1] and [x2, y2].<br>"); 15927 - html += 15928 - wxT 15929 - ("The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on invalid arguments<br>"); 15930 - html += 15931 - wxT 15932 - ("convenience predicate: TRUE if the intersection of both MBRs is not empty</td></tr>"); 15933 - html += 15934 - wxT 15935 - ("<tr><td bgcolor=\"#fffff0\">MbrContains( geom1 Geometry , geom2 Geometry ) : Integer</td>"); 15936 - html += 15937 - wxT 15938 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments<br>"); 15939 - html += 15940 - wxT 15941 - ("convenience predicate: TRUE if g2 MBR is completely contained in g1 MBR</td></tr>"); 15942 - html += 15943 - wxT 15944 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"c40\">functions testing spatial relationships</a>"); 15945 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 15946 - html += 15947 - wxT 15948 - ("<tr><td bgcolor=\"#fffff0\">Equals( geom1 Geometry , geom2 Geometry ) : Integer<hr>"); 15949 - html += wxT("ST_Equals( geom1 Geometry , geom2 Geometry ) : Integer</td>"); 15950 - html += 15951 - wxT 15952 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.<br>"); 15953 - html += wxT("TRUE if g1 and g2 are equal</td></tr>"); 15954 - html += 15955 - wxT 15956 - ("<tr><td bgcolor=\"#fffff0\">Disjoint( geom1 Geometry , geom2 Geometry ) : Integer<hr>"); 15957 - html += wxT("ST_Disjoint( geom1 Geometry , geom2 Geometry ) : Integer</td>"); 15958 - html += 15959 - wxT 15960 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.<br>"); 15961 - html += 15962 - wxT("TRUE if the intersection of g1 and g2 is the empty set</td></tr>"); 15963 - html += 15964 - wxT 15965 - ("<tr><td bgcolor=\"#fffff0\">Touches( geom1 Geometry , geom2 Geometry ) : Integer<hr>"); 15966 - html += wxT("ST_Touches( geom1 Geometry , geom2 Geometry ) : Integer</td>"); 15967 - html += 15968 - wxT 15969 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.<br>"); 15970 - html += 15971 - wxT 15972 - ("TRUE if the only Points in common between g1 and g2 lie in the union of the boundaries of g1 and g2</td></tr>"); 15973 - html += 15974 - wxT 15975 - ("<tr><td bgcolor=\"#fffff0\">Within( geom1 Geometry , geom2 Geometry ) : Integer<hr>"); 15976 - html += wxT("ST_Within( geom1 Geometry , geom2 Geometry ) : Integer</td>"); 15977 - html += 15978 - wxT 15979 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.<br>"); 15980 - html += wxT("TRUE if g1 is completely contained in g2</td></tr>"); 15981 - html += 15982 - wxT 15983 - ("<tr><td bgcolor=\"#fffff0\">Overlaps( geom1 Geometry , geom2 Geometry ) : Integer<hr>"); 15984 - html += wxT("ST_Overlaps( geom1 Geometry , geom2 Geometry ) : Integer</td>"); 15985 - html += 15986 - wxT 15987 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.<br>"); 15988 - html += 15989 - wxT 15990 - ("TRUE if the intersection of g1 and g2 results in a value of the same dimension as g1 and g2 that is different from both g1 and g2</td></tr>"); 15991 - html += 15992 - wxT 15993 - ("<tr><td bgcolor=\"#fffff0\">Crosses( geom1 Geometry , geom2 Geometry ) : Integer<hr>"); 15994 - html += wxT("ST_Crosses( geom1 Geometry , geom2 Geometry ) : Integer</td>"); 15995 - html += 15996 - wxT 15997 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.<br>"); 15998 - html += 15999 - wxT 16000 - ("TRUE if the intersection of g1 and g2 results in a value whose dimension is less than the maximum dimension of g1 and g2 "); 16001 - html += 16002 - wxT 16003 - ("and the intersection value includes Points interior to both g1 and g2, and the intersection value is not equal to either g1 or g2</td></tr>"); 16004 - html += 16005 - wxT 16006 - ("<tr><td bgcolor=\"#fffff0\">Intersects( geom1 Geometry , geom2 Geometry ) : Integer<hr>"); 16007 - html += 16008 - wxT("ST_Intersects( geom1 Geometry , geom2 Geometry ) : Integer</td>"); 16009 - html += 16010 - wxT 16011 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments<br>"); 16012 - html += 16013 - wxT 16014 - ("convenience predicate: TRUE if the intersection of g1 and g2 is not empty</td></tr>"); 16015 - html += 16016 - wxT 16017 - ("<tr><td bgcolor=\"#fffff0\">Contains( geom1 Geometry , geom2 Geometry ) : Integer<hr>"); 16018 - html += wxT("ST_Contains( geom1 Geometry , geom2 Geometry ) : Integer</td>"); 16019 - html += 16020 - wxT 16021 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments<br>"); 16022 - html += 16023 - wxT 16024 - ("convenience predicate: TRUE if g2 is completely contained in g1</td></tr>"); 16025 - html += 16026 - wxT 16027 - ("<tr><td bgcolor=\"#fffff0\">Covers( geom1 Geometry , geom2 Geometry ) : Integer</td>"); 16028 - html += 16029 - wxT 16030 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments<br>"); 16031 - html += 16032 - wxT("convenience predicate: TRUE if g1 completely covers g2</td></tr>"); 16033 - html += 16034 - wxT 16035 - ("<tr><td bgcolor=\"#fffff0\">CoveredBy( geom1 Geometry , geom2 Geometry ) : Integer</td>"); 16036 - html += 16037 - wxT 16038 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments<br>"); 16039 - html += 16040 - wxT 16041 - ("convenience predicate: TRUE if g1 is completely covered by g2</td></tr>"); 16042 - html += 16043 - wxT 16044 - ("<tr><td bgcolor=\"#fffff0\">Relate( geom1 Geometry , geom2 Geometry , patternMatrix String ) : Integer<hr>"); 16045 - html += 16046 - wxT 16047 - ("ST_Relate( geom1 Geometry , geom2 Geometry , patternMatrix String ) : Integer</td>"); 16048 - html += 16049 - wxT 16050 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.<br>"); 16051 - html += 16052 - wxT 16053 - ("return TRUE if the spatial relationship specified by the patternMatrix holds</td></tr>"); 16054 - html += 16055 - wxT 16056 - ("<tr><td bgcolor=\"#fffff0\">Distance( geom1 Geometry , geom2 Geometry [ , use_ellipsoid Boolean ] ) : Double precision<hr>"); 16057 - html += 16058 - wxT 16059 - ("ST_Distance( geom1 Geometry , geom2 Geometry [ , use_ellipsoid Boolean ] ) : Double precision</td>"); 16060 - html += 16061 - wxT 16062 - ("<td bgcolor=\"#f0fff0\">return the distance between geom1 and geom2</td></tr>"); 16063 - html += 16064 - wxT 16065 - ("<tr><td bgcolor=\"#fffff0\">HausdorffDistance( geom1 Geometry , geom2 Geometry ) : Double precision<hr>"); 16066 - html += 16067 - wxT 16068 - ("ST_HausdorffDistance( geom1 Geometry , geom2 Geometry ) : Double precision</td>"); 16069 - html += 16070 - wxT 16071 - ("<td bgcolor=\"#f0fff0\">return the Hausdorff Distance between geom1 and geom2</td></tr>"); 16072 - html += 16073 - wxT 16074 - ("<tr><td bgcolor=\"#fffff0\">PtDistWithin( geom1 Geometry , geom2 Geometry , range Double precision [ , use_spheroid Integer ] ) : Integer</td>"); 16075 - html += 16076 - wxT 16077 - ("<td bgcolor=\"#f0fff0\">checks if the distance between geom1 and geom2 is within the given range.<br>"); 16078 - html += 16079 - wxT 16080 - ("As a special case if both geoms are simple WGS84 POINTs (SRID=4326) distances are expessed in meters.</td></tr>"); 16081 - html += 16082 - wxT 16083 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"c41\">functions implementing spatial operators</a>"); 16084 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 16085 - html += 16086 - wxT 16087 - ("<tr><td bgcolor=\"#fffff0\">Intersection( geom1 Geometry , geom2 Geometry ) : Geometry<hr>"); 16088 - html += 16089 - wxT("ST_Intersection( geom1 Geometry , geom2 Geometry ) : Geometry</td>"); 16090 - html += 16091 - wxT 16092 - ("<td bgcolor=\"#f0fff0\">return a geometric object that is the intersection of geometric objects geom1 and geom2</td></tr>"); 16093 - html += 16094 - wxT 16095 - ("<tr><td bgcolor=\"#fffff0\">Difference( geom1 Geometry , geom2 Geometry ) : Geometry<hr>"); 16096 - html += 16097 - wxT("ST_Difference( geom1 Geometry , geom2 Geometry ) : Geometry</td>"); 16098 - html += 16099 - wxT 16100 - ("<td bgcolor=\"#f0fff0\">return a geometric object that is the closure of the set difference of geom1 and geom2</td></tr>"); 16101 - html += 16102 - wxT 16103 - ("<tr><td bgcolor=\"#fffff0\">GUnion( geom1 Geometry , geom2 Geometry ) : Geometry<hr>"); 16104 - html += wxT("ST_Union( geom1 Geometry , geom2 Geometry ) : Geometry</td>"); 16105 - html += 16106 - wxT 16107 - ("<td bgcolor=\"#f0fff0\">return a geometric object that is the set union of geom1 and geom2</td></tr>"); 16108 - html += 16109 - wxT("<tr><td bgcolor=\"#fffff0\">GUnion( geom Geometry ) : Geometry<hr>"); 16110 - html += wxT("ST_Union( geom Geometry ) : Geometry</td>"); 16111 - html += 16112 - wxT 16113 - ("<td bgcolor=\"#f0fff0\">return a geometric object that is the set union of input values<br>"); 16114 - html += wxT("<b><u>aggregate function</u></b></td></tr>"); 16115 - html += 16116 - wxT 16117 - ("<tr><td bgcolor=\"#fffff0\">SymDifference( geom1 Geometry , geom2 Geometry ) : Geometry<hr>"); 16118 - html += 16119 - wxT("ST_SymDifference( geom1 Geometry , geom2 Geometry ) : Geometry</td>"); 16120 - html += 16121 - wxT 16122 - ("<td bgcolor=\"#f0fff0\">return a geometric object that is the closure of the set symmetric difference of geom1 and geom2 (logical XOR of space)</td></tr>"); 16123 - html += 16124 - wxT 16125 - ("<tr><td bgcolor=\"#fffff0\">Buffer( geom Geometry , dist Double precision ) : Geometry<hr>"); 16126 - html += 16127 - wxT("ST_Buffer( geom Geometry , dist Double precision ) : Geometry</td>"); 16128 - html += 16129 - wxT 16130 - ("<td bgcolor=\"#f0fff0\">return a geometric object defined by buffering a distance d around geom, "); 16131 - html += 16132 - wxT 16133 - ("where dist is in the distance units for the Spatial Reference of geom</td></tr>"); 16134 - html += 16135 - wxT 16136 - ("<tr><td bgcolor=\"#fffff0\">ConvexHull( geom Geometry ) : Geometry<hr>"); 16137 - html += wxT("ST_ConvexHull( geom Geometry ) : Geometry</td>"); 16138 - html += 16139 - wxT 16140 - ("<td bgcolor=\"#f0fff0\">return a geometric object that is the convex hull of geom</td></tr>"); 16141 - html += 16142 - wxT 16143 - ("<tr><td bgcolor=\"#fffff0\">OffsetCurve( geom Curve , radius Double precision, left_or_right Integer ) : Curve<hr>"); 16144 - html += 16145 - wxT 16146 - ("ST_OffsetCurve( geom Curve , radius Double precision, left_or_right Integer ) : Curve</td>"); 16147 - html += 16148 - wxT 16149 - ("<td bgcolor=\"#f0fff0\">return a geometric object representing the corresponding left- (or right-sided) offset curve<br>"); 16150 - html += 16151 - wxT 16152 - ("NULL if returned whenever is not possible deriving an offset curve from the original geometry<br>"); 16153 - html += 16154 - wxT("[a single not-closed LINESTRING is expected as input]</td></tr>"); 16155 - html += 16156 - wxT 16157 - ("<tr><td bgcolor=\"#fffff0\">SingleSidedBuffer( geom Curve , radius Double precision, left_or_right Integer ) : Curve<hr>"); 16158 - html += 16159 - wxT 16160 - ("ST_SingleSidedBuffer( geom Curve , radius Double precision, left_or_right Integer ) : Curve</td>"); 16161 - html += 16162 - wxT 16163 - ("<td bgcolor=\"#f0fff0\">return a geometric object representing the corresponding left- (or right-sided) single-sided buffer<br>"); 16164 - html += 16165 - wxT 16166 - ("NULL if returned whenever is not possible deriving a single-sided buffer from the original geometry<br>"); 16167 - html += 16168 - wxT("[a single not-closed LINESTRING is expected as input]</td></tr>"); 16169 - html += 16170 - wxT 16171 - ("<tr><td bgcolor=\"#fffff0\">SharedPaths( geom1 Geometry , geom2 Geometry ) : Geometry<hr>"); 16172 - html += 16173 - wxT("ST_SharedPaths( geom1 Geometry , geom2 Geometry ) : Geometry</td>"); 16174 - html += 16175 - wxT 16176 - ("<td bgcolor=\"#f0fff0\">return a geometric object (of the MULTILINESTRING type) representing any common edge shared by both geometries<br>"); 16177 - html += wxT("NULL if returned is no common edge exists</td></tr>"); 16178 - html += 16179 - wxT 16180 - ("<tr><td bgcolor=\"#fffff0\">Line_Interpolate_Point( line Curve , fraction Double precision ) : Point<hr>"); 16181 - html += 16182 - wxT 16183 - ("ST_Line_Interpolate_Point( line Curve , fraction Double precision ) : Point</td>"); 16184 - html += 16185 - wxT 16186 - ("<td bgcolor=\"#f0fff0\">return a point interpolated along a line.<br>Second argument (between 0.0 and 1.0) representing fraction"); 16187 - html += wxT("of total length of linestring the point has to be located.<br>"); 16188 - html += wxT("NULL if returned for invalid arguments</td></tr>"); 16189 - html += 16190 - wxT 16191 - ("<tr><td bgcolor=\"#fffff0\">Line_Interpolate_Equidistant_Points( line Curve , distance Double precision ) : Point<hr>"); 16192 - html += 16193 - wxT 16194 - ("ST_Line_Interpolate_Equidistant_Points( line Curve , distance Double precision ) : Point</td>"); 16195 - html += 16196 - wxT 16197 - ("<td bgcolor=\"#f0fff0\">return a set of equidistant points interpolated along a line; the returned geometry "); 16198 - html += 16199 - wxT 16200 - ("always corresponds to a MULTIPOINT supporting the M coordinate (representing the progressive distance for each interpolated Point).<br>"); 16201 - html += 16202 - wxT 16203 - ("Second argument represents the regular distance between interpolated points.<br>"); 16204 - html += wxT("NULL if returned for invalid arguments</td></tr>"); 16205 - html += 16206 - wxT 16207 - ("<tr><td bgcolor=\"#fffff0\">Line_Locatate_Point( line Curve , point Point ) : Double precision<hr>"); 16208 - html += 16209 - wxT 16210 - ("ST_Line_Locate_Point( line Curve , point Point ) : Double precision</td>"); 16211 - html += 16212 - wxT 16213 - ("<td bgcolor=\"#f0fff0\">return a number (between 0.0 and 1.0) representing the location of the closest point on LineString"); 16214 - html += wxT("to the given Point, as a fraction of total 2d line length.<br>"); 16215 - html += wxT("NULL if returned for invalid arguments</td></tr>"); 16216 - html += 16217 - wxT 16218 - ("<tr><td bgcolor=\"#fffff0\">Line_Substring( line Curve , start_fraction Double precision , end_fraction Double precision ) : Curve<hr>"); 16219 - html += 16220 - wxT 16221 - ("ST_Line_Substring( line Curve , start_fraction Double precision , end_fraction Double precision ) : Curve</td>"); 16222 - html += 16223 - wxT 16224 - ("<td bgcolor=\"#f0fff0\">Return a Linestring being a substring of the input one starting and ending at the given fractions of total 2d length.<br>"); 16225 - html += 16226 - wxT 16227 - ("Second and third arguments are expected to be in the range between 0.0 and 1.0.<br>"); 16228 - html += wxT("NULL if returned for invalid arguments</td></tr>"); 16229 - html += 16230 - wxT 16231 - ("<tr><td bgcolor=\"#fffff0\">ClosestPoint( geom1 Geometry , geom2 Geometry ) : Point<hr>"); 16232 - html += 16233 - wxT("ST_ClosestPoint( geom1 Geometry , geom2 Geometry ) : Point</td>"); 16234 - html += 16235 - wxT 16236 - ("<td bgcolor=\"#f0fff0\">Returns the Point on geom1 that is closest to geom2.<br>"); 16237 - html += 16238 - wxT 16239 - ("NULL is returned for invalid arguments (or if distance is ZERO)</td></tr>"); 16240 - html += 16241 - wxT 16242 - ("<tr><td bgcolor=\"#fffff0\">ShortestLine( geom1 Geometry , geom2 Geometry ) : Curve<hr>"); 16243 - html += 16244 - wxT("ST_ShortestLine( geom1 Geometry , geom2 Geometry ) : Curve</td>"); 16245 - html += 16246 - wxT 16247 - ("<td bgcolor=\"#f0fff0\">Returns the shortest line between two geometries.<br>"); 16248 - html += 16249 - wxT 16250 - ("NULL is returned for invalid arguments (or if distance is ZERO)</td></tr>"); 16251 - html += 16252 - wxT 16253 - ("<tr><td bgcolor=\"#fffff0\">Snap( geom1 Geometry , geom2 Geometry , tolerance Double precision ) : Geometry<hr>"); 16254 - html += 16255 - wxT 16256 - ("ST_Snap( geom1 Geometry , geom2 Geometry , tolerance Double precision ) : Geometry</td>"); 16257 - html += 16258 - wxT 16259 - ("<td bgcolor=\"#f0fff0\">Returns a new Geometry representing a modified geom1, so to \"snap\" vertices "); 16260 - html += 16261 - wxT 16262 - ("and segments to geom2 vertices; a snap distance tolerance is used to control where snapping is performed.<br>"); 16263 - html += wxT("NULL is returned for invalid arguments</td></tr>"); 16264 - html += 16265 - wxT 16266 - ("<tr><td bgcolor=\"#fffff0\">LineMerge( geom Geometry ) : Geometry<hr>"); 16267 - html += wxT("ST_LineMerge( geom Geometry ) : Geometry</td>"); 16268 - html += 16269 - wxT 16270 - ("<td bgcolor=\"#f0fff0\">a Geometry (actually corresponding to a LINESTRING or MULTILINESTRING) will be returned."); 16271 - html += 16272 - wxT 16273 - ("The input Geometry is expected to represent a LINESTRING or a MULTILINESTRING.<br>The input Geometry can be an "); 16274 - html += 16275 - wxT 16276 - ("arbitrary collection of sparse line fragments: this function will then try to (possibly) reassemble them into one"); 16277 - html += wxT("(or more) Linestring(s).<br>"); 16278 - html += wxT("NULL is returned for invalid arguments</td></tr>"); 16279 - html += 16280 - wxT 16281 - ("<tr><td bgcolor=\"#fffff0\">UnaryUnion( geom Geometry ) : Geometry<hr>"); 16282 - html += wxT("ST_UnaryUnion( geom Geometry ) : Geometry</td>"); 16283 - html += 16284 - wxT 16285 - ("<td bgcolor=\"#f0fff0\">Exactely the same as ST_Union, but applied to a single Geometry.<br>"); 16286 - html += 16287 - wxT 16288 - ("(set union of elementary Geometries within a MULTI- or GEOMETRYCOLLECTION complex Geometry).<br>"); 16289 - html += wxT("NULL will be returned if any error is encountered</td></tr>"); 16290 - html += 16291 - wxT 16292 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"c42\">functions for coordinate transformations</a>"); 16293 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 16294 - html += 16295 - wxT 16296 - ("<tr><td bgcolor=\"#fffff0\">Transform( geom Geometry , newSRID Integer ) : Geometry<br>"); 16297 - html += 16298 - wxT("ST_Transform( geom Geometry , newSRID Integer ) : Geometry</td>"); 16299 - html += 16300 - wxT 16301 - ("<td bgcolor=\"#f0fff0\">return a geometric object obtained by reprojecting coordinates into the Reference System identified by newSRID</td></tr>"); 16302 - html += 16303 - wxT 16304 - ("<tr><td bgcolor=\"#fffff0\">SridFromAuthCRS( auth_name String , auth_SRID Integer ) : Integer</td>"); 16305 - html += 16306 - wxT 16307 - ("<td bgcolor=\"#f0fff0\">return the internal SRID corresponding to auth_name and auth_SRID<br>-1 will be returned if no such CRS is defined</td></tr>"); 16308 - html += 16309 - wxT 16310 - ("<tr><td bgcolor=\"#fffff0\">ShiftCoords( geom Geometry , shiftX Double precision , shiftY Double precision ) : Geometry<hr>"); 16311 - html += 16312 - wxT 16313 - ("ShiftCoordinates( geom Geometry , shiftX Double precision , shiftY Double precision ) : Geometry</td>"); 16314 - html += 16315 - wxT 16316 - ("<td bgcolor=\"#f0fff0\">return a geometric object obtained by translating coordinates according to shiftX and shiftY values</td></tr>"); 16317 - html += 16318 - wxT 16319 - ("<tr><td bgcolor=\"#fffff0\">ST_Translate( geom Geometry , shiftX Double precision , shiftY Double precision , shiftZ Double Precision ) : Geometry</td>"); 16320 - html += 16321 - wxT 16322 - ("<td bgcolor=\"#f0fff0\">return a geometric object obtained by translating coordinates according to shiftX, shiftY and shiftZ values</td></tr>"); 16323 - html += 16324 - wxT 16325 - ("<tr><td bgcolor=\"#fffff0\">ST_Shift_Longitude( geom Geometry ) : Geometry</td>"); 16326 - html += 16327 - wxT 16328 - ("<td bgcolor=\"#f0fff0\">return a geometric object obtained by translating any negative longitude by 360.<hr>"); 16329 - html += 16330 - wxT 16331 - ("Only meaningful for geographic (longitude/latitude) coordinates.</td></tr>"); 16332 - html += 16333 - wxT 16334 - ("<tr><td bgcolor=\"#fffff0\">NormalizeLonLat( geom Geometry ) : Geometry</td>"); 16335 - html += 16336 - wxT 16337 - ("<td bgcolor=\"#f0fff0\">return a geometric object obtained by normalizing any longitude in the range"); 16338 - html += wxT("[-180 / +180] and any latitude in the range [-90 / + 90].<hr>"); 16339 - html += 16340 - wxT 16341 - ("Only meaningful for geographic (longitude/latitude) coordinates.</td></tr>"); 16342 - html += 16343 - wxT 16344 - ("<tr><td bgcolor=\"#fffff0\">ScaleCoords( geom Geometry , scaleX Double precision [ , scaleY Double precision ] ) : Geometry<hr>"); 16345 - html += 16346 - wxT 16347 - ("ScaleCoordinates( geom Geometry , scaleX Double precision [ , scaleY Double precision ] ) : Geometry</td>"); 16348 - html += 16349 - wxT 16350 - ("<td bgcolor=\"#f0fff0\">return a geometric object obtained by scaling coordinates according to scaleX and scaleY values<br>"); 16351 - html += 16352 - wxT 16353 - ("if only one scale factor is specified, then an isotropic scaling occurs [i.e. the same scale factor is applied to both axis]"); 16354 - html += 16355 - wxT 16356 - ("otherwise an anisotropic scaling occurs [i.e. each axis is scaled according to its own scale factor]</td></tr>"); 16357 - html += 16358 - wxT 16359 - ("<tr><td bgcolor=\"#fffff0\">RotateCoords( geom Geometry , angleInDegrees Double precision ) : Geometry<hr>"); 16360 - html += 16361 - wxT 16362 - ("RotateCoordinates( geom Geometry , angleInDegrees Double precision ) : Geometry</td>"); 16363 - html += 16364 - wxT 16365 - ("<td bgcolor=\"#f0fff0\">return a geometric object obtained by rotating coordinates according to angleInDegrees value<br>"); 16366 - html += wxT("Positive angle = clockwise rotation</td></tr>"); 16367 - html += 16368 - wxT 16369 - ("<tr><td bgcolor=\"#fffff0\">ReflectCoords( geom Geometry , xAxis Integer , yAxis Integer ) : Geometry<hr>"); 16370 - html += 16371 - wxT 16372 - ("ReflectCoordinates( geom Geometry , xAxis Integer , yAxis Integer ) : Geometry</td>"); 16373 - html += 16374 - wxT 16375 - ("<td bgcolor=\"#f0fff0\">return a geometric object obtained by reflecting coordinates according to xAxis and yAxis switches<br>"); 16376 - html += 16377 - wxT 16378 - ("i.e. if xAxis is 0 (FALSE), then x-coordinates remains untouched; otherwise x-coordinates will be reflected</td></tr>"); 16379 - html += 16380 - wxT 16381 - ("<tr><td bgcolor=\"#fffff0\">SwapCoords( geom Geometry ) : Geometry<hr>SwapCoordinates( geom Geometry ) : Geometry</td>"); 16382 - html += 16383 - wxT 16384 - ("<td bgcolor=\"#f0fff0\">return a geometric object obtained by swapping x- and y-coordinates</td></tr>"); 16385 - html += 16386 - wxT 16387 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"c43\">functions for Spatial-MetaData and Spatial-Index handling</a>"); 16388 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 16389 - html += wxT 16390 - ("<tr><td bgcolor=\"#fffff0\">InitSpatialMetaData( void ) : Integer<hr>"); 16391 - html += wxT("InitSpatialMetaData( transaction Integer ) : Integer<hr>"); 16392 - html += wxT("InitSpatialMetaData( mode String ) : Integer<hr>"); 16393 - html += 16394 - wxT 16395 - ("InitSpatialMetaData( transaction Integer , mode String ) : Integer</td>"); 16396 - html += 16397 - wxT 16398 - ("<td bgcolor=\"#f0fff0\">Creates the geometry_columns and spatial_ref_sys metadata tables"); 16399 - html += 16400 - wxT 16401 - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE<hr>"); 16402 - html += 16403 - wxT 16404 - ("the first form (no args) will automatically populate spatial_ref_sys inserting any possible ESPG SRID definition<br>"); 16405 - html += 16406 - wxT 16407 - ("if the arg 'WGS84' (alias 'WGS84_ONLY') is specified, then only WGS84-releated EPSG SRIDs will be inserted<br>"); 16408 - html += 16409 - wxT 16410 - ("if the arg 'NONE' (alias 'EMPTY') is specified, no EPSG SRID will be inserted at all</td></tr>"); 16411 - html += 16412 - wxT 16413 - ("<tr><td bgcolor=\"#fffff0\">InsertEpsgSrid( srid <i>Integer</i> ) : Integer</td>"); 16414 - html += 16415 - wxT 16416 - ("<td bgcolor=\"#f0fff0\">Attempts to insert into spatial_ref_sys the EPSG definition uniquely identified by srid<br>"); 16417 - html += 16418 - wxT 16419 - ("[the corresponding EPSG SRID definition will be copied from the inlined dataset defined in libspatialite<hr>"); 16420 - html += 16421 - wxT 16422 - ("the return type is Integer, with a return value of 1 for success or 0 for failure</td></tr>"); 16423 - html += 16424 - wxT 16425 - ("<tr><td bgcolor=\"#fffff0\">AddGeometryColumn( table String , column String , srid Integer , geom_type String , dimension String [ , not_null Integer ] ) : Integer</td>"); 16426 - html += 16427 - wxT 16428 - ("<td bgcolor=\"#f0fff0\">Creates a new geometry column updating the Spatial Metadata tables and creating any required trigger in order to enforce constraints<br>"); 16429 - html += 16430 - wxT 16431 - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE</td></tr>"); 16432 - html += 16433 - wxT 16434 - ("<tr><td bgcolor=\"#fffff0\">RecoverGeometryColumn( table String , column String , srid Integer , geom_type String , dimension String ) : Integer</td>"); 16435 - html += 16436 - wxT 16437 - ("<td bgcolor=\"#f0fff0\">Validates an existing ordinary column in order to possibly transform it in a real geometry column, "); 16438 - html += 16439 - wxT 16440 - ("thus updating the Spatial Metadata tables and creating any required trigger in order to enforce constraints<br>"); 16441 - html += 16442 - wxT 16443 - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE</td></tr>"); 16444 - html += 16445 - wxT 16446 - ("<tr><td bgcolor=\"#fffff0\">DiscardGeometryColumn( table String , column String ) : Integer</td>"); 16447 - html += 16448 - wxT 16449 - ("<td bgcolor=\"#f0fff0\">Removes a geometry column from Spatial MetaData tables and drops any related trigger<br>"); 16450 - html += 16451 - wxT 16452 - ("the column itself still continues to exist untouched as an ordinary, unconstrained column<br>"); 16453 - html += 16454 - wxT 16455 - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE</td></tr>"); 16456 - html += 16457 - wxT 16458 - ("<tr><td bgcolor=\"#fffff0\">RegisterVirtualGeometry( table String ) : Integer</td>"); 16459 - html += 16460 - wxT 16461 - ("<td bgcolor=\"#f0fff0\">Registers a VirtualShape table into Spatial MetaData tables; the VirtualShape table should be already created in some previous step.<br>"); 16462 - html += 16463 - wxT 16464 - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE</td></tr>"); 16465 - html += 16466 - wxT 16467 - ("<tr><td bgcolor=\"#fffff0\">DropVirtualGeometry( table String ) : Integer</td>"); 16468 - html += 16469 - wxT 16470 - ("<td bgcolor=\"#f0fff0\">Removes a VirtualShape table from Spatial MetaData tables, dropping the VirtualShape table as well.<br>"); 16471 - html += 16472 - wxT 16473 - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE</td></tr>"); 16474 - html += 16475 - wxT 16476 - ("<tr><td bgcolor=\"#fffff0\">CreateSpatialIndex( table String , column String ) : Integer</td>"); 16477 - html += 16478 - wxT 16479 - ("<td bgcolor=\"#f0fff0\">Builds an RTree Spatial Index on a geometry column, "); 16480 - html += 16481 - wxT 16482 - ("creating any required trigger required in order to enforce full data coherency between the main table and Spatial Index<br>"); 16483 - html += 16484 - wxT 16485 - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE</td></tr>"); 16486 - html += 16487 - wxT 16488 - ("<tr><td bgcolor=\"#fffff0\">DisableSpatialIndex( table String , column String ) : Integer</td>"); 16489 - html += 16490 - wxT 16491 - ("<td bgcolor=\"#f0fff0\">Disables an RTree Spatial Index, removing any related trigger<br>"); 16492 - html += 16493 - wxT 16494 - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE</td></tr>"); 16495 - html += 16496 - wxT 16497 - ("<tr><td bgcolor=\"#fffff0\">CheckShadowedRowid( table String ) : Integer</td>"); 16498 - html += 16499 - wxT 16500 - ("<td bgcolor=\"#f0fff0\">Checks if some table has a physical column named \"rowid\" (caseless) shadowing the real ROWID.<br>"); 16501 - html += 16502 - wxT 16503 - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE</td></tr>"); 16504 - html += 16505 - wxT("<tr><td bgcolor=\"#fffff0\">CheckSpatialIndex( void ) : Integer<hr>"); 16506 - html += 16507 - wxT("CheckSpatialIndex( table String , column String ) : Integer</td>"); 16508 - html += 16509 - wxT 16510 - ("<td bgcolor=\"#f0fff0\">Checks an RTree Spatial Index for validity and consistency<br>"); 16511 - html += 16512 - wxT 16513 - ("- if no arguments are passed, then any RTree defined into geometry_columns will be checked<br>"); 16514 - html += 16515 - wxT 16516 - ("- otherwise only the RTree corresponding to table and column will be checked<br>"); 16517 - html += 16518 - wxT 16519 - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE</td></tr>"); 16520 - html += 16521 - wxT 16522 - ("<tr><td bgcolor=\"#fffff0\">RecoverSpatialIndex( [ no_check Integer ] ) : Integer<hr>"); 16523 - html += 16524 - wxT 16525 - ("RecoverSpatialIndex( table String , column String [ , no_check Integer ] ) : Integer</td>"); 16526 - html += 16527 - wxT 16528 - ("<td bgcolor=\"#f0fff0\">Recovers a (possibly broken) RTree Spatial Index<br>"); 16529 - html += 16530 - wxT 16531 - ("- if no arguments are passed, then any RTree defined into geometry_columns will be recovered<br>"); 16532 - html += 16533 - wxT 16534 - ("- otherwise only the RTree corresponding to table and column will be recovered<br>"); 16535 - html += 16536 - wxT("- the optional argument no_check will be interpreted as follows:<br>"); 16537 - html += 16538 - wxT 16539 - (" * if no_check = FALSE (default) the RTree will be checked first: "); 16540 - html += wxT("and only an invalid RTree will be then actually rebuilt<br>"); 16541 - html += 16542 - wxT 16543 - (" * if no_check = TRUE the RTree will be unconditionally rebuilt from scratch anyway<br>"); 16544 - html += 16545 - wxT 16546 - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE</td></tr>"); 16547 - html += 16548 - wxT 16549 - ("<tr><td bgcolor=\"#fffff0\">InvalidateLayerStatistics( void ) : Integer<hr>"); 16550 - html += 16551 - wxT 16552 - ("InvalidateLayerStatistics( table String [, column String ] ) : Integer</td>"); 16553 - html += 16554 - wxT 16555 - ("<td bgcolor=\"#f0fff0\">Immediately and unconditionally invalidates the internal Layer Statistics<br>"); 16556 - html += 16557 - wxT 16558 - ("- if no arguments are passed, then internal statics will be invalidated for any possible Geometry Column "); 16559 - html += wxT("defined in the current DB<br>"); 16560 - html += 16561 - wxT 16562 - ("- otherwise statistics will be invalidated only for Geometry Columns corresponding to the given table<br>"); 16563 - html += 16564 - wxT 16565 - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE</td></tr>"); 16566 - html += 16567 - wxT 16568 - ("<tr><td bgcolor=\"#fffff0\">UpdateLayerStatistics( void ) : Integer<hr>"); 16569 - html += 16570 - wxT 16571 - ("UpdateLayerStatistics( table String [, column String ] ) : Integer</td>"); 16572 - html += 16573 - wxT 16574 - ("<td bgcolor=\"#f0fff0\">Updates the internal Layer Statistics [Feature Count and Total Extent]<br>"); 16575 - html += 16576 - wxT 16577 - ("- if no arguments are passed, then internal statics will be updated for any possible Geometry Column "); 16578 - html += wxT("defined in the current DB<br>"); 16579 - html += 16580 - wxT 16581 - ("- otherwise statistics will be updated only for Geometry Columns corresponding to the given table<br>"); 16582 - html += 16583 - wxT 16584 - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE</td></tr>"); 16585 - html += 16586 - wxT 16587 - ("<tr><td bgcolor=\"#fffff0\">GetLayerExtent( table String [ , column String [ , mode Boolean] ] ) : Geometry</td>"); 16588 - html += 16589 - wxT 16590 - ("<td bgcolor=\"#f0fff0\">Return the Envelope corresponding to the Total Extent of some Layer; "); 16591 - html += 16592 - wxT 16593 - ("if the Table/Layer only contains a single Geometry column passing the column name isn't strictly required.<br>"); 16594 - html += 16595 - wxT 16596 - ("NULL will be returned if any error occurs or if the required table isn't a Layer.</td></tr>"); 16597 - html += 16598 - wxT 16599 - ("<tr><td bgcolor=\"#fffff0\">CreateTopologyTables( SRID Integer , dims String ) : Integer<hr>"); 16600 - html += 16601 - wxT 16602 - ("CreateTopologyTables( prefix String , SRID Integer , dims String ) : Integer</td>"); 16603 - html += 16604 - wxT("<td bgcolor=\"#f0fff0\">Creates a set of <b>Topology</b> tables.<br>"); 16605 - html += 16606 - wxT 16607 - ("<ul><li>the SRIDargument is mandatory</li><li>the dims argument must be 'XY' or 'XYZ': 2 or 3 are valid aliases</li>"); 16608 - html += 16609 - wxT 16610 - ("<li>the optionalargument prefix can be used to support more Topology sets on the same DB: "); 16611 - html += 16612 - wxT 16613 - ("if omitted a \"topo_\" prefix will be assumed by default</li></ul><hr>"); 16614 - html += 16615 - wxT 16616 - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE (failure).</td></tr>"); 16617 - html += 16618 - wxT 16619 - ("<tr><td bgcolor=\"#fffff0\">CreateRasterCoveragesTable( void ) : Integer</td>"); 16620 - html += 16621 - wxT 16622 - ("<td bgcolor=\"#f0fff0\">Creates the <b>raster_coverages</b> table required by RasterLite-2<hr>"); 16623 - html += 16624 - wxT 16625 - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE (failure).</td></tr>"); 16626 - html += 16627 - wxT 16628 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"c43metacatalog\">functions for MetaCatalog and related Statistics</a>"); 16629 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 16630 - html += 16631 - wxT 16632 - ("<tr><td bgcolor=\"#fffff0\">CreateMetaCatalogTables( transaction Integer ) : Integer</td>"); 16633 - html += 16634 - wxT 16635 - ("<td bgcolor=\"#f0fff0\">Creates both <b>splite_metacatalog</b> and <b>splite_metacatalog_statistics</b> tables; "); 16636 - html += 16637 - wxT 16638 - ("<i>splite_metacatalog</i> will be populated so to describe every table/column currently defined within the DB.<br>"); 16639 - html += 16640 - wxT 16641 - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE</td></tr>"); 16642 - html += 16643 - wxT 16644 - ("<tr><td bgcolor=\"#fffff0\">UpdateMetaCatalogTables( transaction Integer , table_name String, column_name String ) : Integer</hr>"); 16645 - html += 16646 - wxT 16647 - ("UpdateMetaCatalogTables( transaction Integer , master_table String , table_name String, column_name String ) : Integer</td>"); 16648 - html += 16649 - wxT 16650 - ("<td bgcolor=\"#f0fff0\">Updates the <b>splite_metacatalog_statistics</b> table by computing the statistic summary for the required table/column.<br>"); 16651 - html += 16652 - wxT 16653 - ("the second form (four args) will use a MasterTable in order to identify all table/columns to be updated.<br>"); 16654 - html += 16655 - wxT 16656 - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE</td></tr>"); 16657 - html += 16658 - wxT 16659 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"c43style\">functions supporting SLD/SE Styled Layers</a>"); 16660 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 16661 - html += 16662 - wxT("<tr><td bgcolor=\"#fffff0\">CreateStylingTables( ) : Integer<hr>"); 16663 - html += wxT("CreateStylingTables( relaxed Integer ) : Integer</td>"); 16664 - html += 16665 - wxT 16666 - ("<td bgcolor=\"#f0fff0\">Creates a set of tables supporting <b>SLD/SE Styled Layers</b>.<br>"); 16667 - html += 16668 - wxT 16669 - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE "); 16670 - html += wxT("(failure): -1 will be returned on invalid arguments.</td></tr>"); 16671 - html += 16672 - wxT 16673 - ("<tr><td bgcolor=\"#fffff0\">RegisterExternalGraphic( xlink_href String , resource BLOB ) : Integer<hr>"); 16674 - html += 16675 - wxT 16676 - ("RagisterExternalGraphic( xlink_href String , resource BLOB , title String , abstract String , file_name String ) : Integer</td>"); 16677 - html += 16678 - wxT 16679 - ("<td bgcolor=\"#f0fff0\">Inserts (or updates) an <b>External Graphic Resource</b>.<br>"); 16680 - html += 16681 - wxT 16682 - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE "); 16683 - html += wxT("(failure): -1 will be returned on invalid arguments.</td></tr>"); 16684 - html += 16685 - wxT 16686 - ("<tr><td bgcolor=\"#fffff0\">RegisterVectorStyledLayer( f_table_name String , f_geometry_column String , style BLOB ) : Integer<hr>"); 16687 - html += 16688 - wxT 16689 - ("RegisterVectorStyledLayer( f_table_name String , f_geometry_column String , style_id Integer , style BLOB ) : Integer</td>"); 16690 - html += 16691 - wxT 16692 - ("<td bgcolor=\"#f0fff0\">Inserts (or updates) a <b>Vector Styled Layer</b> definition.<br>"); 16693 - html += 16694 - wxT 16695 - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE "); 16696 - html += wxT("(failure): -1 will be returned on invalid arguments.</td></tr>"); 16697 - html += 16698 - wxT 16699 - ("<tr><td bgcolor=\"#fffff0\">RegisterRasterStyledLayer( coverage_name String , style BLOB ) : Integer<hr>"); 16700 - html += 16701 - wxT 16702 - ("RegisterRasterStyledLayer( coverage_name String , style_id Integer , style BLOB ) : Integer</td>"); 16703 - html += 16704 - wxT 16705 - ("<td bgcolor=\"#f0fff0\">Inserts (or updates) a <b>Raster Styled Layer</b> definition.<br>"); 16706 - html += 16707 - wxT 16708 - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE "); 16709 - html += wxT("(failure): -1 will be returned on invalid arguments.</td></tr>"); 16710 - html += 16711 - wxT 16712 - ("<tr><td bgcolor=\"#fffff0\">RegisterStyledGroup( group_name String , f_table_name String , f_geometry_colum String [ , paint_order Integer ] ) : Integer<hr>"); 16713 - html += 16714 - wxT 16715 - ("RegisterStyledGroup( group_name String, coverage_name String [ , paint_order Integer ] ) : Integer</td>"); 16716 - html += 16717 - wxT 16718 - ("<td bgcolor=\"#f0fff0\">Inserts (or updates) a <b>Styled Group</b> definition.<br>"); 16719 - html += 16720 - wxT 16721 - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE "); 16722 - html += wxT("(failure): -1 will be returned on invalid arguments.</td></tr>"); 16723 - html += 16724 - wxT 16725 - ("<tr><td bgcolor=\"#fffff0\">SetStyledGroupInfos( group_name String , title String , abstract String ) : Integer</td>"); 16726 - html += 16727 - wxT 16728 - ("<td bgcolor=\"#f0fff0\">Inserts (or updates) the descriptive infos associated to a <b>Styled Group</b><br>"); 16729 - html += 16730 - wxT 16731 - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE "); 16732 - html += wxT("(failure): -1 will be returned on invalid arguments.</td></tr>"); 16733 - html += 16734 - wxT 16735 - ("<tr><td bgcolor=\"#fffff0\">RegisterGroupStyle( group_name String , style BLOB ) : Integer<hr>"); 16736 - html += 16737 - wxT 16738 - ("RegisterGroupStyle( group_name String , style_id Integer , style BLOB ) : Integer</td>"); 16739 - html += 16740 - wxT 16741 - ("<td bgcolor=\"#f0fff0\">Inserts (or updates) a <b>Group Style</b> definition.<br>"); 16742 - html += 16743 - wxT 16744 - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE "); 16745 - html += wxT("(failure): -1 will be returned on invalid arguments.</td></tr>"); 16746 - html += 16747 - wxT 16748 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"c43isometa\">functions implementing ISO Metadata</a>"); 16749 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 16750 - html += 16751 - wxT("<tr><td bgcolor=\"#fffff0\">CreateIsoMetadataTables( ) : Integer<hr>"); 16752 - html += wxT("CreateIsoMetadataTables( relaxed Integer ) : Integer</td>"); 16753 - html += 16754 - wxT 16755 - ("<td bgcolor=\"#f0fff0\">Creates a set of tables supporting <b>ISO Metadata</b>.<br>"); 16756 - html += 16757 - wxT 16758 - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE "); 16759 - html += wxT("(failure): -1 will be returned on invalid arguments.</td></tr>"); 16760 - html += 16761 - wxT 16762 - ("<tr><td bgcolor=\"#fffff0\">RegisterIsoMetadata( scope String , metadata BLOB ) : Integer<hr>"); 16763 - html += 16764 - wxT 16765 - ("RegisterIsoMetadata( scope String , metadata BLOB , id Integer ) : Integer<hr>"); 16766 - html += 16767 - wxT 16768 - ("RagisterIsoMetadata( scope String , metadata BLOB , fileIdentifier String ) : Integer</td>"); 16769 - html += 16770 - wxT 16771 - ("<td bgcolor=\"#f0fff0\">Inserts (or updates) an <b>ISO Metadata</b> definition.<br>"); 16772 - html += 16773 - wxT 16774 - ("The first form (two arguments only) always performs an INSERT; if one the optional arguments \"id\" or \"fileIdentifier\" an UPDATE could be eventually performed if a corresponding metadata row is already defined.<br>"); 16775 - html += 16776 - wxT 16777 - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE "); 16778 - html += wxT("(failure): -1 will be returned on invalid arguments.</td></tr>"); 16779 - html += 16780 - wxT 16781 - ("<tr><td bgcolor=\"#fffff0\">GetIsoMetadataId( fileIdentifier String ) : Integer</td>"); 16782 - html += 16783 - wxT 16784 - ("<td bgcolor=\"#f0fff0\">Return the unique \"id\" corresponding to the ISO Metadata definition identified by <b>fileIdentifier</b>.<hr>"); 16785 - html += 16786 - wxT 16787 - ("If no corresponding ISO Metadata definition exists, this function will always return ZERO; -1 will be returned for invalid arguments.</td></tr>"); 16788 - html += 16789 - wxT 16790 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"c43fdo\">functions implementing FDO/OGR compatibily</a>"); 16791 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 16792 - html += 16793 - wxT 16794 - ("<tr><td bgcolor=\"#fffff0\">CheckSpatialMetaData( void ) : Integer</td>"); 16795 - html += 16796 - wxT 16797 - ("<td bgcolor=\"#f0fff0\">Checks the Spatial Metadata type, then returning:<br>"); 16798 - html += 16799 - wxT 16800 - ("<b>0</b> if the <i>geometry_columns</i> and <i>spatial_ref_sys</i> table does not exist, "); 16801 - html += 16802 - wxT 16803 - ("or if their actual layout doesn't corresponds to any known implementation<br>"); 16804 - html += 16805 - wxT 16806 - ("<b>1</b> if both tables exist, and their layout is the one used by <i>SpatiaLite legacy</i> (older versions including 3.0.1)<br>"); 16807 - html += 16808 - wxT 16809 - ("<b>2</b> if both tables exist, and their layout is the one used by <i>FDO/OGR</i><br>"); 16810 - html += 16811 - wxT 16812 - ("<b>3</b> if both tables exist, and their layout is the one currently used by <i>SpatiaLite</i> (3.1.0 or any subsequent version)</td></tr>"); 16813 - html += 16814 - wxT("<tr><td bgcolor=\"#fffff0\">AutoFDOStart( void ) : Integer</td>"); 16815 - html += 16816 - wxT 16817 - ("<td bgcolor=\"#f0fff0\">This function will inspect the Spatial Metadata, then automatically creating/refreshing a <i>VirtualFDO</i>"); 16818 - html += 16819 - wxT 16820 - (" wrapper for each FDO/OGR geometry table<br>the return type is Integer [how many VirtualFDO tables have been created]</td></tr>"); 16821 - html += wxT("<tr><td bgcolor=\"#fffff0\">AutoFDOStop( void ) : Integer</td>"); 16822 - html += 16823 - wxT 16824 - ("<td bgcolor=\"#f0fff0\">This function will inspect the Spatial Metadata, then automatically destroying any <i>VirtualFDO</i>"); 16825 - html += 16826 - wxT 16827 - (" wrapper found<br>the return type is Integer [how many VirtualFDO tables have been destroyed]</td></tr>"); 16828 - html += 16829 - wxT 16830 - ("<tr><td bgcolor=\"#fffff0\">InitFDOSpatialMetaData( void ) : Integer</td>"); 16831 - html += 16832 - wxT 16833 - ("<td bgcolor=\"#f0fff0\">Creates the geometry_columns and spatial_ref_sys metadata tables"); 16834 - html += 16835 - wxT 16836 - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE<br>"); 16837 - html += 16838 - wxT 16839 - ("<u>Please note:</u> Spatial Metadata created using this function will have the FDO/OGR layout, and not the SpatiaLite's own</td></tr>"); 16840 - html += 16841 - wxT 16842 - ("<tr><td bgcolor=\"#fffff0\">AddFDOGeometryColumn( table String , column String , srid Integer , geom_type String , dimension Integer , geometry_type String ) : Integer</td>"); 16843 - html += 16844 - wxT 16845 - ("<td bgcolor=\"#f0fff0\">Creates a new geometry column updating the FDO/OGR Spatial Metadata tables<br>"); 16846 - html += 16847 - wxT 16848 - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE</td></tr>"); 16849 - html += 16850 - wxT 16851 - ("<tr><td bgcolor=\"#fffff0\">RecoverFDOGeometryColumn( table String , column String , srid Integer , geom_type String , dimension Integer , geometry_type String ) : Integer</td>"); 16852 - html += 16853 - wxT 16854 - ("<td bgcolor=\"#f0fff0\">Validates an existing ordinary column in order to possibly transform it in a real geometry column, "); 16855 - html += wxT("thus updating the FDO/OGR Spatial Metadata tables<br>"); 16856 - html += 16857 - wxT 16858 - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE</td></tr>"); 16859 - html += 16860 - wxT 16861 - ("<tr><td bgcolor=\"#fffff0\">DiscardFDOGeometryColumn( table String , column String ) : Integer</td>"); 16862 - html += 16863 - wxT 16864 - ("<td bgcolor=\"#f0fff0\">Removes a geometry column from FDO/OGR Spatial MetaData tables<br>"); 16865 - html += 16866 - wxT 16867 - ("the column itself still continues to exist untouched as an ordinary column<br>"); 16868 - html += 16869 - wxT 16870 - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE</td></tr>"); 16871 - html += 16872 - wxT 16873 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"c44\">functions for MbrCache-based queries</a>"); 16874 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 16875 - html += 16876 - wxT 16877 - ("<tr><td bgcolor=\"#fffff0\">FilterMbrWithin( x1 Double precision , y1 Double precision , x2 Double precision , y2 Double precision ) : Integer</td>"); 16878 - html += 16879 - wxT 16880 - ("<td bgcolor=\"#f0fff0\">Retrieves from an MbrCache any entity whose MBR falls within"); 16881 - html += 16882 - wxT 16883 - (" the rectangle identified by extreme points x1 y1 and x2 y2</td></tr>"); 16884 - html += 16885 - wxT 16886 - ("<tr><td bgcolor=\"#fffff0\">FilterMbrContains( x1 Double precision , y1 Double precision , x2 Double precision , y2 Double precision ) : Integer</td>"); 16887 - html += 16888 - wxT 16889 - ("<td bgcolor=\"#f0fff0\">Retrieves from an MbrCache any entity whose MBR contains"); 16890 - html += 16891 - wxT 16892 - (" the rectangle identified by extreme points x1 y1 and x2 y2</td></tr>"); 16893 - html += 16894 - wxT 16895 - ("<tr><td bgcolor=\"#fffff0\">FilterMbrIntersects( x1 Double precision , y1 Double precision , x2 Double precision , y2 Double precision ) : Integer</td>"); 16896 - html += 16897 - wxT 16898 - ("<td bgcolor=\"#f0fff0\">Retrieves from an MbrCache any entity whose MBR intersects"); 16899 - html += 16900 - wxT 16901 - (" the rectangle identified by extreme points x1 y1 and x2 y2</td></tr>"); 16902 - html += 16903 - wxT 16904 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"c45\">functions for R*Tree-based queries (Geometry Callbacks)</a>"); 16905 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 16906 - html += 16907 - wxT 16908 - ("<tr><td bgcolor=\"#fffff0\">RTreeWithin( x1 Double precision , y1 Double precision , x2 Double precision , y2 Double precision ) : Integer</td>"); 16909 - html += 16910 - wxT 16911 - ("<td bgcolor=\"#f0fff0\">*DEPRECATED* (alias-name for RTreeIntersects)</td></tr>"); 16912 - html += 16913 - wxT 16914 - ("<tr><td bgcolor=\"#fffff0\">RTreeContains( x1 Double precision , y1 Double precision , x2 Double precision , y2 Double precision ) : Integer</td>"); 16915 - html += 16916 - wxT 16917 - ("<td bgcolor=\"#f0fff0\">*DEPRECATED* (alias-name for RTreeIntersects)</td></tr>"); 16918 - html += 16919 - wxT 16920 - ("<tr><td bgcolor=\"#fffff0\">RTreeIntersects( x1 Double precision , y1 Double precision , x2 Double precision , y2 Double precision ) : Integer</td>"); 16921 - html += 16922 - wxT 16923 - ("<td bgcolor=\"#f0fff0\">Retrieves from an R*Tree any entity whose MBR intersects"); 16924 - html += 16925 - wxT 16926 - (" the rectangle identified by extreme points x1 y1 and x2 y2</td></tr>"); 16927 - html += 16928 - wxT 16929 - ("<tr><td bgcolor=\"#fffff0\">RTreeDistWithin( x Double precision , y Double precision , radius Double precision ) : Integer</td>"); 16930 - html += 16931 - wxT 16932 - ("<td bgcolor=\"#f0fff0\">Retrieves from an R*Tree any entity whose MBR intersects"); 16933 - html += 16934 - wxT 16935 - (" the square square circumscribed on the given circle (x y center, radius)</td></tr>"); 16936 - html += 16937 - wxT 16938 - ("<tr><td align=\"center\" bgcolor=\"#e0ffe0\" colspan=\"2\"><a name=\"xmlBlob\">SQL functions supporting XmlBLOB</a>"); 16939 - html += wxT("<br><a href=\"#index\">back to index</a></td></tr>"); 16940 - html += 16941 - wxT 16942 - ("<tr><td bgcolor=\"#fffff0\">XB_Create( xmlPayload BLOB ) : XmlBLOB<hr>"); 16943 - html += 16944 - wxT("XB_Create( xmlPayload BLOB , compressed Boolean ) : XmlBLOB<hr>"); 16945 - html += 16946 - wxT 16947 - ("XB_Create( xmlPayload BLOB , compressed Boolean , schemaURI Text ) : XmlBLOB<hr>"); 16948 - html += 16949 - wxT 16950 - ("XB_Create( xmlPayload BLOB , compressed Boolean , internalSchemaURI Boolean ) : XmlBLOB</td>"); 16951 - html += 16952 - wxT 16953 - ("<td bgcolor=\"#f0fff0\">Construct an XmlBLOB object starting from an XmlDocument.<hr>"); 16954 - html += 16955 - wxT 16956 - ("NULL will be returned for not well-formed XmlDocuments, or when XML validation is required but XmlDocument fails to pass validation for any reason.</td></tr>"); 16957 - html += 16958 - wxT 16959 - ("<tr><td bgcolor=\"#fffff0\">XB_GetPayload( xmlObject BLOB [ , indent Integer ] ) : String</td>"); 16960 - html += 16961 - wxT 16962 - ("<td bgcolor=\"#f0fff0\">Extracts a generic BLOB from an XmlBLOB object, exactly corresponding to the original XmlDocument and fully preserving the original character encoding.</td></tr>"); 16963 - html += 16964 - wxT 16965 - ("<tr><td bgcolor=\"#fffff0\">XB_GetDocument( xmlObject BLOB [ , indent Integer ] ) : String</td>"); 16966 - html += 16967 - wxT 16968 - ("<td bgcolor=\"#f0fff0\">Extracts an XmlDocument from an XmlBLOB object; the returned XmlDocument will always be UTF-8 encoded (TEXT), irrespectively from the original internal encoding declaration.</td></tr>"); 16969 - html += 16970 - wxT 16971 - ("<tr><td bgcolor=\"#fffff0\">XB_SchemaValidate( xmlObject BLOB , schemaURI Text [ , compressed Boolean ] ) : XmlBLOB<hr>"); 16972 - html += 16973 - wxT 16974 - ("XB_SchemaValidate( xmlObject BLOB , internalSchemaURI Boolean [ , compressed Boolean ] ) : XmlBLOB</td>"); 16975 - html += 16976 - wxT 16977 - ("<td bgcolor=\"#f0fff0\">Construct an XML validated XmlBLOB object starting from an XmlDocument.<hr>"); 16978 - html += 16979 - wxT 16980 - ("NULL will be returned if the input XmlBLOB fails to pass validation for any reason.</td></tr>"); 16981 - html += 16982 - wxT 16983 - ("<tr><td bgcolor=\"#fffff0\">XB_Compress( xmlObject BLOB ) : XmlBLOB</td>"); 16984 - html += 16985 - wxT 16986 - ("<td bgcolor=\"#f0fff0\">A new compressed XmlBLOB object will be returned.</td></tr>"); 16987 - html += 16988 - wxT 16989 - ("<tr><td bgcolor=\"#fffff0\">XB_Uncompress( xmlObject BLOB ) : XmlBLOB</td>"); 16990 - html += 16991 - wxT 16992 - ("<td bgcolor=\"#f0fff0\">A new uncompressed XmlBLOB object will be returned.</td></tr>"); 16993 - html += 16994 - wxT 16995 - ("<tr><td bgcolor=\"#fffff0\">XB_IsValid( xmlObject BLOB ) : Integer</td>"); 16996 - html += 16997 - wxT 16998 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, "); 16999 - html += 17000 - wxT 17001 - ("and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.</td></tr>"); 17002 - html += 17003 - wxT 17004 - ("<tr><td bgcolor=\"#fffff0\">XB_IsCompressed( xmlObject BLOB ) : Integer</td>"); 17005 - html += 17006 - wxT 17007 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, "); 17008 - html += 17009 - wxT 17010 - ("and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.</td></tr>"); 17011 - html += 17012 - wxT 17013 - ("<tr><td bgcolor=\"#fffff0\">XB_IsSchemaValidated( xmlObject BLOB ) : Integer</td>"); 17014 - html += 17015 - wxT 17016 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, "); 17017 - html += 17018 - wxT 17019 - ("and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.</td></tr>"); 17020 - html += 17021 - wxT 17022 - ("<tr><td bgcolor=\"#fffff0\">XB_IsIsoMetadata( xmlObject BLOB ) : Integer</td>"); 17023 - html += 17024 - wxT 17025 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, "); 17026 - html += 17027 - wxT 17028 - ("and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.</td></tr>"); 17029 - html += 17030 - wxT 17031 - ("<tr><td bgcolor=\"#fffff0\">XB_IsSldSeVectorStyle( xmlObject BLOB ) : Integer</td>"); 17032 - html += 17033 - wxT 17034 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, "); 17035 - html += 17036 - wxT 17037 - ("and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.</td></tr>"); 17038 - html += 17039 - wxT 17040 - ("<tr><td bgcolor=\"#fffff0\">XB_IsSldSeRasterStyle( xmlObject BLOB ) : Integer</td>"); 17041 - html += 17042 - wxT 17043 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, "); 17044 - html += 17045 - wxT 17046 - ("and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.</td></tr>"); 17047 - html += 17048 - wxT 17049 - ("<tr><td bgcolor=\"#fffff0\">XB_IsSvg( xmlObject BLOB ) : Integer</td>"); 17050 - html += 17051 - wxT 17052 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, "); 17053 - html += 17054 - wxT 17055 - ("and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.</td></tr>"); 17056 - html += 17057 - wxT 17058 - ("<tr><td bgcolor=\"#fffff0\">XB_GetDocumentSize( xmlObject BLOB ) : Integer</td>"); 17059 - html += 17060 - wxT 17061 - ("<td bgcolor=\"#f0fff0\">Will return the size in bytes of the corresponding uncompressed XmlDocument.</td></tr>"); 17062 - html += 17063 - wxT 17064 - ("<tr><td bgcolor=\"#fffff0\">XB_GetEncoding( xmlObject BLOB ) : String</td>"); 17065 - html += 17066 - wxT 17067 - ("<td bgcolor=\"#f0fff0\">Will return the character encoding internally declared by the XmlDocument corresponding to the input XmlBLOB.</td></tr>"); 17068 - html += 17069 - wxT 17070 - ("<tr><td bgcolor=\"#fffff0\">XB_GetSchemaURI( xmlObject BLOB ) : String</td>"); 17071 - html += 17072 - wxT 17073 - ("<td bgcolor=\"#f0fff0\">Will return the Schema URI effectively used to validate an XmlBLOB.</td></tr>"); 17074 - html += 17075 - wxT 17076 - ("<tr><td bgcolor=\"#fffff0\">XB_GetInternalSchemaURI( xmlPayload BLOB ) : String</td>"); 17077 - html += 17078 - wxT 17079 - ("<td bgcolor=\"#f0fff0\">Will return the Schema URI internally declared by the input XmlDocument.</td></tr>"); 17080 - html += 17081 - wxT 17082 - ("<tr><td bgcolor=\"#fffff0\">XB_GetFileId( xmlObject BLOB ) : String</td>"); 17083 - html += 17084 - wxT 17085 - ("<td bgcolor=\"#f0fff0\">Will return the FileId defined within the XmlBLOB (if any).</td></tr>"); 17086 - html += 17087 - wxT 17088 - ("<tr><td bgcolor=\"#fffff0\">XB_SetFileId( xmlObject BLOB , fileId String ) : XmlBLOB</td>"); 17089 - html += 17090 - wxT 17091 - ("<td bgcolor=\"#f0fff0\">Will return a new XmlBLOB by replacing the FileIdentifier value.</td></tr>"); 17092 - html += 17093 - wxT 17094 - ("<tr><td bgcolor=\"#fffff0\">XB_AddFileId( xmlObject BLOB , fileId String , IdNameSpacePrefix String , IdNameSpaceURI String , CsNameSpacePrefix String , CsNameSpaceURI String ) : XmlBLOB</td>"); 17095 - html += 17096 - wxT 17097 - ("<td bgcolor=\"#f0fff0\">Will return a new XmlBLOB by inserting a FileIdentifier value.</td></tr>"); 17098 - html += 17099 - wxT 17100 - ("<tr><td bgcolor=\"#fffff0\">XB_GetParentId( xmlObject BLOB ) : String</td>"); 17101 - html += 17102 - wxT 17103 - ("<td bgcolor=\"#f0fff0\">Will return the ParentId defined within the XmlBLOB (if any).</td></tr>"); 17104 - html += 17105 - wxT 17106 - ("<tr><td bgcolor=\"#fffff0\">XB_SetParentId( xmlObject BLOB , parentId String ) : XmlBLOB</td>"); 17107 - html += 17108 - wxT 17109 - ("<td bgcolor=\"#f0fff0\">Will return a new XmlBLOB by replacing the ParentIdentifier value.</td></tr>"); 17110 - html += 17111 - wxT 17112 - ("<tr><td bgcolor=\"#fffff0\">XB_AddParentId( xmlObject BLOB , parentId String , IdNameSpacePrefix String , IdNameSpaceURI String , CsNameSpacePrefix String , CsNameSpaceURI String ) : XmlBLOB</td>"); 17113 - html += 17114 - wxT 17115 - ("<td bgcolor=\"#f0fff0\">Will return a new XmlBLOB by inserting a ParentIdentifier value.</td></tr>"); 17116 - html += 17117 - wxT 17118 - ("<tr><td bgcolor=\"#fffff0\">XB_GetTitle( xmlObject BLOB ) : String</td>"); 17119 - html += 17120 - wxT 17121 - ("<td bgcolor=\"#f0fff0\">Will return the Title defined within the XmlBLOB (if any).</td></tr>"); 17122 - html += 17123 - wxT 17124 - ("<tr><td bgcolor=\"#fffff0\">XB_GetAbstract( xmlObject BLOB ) : String</td>"); 17125 - html += 17126 - wxT 17127 - ("<td bgcolor=\"#f0fff0\">Will return the Abstract defined within the XmlBLOB (if any).</td></tr>"); 17128 - html += 17129 - wxT 17130 - ("<tr><td bgcolor=\"#fffff0\">XB_GetGeometry( xmlObject BLOB ) : Geometry</td>"); 17131 - html += 17132 - wxT 17133 - ("<td bgcolor=\"#f0fff0\">Will return the Geometry defined within the XmlBLOB (if any).</td></tr>"); 17134 - html += 17135 - wxT 17136 - ("<tr><td bgcolor=\"#fffff0\">XB_GetLastParseError( void ) : String</td>"); 17137 - html += 17138 - wxT 17139 - ("<td bgcolor=\"#f0fff0\">Will return the most recent XML parsing error (if any).</td></tr>"); 17140 - html += 17141 - wxT 17142 - ("<tr><td bgcolor=\"#fffff0\">XB_GetLastValidateError( void ) : String</td>"); 17143 - html += 17144 - wxT 17145 - ("<td bgcolor=\"#f0fff0\">Will return the most recent XML validating error (if any).</td></tr>"); 17146 - html += 17147 - wxT 17148 - ("<tr><td bgcolor=\"#fffff0\">XB_IsValidXPathExpression( expr Text ) : Integer</td>"); 17149 - html += 17150 - wxT 17151 - ("<td bgcolor=\"#f0fff0\">The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, "); 17152 - html += 17153 - wxT 17154 - ("and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.</td></tr>"); 17155 - html += 17156 - wxT 17157 - ("<tr><td bgcolor=\"#fffff0\">XB_GetLastXPathError( void ) : String</td>"); 17158 - html += 17159 - wxT 17160 - ("<td bgcolor=\"#f0fff0\">Will return the most recent XPath error (if any).</td></tr>"); 17161 - html += 17162 - wxT("<tr><td bgcolor=\"#fffff0\">XB_CacheFlush( void ) : Boolean</td>"); 17163 - html += 17164 - wxT 17165 - ("<td bgcolor=\"#f0fff0\">Reset the internal XML Schema cache to its initial empty state.</td></tr>"); 17166 - html += 17167 - wxT("<tr><td bgcolor=\"#fffff0\">XB_CacheFlush( void ) : Boolean</td>"); 17168 - html += 17169 - wxT 17170 - ("<td bgcolor=\"#f0fff0\">Reset the internal XML Schema cache to its initial empty state.</td></tr>"); 17171 - html += 17172 - wxT 17173 - ("<tr><td bgcolor=\"#fffff0\">XB_LoadXML( filepath-or-URL String ) : BLOB</td>"); 17174 - html += 17175 - wxT 17176 - ("<td bgcolor=\"#f0fff0\">If \"filepath-or-URL\" corresponds to some valid local pathname, and the corresponding file (expected to contain a well-formed XML Document) "); 17177 - html += 17178 - wxT 17179 - ("can be actually accessed in read mode, then the whole file content will be returned as a BLOB value.<br>"); 17180 - html += 17181 - wxT 17182 - ("This function is even able to acces a remote XML Document identified by an URL.<br>Otherwise NULL will be returned.<br>"); 17183 - html += 17184 - wxT 17185 - ("<u>Please note:</u> SQLite doesn't support BLOB values bigger than SQLITE_MAX_LENGTH (usually, 1 GB).<hr>"); 17186 - html += 17187 - wxT 17188 - ("<u>Please note well</u>: this SQL function open the doors to many potential security issues, and thus is always disabled by default.<br>"); 17189 - html += 17190 - wxT 17191 - ("Explicitly setting the environment variable \"SPATIALITE_SECURITY=relaxed\" is absolutely required in order to effectively enable this function.<br>"); 17192 - html += wxT("Please see: CountUnsafeTriggers().</td></tr>"); 17193 - html += 17194 - wxT 17195 - ("<tr><td bgcolor=\"#fffff0\">XB_StoreXML( XmlObject XmlBLOB , filepath String ) : Integer<hr>"); 17196 - html += 17197 - wxT 17198 - ("XB_StoreXML( XmlObject XmlBLOB , filepath String , indent Integer ) : Integer</td>"); 17199 - html += 17200 - wxT 17201 - ("<td bgcolor=\"#f0fff0\">If \"XmlObject\" is of the XmlBLOB-type, and if \"filepath\" corresponds to some valid pathname "); 17202 - html += 17203 - wxT 17204 - ("(accessible in write/create mode), then the corresponding file will be created/overwritten so to "); 17205 - html += 17206 - wxT 17207 - ("contain the corresponding XML Document (fully preserving the original character encoding).<br>"); 17208 - html += 17209 - wxT 17210 - ("If the optional argument \"indent\" is set to some positive value then the returned XmlDocument will be nicely formatted and properly indented by the required factor; "); 17211 - html += 17212 - wxT 17213 - ("ZERO will cause the whole XmlDocument to be returned as a single line. (default setting is <i>negative</i> indenting, i.e. not reformatting at all).<hr>"); 17214 - html += 17215 - wxT 17216 - ("The return type is Integer, with a return value of 1 for success, 0 for failure and -1 for invalid arguments.<hr>"); 17217 - html += 17218 - wxT 17219 - ("<u>Please note well</u>: this SQL function open the doors to many potential security issues, and thus is always disabled by default.<br>"); 17220 - html += 17221 - wxT 17222 - ("Explicitly setting the environment variable \"SPATIALITE_SECURITY=relaxed\" is absolutely required in order to effectively enable this function.<br>"); 17223 - html += wxT("Please see: CountUnsafeTriggers().</td></tr>"); 17224 - html += wxT("</table>"); 17225 - html += wxT("<a href=\"#index\">back to index</a>"); 17226 - html += wxT("</body>"); 17227 - html += wxT("</html>"); 17228 -}
Changes to Makefile-static-mingw32.
1 1 # SandroFurieri (c) 2008 2 2 # Makefile ( Mingw & wxwidgets) for spatialite-GUI 3 3 4 4 SRC = Main.cpp TableTree.cpp QueryView.cpp ResultSetView.cpp BlobExplorer.cpp \ 5 - Dialogs.cpp Shapefiles.cpp Network.cpp Exif.cpp TextCsv.cpp \ 5 + Dialogs.cpp Shapefiles.cpp Exif.cpp TextCsv.cpp Postgres.cpp \ 6 6 Objects.cpp QueryViewComposer.cpp MalformedGeoms.cpp DialogsGraph.cpp \ 7 7 Raster.cpp Styles.cpp RasterSymbolizers.cpp VectorSymbolizers1.cpp \ 8 8 VectorSymbolizers2.cpp Wfs.cpp SqlFilterComposer.cpp \ 9 9 WmsDialog.cpp LayerTree.cpp MapPanel.cpp MapView.cpp \ 10 - QuickStyles.cpp \ 10 + QuickStylesVector.cpp QuickStylesTopology.cpp QuickStylesRaster.cpp \ 11 + HtmlHelp.cpp \ 11 12 win_resource/resource.rc 12 13 OBJ = Main.o TableTree.o QueryView.o ResultSetView.o BlobExplorer.o \ 13 - Dialogs.o Shapefiles.o Network.o Exif.o TextCsv.o Objects.o \ 14 + Dialogs.o Shapefiles.o Exif.o TextCsv.o Objects.o Postgres.o \ 14 15 QueryViewComposer.o MalformedGeoms.o DialogsGraph.o \ 15 16 Raster.o Styles.o RasterSymbolizers.o VectorSymbolizers1.o \ 16 - VectorSymbolizers2.o Wfs.o SqlFiltersComposer.o \ 17 - WmsDialog.o LayerTree.o MapPanel.o MapView.o QuickStyles.o \ 17 + VectorSymbolizers2.o Wfs.o SqlFiltersComposer.o HtmlHelp.o \ 18 + WmsDialog.o LayerTree.o MapPanel.o MapView.o QuickStylesVector.o \ 19 + QuickStylesTopology.o QuickStylesRaster.o \ 18 20 win_resource/resource.o 19 21 EXE = ./static_bin/spatialite_gui.exe 20 22 INCLUDE = Classdef.h 21 23 22 24 # Define default flags: 23 25 CXXFLAGS = $(shell /mingw32/local/bin/wx-config --cxxflags) 24 26 LIB = -Wl,--subsystem,windows /mingw32/local/lib/libwx_mswu-3.0.a \ ................................................................................ 36 38 /mingw32/local/lib/libfreetype.a /mingw32/local/lib/libexpat.a \ 37 39 /mingw32/local/lib/libgeotiff.a /mingw32/local/lib/libtiff.a \ 38 40 /mingw32/local/lib/libpng.a /mingw32/local/lib/libjpeg.a \ 39 41 /mingw32/local/lib/libsqlite3.a /mingw32/local/lib/libcurl.a \ 40 42 /mingw32/local/lib/libwebp.a /mingw32/local/lib/libgif.a \ 41 43 /mingw32/local/lib/libssl.a /mingw32/local/lib/libcrypto.a \ 42 44 /mingw32/local/lib/libz.a /mingw32/local/lib/liblzma.a \ 43 - /mingw32/local/lib/libCharLS.a /mingw32/local/lib/libopenjp2.a 45 + /mingw32/local/lib/libCharLS.a /mingw32/local/lib/libopenjp2.a \ 46 + /mingw32/local/lib/libvirtualpg.a 44 47 EXTRALIB2 = -lgdi32 -lmsimg32 -lws2_32 -lwldap32 45 48 46 49 CXX = g++ -static 47 50 REZ = $(shell /mingw32/local/bin/wx-config --rescomp) 48 51 49 52 50 53 all: $(EXE) ................................................................................ 92 95 93 96 DialogsGraph.o: DialogsGraph.cpp $(INCLUDE) 94 97 $(CXX) -c DialogsGraph.cpp $(CXXFLAGS) $(EXTRAFLAGS) 95 98 96 99 Shapefiles.o: Shapefiles.cpp $(INCLUDE) 97 100 $(CXX) -c Shapefiles.cpp $(CXXFLAGS) $(EXTRAFLAGS) 98 101 99 -Network.o: Network.cpp $(INCLUDE) 100 - $(CXX) -c Network.cpp $(CXXFLAGS) $(EXTRAFLAGS) 101 - 102 102 Exif.o: Exif.cpp $(INCLUDE) 103 103 $(CXX) -c Exif.cpp $(CXXFLAGS) $(EXTRAFLAGS) 104 104 105 105 TextCsv.o: TextCsv.cpp $(INCLUDE) 106 106 $(CXX) -c TextCsv.cpp $(CXXFLAGS) $(EXTRAFLAGS) 107 107 108 108 Objects.o: Objects.cpp $(INCLUDE) ................................................................................ 122 122 123 123 MapPanel.o: MapPanel.cpp $(INCLUDE) 124 124 $(CXX) -c MapPanel.cpp $(CXXFLAGS) $(EXTRAFLAGS) 125 125 126 126 MapView.o: MapView.cpp $(INCLUDE) 127 127 $(CXX) -c MapView.cpp $(CXXFLAGS) $(EXTRAFLAGS) 128 128 129 -QuickStyles.o: QuickStyles.cpp $(INCLUDE) 130 - $(CXX) -c QuickStyles.cpp $(CXXFLAGS) $(EXTRAFLAGS) 129 +QuickStylesVector.o: QuickStylesVector.cpp $(INCLUDE) 130 + $(CXX) -c QuickStylesVector.cpp $(CXXFLAGS) $(EXTRAFLAGS) 131 + 132 +QuickStylesTopology.o: QuickStylesTopology.cpp $(INCLUDE) 133 + $(CXX) -c QuickStylesTopology.cpp $(CXXFLAGS) $(EXTRAFLAGS) 134 + 135 +QuickStylesRaster.o: QuickStylesRaster.cpp $(INCLUDE) 136 + $(CXX) -c QuickStylesRaster.cpp $(CXXFLAGS) $(EXTRAFLAGS) 137 + 138 +Postgres.o: Postgres.cpp $(INCLUDE) 139 + $(CXX) -c Postgres.cpp $(CXXFLAGS) $(EXTRAFLAGS) 140 + 141 +HtmlHelp.o: HtmlHelp.cpp $(INCLUDE) 142 + $(CXX) -c HtmlHelp.cpp $(CXXFLAGS) $(EXTRAFLAGS) 131 143 132 144 win_resource/resource.o: win_resource/resource.rc 133 145 echo $(CXXFLAGS) 134 146 $(REZ) $(CXXFLAGS) -i win_resource/resource.rc -o win_resource/resource.o
Changes to Makefile-static-mingw64.
1 1 # SandroFurieri (c) 2008 2 2 # Makefile ( Mingw & wxwidgets) for spatialite-GUI 3 3 4 4 SRC = Main.cpp TableTree.cpp QueryView.cpp ResultSetView.cpp BlobExplorer.cpp \ 5 - Dialogs.cpp Shapefiles.cpp Network.cpp Exif.cpp TextCsv.cpp \ 5 + Dialogs.cpp Shapefiles.cpp Exif.cpp TextCsv.cpp Postgres.cpp \ 6 6 Objects.cpp QueryViewComposer.cpp MalformedGeoms.cpp DialogsGraph.cpp \ 7 7 Raster.cpp Styles.cpp RasterSymbolizers.cpp VectorSymbolizers1.cpp \ 8 8 VectorSymbolizers2.cpp Wfs.cpp SqlFilterComposer.cpp \ 9 9 WmsDialog.cpp LayerTree.cpp MapPanel.cpp MapView.cpp \ 10 - QuickStyles.cpp \ 10 + QuickStylesVector.cpp QuickStylesTopology.cpp QuickStylesRaster.cpp \ 11 + HtmlHelp.cpp \ 11 12 win_resource/resource.rc 12 13 OBJ = Main.o TableTree.o QueryView.o ResultSetView.o BlobExplorer.o \ 13 - Dialogs.o Shapefiles.o Network.o Exif.o TextCsv.o Objects.o \ 14 + Dialogs.o Shapefiles.o Exif.o TextCsv.o Objects.o Postgres.o \ 14 15 QueryViewComposer.o MalformedGeoms.o DialogsGraph.o \ 15 16 Raster.o Styles.o RasterSymbolizers.o VectorSymbolizers1.o \ 16 - VectorSymbolizers2.o Wfs.o SqlFiltersComposer.o \ 17 - WmsDialog.o LayerTree.o MapPanel.o MapView.o QuickStyles.o \ 17 + VectorSymbolizers2.o Wfs.o SqlFiltersComposer.o HtmlHelp.o \ 18 + WmsDialog.o LayerTree.o MapPanel.o MapView.o QuickStylesVector.o \ 19 + QuickStylesTopology.o QuickStylesRaster.o \ 18 20 win_resource/resource.o 19 21 EXE = ./static_bin/spatialite_gui.exe 20 22 INCLUDE = Classdef.h 21 23 22 24 # Define default flags: 23 25 CXXFLAGS = $(shell /mingw64/local/bin/wx-config --cxxflags) 24 26 LIB = -Wl,--subsystem,windows /mingw64/local/lib/libwx_mswu-3.0.a \ ................................................................................ 36 38 /mingw64/local/lib/libfreetype.a /mingw64/local/lib/libexpat.a \ 37 39 /mingw64/local/lib/libgeotiff.a /mingw64/local/lib/libtiff.a \ 38 40 /mingw64/local/lib/libpng.a /mingw64/local/lib/libjpeg.a \ 39 41 /mingw64/local/lib/libsqlite3.a /mingw64/local/lib/libcurl.a \ 40 42 /mingw64/local/lib/libwebp.a /mingw64/local/lib/libgif.a \ 41 43 /mingw64/local/lib/libssl.a /mingw64/local/lib/libcrypto.a \ 42 44 /mingw64/local/lib/libz.a /mingw64/local/lib/liblzma.a \ 43 - /mingw64/local/lib/libCharLS.a /mingw64/local/lib/libopenjp2.a 45 + /mingw64/local/lib/libCharLS.a /mingw64/local/lib/libopenjp2.a \ 46 + /mingw64/local/lib/libvirtualpg.a 44 47 EXTRALIB2 = -lgdi32 -lmsimg32 -lws2_32 -lwldap32 45 48 46 49 CXX = g++ -static 47 50 REZ = $(shell /mingw64/local/bin/wx-config --rescomp) 48 51 49 52 50 53 all: $(EXE) ................................................................................ 92 95 93 96 DialogsGraph.o: DialogsGraph.cpp $(INCLUDE) 94 97 $(CXX) -c DialogsGraph.cpp $(CXXFLAGS) $(EXTRAFLAGS) 95 98 96 99 Shapefiles.o: Shapefiles.cpp $(INCLUDE) 97 100 $(CXX) -c Shapefiles.cpp $(CXXFLAGS) $(EXTRAFLAGS) 98 101 99 -Network.o: Network.cpp $(INCLUDE) 100 - $(CXX) -c Network.cpp $(CXXFLAGS) $(EXTRAFLAGS) 101 - 102 102 Exif.o: Exif.cpp $(INCLUDE) 103 103 $(CXX) -c Exif.cpp $(CXXFLAGS) $(EXTRAFLAGS) 104 104 105 105 TextCsv.o: TextCsv.cpp $(INCLUDE) 106 106 $(CXX) -c TextCsv.cpp $(CXXFLAGS) $(EXTRAFLAGS) 107 107 108 108 Objects.o: Objects.cpp $(INCLUDE) ................................................................................ 122 122 123 123 MapPanel.o: MapPanel.cpp $(INCLUDE) 124 124 $(CXX) -c MapPanel.cpp $(CXXFLAGS) $(EXTRAFLAGS) 125 125 126 126 MapView.o: MapView.cpp $(INCLUDE) 127 127 $(CXX) -c MapView.cpp $(CXXFLAGS) $(EXTRAFLAGS) 128 128 129 -QuickStyles.o: QuickStyles.cpp $(INCLUDE) 130 - $(CXX) -c QuickStyles.cpp $(CXXFLAGS) $(EXTRAFLAGS) 129 +QuickStylesVector.o: QuickStylesVector.cpp $(INCLUDE) 130 + $(CXX) -c QuickStylesVector.cpp $(CXXFLAGS) $(EXTRAFLAGS) 131 + 132 +QuickStylesTopology.o: QuickStylesTopology.cpp $(INCLUDE) 133 + $(CXX) -c QuickStylesTopology.cpp $(CXXFLAGS) $(EXTRAFLAGS) 134 + 135 +QuickStylesRaster.o: QuickStylesRaster.cpp $(INCLUDE) 136 + $(CXX) -c QuickStylesRaster.cpp $(CXXFLAGS) $(EXTRAFLAGS) 137 + 138 +Postgres.o: Postgres.cpp $(INCLUDE) 139 + $(CXX) -c Postgres.cpp $(CXXFLAGS) $(EXTRAFLAGS) 140 + 141 +HtmlHelp.o: HtmlHelp.cpp $(INCLUDE) 142 + $(CXX) -c HtmlHelp.cpp $(CXXFLAGS) $(EXTRAFLAGS) 131 143 132 144 win_resource/resource.o: win_resource/resource.rc 133 145 echo $(CXXFLAGS) 134 146 $(REZ) $(CXXFLAGS) -i win_resource/resource.rc -o win_resource/resource.o
Changes to Makefile.am.
3 3 bin_PROGRAMS = spatialite_gui 4 4 5 5 AM_CPPFLAGS = @CFLAGS@ @CPPFLAGS@ 6 6 AM_CPPFLAGS += -I$(top_srcdir) 7 7 8 8 spatialite_gui_SOURCES = Classdef.h BlobExplorer.cpp \ 9 9 Dialogs.cpp DialogsGraph.cpp WmsDialog.cpp Exif.cpp \ 10 - Main.cpp MalformedGeoms.cpp Network.cpp \ 10 + Main.cpp MalformedGeoms.cpp \ 11 11 Objects.cpp QueryView.cpp QueryViewComposer.cpp \ 12 12 ResultSetView.cpp Shapefiles.cpp TableTree.cpp \ 13 13 TextCsv.cpp Wfs.cpp Raster.cpp Styles.cpp \ 14 14 RasterSymbolizers.cpp VectorSymbolizers1.cpp \ 15 15 VectorSymbolizers2.cpp SqlFiltersComposer.cpp \ 16 16 MapPanel.cpp MapView.cpp LayerTree.cpp \ 17 - QuickStyles.cpp 17 + QuickStylesVector.cpp QuickStylesTopology.cpp \ 18 + QuickStylesRaster.cpp HtmlHelp.cpp Postgres.cpp 18 19 19 20 LDADD = @WX_LIBS@ @LIBSPATIALITE_LIBS@ \ 20 - @LIBRASTERLITE2_LIBS@ @LIBFREEXL_LIBS@ @LIBXML2_LIBS@ -lgeos_c 21 + @LIBRASTERLITE2_LIBS@ @LIBFREEXL_LIBS@ \ 22 + @LIBVIRTUALPG_LIBS@ @LIBXML2_LIBS@ \ 23 + @PG_LDFLAGS@ @PG_LIB@ -lgeos_c 21 24 22 -EXTRA_DIST = Makefile-static-MinGW \ 23 - Makefile-static-mingw32 \ 24 - Makefile-static-mingw64 \ 25 - Makefile-static-Linux \ 26 - Makefile-static-MacOsX \ 27 - indent_me 25 +EXTRA_DIST = Makefile-static-mingw32 \ 26 + Makefile-static-mingw64 \ 27 + helpgen/helpgen.c \ 28 + helpgen/READ_ME.txt \ 29 + indent_me 28 30 29 31 AUTOMAKE_OPTIONS = dist-zip foreign 30 32 31 33 SUBDIRS = icons win_resource mac_resource gnome_resource 32 34
Changes to Makefile.in.
1 -# Makefile.in generated by automake 1.15 from Makefile.am. 1 +# Makefile.in generated by automake 1.15.1 from Makefile.am. 2 2 # @configure_input@ 3 3 4 -# Copyright (C) 1994-2014 Free Software Foundation, Inc. 4 +# Copyright (C) 1994-2017 Free Software Foundation, Inc. 5 5 6 6 # This Makefile.in is free software; the Free Software Foundation 7 7 # gives unlimited permission to copy and/or distribute it, 8 8 # with or without modifications, as long as this notice is preserved. 9 9 10 10 # This program is distributed in the hope that it will be useful, 11 11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without ................................................................................ 105 105 CONFIG_HEADER = config.h 106 106 CONFIG_CLEAN_FILES = 107 107 CONFIG_CLEAN_VPATH_FILES = 108 108 am__installdirs = "$(DESTDIR)$(bindir)" 109 109 PROGRAMS = $(bin_PROGRAMS) 110 110 am_spatialite_gui_OBJECTS = BlobExplorer.$(OBJEXT) Dialogs.$(OBJEXT) \ 111 111 DialogsGraph.$(OBJEXT) WmsDialog.$(OBJEXT) Exif.$(OBJEXT) \ 112 - Main.$(OBJEXT) MalformedGeoms.$(OBJEXT) Network.$(OBJEXT) \ 113 - Objects.$(OBJEXT) QueryView.$(OBJEXT) \ 114 - QueryViewComposer.$(OBJEXT) ResultSetView.$(OBJEXT) \ 115 - Shapefiles.$(OBJEXT) TableTree.$(OBJEXT) TextCsv.$(OBJEXT) \ 116 - Wfs.$(OBJEXT) Raster.$(OBJEXT) Styles.$(OBJEXT) \ 117 - RasterSymbolizers.$(OBJEXT) VectorSymbolizers1.$(OBJEXT) \ 118 - VectorSymbolizers2.$(OBJEXT) SqlFiltersComposer.$(OBJEXT) \ 119 - MapPanel.$(OBJEXT) MapView.$(OBJEXT) LayerTree.$(OBJEXT) \ 120 - QuickStyles.$(OBJEXT) 112 + Main.$(OBJEXT) MalformedGeoms.$(OBJEXT) Objects.$(OBJEXT) \ 113 + QueryView.$(OBJEXT) QueryViewComposer.$(OBJEXT) \ 114 + ResultSetView.$(OBJEXT) Shapefiles.$(OBJEXT) \ 115 + TableTree.$(OBJEXT) TextCsv.$(OBJEXT) Wfs.$(OBJEXT) \ 116 + Raster.$(OBJEXT) Styles.$(OBJEXT) RasterSymbolizers.$(OBJEXT) \ 117 + VectorSymbolizers1.$(OBJEXT) VectorSymbolizers2.$(OBJEXT) \ 118 + SqlFiltersComposer.$(OBJEXT) MapPanel.$(OBJEXT) \ 119 + MapView.$(OBJEXT) LayerTree.$(OBJEXT) \ 120 + QuickStylesVector.$(OBJEXT) QuickStylesTopology.$(OBJEXT) \ 121 + QuickStylesRaster.$(OBJEXT) HtmlHelp.$(OBJEXT) \ 122 + Postgres.$(OBJEXT) 121 123 spatialite_gui_OBJECTS = $(am_spatialite_gui_OBJECTS) 122 124 spatialite_gui_LDADD = $(LDADD) 123 125 spatialite_gui_DEPENDENCIES = 124 126 AM_V_lt = $(am__v_lt_@AM_V@) 125 127 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) 126 128 am__v_lt_0 = --silent 127 129 am__v_lt_1 = ................................................................................ 315 317 LIBOBJS = @LIBOBJS@ 316 318 LIBRASTERLITE2_CFLAGS = @LIBRASTERLITE2_CFLAGS@ 317 319 LIBRASTERLITE2_LIBS = @LIBRASTERLITE2_LIBS@ 318 320 LIBS = @LIBS@ 319 321 LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@ 320 322 LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@ 321 323 LIBTOOL = @LIBTOOL@ 324 +LIBVIRTUALPG_CFLAGS = @LIBVIRTUALPG_CFLAGS@ 325 +LIBVIRTUALPG_LIBS = @LIBVIRTUALPG_LIBS@ 322 326 LIBWEBP_CFLAGS = @LIBWEBP_CFLAGS@ 323 327 LIBWEBP_LIBS = @LIBWEBP_LIBS@ 324 328 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ 325 329 LIBXML2_LIBS = @LIBXML2_LIBS@ 326 330 LIPO = @LIPO@ 327 331 LN_S = @LN_S@ 328 332 LTLIBOBJS = @LTLIBOBJS@ ................................................................................ 341 345 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 342 346 PACKAGE_NAME = @PACKAGE_NAME@ 343 347 PACKAGE_STRING = @PACKAGE_STRING@ 344 348 PACKAGE_TARNAME = @PACKAGE_TARNAME@ 345 349 PACKAGE_URL = @PACKAGE_URL@ 346 350 PACKAGE_VERSION = @PACKAGE_VERSION@ 347 351 PATH_SEPARATOR = @PATH_SEPARATOR@ 352 +PGCONFIG = @PGCONFIG@ 353 +PG_CFLAGS = @PG_CFLAGS@ 354 +PG_LDFLAGS = @PG_LDFLAGS@ 355 +PG_LIB = @PG_LIB@ 348 356 PKG_CONFIG = @PKG_CONFIG@ 349 357 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ 350 358 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ 351 359 RANLIB = @RANLIB@ 352 360 SED = @SED@ 353 361 SET_MAKE = @SET_MAKE@ 354 362 SHELL = @SHELL@ ................................................................................ 409 417 top_build_prefix = @top_build_prefix@ 410 418 top_builddir = @top_builddir@ 411 419 top_srcdir = @top_srcdir@ 412 420 ACLOCAL_AMFLAGS = -I m4 413 421 AM_CPPFLAGS = @CFLAGS@ @CPPFLAGS@ -I$(top_srcdir) 414 422 spatialite_gui_SOURCES = Classdef.h BlobExplorer.cpp \ 415 423 Dialogs.cpp DialogsGraph.cpp WmsDialog.cpp Exif.cpp \ 416 - Main.cpp MalformedGeoms.cpp Network.cpp \ 424 + Main.cpp MalformedGeoms.cpp \ 417 425 Objects.cpp QueryView.cpp QueryViewComposer.cpp \ 418 426 ResultSetView.cpp Shapefiles.cpp TableTree.cpp \ 419 427 TextCsv.cpp Wfs.cpp Raster.cpp Styles.cpp \ 420 428 RasterSymbolizers.cpp VectorSymbolizers1.cpp \ 421 429 VectorSymbolizers2.cpp SqlFiltersComposer.cpp \ 422 430 MapPanel.cpp MapView.cpp LayerTree.cpp \ 423 - QuickStyles.cpp 431 + QuickStylesVector.cpp QuickStylesTopology.cpp \ 432 + QuickStylesRaster.cpp HtmlHelp.cpp Postgres.cpp 424 433 425 434 LDADD = @WX_LIBS@ @LIBSPATIALITE_LIBS@ \ 426 - @LIBRASTERLITE2_LIBS@ @LIBFREEXL_LIBS@ @LIBXML2_LIBS@ -lgeos_c 435 + @LIBRASTERLITE2_LIBS@ @LIBFREEXL_LIBS@ \ 436 + @LIBVIRTUALPG_LIBS@ @LIBXML2_LIBS@ \ 437 + @PG_LDFLAGS@ @PG_LIB@ -lgeos_c 427 438 428 -EXTRA_DIST = Makefile-static-MinGW \ 429 - Makefile-static-mingw32 \ 430 - Makefile-static-mingw64 \ 431 - Makefile-static-Linux \ 432 - Makefile-static-MacOsX \ 433 - indent_me 439 +EXTRA_DIST = Makefile-static-mingw32 \ 440 + Makefile-static-mingw64 \ 441 + helpgen/helpgen.c \ 442 + helpgen/READ_ME.txt \ 443 + indent_me 434 444 435 445 AUTOMAKE_OPTIONS = dist-zip foreign 436 446 SUBDIRS = icons win_resource mac_resource gnome_resource 437 447 all: config.h 438 448 $(MAKE) $(AM_MAKEFLAGS) all-recursive 439 449 440 450 .SUFFIXES: ................................................................................ 547 557 distclean-compile: 548 558 -rm -f *.tab.c 549 559 550 560 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BlobExplorer.Po@am__quote@ 551 561 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Dialogs.Po@am__quote@ 552 562 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DialogsGraph.Po@am__quote@ 553 563 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Exif.Po@am__quote@ 564 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/HtmlHelp.Po@am__quote@ 554 565 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LayerTree.Po@am__quote@ 555 566 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Main.Po@am__quote@ 556 567 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MalformedGeoms.Po@am__quote@ 557 568 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MapPanel.Po@am__quote@ 558 569 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MapView.Po@am__quote@ 559 -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Network.Po@am__quote@ 560 570 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Objects.Po@am__quote@ 571 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Postgres.Po@am__quote@ 561 572 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/QueryView.Po@am__quote@ 562 573 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/QueryViewComposer.Po@am__quote@ 563 -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/QuickStyles.Po@am__quote@ 574 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/QuickStylesRaster.Po@am__quote@ 575 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/QuickStylesTopology.Po@am__quote@ 576 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/QuickStylesVector.Po@am__quote@ 564 577 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Raster.Po@am__quote@ 565 578 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RasterSymbolizers.Po@am__quote@ 566 579 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ResultSetView.Po@am__quote@ 567 580 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Shapefiles.Po@am__quote@ 568 581 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SqlFiltersComposer.Po@am__quote@ 569 582 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Styles.Po@am__quote@ 570 583 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TableTree.Po@am__quote@
Changes to MalformedGeoms.cpp.
1 1 /* 2 2 / MalformedGeoms.cpp 3 3 / identifying malformed geometries 4 4 / 5 5 / version 1.7, 2013 May 8 6 6 / 7 -/ Author: Sandro Furieri a-furieri@lqt.it 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 8 / 9 9 / Copyright (C) 2008-2013 Alessandro Furieri 10 10 / 11 11 / This program is free software: you can redistribute it and/or modify 12 12 / it under the terms of the GNU General Public License as published by 13 13 / the Free Software Foundation, either version 3 of the License, or 14 14 / (at your option) any later version.
Changes to MapPanel.cpp.
1 1 /* 2 2 / MapPanel.cpp 3 3 / the Map Panel of spatialite_gui - a SQLite /SpatiaLite GUI tool 4 4 / 5 5 / version 2.0, 2017 January 8 6 6 / 7 -/ Author: Sandro Furieri a-furieri@lqt.it 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 8 / 9 9 / Copyright (C) 2017 Alessandro Furieri 10 10 / 11 11 / This program is free software: you can redistribute it and/or modify 12 12 / it under the terms of the GNU General Public License as published by 13 13 / the Free Software Foundation, either version 3 of the License, or 14 14 / (at your option) any later version. ................................................................................ 31 31 #include "wx/spinctrl.h" 32 32 #include "wx/colordlg.h" 33 33 34 34 #include <float.h> 35 35 36 36 #include "icons/icon_map.xpm" 37 37 #include "icons/linestrings_on.xpm" 38 -#include "icons/linestrings_off.xpm" 39 38 #include "icons/points_on.xpm" 40 -#include "icons/points_off.xpm" 41 39 #include "icons/polygons_on.xpm" 42 -#include "icons/polygons_off.xpm" 43 40 #include "icons/vector.xpm" 44 -#include "icons/vector_off.xpm" 45 41 #include "icons/topo_geo.xpm" 46 -#include "icons/topo_geo_off.xpm" 47 42 #include "icons/topo_net.xpm" 48 -#include "icons/topo_net_off.xpm" 49 43 #include "icons/coverage.xpm" 50 -#include "icons/coverage_off.xpm" 51 44 #include "icons/wms.xpm" 52 -#include "icons/wms_off.xpm" 53 45 #include "icons/icon_info.xpm" 54 46 #include "icons/map_add.xpm" 55 47 #include "icons/map_table.xpm" 56 48 #include "icons/identify.xpm" 57 49 #include "icons/zoom_in.xpm" 58 50 #include "icons/zoom_out.xpm" 59 51 #include "icons/pan.xpm" ................................................................................ 782 774 color = wxColour(192, 192, 192); 783 775 MyBitmapCellRenderer *renderer = new MyBitmapCellRenderer; 784 776 wxBitmap bmp; 785 777 switch (pL->GetLayerType()) 786 778 { 787 779 case MAP_LAYER_VECTOR: 788 780 case MAP_LAYER_VECTOR_VIEW: 781 + case MAP_LAYER_VECTOR_SHP: 789 782 switch (pL->GetGeometryType()) 790 783 { 791 784 case 1: 792 785 case 1001: 793 786 case 2001: 794 787 case 3001: 795 788 case 4: ................................................................................ 839 832 pL = pL->GetNext(); 840 833 continue; 841 834 }; 842 835 renderer->SetGraphic(bmp); 843 836 Layers->SetCellValue(count, 0, pL->GetDbPrefix()); 844 837 Layers->SetCellTextColour(count, 0, color); 845 838 Layers->SetCellRenderer(count, 1, renderer); 846 - if (pL->GetLayerType() == MAP_LAYER_VECTOR) 839 + if (pL->GetLayerType() == MAP_LAYER_VECTOR 840 + || pL->GetLayerType() == MAP_LAYER_VECTOR_VIEW 841 + || pL->GetLayerType() == MAP_LAYER_VECTOR_SHP) 847 842 { 848 843 wxString prefixName = pL->GetLayerPrefix(); 849 844 prefixName += wxT("."); 850 845 prefixName += pL->GetLayerName(); 851 846 Layers->SetCellValue(count, 2, prefixName); 852 847 } else 853 848 Layers->SetCellValue(count, 2, pL->GetLayerName()); ................................................................................ 2593 2588 // first row: Layer's fully qualified name 2594 2589 wxBoxSizer *nameSizer = new wxBoxSizer(wxHORIZONTAL); 2595 2590 boxSizer->Add(nameSizer, 0, wxALIGN_RIGHT | wxALL, 0); 2596 2591 wxStaticText *nameLabel = 2597 2592 new wxStaticText(this, wxID_STATIC, wxT("&Full Name:")); 2598 2593 nameSizer->Add(nameLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2599 2594 wxString name = Layer->GetDbPrefix(); 2600 - if (Layer->GetType() == MAP_LAYER_VECTOR) 2595 + if (Layer->GetType() == MAP_LAYER_VECTOR 2596 + || Layer->GetType() == MAP_LAYER_VECTOR_VIEW 2597 + || Layer->GetType() == MAP_LAYER_VECTOR_SHP) 2601 2598 name += wxT(".") + Layer->GetVectorPrefix(); 2602 2599 name += wxT(".") + Layer->GetName(); 2603 2600 wxTextCtrl *nameCtrl = new wxTextCtrl(this, ID_MAPLAYER_NAME, name, 2604 2601 wxDefaultPosition, wxSize(550, 22), 2605 2602 wxTE_READONLY); 2606 2603 nameSizer->Add(nameCtrl, 0, wxALIGN_RIGHT | wxALL, 5); 2607 2604 // second row: Title ................................................................................ 2661 2658 switch (Layer->GetType()) 2662 2659 { 2663 2660 case MAP_LAYER_WMS: 2664 2661 datasource = wxT("WMS Layer GetMap URL:\n"); 2665 2662 datasource += wxString::FromUTF8(Layer->GetWmsGetMapURL()); 2666 2663 break; 2667 2664 case MAP_LAYER_VECTOR: 2665 + case MAP_LAYER_VECTOR_VIEW: 2666 + case MAP_LAYER_VECTOR_SHP: 2668 2667 datasource = wxT("Vector Coverage\n"); 2669 2668 datasource += wxT("SpatiaLite "); 2670 2669 if (Layer->GetVectorPrefix().IsSameAs(wxT("table")) == true) 2671 2670 datasource += 2672 2671 wxT("GeoTable: ") + wxString::FromUTF8(Layer->GetTableName()) + 2673 2672 wxT(" / ") + wxString::FromUTF8(Layer->GetGeometryColumn()) + 2674 2673 wxT("\n"); ................................................................................ 3758 3757 { 3759 3758 CachedNodes = new CachedFrame(); 3760 3759 CachedLinks = new CachedFrame(); 3761 3760 CachedLinkSeeds = new CachedFrame(); 3762 3761 } 3763 3762 QuickStyle = NULL; 3764 3763 QuickStyleTopology = NULL; 3764 + QuickStyleRaster = NULL; 3765 3765 Prev = NULL; 3766 3766 Next = NULL; 3767 3767 } 3768 3768 3769 3769 MapLayer::~MapLayer() 3770 3770 { 3771 3771 // ................................................................................ 3811 3811 delete CachedLinkSeeds; 3812 3812 if (CachedFaceSeeds != NULL) 3813 3813 delete CachedFaceSeeds; 3814 3814 if (QuickStyle != NULL) 3815 3815 delete QuickStyle; 3816 3816 if (QuickStyleTopology != NULL) 3817 3817 delete QuickStyleTopology; 3818 + if (QuickStyleRaster != NULL) 3819 + delete QuickStyleRaster; 3818 3820 } 3819 3821 3820 3822 void MapLayer::Invalidate() 3821 3823 { 3822 3824 // 3823 3825 // the Style changed: invalidating all Caches 3824 3826 // ................................................................................ 3886 3888 QuickStyleTopology = style->Clone(); 3887 3889 Invalidate(); 3888 3890 return true; 3889 3891 } 3890 3892 } 3891 3893 return false; 3892 3894 } 3895 + 3896 +bool MapLayer::UpdateQuickStyle(QuickStyleRasterObj * style) 3897 +{ 3898 +// 3899 +// updating the current Quick Syle 3900 +// 3901 + bool ret; 3902 + if (QuickStyleRaster == NULL) 3903 + { 3904 + QuickStyleRaster = style->Clone(); 3905 + QuickStyleRaster->UpdateXmlStyle(); 3906 + Invalidate(); 3907 + return true; 3908 + } else 3909 + { 3910 + ret = style->Compare(QuickStyleRaster); 3911 + if (ret == false) 3912 + { 3913 + if (QuickStyleRaster != NULL) 3914 + delete QuickStyleRaster; 3915 + QuickStyleRaster = style->Clone(); 3916 + QuickStyleRaster->UpdateXmlStyle(); 3917 + Invalidate(); 3918 + return true; 3919 + } 3920 + } 3921 + return false; 3922 +} 3893 3923 3894 3924 void MapLayer::PrepareGraphicsContext(int width, int height, double minx, 3895 3925 double miny, double maxx, double maxy, 3896 3926 const char *style) 3897 3927 { 3898 3928 // 3899 3929 // initializing the Graphics Context ................................................................................ 3926 3956 if (CachedLinks->IsValid(width, height, minx, miny, maxx, maxy, style) != 3927 3957 true) 3928 3958 CachedLinks->Reset(width, height, minx, miny, maxx, maxy, style); 3929 3959 if (CachedLinkSeeds->IsValid(width, height, minx, miny, maxx, maxy, style) 3930 3960 != true) 3931 3961 CachedLinkSeeds->Reset(width, height, minx, miny, maxx, maxy, style); 3932 3962 } 3933 - if (Type == MAP_LAYER_VECTOR || Type == MAP_LAYER_TOPOLOGY 3963 + if (Type == MAP_LAYER_VECTOR || Type == MAP_LAYER_VECTOR_VIEW 3964 + || Type == MAP_LAYER_VECTOR_SHP || Type == MAP_LAYER_TOPOLOGY 3934 3965 || Type == MAP_LAYER_NETWORK) 3935 3966 { 3936 3967 // Labels 3937 3968 if (CachedLabels->IsValid(width, height, minx, miny, maxx, maxy, style) != 3938 3969 true) 3939 3970 CachedLabels->Reset(width, height, minx, miny, maxx, maxy, style); 3940 3971 }
Changes to MapView.cpp.
1 1 /* 2 2 / MapView.cpp 3 3 / the Map View of spatialite_gui - a SQLite /SpatiaLite GUI tool 4 4 / 5 5 / version 2.0, 2017 January 8 6 6 / 7 -/ Author: Sandro Furieri a-furieri@lqt.it 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 8 / 9 9 / Copyright (C) 2017 Alessandro Furieri 10 10 / 11 11 / This program is free software: you can redistribute it and/or modify 12 12 / it under the terms of the GNU General Public License as published by 13 13 / the Free Software Foundation, either version 3 of the License, or 14 14 / (at your option) any later version. ................................................................................ 199 199 void MyMapView::OnSize(wxSizeEvent & WXUNUSED(event)) 200 200 { 201 201 // 202 202 // this window has changed its size 203 203 // 204 204 PrepareMap(); 205 205 } 206 + 207 +int MyMapView::GetImageWidth() 208 +{ 209 +// will return the current image Width 210 + wxSize sz = GetClientSize(); 211 + return sz.GetWidth(); 212 +} 213 + 214 +int MyMapView::GetImageHeight() 215 +{ 216 +// will return the current image Width 217 + wxSize sz = GetClientSize(); 218 + return sz.GetHeight(); 219 +} 206 220 207 221 void MyMapView::OnPaint(wxPaintEvent & WXUNUSED(event)) 208 222 { 209 223 // 210 224 // this window needs to be repainted 211 225 // 212 226 wxPaintDC dc(this); ................................................................................ 540 554 coords = wxString::FromUTF8(dummy); 541 555 sqlite3_free(dummy); 542 556 543 557 MapPanel->UpdateMapScale(); 544 558 MapPanel->UpdateMapCoords(coords); 545 559 MapPanel->UpdateMapSRID(); 546 560 } 561 + 562 +void MyMapView::DoPrepareBBox(wxString & bbox) 563 +{ 564 +// preparing the current frame BBOX 565 + char *buf = 566 + sqlite3_mprintf("BuildMBR(%f, %f, %f, %f, %d), ", FrameMinX, FrameMinY, 567 + FrameMaxX, FrameMaxY, MapSRID); 568 + bbox = wxString::FromUTF8(buf); 569 + sqlite3_free(buf); 570 +} 571 + 572 +void MyMapView::GetBBox(int *srid, double *minx, double *miny, double *maxx, double *maxy) 573 +{ 574 +// returning the current fram BBOX 575 +*srid = MapSRID; 576 + *minx = FrameMinX; 577 + *miny = FrameMinY; 578 + *maxx = FrameMaxX; 579 + *maxy = FrameMaxY; 580 +} 547 581 548 582 void MyMapView::Invalidate() 549 583 { 550 584 // resetting to initial state 551 585 ValidMap = false; 552 586 MapMinX = DBL_MAX; 553 587 MapMinY = DBL_MAX; ................................................................................ 2309 2343 nice(10); 2310 2344 } 2311 2345 } 2312 2346 #endif 2313 2347 2314 2348 lyr->IncrementRetryCount(); 2315 2349 view->DoPaintLayer(lyr); 2316 - mother->ReleaseThread(index, lyr); 2350 + mother->ReleaseThread(index); 2317 2351 lyr->SetLocked(false); 2318 2352 if (lyr->IsReady() == true) 2319 2353 { 2320 2354 canvas->SetChanged(true); 2321 2355 wxCommandEvent evt_step(wxEVT_COMMAND_BUTTON_CLICKED, ID_PAINT_MAP_STEP); 2322 2356 view->GetEventHandler()->AddPendingEvent(evt_step); 2323 2357 } ................................................................................ 2865 2899 char *db_prefix; 2866 2900 char *layer_name = NULL; 2867 2901 int len; 2868 2902 rl2CanvasPtr canvas; 2869 2903 sqlite3_stmt *stmt = NULL; 2870 2904 const char *sql; 2871 2905 int ret; 2906 + unsigned char *quickStyle = NULL; 2872 2907 2873 2908 if (lyr == NULL) 2874 2909 return; 2875 2910 layer = lyr->GetLayer(); 2876 2911 if (layer == NULL) 2877 2912 return; 2878 2913 config = layer->GetRasterConfig(); 2879 2914 if (config == NULL) 2880 2915 return; 2916 + 2917 +// attempting to apply a QuickStyle 2918 + if (layer->GetQuickStyleRaster() != NULL) 2919 + { 2920 + if (strcasecmp 2921 + (layer->GetQuickStyleRaster()->GetUUID(), config->GetStyle()) == 0) 2922 + { 2923 + // applying the Quick Style 2924 + quickStyle = layer->GetQuickStyleRaster()->CloneXmlStyle(); 2925 + } 2926 + } 2881 2927 2882 2928 wxString prefix = layer->GetDbPrefix(); 2883 2929 len = prefix.Len(); 2884 2930 if (len == 0) 2885 2931 db_prefix = NULL; 2886 2932 else 2887 2933 { ................................................................................ 2925 2971 (unsigned char *) sqlite3_column_blob(stmt, 0); 2926 2972 int blob_sz = sqlite3_column_bytes(stmt, 0); 2927 2973 canvas = layer->CreateCanvas(); 2928 2974 rl2_map_image_paint_from_raster(MapPanel->GetSqlite(), 2929 2975 MapPanel->GetRL2PrivateData(), 2930 2976 canvas, db_prefix, layer_name, 2931 2977 blob, blob_sz, 2932 - config->GetStyle()); 2978 + config->GetStyle(), quickStyle); 2933 2979 layer->Validate(canvas); 2934 2980 rl2_destroy_canvas(canvas); 2935 2981 } 2936 2982 } 2937 2983 } 2938 2984 sqlite3_finalize(stmt); 2939 2985 if (db_prefix != NULL) ................................................................................ 3045 3091 (unsigned char *) sqlite3_column_blob(stmt, 0); 3046 3092 int blob_sz = sqlite3_column_bytes(stmt, 0); 3047 3093 canvas = layer->CreateCanvas(); 3048 3094 const void *data = MapPanel->GetRL2PrivateData(); 3049 3095 if (layer->GetType() == MAP_LAYER_TOPOLOGY) 3050 3096 rl2_map_image_paint_from_vector_ex(MapPanel->GetSqlite(), data, 3051 3097 canvas, db_prefix, 3052 - layer_name, blob, blob_sz, 3098 + layer_name, blob, blob_sz, 0, 3053 3099 styleName, quickStyle, 3054 3100 config->AreNodesVisible(), 3055 3101 config->AreEdgesVisible(), 3056 3102 config->AreFacesVisible(), 3057 3103 config->AreEdgeSeedsVisible 3058 3104 (), 3059 3105 config->AreFaceSeedsVisible 3060 3106 ()); 3061 3107 else if (layer->GetType() == MAP_LAYER_NETWORK) 3062 3108 rl2_map_image_paint_from_vector_ex(MapPanel->GetSqlite(), data, 3063 3109 canvas, db_prefix, 3064 - layer_name, blob, blob_sz, 3110 + layer_name, blob, blob_sz, 0, 3065 3111 styleName, quickStyle, 3066 3112 config->AreNodesVisible(), 3067 3113 config->AreLinksVisible(), 0, 3068 3114 config->AreLinkSeedsVisible 3069 3115 (), 0); 3070 3116 else 3071 3117 rl2_map_image_paint_from_vector(MapPanel->GetSqlite(), data, 3072 3118 canvas, db_prefix, layer_name, 3073 - blob, blob_sz, 3119 + blob, blob_sz, 0, 3074 3120 styleName, quickStyle); 3075 3121 layer->Validate(canvas); 3076 3122 rl2_destroy_canvas(canvas); 3077 3123 } 3078 3124 } 3079 3125 } 3080 3126 sqlite3_finalize(stmt); ................................................................................ 3284 3330 rl2_graph_get_context_alpha_array(ctx, &half_transparent); 3285 3331 rl2_graph_destroy_context(ctx); 3286 3332 3287 3333 // updating the Screen 3288 3334 wxImage img = wxImage(FrameWidth, FrameHeight); 3289 3335 img.SetData(rgb, false); 3290 3336 img.SetAlpha(alpha, false); 3291 - BlinkBitmap = img; 3337 + BlinkBitmap = wxBitmap(img); 3292 3338 DynamicBlink = true; 3293 3339 ResetScreenBitmap(); 3294 3340 DynamicBlink = false; 3295 3341 } 3296 3342 3297 3343 void MyMapView::ResetMapBitmap(wxImage & img, unsigned int width, 3298 3344 unsigned int height) ................................................................................ 3341 3387 } 3342 3388 3343 3389 void MyMapView::RebuildLayerTree(MyLayerTree * LayerTree) 3344 3390 { 3345 3391 // 3346 3392 // rebuilding from scratch the Map Layers Tree 3347 3393 // 3348 - MapLayerObject *obj; 3349 3394 wxTreeItemId layer; 3350 3395 ::wxBeginBusyCursor(); 3351 3396 LayerTree->Hide(); 3352 3397 LayerTree->DeleteChildren(LayerTree->GetRoot()); 3353 3398 3354 3399 int count_rasters = 0; 3355 3400 MapLayer *pL = FirstLayer; ................................................................................ 4484 4529 *(UnusedThreads + i) = false; 4485 4530 return i; 4486 4531 } 4487 4532 } 4488 4533 return -1; 4489 4534 } 4490 4535 4491 -void MapViewPaintParams::ReleaseThread(int index, SingleLayerPainter * lyr) 4536 +void MapViewPaintParams::ReleaseThread(int index) 4492 4537 { 4493 4538 // releasing a Thread slot 4494 4539 if (UnusedThreads == NULL) 4495 4540 return; 4496 4541 if (index >= 0 && index < NumThreads) 4497 4542 { 4498 4543 // unlocking the Thread slot
Deleted Network.cpp.
1 -/* 2 -/ Network.cpp 3 -/ methods related to Network building 4 -/ 5 -/ version 1.7, 2013 May 8 6 -/ 7 -/ Author: Sandro Furieri a-furieri@lqt.it 8 -/ 9 -/ Copyright (C) 2008-2013 Alessandro Furieri 10 -/ 11 -/ This program is free software: you can redistribute it and/or modify 12 -/ it under the terms of the GNU General Public License as published by 13 -/ the Free Software Foundation, either version 3 of the License, or 14 -/ (at your option) any later version. 15 -/ 16 -/ This program is distributed in the hope that it will be useful, 17 -/ but WITHOUT ANY WARRANTY; without even the implied warranty of 18 -/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 -/ GNU General Public License for more details. 20 -/ 21 -/ You should have received a copy of the GNU General Public License 22 -/ along with this program. If not, see <http://www.gnu.org/licenses/>. 23 -/ 24 -*/ 25 - 26 -#include "Classdef.h" 27 -#include <float.h> 28 - 29 -#if defined(_WIN32) && !defined(__MINGW32__) 30 -#define strcasecmp _stricmp 31 -#endif 32 - 33 -#define MAX_BLOCK 1048576 34 - 35 -void 36 - MyFrame::BuildNetwork(wxString & table, wxString & from, wxString & to, 37 - bool isNoGeometry, wxString & geometry, wxString & name, 38 - bool cost_length, wxString & cost, bool bidirectional, 39 - bool one_way, wxString & one_way_from_to, 40 - wxString & one_way_to_from, bool aStarSupported, 41 - wxString & dataTableName, wxString & virtualTableName) 42 -{ 43 -// 44 -// trying to build a Network 45 -// 46 - int ret; 47 - sqlite3_stmt *stmt; 48 - Network *p_graph = NULL; 49 - wxString sql; 50 - char xsql[2048]; 51 - char **results; 52 - int n_rows; 53 - int n_columns; 54 - int i; 55 - char *errMsg = NULL; 56 - char *col_name; 57 - int type; 58 - bool ok_from_column = false; 59 - bool ok_to_column = false; 60 - bool ok_cost_column = false; 61 - bool ok_geom_column = false; 62 - bool ok_name_column = false; 63 - bool ok_oneway_tofrom = false; 64 - bool ok_oneway_fromto = false; 65 - bool from_null = false; 66 - bool from_int = false; 67 - bool from_double = false; 68 - bool from_text = false; 69 - bool from_blob = false; 70 - bool to_null = false; 71 - bool to_int = false; 72 - bool to_double = false; 73 - bool to_text = false; 74 - bool to_blob = false; 75 - bool cost_null = false; 76 - bool cost_text = false; 77 - bool cost_blob = false; 78 - bool tofrom_null = false; 79 - bool tofrom_double = false; 80 - bool tofrom_text = false; 81 - bool tofrom_blob = false; 82 - bool fromto_null = false; 83 - bool fromto_double = false; 84 - bool fromto_text = false; 85 - bool fromto_blob = false; 86 - bool geom_null = false; 87 - bool geom_not_linestring = false; 88 - int col_n; 89 - int fromto_n = 0; 90 - int tofrom_n = 0; 91 - sqlite3_int64 rowid; 92 - sqlite3_int64 id_from = -1; 93 - sqlite3_int64 id_to = -1; 94 - char code_from[1024]; 95 - char code_to[1024]; 96 - double node_from_x; 97 - double node_from_y; 98 - double node_to_x; 99 - double node_to_y; 100 - double cost_val; 101 - int fromto; 102 - int tofrom; 103 - wxString endMsg; 104 - wxString msg; 105 - bool wr; 106 - bool aStarLength; 107 - double a_star_length; 108 - double a_star_coeff; 109 - double min_a_star_coeff = DBL_MAX; 110 - char *xname; 111 - char *xname2; 112 - 113 - if (isNoGeometry == true) 114 - { 115 - BuildNetwork(table, from, to, name, cost, bidirectional, one_way, 116 - one_way_from_to, one_way_to_from, dataTableName, 117 - virtualTableName); 118 - return; 119 - } 120 - 121 - ::wxBeginBusyCursor(); 122 -// checking for table existence 123 - sql = 124 - wxT("SELECT tbl_name FROM sqlite_master WHERE Lower(tbl_name) = Lower('"); 125 - xname = (char *) malloc((table.Len() * 4) + 1); 126 - strcpy(xname, table.ToUTF8()); 127 - xname2 = gaiaSingleQuotedSql(xname); 128 - free(xname); 129 - sql += wxString::FromUTF8(xname2); 130 - free(xname2); 131 - sql += wxT("') AND type = 'table'"); 132 - strcpy(xsql, sql.ToUTF8()); 133 - ret = 134 - sqlite3_get_table(SqliteHandle, xsql, &results, &n_rows, &n_columns, 135 - &errMsg); 136 - if (ret != SQLITE_OK) 137 - { 138 -// some error occurred 139 - wxMessageBox(wxT("SQLite SQL error: ") + wxString::FromUTF8(errMsg), 140 - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 141 - sqlite3_free(errMsg); 142 - goto abort; 143 - } 144 - if (n_rows == 0) 145 - { 146 - // required table does not exists 147 - wxMessageBox(wxT("ERROR: table ") + table + wxT(" does not exists"), 148 - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 149 - goto abort; 150 - } else 151 - sqlite3_free_table(results); 152 -// checking for columns existence 153 - sql = wxT("PRAGMA table_info("); 154 - xname = (char *) malloc((table.Len() * 4) + 1); 155 - strcpy(xname, table.ToUTF8()); 156 - xname2 = gaiaDoubleQuotedSql(xname); 157 - free(xname); 158 - sql += wxString::FromUTF8(xname2); 159 - free(xname2); 160 - sql += wxT(")"); 161 - strcpy(xsql, sql.ToUTF8()); 162 - ret = 163 - sqlite3_get_table(SqliteHandle, xsql, &results, &n_rows, &n_columns, 164 - &errMsg); 165 - if (ret != SQLITE_OK) 166 - { 167 -// some error occurred 168 - wxMessageBox(wxT("SQLite SQL error: ") + wxString::FromUTF8(errMsg), 169 - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 170 - sqlite3_free(errMsg); 171 - goto abort; 172 - } 173 - if (n_rows > 1) 174 - { 175 - for (i = 1; i <= n_rows; i++) 176 - { 177 - char xcol[256]; 178 - col_name = results[(i * n_columns) + 1]; 179 - strcpy(xcol, from.ToUTF8()); 180 - if (strcasecmp(xcol, col_name) == 0) 181 - ok_from_column = true; 182 - strcpy(xcol, to.ToUTF8()); 183 - if (strcasecmp(xcol, col_name) == 0) 184 - ok_to_column = true; 185 - if (cost_length == false) 186 - { 187 - strcpy(xcol, cost.ToUTF8()); 188 - if (strcasecmp(xcol, col_name) == 0) 189 - ok_cost_column = true; 190 - } 191 - strcpy(xcol, geometry.ToUTF8()); 192 - if (strcasecmp(xcol, col_name) == 0) 193 - ok_geom_column = true; 194 - if (name.Len() > 0) 195 - { 196 - strcpy(xcol, name.ToUTF8()); 197 - if (strcasecmp(xcol, col_name) == 0) 198 - ok_name_column = true; 199 - } 200 - if (one_way == true) 201 - { 202 - strcpy(xcol, one_way_from_to.ToUTF8()); 203 - if (strcasecmp(xcol, col_name) == 0) 204 - ok_oneway_tofrom = true; 205 - } 206 - if (one_way == true) 207 - { 208 - strcpy(xcol, one_way_to_from.ToUTF8()); 209 - if (strcasecmp(xcol, col_name) == 0) 210 - ok_oneway_fromto = true; 211 - } 212 - } 213 - sqlite3_free_table(results); 214 - } 215 - if (ok_from_column == true && ok_to_column == true && ok_geom_column == true) 216 - ; 217 - else 218 - goto abort; 219 - if (name.Len() > 0 && ok_name_column == false) 220 - goto abort; 221 - if (cost_length == false && ok_cost_column == false) 222 - goto abort; 223 - if (one_way == true && ok_oneway_tofrom == false) 224 - goto abort; 225 - if (one_way == true && ok_oneway_fromto == false) 226 - goto abort; 227 -// checking column types 228 - p_graph = new Network(); 229 - xname = (char *) malloc((from.Len() * 4) + 1); 230 - strcpy(xname, from.ToUTF8()); 231 - xname2 = gaiaDoubleQuotedSql(xname); 232 - free(xname); 233 - sql = wxT("SELECT ") + wxString::FromUTF8(xname2); 234 - free(xname2); 235 - xname = (char *) malloc((to.Len() * 4) + 1); 236 - strcpy(xname, to.ToUTF8()); 237 - xname2 = gaiaDoubleQuotedSql(xname); 238 - free(xname); 239 - sql += wxT(", ") + wxString::FromUTF8(xname2); 240 - free(xname2); 241 - xname = (char *) malloc((geometry.Len() * 4) + 1); 242 - strcpy(xname, geometry.ToUTF8()); 243 - xname2 = gaiaDoubleQuotedSql(xname); 244 - free(xname); 245 - sql += wxT(", GeometryType(") + wxString::FromUTF8(xname2) + wxT(")"); 246 - free(xname2); 247 - col_n = 3; 248 - if (cost_length == false) 249 - { 250 - xname = (char *) malloc((cost.Len() * 4) + 1); 251 - strcpy(xname, cost.ToUTF8()); 252 - xname2 = gaiaDoubleQuotedSql(xname); 253 - free(xname); 254 - sql += wxT(", ") + wxString::FromUTF8(xname2); 255 - free(xname2); 256 - col_n++; 257 - } 258 - if (one_way == true) 259 - { 260 - xname = (char *) malloc((one_way_to_from.Len() * 4) + 1); 261 - strcpy(xname, one_way_to_from.ToUTF8()); 262 - xname2 = gaiaDoubleQuotedSql(xname); 263 - free(xname); 264 - sql += wxT(", ") + wxString::FromUTF8(xname2); 265 - free(xname2); 266 - tofrom_n = col_n; 267 - col_n++; 268 - xname = (char *) malloc((one_way_from_to.Len() * 4) + 1); 269 - strcpy(xname, one_way_from_to.ToUTF8()); 270 - xname2 = gaiaDoubleQuotedSql(xname); 271 - free(xname); 272 - sql += wxT(", ") + wxString::FromUTF8(xname2); 273 - free(xname2); 274 - fromto_n = col_n; 275 - col_n++; 276 - } 277 - xname = (char *) malloc((table.Len() * 4) + 1); 278 - strcpy(xname, table.ToUTF8()); 279 - xname2 = gaiaDoubleQuotedSql(xname); 280 - free(xname); 281 - sql += wxT(" FROM ") + wxString::FromUTF8(xname2); 282 - free(xname2); 283 - strcpy(xsql, sql.ToUTF8()); 284 - ret = sqlite3_prepare_v2(SqliteHandle, xsql, strlen(xsql), &stmt, NULL); 285 - if (ret != SQLITE_OK) 286 - { 287 - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); 288 - wxMessageBox(wxT("SQL error: ") + err, wxT("spatialite_gui"), 289 - wxOK | wxICON_ERROR, this); 290 - goto abort; 291 - } 292 - n_columns = sqlite3_column_count(stmt); 293 - while (1) 294 - { 295 - ret = sqlite3_step(stmt); 296 - if (ret == SQLITE_DONE) 297 - break; 298 - if (ret == SQLITE_ROW) 299 - { 300 - // the NodeFrom type 301 - type = sqlite3_column_type(stmt, 0); 302 - if (type == SQLITE_NULL) 303 - from_null = true; 304 - if (type == SQLITE_INTEGER) 305 - { 306 - from_int = true; 307 - id_from = sqlite3_column_int64(stmt, 0); 308 - p_graph->InsertNode(id_from); 309 - } 310 - if (type == SQLITE_FLOAT) 311 - from_double = true; 312 - if (type == SQLITE_TEXT) 313 - { 314 - from_text = true; 315 - strcpy(code_from, (char *) sqlite3_column_text(stmt, 0)); 316 - p_graph->InsertNode(code_from); 317 - } 318 - if (type == SQLITE_BLOB) 319 - from_blob = true; 320 - // the NodeTo type 321 - type = sqlite3_column_type(stmt, 1); 322 - if (type == SQLITE_NULL) 323 - to_null = true; 324 - if (type == SQLITE_INTEGER) 325 - { 326 - to_int = true; 327 - id_to = sqlite3_column_int64(stmt, 1); 328 - p_graph->InsertNode(id_to); 329 - } 330 - if (type == SQLITE_FLOAT) 331 - to_double = true; 332 - if (type == SQLITE_TEXT) 333 - { 334 - to_text = true; 335 - strcpy(code_to, (char *) sqlite3_column_text(stmt, 1)); 336 - p_graph->InsertNode(code_to); 337 - } 338 - if (type == SQLITE_BLOB) 339 - to_blob = true; 340 - // the Geometry type 341 - type = sqlite3_column_type(stmt, 2); 342 - if (type == SQLITE_NULL) 343 - geom_null = true; 344 - else if (strcmp("LINESTRING", (char *) sqlite3_column_text(stmt, 2)) 345 - != 0) 346 - geom_not_linestring = true; 347 - col_n = 3; 348 - if (cost_length == false) 349 - { 350 - // the Cost type 351 - type = sqlite3_column_type(stmt, col_n); 352 - col_n++; 353 - if (type == SQLITE_NULL) 354 - cost_null = true; 355 - if (type == SQLITE_TEXT) 356 - cost_text = true; 357 - if (type == SQLITE_BLOB) 358 - cost_blob = true; 359 - } 360 - if (one_way == true) 361 - { 362 - // the FromTo type 363 - type = sqlite3_column_type(stmt, col_n); 364 - col_n++; 365 - if (type == SQLITE_NULL) 366 - fromto_null = true; 367 - if (type == SQLITE_FLOAT) 368 - fromto_double = true; 369 - if (type == SQLITE_TEXT) 370 - fromto_text = true; 371 - if (type == SQLITE_BLOB) 372 - fromto_blob = true; 373 - // the ToFrom type 374 - type = sqlite3_column_type(stmt, col_n); 375 - col_n++; 376 - if (type == SQLITE_NULL) 377 - tofrom_null = true; 378 - if (type == SQLITE_FLOAT) 379 - tofrom_double = true; 380 - if (type == SQLITE_TEXT) 381 - tofrom_text = true; 382 - if (type == SQLITE_BLOB) 383 - tofrom_blob = true; 384 - } 385 - } else 386 - { 387 - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); 388 - wxMessageBox(wxT("sqlite3_step error: ") + err, wxT("spatialite_gui"), 389 - wxOK | wxICON_ERROR, this); 390 - sqlite3_finalize(stmt); 391 - goto abort; 392 - } 393 - } 394 - sqlite3_finalize(stmt); 395 - ret = 1; 396 - if (from_null == true) 397 - ret = 0; 398 - if (from_blob == true) 399 - ret = 0; 400 - if (from_double == true) 401 - ret = 0; 402 - if (to_null == true) 403 - ret = 0; 404 - if (to_blob == true) 405 - ret = 0; 406 - if (to_double == true) 407 - ret = 0; 408 - if (geom_null == true) 409 - ret = 0; 410 - if (geom_not_linestring == true) 411 - ret = 0; 412 - if (cost_length == false) 413 - { 414 - if (cost_null == true) 415 - ret = 0; 416 - if (cost_blob == true) 417 - ret = 0; 418 - if (cost_text == true) 419 - ret = 0; 420 - } 421 - if (one_way == true) 422 - { 423 - if (fromto_null == true) 424 - ret = 0; 425 - if (fromto_blob == true) 426 - ret = 0; 427 - if (fromto_text == true) 428 - ret = 0; 429 - if (fromto_double == true) 430 - ret = 0; 431 - if (tofrom_null == true) 432 - ret = 0; 433 - if (tofrom_blob == true) 434 - ret = 0; 435 - if (tofrom_text == true) 436 - ret = 0; 437 - if (tofrom_double == true) 438 - ret = 0; 439 - } 440 - if (!ret) 441 - goto abort; 442 - if (from_int == true && to_int == true) 443 - { 444 - // each node is identified by an INTEGER id 445 - p_graph->SetNodeCode(false); 446 - } else if (from_text == true && to_text == true) 447 - { 448 - // each node is identified by a TEXT code 449 - p_graph->SetNodeCode(true); 450 - } else 451 - goto abort; 452 - p_graph->InitNodes(); 453 -// checking topologic consistency 454 - xname = (char *) malloc((from.Len() * 4) + 1); 455 - strcpy(xname, from.ToUTF8()); 456 - xname2 = gaiaDoubleQuotedSql(xname); 457 - free(xname); 458 - sql = wxT("SELECT ROWID, ") + wxString::FromUTF8(xname2); 459 - free(xname2); 460 - xname = (char *) malloc((to.Len() * 4) + 1); 461 - strcpy(xname, to.ToUTF8()); 462 - xname2 = gaiaDoubleQuotedSql(xname); 463 - free(xname); 464 - sql += wxT(", ") + wxString::FromUTF8(xname2) + wxT(", "); 465 - free(xname2); 466 - xname = (char *) malloc((geometry.Len() * 4) + 1); 467 - strcpy(xname, geometry.ToUTF8()); 468 - xname2 = gaiaDoubleQuotedSql(xname); 469 - free(xname); 470 - sql += 471 - wxT("X(StartPoint(") + wxString::FromUTF8(xname2) + 472 - wxT(")), Y(StartPoint("); 473 - sql += wxString::FromUTF8(xname2) + wxT(")), "); 474 - sql += 475 - wxT("X(EndPoint(") + wxString::FromUTF8(xname2) + wxT(")), Y(EndPoint("); 476 - sql += wxString::FromUTF8(xname2) + wxT("))"); 477 - free(xname2); 478 - if (aStarSupported == true) 479 - { 480 - // supporting A* algorithm 481 - if (cost_length == false) 482 - { 483 - xname = (char *) malloc((cost.Len() * 4) + 1); 484 - strcpy(xname, cost.ToUTF8()); 485 - xname2 = gaiaDoubleQuotedSql(xname); 486 - free(xname); 487 - sql += wxT(", ") + wxString::FromUTF8(xname2); 488 - free(xname2); 489 - xname = (char *) malloc((geometry.Len() * 4) + 1); 490 - strcpy(xname, geometry.ToUTF8()); 491 - xname2 = gaiaDoubleQuotedSql(xname); 492 - free(xname); 493 - sql += wxT(", GLength(") + wxString::FromUTF8(xname2) + wxT(")"); 494 - free(xname2); 495 - col_n = 9; 496 - aStarLength = true; 497 - } else 498 - { 499 - xname = (char *) malloc((geometry.Len() * 4) + 1); 500 - strcpy(xname, geometry.ToUTF8()); 501 - xname2 = gaiaDoubleQuotedSql(xname); 502 - free(xname); 503 - sql += wxT(", GLength(") + wxString::FromUTF8(xname2) + wxT(")"); 504 - free(xname2); 505 - col_n = 9; 506 - aStarLength = false; 507 - min_a_star_coeff = 1.0; 508 - } 509 - } else 510 - { 511 - // A* algorithm unsupported 512 - if (cost_length == false) 513 - { 514 - xname = (char *) malloc((cost.Len() * 4) + 1); 515 - strcpy(xname, cost.ToUTF8()); 516 - xname2 = gaiaDoubleQuotedSql(xname); 517 - free(xname); 518 - sql += wxT(", ") + wxString::FromUTF8(xname2); 519 - free(xname2); 520 - col_n = 8; 521 - } else 522 - { 523 - xname = (char *) malloc((geometry.Len() * 4) + 1); 524 - strcpy(xname, geometry.ToUTF8()); 525 - xname2 = gaiaDoubleQuotedSql(xname); 526 - free(xname); 527 - sql += wxT(", GLength(") + wxString::FromUTF8(xname2) + wxT(")"); 528 - free(xname2); 529 - col_n = 9; 530 - } 531 - aStarLength = false; 532 - } 533 - if (one_way == true) 534 - { 535 - xname = (char *) malloc((one_way_to_from.Len() * 4) + 1); 536 - strcpy(xname, one_way_to_from.ToUTF8()); 537 - xname2 = gaiaDoubleQuotedSql(xname); 538 - free(xname); 539 - sql += wxT(", ") + wxString::FromUTF8(xname2); 540 - free(xname2); 541 - tofrom_n = col_n; 542 - col_n++; 543 - xname = (char *) malloc((one_way_from_to.Len() * 4) + 1); 544 - strcpy(xname, one_way_from_to.ToUTF8()); 545 - xname2 = gaiaDoubleQuotedSql(xname); 546 - free(xname); 547 - sql += wxT(", ") + wxString::FromUTF8(xname2); 548 - free(xname2); 549 - fromto_n = col_n; 550 - col_n++; 551 - } 552 - xname = (char *) malloc((table.Len() * 4) + 1); 553 - strcpy(xname, table.ToUTF8()); 554 - xname2 = gaiaDoubleQuotedSql(xname); 555 - free(xname); 556 - sql += wxT(" FROM ") + wxString::FromUTF8(xname2); 557 - free(xname2); 558 - strcpy(xsql, sql.ToUTF8()); 559 - ret = sqlite3_prepare_v2(SqliteHandle, xsql, strlen(xsql), &stmt, NULL); 560 - if (ret != SQLITE_OK) 561 - { 562 - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); 563 - wxMessageBox(wxT("SQL error: ") + err, wxT("spatialite_gui"), 564 - wxOK | wxICON_ERROR, this); 565 - goto abort; 566 - } 567 - n_columns = sqlite3_column_count(stmt); 568 - while (1) 569 - { 570 - ret = sqlite3_step(stmt); 571 - if (ret == SQLITE_DONE) 572 - break; 573 - if (ret == SQLITE_ROW) 574 - { 575 - fromto = true; 576 - tofrom = true; 577 - if (p_graph->IsNodeCode() == true) 578 - { 579 - id_from = -1; 580 - id_to = -1; 581 - } else 582 - { 583 - *code_from = '\0'; 584 - *code_to = '\0'; 585 - } 586 - // fetching the ROWID 587 - rowid = sqlite3_column_int64(stmt, 0); 588 - // fetching the NodeFrom value 589 - if (p_graph->IsNodeCode() == true) 590 - strcpy(code_from, (char *) sqlite3_column_text(stmt, 1)); 591 - else 592 - id_from = sqlite3_column_int64(stmt, 1); 593 - // fetching the NodeTo value 594 - if (p_graph->IsNodeCode() == true) 595 - strcpy(code_to, (char *) sqlite3_column_text(stmt, 2)); 596 - else 597 - id_to = sqlite3_column_int64(stmt, 2); 598 - // fetching the NodeFromX value 599 - node_from_x = sqlite3_column_double(stmt, 3); 600 - // fetching the NodeFromY value 601 - node_from_y = sqlite3_column_double(stmt, 4); 602 - // fetching the NodeFromX value 603 - node_to_x = sqlite3_column_double(stmt, 5); 604 - // fetching the NodeFromY value 605 - node_to_y = sqlite3_column_double(stmt, 6); 606 - // fetching the Cost value 607 - cost_val = sqlite3_column_double(stmt, 7); 608 - if (one_way == true) 609 - { 610 - // fetching the OneWay-FromTo value 611 - fromto = sqlite3_column_int(stmt, fromto_n); 612 - // fetching the OneWay-ToFrom value 613 - tofrom = sqlite3_column_int(stmt, tofrom_n); 614 - } 615 - if (cost_val <= 0.0) 616 - p_graph->SetError(); 617 - if (aStarLength == true) 618 - { 619 - // supporting A* - fetching the arc length 620 - a_star_length = sqlite3_column_double(stmt, 8); 621 - a_star_coeff = cost_val / a_star_length; 622 - if (a_star_coeff < min_a_star_coeff) 623 - min_a_star_coeff = a_star_coeff; 624 - } 625 - if (bidirectional == true) 626 - { 627 - if (fromto) 628 - { 629 - if (p_graph->IsNodeCode() == true) 630 - p_graph->AddArc(rowid, code_from, code_to, node_from_x, 631 - node_from_y, node_to_x, node_to_y, 632 - cost_val); 633 - else 634 - p_graph->AddArc(rowid, id_from, id_to, node_from_x, 635 - node_from_y, node_to_x, node_to_y, 636 - cost_val); 637 - } 638 - if (tofrom) 639 - { 640 - if (p_graph->IsNodeCode() == true) 641 - p_graph->AddArc(rowid, code_to, code_from, node_to_x, 642 - node_to_y, node_from_x, node_from_y, 643 - cost_val); 644 - else 645 - p_graph->AddArc(rowid, id_to, id_from, node_to_x, node_to_y, 646 - node_from_x, node_from_y, cost_val); 647 - } 648 - } else 649 - { 650 - if (p_graph->IsNodeCode() == true) 651 - p_graph->AddArc(rowid, code_from, code_to, node_from_x, 652 - node_from_y, node_to_x, node_to_y, cost_val); 653 - else 654 - p_graph->AddArc(rowid, id_from, id_to, node_from_x, node_from_y, 655 - node_to_x, node_to_y, cost_val); 656 - } 657 - if (p_graph->IsError() == true) 658 - { 659 - sqlite3_finalize(stmt); 660 - goto abort; 661 - } 662 - } else 663 - { 664 - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); 665 - wxMessageBox(wxT("sqlite3_step error: ") + err, wxT("spatialite_gui"), 666 - wxOK | wxICON_ERROR, this); 667 - sqlite3_finalize(stmt); 668 - goto abort; 669 - } 670 - } 671 - sqlite3_finalize(stmt); 672 - ::wxEndBusyCursor(); 673 - wr = 674 - CreateNetwork(p_graph, table, from, to, geometry, name, 675 - aStarSupported, min_a_star_coeff, dataTableName, 676 - virtualTableName); 677 - if (wr == true) 678 - { 679 - endMsg = 680 - wxT("OK: VirtualNetwork table '") + table + 681 - wxT("_net' successfully created"); 682 - wxMessageBox(endMsg, wxT("spatialite_gui"), wxOK | wxICON_INFORMATION, 683 - this); 684 - } else 685 - { 686 - endMsg = 687 - wxT("DB ERROR: VirtualNetwork table '") + table + 688 - wxT("_net' was not created"); 689 - wxMessageBox(endMsg, wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 690 - } 691 - if (p_graph) 692 - delete p_graph; 693 - InitTableTree(); 694 - return; 695 -abort: 696 - ::wxEndBusyCursor(); 697 - msg = 698 - wxT 699 - ("It's impossible to build a Network using the given configuration;\nsome fatal error occurred\n\n"); 700 - msg += wxT("please note: using the 'spatialite_network' command-line tool\n"); 701 - msg += 702 - wxT 703 - ("you can obtain a full detailed report explaining causes for this failure"); 704 - wxMessageBox(msg, wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 705 - if (p_graph) 706 - delete p_graph; 707 -} 708 - 709 -void 710 - MyFrame::BuildNetwork(wxString & table, wxString & from, wxString & to, 711 - wxString & name, wxString & cost, bool bidirectional, 712 - bool one_way, wxString & one_way_from_to, 713 - wxString & one_way_to_from, wxString & dataTableName, 714 - wxString & virtualTableName) 715 -{ 716 -// 717 -// trying to build a Network - NO-GEOMETRY 718 -// 719 - int ret; 720 - sqlite3_stmt *stmt; 721 - Network *p_graph = NULL; 722 - wxString sql; 723 - char xsql[2048]; 724 - char **results; 725 - int n_rows; 726 - int n_columns; 727 - int i; 728 - char *errMsg = NULL; 729 - char *col_name; 730 - int type; 731 - bool ok_from_column = false; 732 - bool ok_to_column = false; 733 - bool ok_cost_column = false; 734 - bool ok_name_column = false; 735 - bool ok_oneway_tofrom = false; 736 - bool ok_oneway_fromto = false; 737 - bool from_null = false; 738 - bool from_int = false; 739 - bool from_double = false; 740 - bool from_text = false; 741 - bool from_blob = false; 742 - bool to_null = false; 743 - bool to_int = false; 744 - bool to_double = false; 745 - bool to_text = false; 746 - bool to_blob = false; 747 - bool cost_null = false; 748 - bool cost_text = false; 749 - bool cost_blob = false; 750 - bool tofrom_null = false; 751 - bool tofrom_double = false; 752 - bool tofrom_text = false; 753 - bool tofrom_blob = false; 754 - bool fromto_null = false; 755 - bool fromto_double = false; 756 - bool fromto_text = false; 757 - bool fromto_blob = false; 758 - int col_n; 759 - int fromto_n = 0; 760 - int tofrom_n = 0; 761 - sqlite3_int64 rowid; 762 - sqlite3_int64 id_from = -1; 763 - sqlite3_int64 id_to = -1; 764 - char code_from[1024]; 765 - char code_to[1024]; 766 - double cost_val; 767 - int fromto; 768 - int tofrom; 769 - wxString endMsg; 770 - wxString msg; 771 - bool wr; 772 - char *xname; 773 - char *xname2; 774 - 775 - ::wxBeginBusyCursor(); 776 -// checking for table existence 777 - sql = 778 - wxT("SELECT tbl_name FROM sqlite_master WHERE Lower(tbl_name) = Lower('"); 779 - xname = (char *) malloc((table.Len() * 4) + 1); 780 - strcpy(xname, table.ToUTF8()); 781 - xname2 = gaiaSingleQuotedSql(xname); 782 - free(xname); 783 - sql += wxString::FromUTF8(xname2); 784 - free(xname2); 785 - sql += wxT("') AND type = 'table'"); 786 - strcpy(xsql, sql.ToUTF8()); 787 - ret = 788 - sqlite3_get_table(SqliteHandle, xsql, &results, &n_rows, &n_columns, 789 - &errMsg); 790 - if (ret != SQLITE_OK) 791 - { 792 -// some error occurred 793 - wxMessageBox(wxT("SQLite SQL error: ") + wxString::FromUTF8(errMsg), 794 - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 795 - sqlite3_free(errMsg); 796 - goto abort; 797 - } 798 - if (n_rows == 0) 799 - { 800 - // required table does not exists 801 - wxMessageBox(wxT("ERROR: table ") + table + wxT(" does not exists"), 802 - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 803 - goto abort; 804 - } else 805 - sqlite3_free_table(results); 806 -// checking for columns existence 807 - sql = wxT("PRAGMA table_info("); 808 - xname = (char *) malloc((table.Len() * 4) + 1); 809 - strcpy(xname, table.ToUTF8()); 810 - xname2 = gaiaDoubleQuotedSql(xname); 811 - free(xname); 812 - sql += wxString::FromUTF8(xname2); 813 - free(xname2); 814 - sql += wxT(")"); 815 - strcpy(xsql, sql.ToUTF8()); 816 - ret = 817 - sqlite3_get_table(SqliteHandle, xsql, &results, &n_rows, &n_columns, 818 - &errMsg); 819 - if (ret != SQLITE_OK) 820 - { 821 -// some error occurred 822 - wxMessageBox(wxT("SQLite SQL error: ") + wxString::FromUTF8(errMsg), 823 - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 824 - sqlite3_free(errMsg); 825 - goto abort; 826 - } 827 - if (n_rows > 1) 828 - { 829 - for (i = 1; i <= n_rows; i++) 830 - { 831 - char xcol[256]; 832 - col_name = results[(i * n_columns) + 1]; 833 - strcpy(xcol, from.ToUTF8()); 834 - if (strcasecmp(xcol, col_name) == 0) 835 - ok_from_column = true; 836 - strcpy(xcol, to.ToUTF8()); 837 - if (strcasecmp(xcol, col_name) == 0) 838 - ok_to_column = true; 839 - strcpy(xcol, cost.ToUTF8()); 840 - if (strcasecmp(xcol, col_name) == 0) 841 - ok_cost_column = true; 842 - if (name.Len() > 0) 843 - { 844 - strcpy(xcol, name.ToUTF8()); 845 - if (strcasecmp(xcol, col_name) == 0) 846 - ok_name_column = true; 847 - } 848 - if (one_way == true) 849 - { 850 - strcpy(xcol, one_way_from_to.ToUTF8()); 851 - if (strcasecmp(xcol, col_name) == 0) 852 - ok_oneway_tofrom = true; 853 - } 854 - if (one_way == true) 855 - { 856 - strcpy(xcol, one_way_to_from.ToUTF8()); 857 - if (strcasecmp(xcol, col_name) == 0) 858 - ok_oneway_fromto = true; 859 - } 860 - } 861 - sqlite3_free_table(results); 862 - } 863 - if (ok_from_column == true && ok_to_column == true) 864 - ; 865 - else 866 - goto abort; 867 - if (name.Len() > 0 && ok_name_column == false) 868 - goto abort; 869 - if (ok_cost_column == false) 870 - goto abort; 871 - if (one_way == true && ok_oneway_tofrom == false) 872 - goto abort; 873 - if (one_way == true && ok_oneway_fromto == false) 874 - goto abort; 875 -// checking column types 876 - p_graph = new Network(); 877 - xname = (char *) malloc((from.Len() * 4) + 1); 878 - strcpy(xname, from.ToUTF8()); 879 - xname2 = gaiaDoubleQuotedSql(xname); 880 - free(xname); 881 - sql = wxT("SELECT ") + wxString::FromUTF8(xname2); 882 - free(xname2); 883 - xname = (char *) malloc((to.Len() * 4) + 1); 884 - strcpy(xname, to.ToUTF8()); 885 - xname2 = gaiaDoubleQuotedSql(xname); 886 - free(xname); 887 - sql += wxT(", ") + wxString::FromUTF8(xname2); 888 - free(xname2); 889 - xname = (char *) malloc((cost.Len() * 4) + 1); 890 - strcpy(xname, cost.ToUTF8()); 891 - xname2 = gaiaDoubleQuotedSql(xname); 892 - free(xname); 893 - sql += wxT(", ") + wxString::FromUTF8(xname2); 894 - free(xname2); 895 - col_n = 3; 896 - if (one_way == true) 897 - { 898 - xname = (char *) malloc((one_way_to_from.Len() * 4) + 1); 899 - strcpy(xname, one_way_to_from.ToUTF8()); 900 - xname2 = gaiaDoubleQuotedSql(xname); 901 - free(xname); 902 - sql += wxT(", ") + wxString::FromUTF8(xname2); 903 - free(xname2); 904 - tofrom_n = col_n; 905 - col_n++; 906 - xname = (char *) malloc((one_way_from_to.Len() * 4) + 1); 907 - strcpy(xname, one_way_from_to.ToUTF8()); 908 - xname2 = gaiaDoubleQuotedSql(xname); 909 - free(xname); 910 - sql += wxT(", ") + wxString::FromUTF8(xname2); 911 - free(xname2); 912 - fromto_n = col_n; 913 - col_n++; 914 - } 915 - xname = (char *) malloc((table.Len() * 4) + 1); 916 - strcpy(xname, table.ToUTF8()); 917 - xname2 = gaiaDoubleQuotedSql(xname); 918 - free(xname); 919 - sql += wxT(" FROM ") + wxString::FromUTF8(xname2); 920 - free(xname2); 921 - strcpy(xsql, sql.ToUTF8()); 922 - ret = sqlite3_prepare_v2(SqliteHandle, xsql, strlen(xsql), &stmt, NULL); 923 - if (ret != SQLITE_OK) 924 - { 925 - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); 926 - wxMessageBox(wxT("SQL error: ") + err, wxT("spatialite_gui"), 927 - wxOK | wxICON_ERROR, this); 928 - goto abort; 929 - } 930 - n_columns = sqlite3_column_count(stmt); 931 - while (1) 932 - { 933 - ret = sqlite3_step(stmt); 934 - if (ret == SQLITE_DONE) 935 - break; 936 - if (ret == SQLITE_ROW) 937 - { 938 - // the NodeFrom type 939 - type = sqlite3_column_type(stmt, 0); 940 - if (type == SQLITE_NULL) 941 - from_null = true; 942 - if (type == SQLITE_INTEGER) 943 - { 944 - from_int = true; 945 - id_from = sqlite3_column_int64(stmt, 0); 946 - p_graph->InsertNode(id_from); 947 - } 948 - if (type == SQLITE_FLOAT) 949 - from_double = true; 950 - if (type == SQLITE_TEXT) 951 - { 952 - from_text = true; 953 - strcpy(code_from, (char *) sqlite3_column_text(stmt, 0)); 954 - p_graph->InsertNode(code_from); 955 - } 956 - if (type == SQLITE_BLOB) 957 - from_blob = true; 958 - // the NodeTo type 959 - type = sqlite3_column_type(stmt, 1); 960 - if (type == SQLITE_NULL) 961 - to_null = true; 962 - if (type == SQLITE_INTEGER) 963 - { 964 - to_int = true; 965 - id_to = sqlite3_column_int64(stmt, 1); 966 - p_graph->InsertNode(id_to); 967 - } 968 - if (type == SQLITE_FLOAT) 969 - to_double = true; 970 - if (type == SQLITE_TEXT) 971 - { 972 - to_text = true; 973 - strcpy(code_to, (char *) sqlite3_column_text(stmt, 1)); 974 - p_graph->InsertNode(code_to); 975 - } 976 - if (type == SQLITE_BLOB) 977 - to_blob = true; 978 - // the Cost type 979 - type = sqlite3_column_type(stmt, 2); 980 - if (type == SQLITE_NULL) 981 - cost_null = true; 982 - if (type == SQLITE_TEXT) 983 - cost_text = true; 984 - if (type == SQLITE_BLOB) 985 - cost_blob = true; 986 - col_n = 3; 987 - if (one_way == true) 988 - { 989 - // the FromTo type 990 - type = sqlite3_column_type(stmt, col_n); 991 - col_n++; 992 - if (type == SQLITE_NULL) 993 - fromto_null = true; 994 - if (type == SQLITE_FLOAT) 995 - fromto_double = true; 996 - if (type == SQLITE_TEXT) 997 - fromto_text = true; 998 - if (type == SQLITE_BLOB) 999 - fromto_blob = true; 1000 - // the ToFrom type 1001 - type = sqlite3_column_type(stmt, col_n); 1002 - col_n++; 1003 - if (type == SQLITE_NULL) 1004 - tofrom_null = true; 1005 - if (type == SQLITE_FLOAT) 1006 - tofrom_double = true; 1007 - if (type == SQLITE_TEXT) 1008 - tofrom_text = true; 1009 - if (type == SQLITE_BLOB) 1010 - tofrom_blob = true; 1011 - } 1012 - } else 1013 - { 1014 - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); 1015 - wxMessageBox(wxT("sqlite3_step error: ") + err, wxT("spatialite_gui"), 1016 - wxOK | wxICON_ERROR, this); 1017 - sqlite3_finalize(stmt); 1018 - goto abort; 1019 - } 1020 - } 1021 - sqlite3_finalize(stmt); 1022 - ret = 1; 1023 - if (from_null == true) 1024 - ret = 0; 1025 - if (from_blob == true) 1026 - ret = 0; 1027 - if (from_double == true) 1028 - ret = 0; 1029 - if (to_null == true) 1030 - ret = 0; 1031 - if (to_blob == true) 1032 - ret = 0; 1033 - if (to_double == true) 1034 - ret = 0; 1035 - if (cost_null == true) 1036 - ret = 0; 1037 - if (cost_blob == true) 1038 - ret = 0; 1039 - if (cost_text == true) 1040 - ret = 0; 1041 - if (one_way == true) 1042 - { 1043 - if (fromto_null == true) 1044 - ret = 0; 1045 - if (fromto_blob == true) 1046 - ret = 0; 1047 - if (fromto_text == true) 1048 - ret = 0; 1049 - if (fromto_double == true) 1050 - ret = 0; 1051 - if (tofrom_null == true) 1052 - ret = 0; 1053 - if (tofrom_blob == true) 1054 - ret = 0; 1055 - if (tofrom_text == true) 1056 - ret = 0; 1057 - if (tofrom_double == true) 1058 - ret = 0; 1059 - } 1060 - if (!ret) 1061 - goto abort; 1062 - if (from_int == true && to_int == true) 1063 - { 1064 - // each node is identified by an INTEGER id 1065 - p_graph->SetNodeCode(false); 1066 - } else if (from_text == true && to_text == true) 1067 - { 1068 - // each node is identified by a TEXT code 1069 - p_graph->SetNodeCode(true); 1070 - } else 1071 - goto abort; 1072 - p_graph->InitNodes(); 1073 -// checking topological consistency 1074 - xname = (char *) malloc((from.Len() * 4) + 1); 1075 - strcpy(xname, from.ToUTF8()); 1076 - xname2 = gaiaDoubleQuotedSql(xname); 1077 - free(xname); 1078 - sql = wxT("SELECT ROWID, ") + wxString::FromUTF8(xname2); 1079 - free(xname2); 1080 - xname = (char *) malloc((to.Len() * 4) + 1); 1081 - strcpy(xname, to.ToUTF8()); 1082 - xname2 = gaiaDoubleQuotedSql(xname); 1083 - free(xname); 1084 - sql += wxT(", ") + wxString::FromUTF8(xname2); 1085 - free(xname2); 1086 - xname = (char *) malloc((cost.Len() * 4) + 1); 1087 - strcpy(xname, cost.ToUTF8()); 1088 - xname2 = gaiaDoubleQuotedSql(xname); 1089 - free(xname); 1090 - sql += wxT(", ") + wxString::FromUTF8(xname2); 1091 - free(xname2); 1092 - col_n = 4; 1093 - if (one_way == true) 1094 - { 1095 - xname = (char *) malloc((one_way_to_from.Len() * 4) + 1); 1096 - strcpy(xname, one_way_to_from.ToUTF8()); 1097 - xname2 = gaiaDoubleQuotedSql(xname); 1098 - free(xname); 1099 - sql += wxT(", ") + wxString::FromUTF8(xname2); 1100 - free(xname2); 1101 - tofrom_n = col_n; 1102 - col_n++; 1103 - xname = (char *) malloc((one_way_from_to.Len() * 4) + 1); 1104 - strcpy(xname, one_way_from_to.ToUTF8()); 1105 - xname2 = gaiaDoubleQuotedSql(xname); 1106 - free(xname); 1107 - sql += wxT(", ") + wxString::FromUTF8(xname2); 1108 - free(xname2); 1109 - fromto_n = col_n; 1110 - col_n++; 1111 - } 1112 - xname = (char *) malloc((table.Len() * 4) + 1); 1113 - strcpy(xname, table.ToUTF8()); 1114 - xname2 = gaiaDoubleQuotedSql(xname); 1115 - free(xname); 1116 - sql += wxT(" FROM ") + wxString::FromUTF8(xname2); 1117 - free(xname2); 1118 - strcpy(xsql, sql.ToUTF8()); 1119 - ret = sqlite3_prepare_v2(SqliteHandle, xsql, strlen(xsql), &stmt, NULL); 1120 - if (ret != SQLITE_OK) 1121 - { 1122 - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); 1123 - wxMessageBox(wxT("SQL error: ") + err, wxT("spatialite_gui"), 1124 - wxOK | wxICON_ERROR, this); 1125 - goto abort; 1126 - } 1127 - n_columns = sqlite3_column_count(stmt); 1128 - while (1) 1129 - { 1130 - ret = sqlite3_step(stmt); 1131 - if (ret == SQLITE_DONE) 1132 - break; 1133 - if (ret == SQLITE_ROW) 1134 - { 1135 - fromto = true; 1136 - tofrom = true; 1137 - if (p_graph->IsNodeCode() == true) 1138 - { 1139 - id_from = -1; 1140 - id_to = -1; 1141 - } else 1142 - { 1143 - *code_from = '\0'; 1144 - *code_to = '\0'; 1145 - } 1146 - // fetching the ROWID 1147 - rowid = sqlite3_column_int64(stmt, 0); 1148 - // fetching the NodeFrom value 1149 - if (p_graph->IsNodeCode() == true) 1150 - strcpy(code_from, (char *) sqlite3_column_text(stmt, 1)); 1151 - else 1152 - id_from = sqlite3_column_int64(stmt, 1); 1153 - // fetching the NodeTo value 1154 - if (p_graph->IsNodeCode() == true) 1155 - strcpy(code_to, (char *) sqlite3_column_text(stmt, 2)); 1156 - else 1157 - id_to = sqlite3_column_int64(stmt, 2); 1158 - // fetching the Cost value 1159 - cost_val = sqlite3_column_double(stmt, 3); 1160 - if (one_way == true) 1161 - { 1162 - // fetching the OneWay-FromTo value 1163 - fromto = sqlite3_column_int(stmt, fromto_n); 1164 - // fetching the OneWay-ToFrom value 1165 - tofrom = sqlite3_column_int(stmt, tofrom_n); 1166 - } 1167 - if (cost_val <= 0.0) 1168 - p_graph->SetError(); 1169 - if (bidirectional == true) 1170 - { 1171 - if (fromto) 1172 - { 1173 - if (p_graph->IsNodeCode() == true) 1174 - p_graph->AddArc(rowid, code_from, code_to, cost_val); 1175 - else 1176 - p_graph->AddArc(rowid, id_from, id_to, cost_val); 1177 - } 1178 - if (tofrom) 1179 - { 1180 - if (p_graph->IsNodeCode() == true) 1181 - p_graph->AddArc(rowid, code_to, code_from, cost_val); 1182 - else 1183 - p_graph->AddArc(rowid, id_to, id_from, cost_val); 1184 - } 1185 - } else 1186 - { 1187 - if (p_graph->IsNodeCode() == true) 1188 - p_graph->AddArc(rowid, code_from, code_to, cost_val); 1189 - else 1190 - p_graph->AddArc(rowid, id_from, id_to, cost_val); 1191 - } 1192 - if (p_graph->IsError() == true) 1193 - { 1194 - sqlite3_finalize(stmt); 1195 - goto abort; 1196 - } 1197 - } else 1198 - { 1199 - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); 1200 - wxMessageBox(wxT("sqlite3_step error: ") + err, wxT("spatialite_gui"), 1201 - wxOK | wxICON_ERROR, this); 1202 - sqlite3_finalize(stmt); 1203 - goto abort; 1204 - } 1205 - } 1206 - sqlite3_finalize(stmt); 1207 - ::wxEndBusyCursor(); 1208 - wr = 1209 - CreateNetwork(p_graph, table, from, to, name, dataTableName, 1210 - virtualTableName); 1211 - if (wr == true) 1212 - { 1213 - endMsg = 1214 - wxT("OK: VirtualNetwork table '") + table + 1215 - wxT("_net' successfully created"); 1216 - wxMessageBox(endMsg, wxT("spatialite_gui"), wxOK | wxICON_INFORMATION, 1217 - this); 1218 - } else 1219 - { 1220 - endMsg = 1221 - wxT("DB ERROR: VirtualNetwork table '") + table + 1222 - wxT("_net' was not created"); 1223 - wxMessageBox(endMsg, wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 1224 - } 1225 - if (p_graph) 1226 - delete p_graph; 1227 - InitTableTree(); 1228 - return; 1229 -abort: 1230 - ::wxEndBusyCursor(); 1231 - msg = 1232 - wxT 1233 - ("It's impossible to build a Network using the given configuration;\nsome fatal error occurred\n\n"); 1234 - msg += wxT("please note: using the 'spatialite_network' command-line tool\n"); 1235 - msg += 1236 - wxT 1237 - ("you can obtain a full detailed report explaining causes for this failure"); 1238 - wxMessageBox(msg, wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 1239 - if (p_graph) 1240 - delete p_graph; 1241 -} 1242 - 1243 -void 1244 - MyFrame::OutputNetNode(unsigned char *auxbuf, int *size, int ind, 1245 - bool node_code, int max_node_length, NetNode * pN, 1246 - int endian_arch, bool aStarSupported) 1247 -{ 1248 -// 1249 -// exporting a Node into NETWORK-DATA 1250 -// 1251 - int n_star; 1252 - int i; 1253 - NetArc **arc_array; 1254 - NetArc *pA; 1255 - unsigned char *out = auxbuf; 1256 - *out++ = GAIA_NET_NODE; 1257 - gaiaExport32(out, ind, 1, endian_arch); // the Node internal index 1258 - out += 4; 1259 - if (node_code) 1260 - { 1261 - // Nodes are identified by a TEXT Code 1262 - memset(out, '\0', max_node_length); 1263 - strcpy((char *) out, pN->GetCode().ToUTF8()); 1264 - out += max_node_length; 1265 - } else 1266 - { 1267 - // Nodes are identified by an INTEGER Id 1268 - gaiaExportI64(out, pN->GetId(), 1, endian_arch); 1269 - out += 8; 1270 - } 1271 - if (aStarSupported) 1272 - { 1273 - // in order to support the A* algorithm [X,Y] are required for each node 1274 - gaiaExport64(out, pN->GetX(), 1, endian_arch); 1275 - out += 8; 1276 - gaiaExport64(out, pN->GetY(), 1, endian_arch); 1277 - out += 8; 1278 - } 1279 - arc_array = pN->PrepareOutcomings(&n_star); 1280 - gaiaExport16(out, n_star, 1, endian_arch); // # of outcoming arcs 1281 - out += 2; 1282 - for (i = 0; i < n_star; i++) 1283 - { 1284 - // exporting the outcoming arcs 1285 - pA = *(arc_array + i); 1286 - *out++ = GAIA_NET_ARC; 1287 - gaiaExportI64(out, pA->GetRowId(), 1, endian_arch); // the Arc rowid 1288 - out += 8; 1289 - gaiaExport32(out, pA->GetTo()->GetInternalIndex(), 1, endian_arch); // the ToNode internal index 1290 - out += 4; 1291 - gaiaExport64(out, pA->GetCost(), 1, endian_arch); // the Arc Cost 1292 - out += 8; 1293 - *out++ = GAIA_NET_END; 1294 - } 1295 - if (arc_array) 1296 - delete[]arc_array; 1297 - *out++ = GAIA_NET_END; 1298 - *size = out - auxbuf; 1299 -} 1300 - 1301 -bool MyFrame::CreateNetwork(Network * p_graph, wxString & table, 1302 - wxString & from, wxString & to, 1303 - wxString & geometry, wxString & name, 1304 - bool aStarSupported, double aStarCoeff, 1305 - wxString & dataTableName, 1306 - wxString & virtualTableName) 1307 -{ 1308 -// 1309 -// creates the NETWORK-DATA table 1310 -// 1311 - int ret; 1312 - wxString sql; 1313 - char xsql[1024]; 1314 - char *errMsg = NULL; 1315 - unsigned char *auxbuf = new unsigned char[MAX_BLOCK]; 1316 - unsigned char *buf = new unsigned char[MAX_BLOCK]; 1317 - unsigned char *out; 1318 - sqlite3_stmt *stmt; 1319 - int i; 1320 - int size; 1321 - int endian_arch = gaiaEndianArch(); 1322 - NetNode *pN; 1323 - int pk = 0; 1324 - int nodes_cnt = 0; 1325 - int len; 1326 - bool net_data_exists = false; 1327 - bool net_exists = false; 1328 - bool delete_existing = false; 1329 - char *xname; 1330 - char *xname2; 1331 - net_data_exists = TableAlreadyExists(dataTableName); 1332 - net_exists = TableAlreadyExists(virtualTableName); 1333 - if (net_data_exists == true || net_exists == true) 1334 - { 1335 - // asking permission to overwrite existing tables 1336 - wxString msg; 1337 - if (net_data_exists == true) 1338 - msg += 1339 - wxT("A table named '") + dataTableName + wxT("' already exists\n"); 1340 - if (net_exists == true) 1341 - msg += 1342 - wxT("A table named '") + virtualTableName + wxT("' already exists\n"); 1343 - msg += wxT("\nDo you allow DROPping existing table(s) ?"); 1344 - wxMessageDialog confirm(this, msg, wxT("Confirm overwrite"), 1345 - wxYES_NO | wxICON_QUESTION); 1346 - ret = confirm.ShowModal(); 1347 - if (ret == wxID_YES) 1348 - delete_existing = true; 1349 - } 1350 - ::wxBeginBusyCursor(); 1351 - for (i = 0; i < p_graph->GetNumNodes(); i++) 1352 - { 1353 - // setting the internal index to each Node 1354 - pN = p_graph->GetSortedNode(i); 1355 - pN->SetInternalIndex(i); 1356 - } 1357 -// starts a transaction 1358 - ret = sqlite3_exec(SqliteHandle, "BEGIN", NULL, NULL, &errMsg); 1359 - if (ret != SQLITE_OK) 1360 - { 1361 - wxMessageBox(wxT("BEGIN error: ") + wxString::FromUTF8(errMsg), 1362 - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 1363 - sqlite3_free(errMsg); 1364 - goto abort; 1365 - } 1366 - if (delete_existing == true) 1367 - { 1368 - xname = (char *) malloc((virtualTableName.Len() * 4) + 1); 1369 - strcpy(xname, virtualTableName.ToUTF8()); 1370 - xname2 = gaiaDoubleQuotedSql(xname); 1371 - free(xname); 1372 - sql = wxT("DROP TABLE IF EXISTS ") + wxString::FromUTF8(xname2); 1373 - free(xname2); 1374 - strcpy(xsql, sql.ToUTF8()); 1375 - ret = sqlite3_exec(SqliteHandle, xsql, NULL, NULL, &errMsg); 1376 - if (ret != SQLITE_OK) 1377 - { 1378 - wxMessageBox(wxT("DROP TABLE error: ") + wxString::FromUTF8(errMsg), 1379 - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 1380 - sqlite3_free(errMsg); 1381 - goto abort; 1382 - } 1383 - xname = (char *) malloc((dataTableName.Len() * 4) + 1); 1384 - strcpy(xname, dataTableName.ToUTF8()); 1385 - xname2 = gaiaDoubleQuotedSql(xname); 1386 - free(xname); 1387 - sql = wxT("DROP TABLE IF EXISTS ") + wxString::FromUTF8(xname2); 1388 - free(xname2); 1389 - strcpy(xsql, sql.ToUTF8()); 1390 - ret = sqlite3_exec(SqliteHandle, xsql, NULL, NULL, &errMsg); 1391 - if (ret != SQLITE_OK) 1392 - { 1393 - wxMessageBox(wxT("DROP TABLE error: ") + wxString::FromUTF8(errMsg), 1394 - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 1395 - sqlite3_free(errMsg); 1396 - goto abort; 1397 - } 1398 - } 1399 -// creating the NETWORK-DATA table 1400 - xname = (char *) malloc((dataTableName.Len() * 4) + 1); 1401 - strcpy(xname, dataTableName.ToUTF8()); 1402 - xname2 = gaiaDoubleQuotedSql(xname); 1403 - free(xname); 1404 - sql = wxT("CREATE TABLE ") + wxString::FromUTF8(xname2); 1405 - free(xname2); 1406 - sql += wxT(" (Id INTEGER PRIMARY KEY, NetworkData BLOB NOT NULL)"); 1407 - strcpy(xsql, sql.ToUTF8()); 1408 - ret = sqlite3_exec(SqliteHandle, xsql, NULL, NULL, &errMsg); 1409 - if (ret != SQLITE_OK) 1410 - { 1411 - wxMessageBox(wxT("CREATE TABLE error: ") + wxString::FromUTF8(errMsg), 1412 - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 1413 - sqlite3_free(errMsg); 1414 - goto abort; 1415 - } 1416 -// preparing the SQL statement 1417 - xname = (char *) malloc((dataTableName.Len() * 4) + 1); 1418 - strcpy(xname, dataTableName.ToUTF8()); 1419 - xname2 = gaiaDoubleQuotedSql(xname); 1420 - free(xname); 1421 - sql = 1422 - wxT("INSERT INTO ") + wxString::FromUTF8(xname2) + 1423 - wxT(" (Id, NetworkData) VALUES (?, ?)"); 1424 - free(xname2); 1425 - strcpy(xsql, sql.ToUTF8()); 1426 - ret = sqlite3_prepare_v2(SqliteHandle, xsql, strlen(xsql), &stmt, NULL); 1427 - if (ret != SQLITE_OK) 1428 - { 1429 - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); 1430 - wxMessageBox(wxT("INSERT error: ") + err, wxT("spatialite_gui"), 1431 - wxOK | wxICON_ERROR, this); 1432 - goto abort; 1433 - } 1434 - if (pk == 0) 1435 - { 1436 - // preparing the HEADER block 1437 - out = buf; 1438 - if (aStarSupported) 1439 - *out++ = GAIA_NET64_A_STAR_START; 1440 - else 1441 - *out++ = GAIA_NET64_START; 1442 - *out++ = GAIA_NET_HEADER; 1443 - gaiaExport32(out, p_graph->GetNumNodes(), 1, endian_arch); // how many Nodes are there 1444 - out += 4; 1445 - if (p_graph->IsNodeCode() == true) 1446 - *out++ = GAIA_NET_CODE; // Nodes are identified by a TEXT code 1447 - else 1448 - *out++ = GAIA_NET_ID; // Nodes are identified by an INTEGER id 1449 - if (p_graph->IsNodeCode() == true) 1450 - *out++ = p_graph->GetMaxCodeLength(); // max TEXT code length 1451 - else 1452 - *out++ = 0x00; 1453 - // inserting the main Table name 1454 - *out++ = GAIA_NET_TABLE; 1455 - len = table.Len() + 1; 1456 - gaiaExport16(out, len, 1, endian_arch); // the Table Name length, including last '\0' 1457 - out += 2; 1458 - memset(out, '\0', len); 1459 - strcpy((char *) out, table.ToUTF8()); 1460 - out += len; 1461 - // inserting the NodeFrom column name 1462 - *out++ = GAIA_NET_FROM; 1463 - len = from.Len() + 1; 1464 - gaiaExport16(out, len, 1, endian_arch); // the NodeFrom column Name length, including last '\0' 1465 - out += 2; 1466 - memset(out, '\0', len); 1467 - strcpy((char *) out, from.ToUTF8()); 1468 - out += len; 1469 - // inserting the NodeTo column name 1470 - *out++ = GAIA_NET_TO; 1471 - len = to.Len() + 1; 1472 - gaiaExport16(out, len, 1, endian_arch); // the NodeTo column Name length, including last '\0' 1473 - out += 2; 1474 - memset(out, '\0', len); 1475 - strcpy((char *) out, to.ToUTF8()); 1476 - out += len; 1477 - // inserting the Geometry column name 1478 - *out++ = GAIA_NET_GEOM; 1479 - len = geometry.Len() + 1; 1480 - gaiaExport16(out, len, 1, endian_arch); // the Geometry column Name length, including last '\0' 1481 - out += 2; 1482 - memset(out, '\0', len); 1483 - strcpy((char *) out, geometry.ToUTF8()); 1484 - out += len; 1485 - // inserting the Name column name - may be empty 1486 - *out++ = GAIA_NET_NAME; 1487 - if (name.Len() == 0) 1488 - len = 1; 1489 - else 1490 - len = name.Len() + 1; 1491 - gaiaExport16(out, len, 1, endian_arch); // the Name column Name length, including last '\0' 1492 - out += 2; 1493 - memset(out, '\0', len); 1494 - if (name.Len() > 0) 1495 - strcpy((char *) out, name.ToUTF8()); 1496 - out += len; 1497 - if (aStarSupported) 1498 - { 1499 - // inserting the A* Heuristic Coeff 1500 - *out++ = GAIA_NET_A_STAR_COEFF; 1501 - gaiaExport64(out, aStarCoeff, 1, endian_arch); 1502 - out += 8; 1503 - } 1504 - *out++ = GAIA_NET_END; 1505 - // INSERTing the Header block 1506 - sqlite3_reset(stmt); 1507 - sqlite3_clear_bindings(stmt); 1508 - sqlite3_bind_int64(stmt, 1, pk); 1509 - sqlite3_bind_blob(stmt, 2, buf, out - buf, SQLITE_STATIC); 1510 - ret = sqlite3_step(stmt); 1511 - if (ret == SQLITE_DONE || ret == SQLITE_ROW) 1512 - ; 1513 - else 1514 - { 1515 - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); 1516 - wxMessageBox(wxT("sqlite3_step error: ") + err, wxT("spatialite_gui"), 1517 - wxOK | wxICON_ERROR, this); 1518 - sqlite3_finalize(stmt); 1519 - goto abort; 1520 - } 1521 - pk++; 1522 - // preparing a new block 1523 - out = buf; 1524 - *out++ = GAIA_NET_BLOCK; 1525 - gaiaExport16(out, 0, 1, endian_arch); // how many Nodes are into this block 1526 - out += 2; 1527 - nodes_cnt = 0; 1528 - } 1529 - for (i = 0; i < p_graph->GetNumNodes(); i++) 1530 - { 1531 - // looping on each Node 1532 - pN = p_graph->GetSortedNode(i); 1533 - OutputNetNode(auxbuf, &size, i, p_graph->IsNodeCode(), 1534 - p_graph->GetMaxCodeLength(), pN, endian_arch, 1535 - aStarSupported); 1536 - if (size >= (MAX_BLOCK - (out - buf))) 1537 - { 1538 - // inserting the last block 1539 - gaiaExport16(buf + 1, nodes_cnt, 1, endian_arch); // how many Nodes are into this block 1540 - sqlite3_reset(stmt); 1541 - sqlite3_clear_bindings(stmt); 1542 - sqlite3_bind_int64(stmt, 1, pk); 1543 - sqlite3_bind_blob(stmt, 2, buf, out - buf, SQLITE_STATIC); 1544 - ret = sqlite3_step(stmt); 1545 - if (ret == SQLITE_DONE || ret == SQLITE_ROW) 1546 - ; 1547 - else 1548 - { 1549 - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); 1550 - wxMessageBox(wxT("sqlite3_step error: ") + err, 1551 - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 1552 - sqlite3_finalize(stmt); 1553 - goto abort; 1554 - } 1555 - pk++; 1556 - // preparing a new block 1557 - out = buf; 1558 - *out++ = GAIA_NET_BLOCK; 1559 - gaiaExport16(out, 0, 1, endian_arch); // how many Nodes are into this block 1560 - out += 2; 1561 - nodes_cnt = 0; 1562 - } 1563 - // inserting the current Node into the block 1564 - nodes_cnt++; 1565 - memcpy(out, auxbuf, size); 1566 - out += size; 1567 - } 1568 - if (nodes_cnt) 1569 - { 1570 - // inserting the last block 1571 - gaiaExport16(buf + 1, nodes_cnt, 1, endian_arch); // how many Nodes are into this block 1572 - sqlite3_reset(stmt); 1573 - sqlite3_clear_bindings(stmt); 1574 - sqlite3_bind_int64(stmt, 1, pk); 1575 - sqlite3_bind_blob(stmt, 2, buf, out - buf, SQLITE_STATIC); 1576 - ret = sqlite3_step(stmt); 1577 - if (ret == SQLITE_DONE || ret == SQLITE_ROW) 1578 - ; 1579 - else 1580 - { 1581 - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); 1582 - wxMessageBox(wxT("sqlite3_step error: ") + err, wxT("spatialite_gui"), 1583 - wxOK | wxICON_ERROR, this); 1584 - sqlite3_finalize(stmt); 1585 - goto abort; 1586 - } 1587 - } 1588 - sqlite3_finalize(stmt); 1589 -// creating the VirtualNetwork NET-table 1590 - xname = (char *) malloc((virtualTableName.Len() * 4) + 1); 1591 - strcpy(xname, virtualTableName.ToUTF8()); 1592 - xname2 = gaiaDoubleQuotedSql(xname); 1593 - free(xname); 1594 - sql = wxT("CREATE VIRTUAL TABLE ") + wxString::FromUTF8(xname2); 1595 - free(xname2); 1596 - sql += wxT(" USING VirtualNetwork("); 1597 - xname = (char *) malloc((dataTableName.Len() * 4) + 1); 1598 - strcpy(xname, dataTableName.ToUTF8()); 1599 - xname2 = gaiaDoubleQuotedSql(xname); 1600 - free(xname); 1601 - sql += wxString::FromUTF8(xname2) + wxT(")"); 1602 - free(xname2); 1603 - strcpy(xsql, sql.ToUTF8()); 1604 - ret = sqlite3_exec(SqliteHandle, xsql, NULL, NULL, &errMsg); 1605 - if (ret != SQLITE_OK) 1606 - { 1607 - wxMessageBox(wxT("CREATE VIRTUAL TABLE error: ") + 1608 - wxString::FromUTF8(errMsg), wxT("spatialite_gui"), 1609 - wxOK | wxICON_ERROR, this); 1610 - sqlite3_free(errMsg); 1611 - goto abort; 1612 - } 1613 -// commits the transaction 1614 - ret = sqlite3_exec(SqliteHandle, "COMMIT", NULL, NULL, &errMsg); 1615 - if (ret != SQLITE_OK) 1616 - { 1617 - wxMessageBox(wxT("COMMIT error: ") + wxString::FromUTF8(errMsg), 1618 - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 1619 - sqlite3_free(errMsg); 1620 - goto abort; 1621 - } 1622 - if (buf) 1623 - delete[]buf; 1624 - if (auxbuf) 1625 - delete[]auxbuf; 1626 - ::wxEndBusyCursor(); 1627 - return true; 1628 -abort: 1629 - ::wxEndBusyCursor(); 1630 - if (buf) 1631 - delete[]buf; 1632 - if (auxbuf) 1633 - delete[]auxbuf; 1634 - return true; 1635 - return false; 1636 -} 1637 - 1638 -bool MyFrame::CreateNetwork(Network * p_graph, wxString & table, 1639 - wxString & from, wxString & to, wxString & name, 1640 - wxString & dataTableName, 1641 - wxString & virtualTableName) 1642 -{ 1643 -// 1644 -// creates the NETWORK-DATA table . NO-GEOMETRY 1645 -// 1646 - int ret; 1647 - wxString sql; 1648 - char xsql[1024]; 1649 - char *errMsg = NULL; 1650 - unsigned char *auxbuf = new unsigned char[MAX_BLOCK]; 1651 - unsigned char *buf = new unsigned char[MAX_BLOCK]; 1652 - unsigned char *out; 1653 - sqlite3_stmt *stmt; 1654 - int i; 1655 - int size; 1656 - int endian_arch = gaiaEndianArch(); 1657 - NetNode *pN; 1658 - int pk = 0; 1659 - int nodes_cnt = 0; 1660 - int len; 1661 - bool net_data_exists = false; 1662 - bool net_exists = false; 1663 - bool delete_existing = false; 1664 - char *xname; 1665 - char *xname2; 1666 - net_data_exists = TableAlreadyExists(dataTableName); 1667 - net_exists = TableAlreadyExists(virtualTableName); 1668 - if (net_data_exists == true || net_exists == true) 1669 - { 1670 - // asking permission to overwrite existing tables 1671 - wxString msg; 1672 - if (net_data_exists == true) 1673 - msg += 1674 - wxT("A table named '") + dataTableName + wxT("' already exists\n"); 1675 - if (net_exists == true) 1676 - msg += 1677 - wxT("A table named '") + virtualTableName + wxT("' already exists\n"); 1678 - msg += wxT("\nDo you allow DROPping existing table(s) ?"); 1679 - wxMessageDialog confirm(this, msg, wxT("Confirm overwrite"), 1680 - wxYES_NO | wxICON_QUESTION); 1681 - ret = confirm.ShowModal(); 1682 - if (ret == wxID_YES) 1683 - delete_existing = true; 1684 - } 1685 - ::wxBeginBusyCursor(); 1686 - for (i = 0; i < p_graph->GetNumNodes(); i++) 1687 - { 1688 - // setting the internal index to each Node 1689 - pN = p_graph->GetSortedNode(i); 1690 - pN->SetInternalIndex(i); 1691 - } 1692 -// starts a transaction 1693 - ret = sqlite3_exec(SqliteHandle, "BEGIN", NULL, NULL, &errMsg); 1694 - if (ret != SQLITE_OK) 1695 - { 1696 - wxMessageBox(wxT("BEGIN error: ") + wxString::FromUTF8(errMsg), 1697 - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 1698 - sqlite3_free(errMsg); 1699 - goto abort; 1700 - } 1701 - if (delete_existing == true) 1702 - { 1703 - xname = (char *) malloc((virtualTableName.Len() * 4) + 1); 1704 - strcpy(xname, virtualTableName.ToUTF8()); 1705 - xname2 = gaiaDoubleQuotedSql(xname); 1706 - free(xname); 1707 - sql = wxT("DROP TABLE IF EXISTS ") + wxString::FromUTF8(xname2); 1708 - free(xname2); 1709 - strcpy(xsql, sql.ToUTF8()); 1710 - ret = sqlite3_exec(SqliteHandle, xsql, NULL, NULL, &errMsg); 1711 - if (ret != SQLITE_OK) 1712 - { 1713 - wxMessageBox(wxT("DROP TABLE error: ") + wxString::FromUTF8(errMsg), 1714 - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 1715 - sqlite3_free(errMsg); 1716 - goto abort; 1717 - } 1718 - xname = (char *) malloc((dataTableName.Len() * 4) + 1); 1719 - strcpy(xname, dataTableName.ToUTF8()); 1720 - xname2 = gaiaDoubleQuotedSql(xname); 1721 - free(xname); 1722 - sql = wxT("DROP TABLE IF EXISTS ") + wxString::FromUTF8(xname2); 1723 - free(xname2); 1724 - strcpy(xsql, sql.ToUTF8()); 1725 - ret = sqlite3_exec(SqliteHandle, xsql, NULL, NULL, &errMsg); 1726 - if (ret != SQLITE_OK) 1727 - { 1728 - wxMessageBox(wxT("DROP TABLE error: ") + wxString::FromUTF8(errMsg), 1729 - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 1730 - sqlite3_free(errMsg); 1731 - goto abort; 1732 - } 1733 - } 1734 -// creating the NETWORK-DATA table 1735 - xname = (char *) malloc((dataTableName.Len() * 4) + 1); 1736 - strcpy(xname, dataTableName.ToUTF8()); 1737 - xname2 = gaiaDoubleQuotedSql(xname); 1738 - free(xname); 1739 - sql = wxT("CREATE TABLE ") + wxString::FromUTF8(xname2); 1740 - free(xname2); 1741 - sql += wxT(" (Id INTEGER PRIMARY KEY, NetworkData BLOB NOT NULL)"); 1742 - strcpy(xsql, sql.ToUTF8()); 1743 - ret = sqlite3_exec(SqliteHandle, xsql, NULL, NULL, &errMsg); 1744 - if (ret != SQLITE_OK) 1745 - { 1746 - wxMessageBox(wxT("CREATE TABLE error: ") + wxString::FromUTF8(errMsg), 1747 - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 1748 - sqlite3_free(errMsg); 1749 - goto abort; 1750 - } 1751 -// preparing the SQL statement 1752 - xname = (char *) malloc((dataTableName.Len() * 4) + 1); 1753 - strcpy(xname, dataTableName.ToUTF8()); 1754 - xname2 = gaiaDoubleQuotedSql(xname); 1755 - free(xname); 1756 - sql = 1757 - wxT("INSERT INTO ") + wxString::FromUTF8(xname2) + 1758 - wxT(" (Id, NetworkData) VALUES (?, ?)"); 1759 - free(xname2); 1760 - strcpy(xsql, sql.ToUTF8()); 1761 - ret = sqlite3_prepare_v2(SqliteHandle, xsql, strlen(xsql), &stmt, NULL); 1762 - if (ret != SQLITE_OK) 1763 - { 1764 - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); 1765 - wxMessageBox(wxT("INSERT error: ") + err, wxT("spatialite_gui"), 1766 - wxOK | wxICON_ERROR, this); 1767 - goto abort; 1768 - } 1769 - if (pk == 0) 1770 - { 1771 - // preparing the HEADER block 1772 - out = buf; 1773 - *out++ = GAIA_NET64_START; 1774 - *out++ = GAIA_NET_HEADER; 1775 - gaiaExport32(out, p_graph->GetNumNodes(), 1, endian_arch); // how many Nodes are there 1776 - out += 4; 1777 - if (p_graph->IsNodeCode() == true) 1778 - *out++ = GAIA_NET_CODE; // Nodes are identified by a TEXT code 1779 - else 1780 - *out++ = GAIA_NET_ID; // Nodes are identified by an INTEGER id 1781 - if (p_graph->IsNodeCode() == true) 1782 - *out++ = p_graph->GetMaxCodeLength(); // max TEXT code length 1783 - else 1784 - *out++ = 0x00; 1785 - // inserting the main Table name 1786 - *out++ = GAIA_NET_TABLE; 1787 - len = table.Len() + 1; 1788 - gaiaExport16(out, len, 1, endian_arch); // the Table Name length, including last '\0' 1789 - out += 2; 1790 - memset(out, '\0', len); 1791 - strcpy((char *) out, table.ToUTF8()); 1792 - out += len; 1793 - // inserting the NodeFrom column name 1794 - *out++ = GAIA_NET_FROM; 1795 - len = from.Len() + 1; 1796 - gaiaExport16(out, len, 1, endian_arch); // the NodeFrom column Name length, including last '\0' 1797 - out += 2; 1798 - memset(out, '\0', len); 1799 - strcpy((char *) out, from.ToUTF8()); 1800 - out += len; 1801 - // inserting the NodeTo column name 1802 - *out++ = GAIA_NET_TO; 1803 - len = to.Len() + 1; 1804 - gaiaExport16(out, len, 1, endian_arch); // the NodeTo column Name length, including last '\0' 1805 - out += 2; 1806 - memset(out, '\0', len); 1807 - strcpy((char *) out, to.ToUTF8()); 1808 - out += len; 1809 - // inserting the Geometry column name 1810 - *out++ = GAIA_NET_GEOM; 1811 - len = 1; 1812 - gaiaExport16(out, len, 1, endian_arch); // the Geometry column Name length, including last '\0' 1813 - out += 2; 1814 - memset(out, '\0', len); 1815 - out += len; 1816 - // inserting the Name column name - may be empty 1817 - *out++ = GAIA_NET_NAME; 1818 - if (name.Len() == 0) 1819 - len = 1; 1820 - else 1821 - len = name.Len() + 1; 1822 - gaiaExport16(out, len, 1, endian_arch); // the Name column Name length, including last '\0' 1823 - out += 2; 1824 - memset(out, '\0', len); 1825 - if (name.Len() > 0) 1826 - strcpy((char *) out, name.ToUTF8()); 1827 - out += len; 1828 - *out++ = GAIA_NET_END; 1829 - // INSERTing the Header block 1830 - sqlite3_reset(stmt); 1831 - sqlite3_clear_bindings(stmt); 1832 - sqlite3_bind_int64(stmt, 1, pk); 1833 - sqlite3_bind_blob(stmt, 2, buf, out - buf, SQLITE_STATIC); 1834 - ret = sqlite3_step(stmt); 1835 - if (ret == SQLITE_DONE || ret == SQLITE_ROW) 1836 - ; 1837 - else 1838 - { 1839 - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); 1840 - wxMessageBox(wxT("sqlite3_step error: ") + err, wxT("spatialite_gui"), 1841 - wxOK | wxICON_ERROR, this); 1842 - sqlite3_finalize(stmt); 1843 - goto abort; 1844 - } 1845 - pk++; 1846 - // preparing a new block 1847 - out = buf; 1848 - *out++ = GAIA_NET_BLOCK; 1849 - gaiaExport16(out, 0, 1, endian_arch); // how many Nodes are into this block 1850 - out += 2; 1851 - nodes_cnt = 0; 1852 - } 1853 - for (i = 0; i < p_graph->GetNumNodes(); i++) 1854 - { 1855 - // looping on each Node 1856 - pN = p_graph->GetSortedNode(i); 1857 - OutputNetNode(auxbuf, &size, i, p_graph->IsNodeCode(), 1858 - p_graph->GetMaxCodeLength(), pN, endian_arch, 0); 1859 - if (size >= (MAX_BLOCK - (out - buf))) 1860 - { 1861 - // inserting the last block 1862 - gaiaExport16(buf + 1, nodes_cnt, 1, endian_arch); // how many Nodes are into this block 1863 - sqlite3_reset(stmt); 1864 - sqlite3_clear_bindings(stmt); 1865 - sqlite3_bind_int64(stmt, 1, pk); 1866 - sqlite3_bind_blob(stmt, 2, buf, out - buf, SQLITE_STATIC); 1867 - ret = sqlite3_step(stmt); 1868 - if (ret == SQLITE_DONE || ret == SQLITE_ROW) 1869 - ; 1870 - else 1871 - { 1872 - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); 1873 - wxMessageBox(wxT("sqlite3_step error: ") + err, 1874 - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 1875 - sqlite3_finalize(stmt); 1876 - goto abort; 1877 - } 1878 - pk++; 1879 - // preparing a new block 1880 - out = buf; 1881 - *out++ = GAIA_NET_BLOCK; 1882 - gaiaExport16(out, 0, 1, endian_arch); // how many Nodes are into this block 1883 - out += 2; 1884 - nodes_cnt = 0; 1885 - } 1886 - // inserting the current Node into the block 1887 - nodes_cnt++; 1888 - memcpy(out, auxbuf, size); 1889 - out += size; 1890 - } 1891 - if (nodes_cnt) 1892 - { 1893 - // inserting the last block 1894 - gaiaExport16(buf + 1, nodes_cnt, 1, endian_arch); // how many Nodes are into this block 1895 - sqlite3_reset(stmt); 1896 - sqlite3_clear_bindings(stmt); 1897 - sqlite3_bind_int64(stmt, 1, pk); 1898 - sqlite3_bind_blob(stmt, 2, buf, out - buf, SQLITE_STATIC); 1899 - ret = sqlite3_step(stmt); 1900 - if (ret == SQLITE_DONE || ret == SQLITE_ROW) 1901 - ; 1902 - else 1903 - { 1904 - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); 1905 - wxMessageBox(wxT("sqlite3_step error: ") + err, wxT("spatialite_gui"), 1906 - wxOK | wxICON_ERROR, this); 1907 - sqlite3_finalize(stmt); 1908 - goto abort; 1909 - } 1910 - } 1911 - sqlite3_finalize(stmt); 1912 -// creating the VirtualNetwork NET-table 1913 - xname = (char *) malloc((virtualTableName.Len() * 4) + 1); 1914 - strcpy(xname, virtualTableName.ToUTF8()); 1915 - xname2 = gaiaDoubleQuotedSql(xname); 1916 - free(xname); 1917 - sql = wxT("CREATE VIRTUAL TABLE ") + wxString::FromUTF8(xname2); 1918 - free(xname2); 1919 - sql += wxT(" USING VirtualNetwork("); 1920 - xname = (char *) malloc((dataTableName.Len() * 4) + 1); 1921 - strcpy(xname, dataTableName.ToUTF8()); 1922 - xname2 = gaiaDoubleQuotedSql(xname); 1923 - free(xname); 1924 - sql += wxString::FromUTF8(xname2) + wxT(")"); 1925 - free(xname2); 1926 - strcpy(xsql, sql.ToUTF8()); 1927 - ret = sqlite3_exec(SqliteHandle, xsql, NULL, NULL, &errMsg); 1928 - if (ret != SQLITE_OK) 1929 - { 1930 - wxMessageBox(wxT("CREATE VIRTUAL TABLE error: ") + 1931 - wxString::FromUTF8(errMsg), wxT("spatialite_gui"), 1932 - wxOK | wxICON_ERROR, this); 1933 - sqlite3_free(errMsg); 1934 - goto abort; 1935 - } 1936 -// commits the transaction 1937 - ret = sqlite3_exec(SqliteHandle, "COMMIT", NULL, NULL, &errMsg); 1938 - if (ret != SQLITE_OK) 1939 - { 1940 - wxMessageBox(wxT("COMMIT error: ") + wxString::FromUTF8(errMsg), 1941 - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 1942 - sqlite3_free(errMsg); 1943 - goto abort; 1944 - } 1945 - if (buf) 1946 - delete[]buf; 1947 - if (auxbuf) 1948 - delete[]auxbuf; 1949 - ::wxEndBusyCursor(); 1950 - return true; 1951 -abort: 1952 - ::wxEndBusyCursor(); 1953 - if (buf) 1954 - delete[]buf; 1955 - if (auxbuf) 1956 - delete[]auxbuf; 1957 - return true; 1958 - return false; 1959 -} 1960 - 1961 -int cmp_prenodes_code(const void *p1, const void *p2) 1962 -{ 1963 -// 1964 -// compares two preliminary nodes by CODE [for QSORT] 1965 -// 1966 - NetNodePre *pP1 = *((NetNodePre **) p1); 1967 - NetNodePre *pP2 = *((NetNodePre **) p2); 1968 - return pP1->GetCode().Cmp(pP2->GetCode()); 1969 -} 1970 - 1971 -int cmp_prenodes_id(const void *p1, const void *p2) 1972 -{ 1973 -// 1974 -// compares two preliminary nodes by ID [for QSORT] 1975 -// 1976 - NetNodePre *pP1 = *((NetNodePre **) p1); 1977 - NetNodePre *pP2 = *((NetNodePre **) p2); 1978 - if (pP1->GetId() == pP2->GetId()) 1979 - return 0; 1980 - if (pP1->GetId() > pP2->GetId()) 1981 - return 1; 1982 - return -1; 1983 -} 1984 - 1985 -int cmp_nodes2_code(const void *p1, const void *p2) 1986 -{ 1987 -// 1988 -// compares two nodes by CODE [for BSEARCH] 1989 -// 1990 - NetNode *pN1 = (NetNode *) p1; 1991 - NetNode *pN2 = *((NetNode **) p2); 1992 - return pN1->GetCode().Cmp(pN2->GetCode()); 1993 -} 1994 - 1995 -int cmp_nodes2_id(const void *p1, const void *p2) 1996 -{ 1997 -// 1998 -// compares two nodes by ID [for BSEARCH] 1999 -// 2000 - NetNode *pN1 = (NetNode *) p1; 2001 - NetNode *pN2 = *((NetNode **) p2); 2002 - if (pN1->GetId() == pN2->GetId()) 2003 - return 0; 2004 - if (pN1->GetId() > pN2->GetId()) 2005 - return 1; 2006 - return -1; 2007 -} 2008 - 2009 -int cmp_nodes1_code(const void *p1, const void *p2) 2010 -{ 2011 -// 2012 -// compares two nodes by CODE [for QSORT] 2013 -// 2014 - NetNode *pN1 = *((NetNode **) p1); 2015 - NetNode *pN2 = *((NetNode **) p2); 2016 - return pN1->GetCode().Cmp(pN2->GetCode()); 2017 -} 2018 - 2019 -int cmp_nodes1_id(const void *p1, const void *p2) 2020 -{ 2021 -// 2022 -// compares two nodes by ID [for QSORT ] 2023 -// 2024 - NetNode *pN1 = *((NetNode **) p1); 2025 - NetNode *pN2 = *((NetNode **) p2); 2026 - if (pN1->GetId() == pN2->GetId()) 2027 - return 0; 2028 - if (pN1->GetId() > pN2->GetId()) 2029 - return 1; 2030 - return -1; 2031 -} 2032 - 2033 -NetNodePre::NetNodePre(sqlite3_int64 id) 2034 -{ 2035 -// 2036 -// Network Node [preliminary] constructor 2037 -// 2038 - Id = id; 2039 - Code = wxT(""); 2040 - Next = NULL; 2041 -} 2042 - 2043 -NetNodePre::NetNodePre(const char *code) 2044 -{ 2045 -// 2046 -// Network Node [preliminary] constructor 2047 -// 2048 - Id = -1; 2049 - Code = wxString::FromUTF8(code); 2050 - Code.Truncate(30); 2051 - Next = NULL; 2052 -} 2053 - 2054 -NetNode::NetNode(sqlite3_int64 id) 2055 -{ 2056 -// 2057 -// Network Node [final] constructor 2058 -// 2059 - InternalIndex = -1; 2060 - Id = id; 2061 - Code = wxT(""); 2062 - X = DBL_MAX; 2063 - Y = DBL_MAX; 2064 - First = NULL; 2065 - Last = NULL; 2066 - Next = NULL; 2067 -} 2068 - 2069 -NetNode::NetNode(wxString & code) 2070 -{ 2071 -// 2072 -// Network Node [final] constructor 2073 -// 2074 - InternalIndex = -1; 2075 - Id = -1; 2076 - Code = code; 2077 - X = DBL_MAX; 2078 - Y = DBL_MAX; 2079 - First = NULL; 2080 - Last = NULL; 2081 - Next = NULL; 2082 -} 2083 - 2084 -NetNode::~NetNode() 2085 -{ 2086 -// Network Node [final] destructor 2087 - NetArcRef *pAR; 2088 - NetArcRef *pARn; 2089 - pAR = First; 2090 - while (pAR) 2091 - { 2092 - pARn = pAR->GetNext(); 2093 - delete pAR; 2094 - pAR = pARn; 2095 - } 2096 -} 2097 - 2098 -void NetNode::AddOutcoming(NetArc * pA) 2099 -{ 2100 -// 2101 -// adds an outcoming Arc to a Node 2102 -// 2103 - NetArcRef *pAR = new NetArcRef(pA); 2104 - if (!First) 2105 - First = pAR; 2106 - if (Last) 2107 - Last->SetNext(pAR); 2108 - Last = pAR; 2109 -} 2110 - 2111 -NetArc **NetNode::PrepareOutcomings(int *count) 2112 -{ 2113 -// 2114 -// preparing the outcoming arc array 2115 -// 2116 - NetArc **arc_array; 2117 - int n = 0; 2118 - int i; 2119 - bool ok; 2120 - NetArcRef *pAR; 2121 - NetArc *pA0; 2122 - NetArc *pA1; 2123 - pAR = First; 2124 - while (pAR) 2125 - { 2126 - // counting how many outcoming arcs are there 2127 - n++; 2128 - pAR = pAR->GetNext(); 2129 - } 2130 - if (!n) 2131 - { 2132 - *count = 0; 2133 - return NULL; 2134 - } 2135 - arc_array = new NetArc *[n]; 2136 - i = 0; 2137 - pAR = First; 2138 - while (pAR) 2139 - { 2140 - // populating the arcs array 2141 - *(arc_array + i++) = pAR->GetReference(); 2142 - pAR = pAR->GetNext(); 2143 - } 2144 - ok = true; 2145 - while (ok == true) 2146 - { 2147 - // bubble sorting the arcs by Cost 2148 - ok = false; 2149 - for (i = 1; i < n; i++) 2150 - { 2151 - pA0 = *(arc_array + i - 1); 2152 - pA1 = *(arc_array + i); 2153 - if (pA0->GetCost() > pA1->GetCost()) 2154 - { 2155 - // swapping the arcs 2156 - *(arc_array + i - 1) = pA1; 2157 - *(arc_array + i) = pA0; 2158 - ok = true; 2159 - } 2160 - } 2161 - } 2162 - *count = n; 2163 - return arc_array; 2164 -} 2165 - 2166 -NetArc::NetArc(sqlite3_int64 rowid, NetNode * from, NetNode * to, double cost) 2167 -{ 2168 -// 2169 -// Network Arc constructor 2170 -// 2171 - RowId = rowid; 2172 - From = from; 2173 - To = to; 2174 - Cost = cost; 2175 - Next = NULL; 2176 -} 2177 - 2178 -Network::Network() 2179 -{ 2180 -// 2181 -// Network constructor 2182 -// 2183 - FirstPre = NULL; 2184 - LastPre = NULL; 2185 - NumPreNodes = 0; 2186 - SortedPreNodes = NULL; 2187 - NumPreNodes = 0; 2188 - SortedPreNodes = NULL; 2189 - FirstArc = NULL; 2190 - LastArc = NULL; 2191 - FirstNode = NULL; 2192 - LastNode = NULL; 2193 - NumNodes = 0; 2194 - SortedNodes = NULL; 2195 - Error = false; 2196 - NodeCode = false; 2197 - MaxCodeLength = 0; 2198 -} 2199 - 2200 -Network::~Network() 2201 -{ 2202 -// 2203 -// Network destructor 2204 -// 2205 - NetArc *pA; 2206 - NetArc *pAn; 2207 - NetNode *pN; 2208 - NetNode *pNn; 2209 - CleanPreNodes(); 2210 - pA = FirstArc; 2211 - while (pA) 2212 - { 2213 - pAn = pA->GetNext(); 2214 - delete pA; 2215 - pA = pAn; 2216 - } 2217 - pN = FirstNode; 2218 - while (pN) 2219 - { 2220 - pNn = pN->GetNext(); 2221 - delete pN; 2222 - pN = pNn; 2223 - } 2224 - if (SortedNodes) 2225 - delete[]SortedNodes; 2226 -} 2227 - 2228 -void Network::CleanPreNodes() 2229 -{ 2230 -// 2231 -// cleaning up the preliminary Nodes list 2232 -// 2233 - NetNodePre *pP; 2234 - NetNodePre *pPn; 2235 - pP = FirstPre; 2236 - while (pP) 2237 - { 2238 - pPn = pP->GetNext(); 2239 - delete pP; 2240 - pP = pPn; 2241 - } 2242 - FirstPre = NULL; 2243 - LastPre = NULL; 2244 - NumPreNodes = 0; 2245 - if (SortedPreNodes) 2246 - delete[]SortedPreNodes; 2247 - SortedPreNodes = NULL; 2248 -} 2249 - 2250 -void Network::InsertNode(sqlite3_int64 id) 2251 -{ 2252 -// 2253 -// inserts a Node into the preliminary list 2254 -// 2255 - NetNodePre *pP = new NetNodePre(id); 2256 - if (!FirstPre) 2257 - FirstPre = pP; 2258 - if (LastPre) 2259 - LastPre->SetNext(pP); 2260 - LastPre = pP; 2261 -} 2262 - 2263 -void Network::InsertNode(const char *code) 2264 -{ 2265 -// 2266 -// inserts a Node into the preliminary list 2267 -// 2268 - NetNodePre *pP = new NetNodePre(code); 2269 - if (!FirstPre) 2270 - FirstPre = pP; 2271 - if (LastPre) 2272 - LastPre->SetNext(pP); 2273 - LastPre = pP; 2274 -} 2275 - 2276 -void Network::AddNode(sqlite3_int64 id) 2277 -{ 2278 -// 2279 -// inserts a Node into the final list 2280 -// 2281 - NetNode *pN = new NetNode(id); 2282 - if (!FirstNode) 2283 - FirstNode = pN; 2284 - if (LastNode) 2285 - LastNode->SetNext(pN); 2286 - LastNode = pN; 2287 -} 2288 - 2289 -void Network::AddNode(wxString & code) 2290 -{ 2291 -// 2292 -// inserts a Node into the final list 2293 -// 2294 - int len; 2295 - NetNode *pN = new NetNode(code); 2296 - len = pN->GetCode().Len() + 1; 2297 - if (len > MaxCodeLength) 2298 - MaxCodeLength = len; 2299 - if (!FirstNode) 2300 - FirstNode = pN; 2301 - if (LastNode) 2302 - LastNode->SetNext(pN); 2303 - LastNode = pN; 2304 -} 2305 - 2306 -NetNode *Network::ProcessNode(sqlite3_int64 id, double x, double y, 2307 - NetNode ** pOther) 2308 -{ 2309 -// 2310 -// inserts a new node or retrieves an already defined one 2311 -// 2312 - NetNode *pN = Find(id); 2313 - *pOther = NULL; 2314 - if (pN) 2315 - { 2316 - // this Node already exists into the sorted list 2317 - if (pN->GetX() == DBL_MAX && pN->GetY() == DBL_MAX) 2318 - { 2319 - pN->SetX(x); 2320 - pN->SetY(y); 2321 - } else 2322 - { 2323 - if (pN->GetX() == x && pN->GetY() == y) 2324 - ; 2325 - else 2326 - *pOther = pN; 2327 - } 2328 - return pN; 2329 - } 2330 -// unexpected error; undefined Node 2331 - return NULL; 2332 -} 2333 - 2334 -NetNode *Network::ProcessNode(wxString & code, double x, double y, 2335 - NetNode ** pOther) 2336 -{ 2337 -// 2338 -// inserts a new node or retrieves an already defined one 2339 -// 2340 - NetNode *pN = Find(code); 2341 - *pOther = NULL; 2342 - if (pN) 2343 - { 2344 - // this Node already exists into the sorted list 2345 - if (pN->GetX() == DBL_MAX && pN->GetY() == DBL_MAX) 2346 - { 2347 - pN->SetX(x); 2348 - pN->SetY(y); 2349 - } else 2350 - { 2351 - if (pN->GetX() == x && pN->GetY() == y) 2352 - ; 2353 - else 2354 - *pOther = pN; 2355 - } 2356 - return pN; 2357 - } 2358 -// unexpected error; undefined Node 2359 - return NULL; 2360 -} 2361 - 2362 -NetNode *Network::ProcessNode(sqlite3_int64 id, NetNode ** pOther) 2363 -{ 2364 -// 2365 -// inserts a new node or retrieves an already defined one 2366 -// 2367 - NetNode *pN = Find(id); 2368 - *pOther = NULL; 2369 - return pN; 2370 -} 2371 - 2372 -NetNode *Network::ProcessNode(wxString & code, NetNode ** pOther) 2373 -{ 2374 -// 2375 -// inserts a new node or retrieves an already defined one 2376 -// 2377 - NetNode *pN = Find(code); 2378 - *pOther = NULL; 2379 - return pN; 2380 -} 2381 - 2382 -void 2383 - Network::AddArc(sqlite3_int64 rowid, sqlite3_int64 id_from, 2384 - sqlite3_int64 id_to, double node_from_x, double node_from_y, 2385 - double node_to_x, double node_to_y, double cost) 2386 -{ 2387 -// 2388 -// inserting an arc into the memory structures 2389 -// 2390 - NetNode *pFrom; 2391 - NetNode *pTo; 2392 - NetNode *pN2; 2393 - NetArc *pA; 2394 - pFrom = ProcessNode(id_from, node_from_x, node_from_y, &pN2); 2395 - if (pN2) 2396 - Error = true; 2397 - pTo = ProcessNode(id_to, node_to_x, node_to_y, &pN2); 2398 - if (pN2) 2399 - Error = true; 2400 - if (!pFrom) 2401 - Error = true; 2402 - if (!pTo) 2403 - Error = true; 2404 - if (pFrom == pTo) 2405 - Error = true; 2406 - if (Error == true) 2407 - return; 2408 - pA = new NetArc(rowid, pFrom, pTo, cost); 2409 - if (!FirstArc) 2410 - FirstArc = pA; 2411 - if (LastArc) 2412 - LastArc->SetNext(pA); 2413 - LastArc = pA; 2414 -// updating Node connections 2415 - pFrom->AddOutcoming(pA); 2416 -} 2417 - 2418 -void 2419 - Network::AddArc(sqlite3_int64 rowid, const char *code_from, 2420 - const char *code_to, double node_from_x, double node_from_y, 2421 - double node_to_x, double node_to_y, double cost) 2422 -{ 2423 -// 2424 -// inserting an arc into the memory structures 2425 -// 2426 - NetNode *pFrom; 2427 - NetNode *pTo; 2428 - NetNode *pN2; 2429 - NetArc *pA; 2430 - wxString stCode = wxString::FromUTF8(code_from); 2431 - pFrom = ProcessNode(stCode, node_from_x, node_from_y, &pN2); 2432 - if (pN2) 2433 - Error = true; 2434 - stCode = wxString::FromUTF8(code_to); 2435 - pTo = ProcessNode(stCode, node_to_x, node_to_y, &pN2); 2436 - if (pN2) 2437 - Error = true; 2438 - if (!pFrom) 2439 - Error = true; 2440 - if (!pTo) 2441 - Error = true; 2442 - if (pFrom == pTo) 2443 - Error = true; 2444 - if (Error == true) 2445 - return; 2446 - pA = new NetArc(rowid, pFrom, pTo, cost); 2447 - if (!FirstArc) 2448 - FirstArc = pA; 2449 - if (LastArc) 2450 - LastArc->SetNext(pA); 2451 - LastArc = pA; 2452 -// updating Node connections 2453 - pFrom->AddOutcoming(pA); 2454 -} 2455 - 2456 -void 2457 - Network::AddArc(sqlite3_int64 rowid, sqlite3_int64 id_from, 2458 - sqlite3_int64 id_to, double cost) 2459 -{ 2460 -// 2461 -// inserting an arc into the memory structures 2462 -// 2463 - NetNode *pFrom; 2464 - NetNode *pTo; 2465 - NetNode *pN2; 2466 - NetArc *pA; 2467 - pFrom = ProcessNode(id_from, &pN2); 2468 - if (pN2) 2469 - Error = true; 2470 - pTo = ProcessNode(id_to, &pN2); 2471 - if (pN2) 2472 - Error = true; 2473 - if (!pFrom) 2474 - Error = true; 2475 - if (!pTo) 2476 - Error = true; 2477 - if (pFrom == pTo) 2478 - Error = true; 2479 - if (Error == true) 2480 - return; 2481 - pA = new NetArc(rowid, pFrom, pTo, cost); 2482 - if (!FirstArc) 2483 - FirstArc = pA; 2484 - if (LastArc) 2485 - LastArc->SetNext(pA); 2486 - LastArc = pA; 2487 -// updating Node connections 2488 - pFrom->AddOutcoming(pA); 2489 -} 2490 - 2491 -void 2492 - Network::AddArc(sqlite3_int64 rowid, const char *code_from, 2493 - const char *code_to, double cost) 2494 -{ 2495 -// 2496 -// inserting an arc into the memory structures 2497 -// 2498 - NetNode *pFrom; 2499 - NetNode *pTo; 2500 - NetNode *pN2; 2501 - NetArc *pA; 2502 - wxString stCode = wxString::FromUTF8(code_from); 2503 - pFrom = ProcessNode(stCode, &pN2); 2504 - if (pN2) 2505 - Error = true; 2506 - stCode = wxString::FromUTF8(code_to); 2507 - pTo = ProcessNode(stCode, &pN2); 2508 - if (pN2) 2509 - Error = true; 2510 - if (!pFrom) 2511 - Error = true; 2512 - if (!pTo) 2513 - Error = true; 2514 - if (pFrom == pTo) 2515 - Error = true; 2516 - if (Error == true) 2517 - return; 2518 - pA = new NetArc(rowid, pFrom, pTo, cost); 2519 - if (!FirstArc) 2520 - FirstArc = pA; 2521 - if (LastArc) 2522 - LastArc->SetNext(pA); 2523 - LastArc = pA; 2524 -// updating Node connections 2525 - pFrom->AddOutcoming(pA); 2526 -} 2527 - 2528 -void Network::Sort() 2529 -{ 2530 -// 2531 -// updating the Nodes sorted list 2532 -// 2533 - int i; 2534 - NetNode *pN; 2535 - NumNodes = 0; 2536 - if (SortedNodes) 2537 - { 2538 - // we must free the already existent sorted list 2539 - delete[]SortedNodes; 2540 - } 2541 - SortedNodes = NULL; 2542 - pN = FirstNode; 2543 - while (pN) 2544 - { 2545 - NumNodes++; 2546 - pN = pN->GetNext(); 2547 - } 2548 - if (!NumNodes) 2549 - return; 2550 - SortedNodes = new NetNode *[NumNodes]; 2551 - i = 0; 2552 - pN = FirstNode; 2553 - while (pN) 2554 - { 2555 - *(SortedNodes + i++) = pN; 2556 - pN = pN->GetNext(); 2557 - } 2558 - if (NodeCode == true) 2559 - { 2560 - // Nodes are identified by a TEXT code 2561 - qsort(SortedNodes, NumNodes, sizeof(NetNode *), cmp_nodes1_code); 2562 - } else 2563 - { 2564 - // Nodes are identified by an INTEGER id 2565 - qsort(SortedNodes, NumNodes, sizeof(NetNode *), cmp_nodes1_id); 2566 - } 2567 -} 2568 - 2569 -NetNode *Network::GetSortedNode(sqlite3_int64 x) 2570 -{ 2571 -// 2572 -// return a sorted Node [by position] 2573 -// 2574 - if (x >= 0 && x < NumNodes) 2575 - return *(SortedNodes + x); 2576 - return NULL; 2577 -} 2578 - 2579 -NetNode *Network::Find(sqlite3_int64 id) 2580 -{ 2581 -// 2582 -// searching a Node into the sorted list 2583 -// 2584 - NetNode **ret; 2585 - NetNode pN(id); 2586 - if (!SortedNodes) 2587 - return NULL; 2588 -// Nodes are identified by an INTEGER id 2589 - ret = 2590 - (NetNode **) bsearch(&pN, SortedNodes, NumNodes, sizeof(NetNode *), 2591 - cmp_nodes2_id); 2592 - if (!ret) 2593 - return NULL; 2594 - return *ret; 2595 -} 2596 - 2597 -NetNode *Network::Find(wxString & code) 2598 -{ 2599 -// 2600 -// searching a Node into the sorted list 2601 -// 2602 - NetNode **ret; 2603 - NetNode pN(code); 2604 - if (!SortedNodes) 2605 - return NULL; 2606 -// Nodes are identified by a TEXT code 2607 - ret = 2608 - (NetNode **) bsearch(&pN, SortedNodes, NumNodes, sizeof(NetNode *), 2609 - cmp_nodes2_code); 2610 - if (!ret) 2611 - return NULL; 2612 - return *ret; 2613 -} 2614 - 2615 -void Network::InitNodes() 2616 -{ 2617 -// 2618 -// prepares the final Nodes list 2619 -// 2620 - sqlite3_int64 last_id; 2621 - wxString last_code; 2622 - int i; 2623 - NetNodePre *pP; 2624 - NumPreNodes = 0; 2625 -// sorting preliminary nodes 2626 - if (SortedPreNodes) 2627 - { 2628 - // we must free the already existent sorted list 2629 - delete[]SortedPreNodes; 2630 - } 2631 - SortedPreNodes = NULL; 2632 - pP = FirstPre; 2633 - while (pP) 2634 - { 2635 - NumPreNodes++; 2636 - pP = pP->GetNext(); 2637 - } 2638 - if (!NumPreNodes) 2639 - return; 2640 - SortedPreNodes = new NetNodePre *[NumPreNodes]; 2641 - i = 0; 2642 - pP = FirstPre; 2643 - while (pP) 2644 - { 2645 - *(SortedPreNodes + i++) = pP; 2646 - pP = pP->GetNext(); 2647 - } 2648 - if (NodeCode == true) 2649 - { 2650 - // Nodes are identified by a TEXT code 2651 - qsort(SortedPreNodes, NumPreNodes, sizeof(NetNodePre *), 2652 - cmp_prenodes_code); 2653 - } else 2654 - { 2655 - // Nodes are identified by an INTEGER id 2656 - qsort(SortedPreNodes, NumPreNodes, sizeof(NetNodePre *), cmp_prenodes_id); 2657 - } 2658 -// creating the final Nodes linked list 2659 - last_id = -1; 2660 - last_code = wxT(""); 2661 - for (i = 0; i < NumPreNodes; i++) 2662 - { 2663 - pP = *(SortedPreNodes + i); 2664 - if (NodeCode == true) 2665 - { 2666 - // Nodes are identified by a TEXT code 2667 - if (pP->GetCode().Cmp(last_code) != 0) 2668 - AddNode(pP->GetCode()); 2669 - } else 2670 - { 2671 - // Nodes are identified by an INTEGER id 2672 - if (pP->GetId() != last_id) 2673 - AddNode(pP->GetId()); 2674 - } 2675 - last_id = pP->GetId(); 2676 - last_code = pP->GetCode(); 2677 - } 2678 -// sorting the final Nodes list 2679 - Sort(); 2680 -// cleaning up the preliminary Nodes structs 2681 - CleanPreNodes(); 2682 -}
Changes to Objects.cpp.
1 1 /* 2 2 / Objects.cpp 3 3 / miscellaneous ancillary classes implementation 4 4 / 5 5 / version 1.7, 2013 May 8 6 6 / 7 -/ Author: Sandro Furieri a-furieri@lqt.it 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 8 / 9 9 / Copyright (C) 2008-2013 Alessandro Furieri 10 10 / 11 11 / This program is free software: you can redistribute it and/or modify 12 12 / it under the terms of the GNU General Public License as published by 13 13 / the Free Software Foundation, either version 3 of the License, or 14 14 / (at your option) any later version. ................................................................................ 106 106 SubType = type; 107 107 DbAlias = dbAlias; 108 108 MainName = name; 109 109 ColName = column; 110 110 PathOrURL = path_or_url; 111 111 Restricted = true; 112 112 } 113 + 114 +MyObject::MyObject(int type, wxString & host, wxString & hostaddr, int port, 115 + wxString & dbname, wxString & user, bool readOnly) 116 +{ 117 +// 118 +// constructor - TreeItemData 119 +// 120 + Type = type; 121 + Host = host; 122 + HostAddr = hostaddr; 123 + Port = port; 124 + DbName = dbname; 125 + User = user; 126 + ReadOnly = readOnly; 127 +} 128 + 129 +MyObject::MyObject(int type, wxString & host, wxString & hostaddr, int port, 130 + wxString & dbname, wxString & user, wxString & schema) 131 +{ 132 +// 133 +// constructor - TreeItemData 134 +// 135 + Type = type; 136 + Host = host; 137 + HostAddr = hostaddr; 138 + Port = port; 139 + DbName = dbname; 140 + User = user; 141 + Schema = schema; 142 +} 143 + 144 +MyObject::MyObject(int type, wxString & host, wxString & hostaddr, int port, 145 + wxString & dbname, wxString & user, wxString & schema, 146 + wxString & name, wxString & virtName, bool readOnly, bool pk, 147 + bool select, bool insertUpdateDelete) 148 +{ 149 +// 150 +// constructor - TreeItemData 151 +// 152 + Type = type; 153 + Host = host; 154 + HostAddr = hostaddr; 155 + Port = port; 156 + DbName = dbname; 157 + User = user; 158 + Schema = schema; 159 + Name = name; 160 + VirtName = virtName; 161 + ReadOnly = readOnly; 162 + PK = pk; 163 + Select = select; 164 + InsertUpdateDelete = insertUpdateDelete; 165 +} 166 + 167 +MyObject::MyObject(int type, wxString & host, wxString & hostaddr, int port, 168 + wxString & dbname, wxString & user, wxString & schema, 169 + wxString & name, wxString & column, wxString & virtName) 170 +{ 171 +// 172 +// constructor - TreeItemData 173 +// 174 + Type = type; 175 + Host = host; 176 + HostAddr = hostaddr; 177 + Port = port; 178 + DbName = dbname; 179 + User = user; 180 + Schema = schema; 181 + Name = name; 182 + Column = column; 183 + VirtName = virtName; 184 +} 113 185 114 186 bool MyObject::IsEditable() 115 187 { 116 188 // 117 189 // testing for an EDITABLE TABLE or VIEW object 118 190 // 119 191 if (Restricted) ................................................................................ 404 476 // 405 477 // testing for FOREIGN KEY COLUMN nodes 406 478 // 407 479 if (Type == MY_FOREIGN_KEY_FLD) 408 480 return true; 409 481 return false; 410 482 } 483 + 484 +bool MyObject::IsPostgreSQL() 485 +{ 486 +// 487 +// testing for PostgreSQL related nodes 488 +// 489 + bool ok = false; 490 + switch (Type) 491 + { 492 + case MY_POSTGRES_CONN: 493 + case MY_POSTGRES_SCHEMA: 494 + case MY_POSTGRES_TABLE: 495 + case MY_POSTGRES_VIEW: 496 + case MY_POSTGIS_VIEW: 497 + case MY_POSTGRES_COLUMN: 498 + case MY_POSTGIS_GEOMETRY: 499 + ok = true; 500 + break; 501 + default: 502 + ok = false; 503 + break; 504 + }; 505 + return ok; 506 +} 411 507 412 508 void MyVariant::Copy(MyVariant * other) 413 509 { 414 510 // 415 511 // transfers a BLOB value 416 512 // 417 513 if (other->Type != MY_BLOB_VARIANT) ................................................................................ 1009 1105 // checking for a GPKG Geometry 1010 1106 // 1011 1107 int i; 1012 1108 char **results; 1013 1109 int rows; 1014 1110 int columns; 1015 1111 char *errMsg = NULL; 1016 - const char *name; 1017 1112 wxString Name; 1018 1113 char *sql; 1019 1114 char xname[1024]; 1020 1115 int ret; 1021 1116 int is_virtual = 0; 1022 - char *xtable; 1023 1117 1024 1118 if (table.StartsWith(wxT("vgpkg_")) == true) 1025 1119 { 1026 1120 wxString clean; 1027 1121 table.StartsWith(wxT("vgpkg_"), &clean); 1028 1122 table = clean; 1029 1123 is_virtual = 1; ................................................................................ 1087 1181 // checking for an FDO/OGR Geometry 1088 1182 // 1089 1183 int i; 1090 1184 char **results; 1091 1185 int rows; 1092 1186 int columns; 1093 1187 char *errMsg = NULL; 1094 - const char *name; 1095 1188 wxString Name; 1096 1189 char *sql; 1097 1190 char xname[1024]; 1098 1191 int ret; 1099 1192 int is_virtual = 0; 1100 - char *xtable; 1101 1193 1102 1194 if (table.StartsWith(wxT("fdo_")) == true) 1103 1195 { 1104 1196 wxString clean; 1105 1197 table.StartsWith(wxT("fdo_"), &clean); 1106 1198 table = clean; 1107 1199 is_virtual = 1; ................................................................................ 4015 4107 Geometry = false; 4016 4108 GeoPackageGeometry = false; 4017 4109 GeoPackageVirtualGeometry = false; 4018 4110 FdoOgrGeometry = false; 4019 4111 FdoOgrVirtualGeometry = false; 4020 4112 Next = NULL; 4021 4113 } 4114 + 4115 +TableViewItem::TableViewItem(wxString & db, wxString & name) 4116 +{ 4117 +// constructor 4118 + DbName = db; 4119 + Name = name; 4120 + View = false; 4121 + Virtual = false; 4122 + Geometry = false; 4123 + GeoPackageGeometry = false; 4124 + GeoPackageVirtualGeometry = false; 4125 + FdoOgrGeometry = false; 4126 + FdoOgrVirtualGeometry = false; 4127 + Next = NULL; 4128 +} 4129 + 4130 +bool TableViewItem::IsPostgresTable(MyPostgres * list) 4131 +{ 4132 +// testing for some PostgreSQL table or view 4133 + MyPostgresConn *pC = list->GetFirst(); 4134 + while (pC != NULL) 4135 + { 4136 + MyPostgresSchema *pS = pC->GetFirst(); 4137 + while (pS != NULL) 4138 + { 4139 + MyPostgresTable *pT = pS->GetFirstTable(); 4140 + while (pT != NULL) 4141 + { 4142 + if (Name.Cmp(pT->GetVirtName()) == 0) 4143 + return true; 4144 + if (Name.Cmp(pT->GetPostGisName()) == 0) 4145 + return true; 4146 + pT = pT->GetNext(); 4147 + } 4148 + MyPostgresView *pV = pS->GetFirstView(); 4149 + while (pV != NULL) 4150 + { 4151 + if (Name.Cmp(pV->GetVirtName()) == 0) 4152 + return true; 4153 + pV = pV->GetNext(); 4154 + } 4155 + pS = pS->GetNext(); 4156 + } 4157 + pC = pC->GetNext(); 4158 + } 4159 + return false; 4160 +} 4161 + 4162 +bool TableViewItem::IsTmpMetadata() 4163 +{ 4164 +// testing for some TEMPORARY METADATA TABLE 4165 + if (DbName.Cmp(wxT("temp")) == 0 4166 + && (Name.Cmp(wxT("postgis_geometry_columns")) == 0 4167 + || Name.Cmp(wxT("tmp_vector_coverages")) == 0)) 4168 + return true; 4169 + return false; 4170 +} 4022 4171 4023 4172 TableViewList::TableViewList() 4024 4173 { 4025 4174 // constructor 4026 4175 First = NULL; 4027 4176 Last = NULL; 4028 4177 Count = 0; ................................................................................ 4047 4196 4048 4197 void TableViewList::Add(wxString & name, bool isView, bool isVirtual) 4049 4198 { 4050 4199 // adding a new item to the list 4051 4200 TableViewItem *item = new TableViewItem(name, isView, isVirtual); 4052 4201 if (First == NULL) 4053 4202 First = item; 4203 + if (Last != NULL) 4204 + Last->SetNext(item); 4205 + Last = item; 4206 +} 4207 + 4208 +void TableViewList::Add(wxString & db, wxString & name) 4209 +{ 4210 +// adding a new item to the list 4211 + TableViewItem *item = new TableViewItem(db, name); 4212 + if (First == NULL) 4213 + First = item; 4054 4214 if (Last != NULL) 4055 4215 Last->SetNext(item); 4056 4216 Last = item; 4057 4217 } 4058 4218 4059 4219 static int cmp_tables1(const void *p1, const void *p2) 4060 4220 {
Added Postgres.cpp.
1 +/* 2 +/ Postgres.cpp 3 +/ helper functions for PostgreSQL connections 4 +/ 5 +/ version 2.1, 2018 May 5 6 +/ 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 +/ 9 +/ Copyright (C) 2018 Alessandro Furieri 10 +/ 11 +/ This program is free software: you can redistribute it and/or modify 12 +/ it under the terms of the GNU General Public License as published by 13 +/ the Free Software Foundation, either version 3 of the License, or 14 +/ (at your option) any later version. 15 +/ 16 +/ This program is distributed in the hope that it will be useful, 17 +/ but WITHOUT ANY WARRANTY; without even the implied warranty of 18 +/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 +/ GNU General Public License for more details. 20 +/ 21 +/ You should have received a copy of the GNU General Public License 22 +/ along with this program. If not, see <http://www.gnu.org/licenses/>. 23 +/ 24 +*/ 25 + 26 +#include "Classdef.h" 27 + 28 +#include "wx/spinctrl.h" 29 +#include "wx/utils.h" 30 +#include "wx/filename.h" 31 + 32 +void MyFrame::GetPQlibVersion(wxString & ver) 33 +{ 34 +// 35 +// returns the PQlib (PostgreSQL client) version 36 +// 37 + int ver_num = vpgPQlibVersion(); 38 + int major = ver_num / 10000; 39 + int minor = (ver_num - (major * 10000)) / 100; 40 + int revision = ver_num - (major * 10000) - (minor * 100); 41 + char version[128]; 42 + sprintf(version, "%d.%02d.%02d", major, minor, revision); 43 + ver = wxString::FromUTF8(version); 44 +} 45 + 46 +bool MyFrame::HasPostgreSqlConnections() 47 +{ 48 +// checks for any current PostgreSQL connection 49 + if (PostgresList.GetFirst() == NULL) 50 + return false; 51 + return true; 52 +} 53 + 54 +void MyFrame::DoLoadLibPQ(wxString & path) 55 +{ 56 +// 57 +// attempting to load LibPQ - dynamic late binding 58 +// 59 + if (DynamicLibPQ.IsLoaded() == true) 60 + DynamicLibPQ.Unload(); 61 + if (DynamicLibPQ.Load(path, wxDL_QUIET)) 62 + { 63 + // retievinig the pointers of ALL APIs 64 + bool valid = true; 65 + bool ok; 66 + VirtualPQapi.PQclear = 67 + (void (*)(PGresult *)) DynamicLibPQ.GetSymbol(wxT("PQclear"), &ok); 68 + if (ok == false) 69 + valid = false; 70 + VirtualPQapi.PQconnectdb = 71 + (PGconn * 72 + (*)(const char *conninfo)) DynamicLibPQ.GetSymbol(wxT("PQconnectdb"), 73 + &ok); 74 + if (ok == false) 75 + valid = false; 76 + VirtualPQapi.PQerrorMessage = 77 + (char *(*)(const PGconn * conn)) 78 + DynamicLibPQ.GetSymbol(wxT("PQerrorMessage"), &ok); 79 + if (ok == false) 80 + valid = false; 81 + VirtualPQapi.PQexec = 82 + (PGresult * 83 + (*)(PGconn * conn, 84 + const char *command)) DynamicLibPQ.GetSymbol(wxT("PQexec"), &ok); 85 + if (ok == false) 86 + valid = false; 87 + VirtualPQapi.PQfinish = 88 + (void (*)(PGconn * conn)) DynamicLibPQ.GetSymbol(wxT("PQfinish"), &ok); 89 + if (ok == false) 90 + valid = false; 91 + VirtualPQapi.PQgetisnull = 92 + (int (*)(const PGresult * res, int row_number, int column_number)) 93 + DynamicLibPQ.GetSymbol(wxT("PQgetisnull"), &ok); 94 + if (ok == false) 95 + valid = false; 96 + VirtualPQapi.PQgetvalue = 97 + (char *(*)(const PGresult * res, int row_number, int column_number)) 98 + DynamicLibPQ.GetSymbol(wxT("PQgetvalue"), &ok); 99 + if (ok == false) 100 + valid = false; 101 + VirtualPQapi.PQlibVersion = 102 + (int (*)(void)) DynamicLibPQ.GetSymbol(wxT("PQlibVersion"), &ok); 103 + if (ok == false) 104 + valid = false; 105 + VirtualPQapi.PQnfields = 106 + (int (*)(const PGresult * res)) DynamicLibPQ.GetSymbol(wxT("PQnfields"), 107 + &ok); 108 + if (ok == false) 109 + valid = false; 110 + VirtualPQapi.PQntuples = 111 + (int (*)(const PGresult * res)) DynamicLibPQ.GetSymbol(wxT("PQntuples"), 112 + &ok); 113 + if (ok == false) 114 + valid = false; 115 + VirtualPQapi.PQresultStatus = 116 + (ExecStatusType(*)(const PGresult * res)) 117 + DynamicLibPQ.GetSymbol(wxT("PQresultStatus"), &ok); 118 + if (ok == false) 119 + valid = false; 120 + VirtualPQapi.PQstatus = 121 + (ConnStatusType(*)(const PGconn * conn)) 122 + DynamicLibPQ.GetSymbol(wxT("PQstatus"), &ok); 123 + if (ok == false) 124 + valid = false; 125 + if (valid == true) 126 + { 127 + if (virtualpg_extension_init(SqliteHandle, &VirtualPQapi) == 128 + SQLITE_OK) 129 + { 130 + // OK, anything is good 131 + PathLibPQ = path; 132 + VirtualPQapiOK = true; 133 + return; 134 + } 135 + } 136 + } 137 + PathLibPQ = wxT(""); 138 +} 139 + 140 +void MyFrame::DoLocateLibPQ(wxString & extpath) 141 +{ 142 +// 143 +// attempting to load LibPQ - path selected by the user 144 +// 145 + int ret; 146 + wxString path = wxDynamicLibrary::CanonicalizeName(wxT("libpq")); 147 + wxFileName name(path); 148 + wxString suffix = 149 + wxT("Dynamic Library (*.") + name.GetExt() + wxT(")|*.") + name.GetExt(); 150 + wxFileDialog fileDialog(this, wxT("libPQ manual search"), wxT(""), path, 151 + suffix, wxFD_OPEN | wxFD_FILE_MUST_EXIST, 152 + wxDefaultPosition, wxDefaultSize, wxT("filedlg")); 153 + ret = fileDialog.ShowModal(); 154 + if (ret == wxID_OK) 155 + { 156 + path = fileDialog.GetPath(); 157 + DoLoadLibPQ(path); 158 + extpath = path; 159 + } 160 +} 161 + 162 +void MyFrame::DoPostgreSqlConnection() 163 +{ 164 +// 165 +// establishing a connection to PostgreSQL 166 +// 167 + if (VirtualPQapiOK == false) 168 + { 169 + // 170 + // LibPQ isn't yet loaded 171 + // 172 + int ret = wxMessageBox(wxT 173 + ("The PostgreSQL client library (LibPQ) isn't yet loaded.\n\n" 174 + "Do you wish to attempt loading it right now ?"), 175 + wxT("spatialite_gui"), 176 + wxYES_NO | wxICON_QUESTION, this); 177 + if (ret == wxYES) 178 + { 179 + // trying to load LibPQ 180 + wxString path; 181 + DoLocateLibPQ(path); 182 + if (VirtualPQapiOK == true) 183 + { 184 + wxMessageBox(wxT 185 + ("The PostgreSQL client library (LibPQ) has been correctly loaded\n\n" 186 + "Full PostgreSQL support is now available."), 187 + wxT("spatialite_gui"), wxOK | wxICON_INFORMATION, 188 + this); 189 + goto ok; 190 + } 191 + if (path.Len() > 0) 192 + wxMessageBox(wxT 193 + ("Unable to load a valid PostgreSQL client library (LibPQ) from:\n\n") 194 + + path + 195 + wxT 196 + ("\n\nFull PostgreSQL support still continues to be disabled."), 197 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 198 + } 199 + return; 200 + } 201 + 202 +ok: 203 + PostgresConnectionDialog dlg; 204 + dlg.Create(this); 205 + int ret = dlg.ShowModal(); 206 + if (ret == wxID_OK) 207 + { 208 + char *conninfo = sqlite3_mprintf(" "); 209 + char *prev; 210 + if (dlg.GetHost() != NULL) 211 + { 212 + prev = conninfo; 213 + conninfo = sqlite3_mprintf("%s host=%s", prev, dlg.GetHost()); 214 + sqlite3_free(prev); 215 + } 216 + if (dlg.GetHostAddr() != NULL) 217 + { 218 + prev = conninfo; 219 + conninfo = sqlite3_mprintf("%s hostaddr=%s", prev, dlg.GetHostAddr()); 220 + sqlite3_free(prev); 221 + } 222 + prev = conninfo; 223 + conninfo = sqlite3_mprintf("%s port=%d", prev, dlg.GetPort()); 224 + sqlite3_free(prev); 225 + if (dlg.GetDbName() != NULL) 226 + { 227 + prev = conninfo; 228 + conninfo = sqlite3_mprintf("%s dbname=%s", prev, dlg.GetDbName()); 229 + sqlite3_free(prev); 230 + } 231 + if (dlg.GetUser() != NULL) 232 + { 233 + prev = conninfo; 234 + conninfo = sqlite3_mprintf("%s user=%s", prev, dlg.GetUser()); 235 + sqlite3_free(prev); 236 + } 237 + if (dlg.GetPassword() != NULL) 238 + { 239 + prev = conninfo; 240 + conninfo = sqlite3_mprintf("%s password=%s", prev, dlg.GetPassword()); 241 + sqlite3_free(prev); 242 + } 243 + wxString host = wxString::FromUTF8(dlg.GetHost()); 244 + wxString hostaddr = wxString::FromUTF8(dlg.GetHostAddr()); 245 + int port = dlg.GetPort(); 246 + wxString dbname = wxString::FromUTF8(dlg.GetDbName()); 247 + wxString user = wxString::FromUTF8(dlg.GetUser()); 248 + bool readOnly = dlg.IsReadOnly(); 249 + bool textDates = dlg.IsTextDates(); 250 + bool ret = false; 251 + if (DoCheckPostgres(host, hostaddr, port, dbname, user) == true) 252 + wxMessageBox(wxT 253 + ("A PostgreSQL Connection with the same arguments alreay exists !!!"), 254 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 255 + else 256 + ret = 257 + DoInitPostgres(host, hostaddr, dlg.GetPort(), dbname, user, readOnly, 258 + textDates, conninfo + 2); 259 + sqlite3_free(conninfo); 260 + if (ret) 261 + InitTableTree(); 262 + } 263 +} 264 + 265 +bool MyFrame::DoCheckPostgres(wxString & host, wxString & hostaddr, int port, 266 + wxString & dbname, wxString & user) 267 +{ 268 +// 269 +// testing for already existing PostgreSQL connections 270 +// 271 + MyPostgresConn *pC = PostgresList.GetFirst(); 272 + while (pC != NULL) 273 + { 274 + if (pC->GetHost().Cmp(host) == 0 && pC->GetHostAddr().Cmp(hostaddr) == 0 275 + && pC->GetPort() == port && pC->GetDbName().Cmp(dbname) == 0 276 + && pC->GetUser().Cmp(user) == 0) 277 + return true; 278 + pC = pC->GetNext(); 279 + } 280 + return false; 281 +} 282 + 283 +void MyFrame::DoInitVirtualPQapi() 284 +{ 285 +// 286 +// initializing the Virtual LibPQ API 287 +// 288 +#ifdef LIBPQ_DEFERRED 289 +/* 290 +/ not directly linked to libpq 291 +/ libpq will be eventually loaded only when required (late binding) 292 +*/ 293 + VirtualPQapi.PQclear = NULL; 294 + VirtualPQapi.PQconnectdb = NULL; 295 + VirtualPQapi.PQerrorMessage = NULL; 296 + VirtualPQapi.PQexec = NULL; 297 + VirtualPQapi.PQfinish = NULL; 298 + VirtualPQapi.PQgetisnull = NULL; 299 + VirtualPQapi.PQgetvalue = NULL; 300 + VirtualPQapi.PQlibVersion = NULL; 301 + VirtualPQapi.PQnfields = NULL; 302 + VirtualPQapi.PQntuples = NULL; 303 + VirtualPQapi.PQresultStatus = NULL; 304 + VirtualPQapi.PQstatus = NULL; 305 + VirtualPQapiOK = false; 306 +#else 307 +/* directly linked to libpq */ 308 + VirtualPQapi.PQclear = PQclear; 309 + VirtualPQapi.PQconnectdb = PQconnectdb; 310 + VirtualPQapi.PQerrorMessage = PQerrorMessage; 311 + VirtualPQapi.PQexec = PQexec; 312 + VirtualPQapi.PQfinish = PQfinish; 313 + VirtualPQapi.PQgetisnull = PQgetisnull; 314 + VirtualPQapi.PQgetvalue = PQgetvalue; 315 + VirtualPQapi.PQlibVersion = PQlibVersion; 316 + VirtualPQapi.PQnfields = PQnfields; 317 + VirtualPQapi.PQntuples = PQntuples; 318 + VirtualPQapi.PQresultStatus = PQresultStatus; 319 + VirtualPQapi.PQstatus = PQstatus; 320 + VirtualPQapiOK = false; 321 +#endif 322 +} 323 + 324 +void MyFrame::DoInitVirtualPG() 325 +{ 326 +// 327 +// attempting to initialize the VirtalPG extension 328 +// 329 + if (virtualpg_extension_init(SqliteHandle, &VirtualPQapi) == SQLITE_OK) 330 + VirtualPQapiOK = true; 331 +} 332 + 333 +bool MyFrame::DoInitPostgres(wxString & host, wxString & hostaddr, int port, 334 + wxString & dbname, wxString & user, bool readOnly, 335 + bool textDates, const char *conninfo) 336 +{ 337 +// 338 +// attempting to initialize a PostgreSQL connection 339 +// 340 + PGconn *pg_conn; 341 + PGresult *res; 342 + int nRows; 343 + int nFields; 344 + const char *obj; 345 + const char *schema_name; 346 + const char *table_name; 347 + const char *geometry; 348 + const char *type; 349 + int srid; 350 + int dims; 351 + int r; 352 + MyPostgresConn *conn; 353 + MyPostgresSchema *pS; 354 + 355 + ::wxBeginBusyCursor(); 356 + pg_conn = vpgPQconnectdb(conninfo); 357 + if (vpgPQstatus(pg_conn) != CONNECTION_OK) 358 + { 359 + char *msg = sqlite3_mprintf("Connection to Postgres failed: %s", 360 + vpgPQerrorMessage(pg_conn)); 361 + wxMessageBox(wxString::FromUTF8(msg), 362 + wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 363 + sqlite3_free(msg); 364 + vpgPQfinish(pg_conn); 365 + ::wxEndBusyCursor(); 366 + return false; 367 + } 368 + 369 + conn = 370 + PostgresList.Insert(host, hostaddr, port, dbname, user, readOnly, 371 + textDates); 372 + 373 +// retrieving all PosgreSQL Tables and Views 374 + const char *sql = 375 + "SELECT 'table' AS obj, t.schemaname, t.tablename, g.f_geometry_column, " 376 + "g.type, g.srid, g.coord_dimension " 377 + "FROM pg_tables AS t LEFT JOIN geometry_columns AS g ON " 378 + "(g.f_table_schema = t.schemaname AND g.f_table_name = t.tablename) " 379 + "WHERE t.schemaname NOT IN ('information_schema', 'pg_catalog') " 380 + "UNION SELECT 'view' AS obj, schemaname, viewname, '', '', -1, -1 FROM pg_views " 381 + "WHERE schemaname NOT IN ('information_schema', 'pg_catalog') " 382 + "ORDER BY 1, 2, 3"; 383 + res = vpgPQexec(pg_conn, sql); 384 + if (vpgPQresultStatus(res) != PGRES_TUPLES_OK) 385 + goto err; 386 + nRows = vpgPQntuples(res); 387 + nFields = vpgPQnfields(res); 388 + if (nRows > 0 && nFields == 7) 389 + { 390 + for (r = 0; r < nRows; r++) 391 + { 392 + obj = vpgPQgetvalue(res, r, 0); 393 + schema_name = vpgPQgetvalue(res, r, 1); 394 + table_name = vpgPQgetvalue(res, r, 2); 395 + geometry = vpgPQgetvalue(res, r, 3); 396 + type = vpgPQgetvalue(res, r, 4); 397 + srid = atoi(vpgPQgetvalue(res, r, 5)); 398 + dims = atoi(vpgPQgetvalue(res, r, 6)); 399 + wxString Schema = wxString::FromUTF8(schema_name); 400 + wxString Table = wxString::FromUTF8(table_name); 401 + wxString Geometry = wxString::FromUTF8(geometry); 402 + wxString Type = wxString::FromUTF8(type); 403 + if (strcmp(obj, "view") == 0) 404 + conn->Add(Schema, Table); 405 + else 406 + conn->Add(Schema, Table, Geometry, Type, srid, dims); 407 + } 408 + } 409 + vpgPQclear(res); 410 + 411 + pS = conn->GetFirst(); 412 + while (pS != NULL) 413 + { 414 + MyPostgresTable *pT = pS->GetFirstTable(); 415 + while (pT != NULL) 416 + { 417 + InitPostgresPks(pg_conn, pS, pT); 418 + DoCheckGrantPermissions(pg_conn, conn->GetUser(), pS, pT); 419 + pT = pT->GetNext(); 420 + } 421 + MyPostgresView *pV = pS->GetFirstView(); 422 + while (pV != NULL) 423 + { 424 + DoCheckGrantPermissions(pg_conn, conn->GetUser(), pS, pV); 425 + pV = pV->GetNext(); 426 + } 427 + pS = pS->GetNext(); 428 + } 429 + vpgPQfinish(pg_conn); 430 + 431 + conn->SetConnectionString(conninfo); 432 + DoSetUniqueVirtNames(); 433 + DoCreatePostgresTables(); 434 + ::wxEndBusyCursor(); 435 + return true; 436 + 437 +err: 438 +// something has gone the wrong way 439 + if (res != NULL) 440 + vpgPQclear(res); 441 + vpgPQfinish(pg_conn); 442 + ::wxEndBusyCursor(); 443 + return false; 444 +} 445 + 446 +void MyFrame::DoSetUniqueVirtNames() 447 +{ 448 +// 449 +// ensuring to set Unique Names to all PostgreSQL Tables and Views 450 +// 451 + wxString baseName; 452 + wxString uniqueName; 453 + MyPostgresConn *pC = PostgresList.GetFirst(); 454 + while (pC != NULL) 455 + { 456 + MyPostgresSchema *pS = pC->GetFirst(); 457 + while (pS != NULL) 458 + { 459 + MyPostgresTable *pT = pS->GetFirstTable(); 460 + while (pT != NULL) 461 + { 462 + if (pT->GetVirtName().Len() == 0) 463 + { 464 + baseName = wxT("vpg_") + pT->GetName(); 465 + PostgresList.MakeUniqueVirtName(baseName, uniqueName); 466 + pT->SetVirtName(uniqueName); 467 + } 468 + if (pT->GetFirst() != NULL) 469 + { 470 + if (pT->GetPostGisName().Len() == 0) 471 + { 472 + baseName = wxT("vpg_") + pT->GetName() + wxT("_postgis"); 473 + PostgresList.MakeUniqueVirtName(baseName, uniqueName); 474 + pT->SetPostGisName(uniqueName); 475 + } 476 + } 477 + pT = pT->GetNext(); 478 + } 479 + MyPostgresView *pV = pS->GetFirstView(); 480 + while (pV != NULL) 481 + { 482 + if (pV->GetVirtName().Len() == 0) 483 + { 484 + baseName = wxT("vpg_") + pV->GetName(); 485 + PostgresList.MakeUniqueVirtName(baseName, uniqueName); 486 + pV->SetVirtName(uniqueName); 487 + } 488 + pV = pV->GetNext(); 489 + } 490 + pS = pS->GetNext(); 491 + } 492 + pC = pC->GetNext(); 493 + } 494 +} 495 + 496 +void MyFrame::DoCreatePostgresTables() 497 +{ 498 +// 499 +// attempting to create any required PostgreSQL/PostGIS table 500 +// 501 + char *sql; 502 + char *virt_name; 503 + char *xvirt_name; 504 + char *geom_name; 505 + char *geo_type; 506 + char *connection_string; 507 + char *schema; 508 + char *table; 509 + int ret; 510 + char *errMsg = NULL; 511 + MyPostgresConn *pC = PostgresList.GetFirst(); 512 + while (pC != NULL) 513 + { 514 + const char *readOnly = "-"; 515 + const char *textDates = "-"; 516 + if (pC->IsReadOnly() == false) 517 + readOnly = "W"; 518 + if (pC->IsTextDates() == false) 519 + textDates = "J"; 520 + MyPostgresSchema *pS = pC->GetFirst(); 521 + while (pS != NULL) 522 + { 523 + MyPostgresTable *pT = pS->GetFirstTable(); 524 + while (pT != NULL) 525 + { 526 + // creating some VirtualPG Table 527 + virt_name = (char *) malloc((pT->GetVirtName().Len() * 4) + 1); 528 + strcpy(virt_name, pT->GetVirtName().ToUTF8()); 529 + xvirt_name = gaiaDoubleQuotedSql(virt_name); 530 + free(virt_name); 531 + connection_string = 532 + (char *) malloc((pC->GetConnectionString().Len() * 4) + 1); 533 + strcpy(connection_string, pC->GetConnectionString().ToUTF8()); 534 + schema = (char *) malloc((pS->GetName().Len() * 4) + 1); 535 + strcpy(schema, pS->GetName().ToUTF8()); 536 + table = (char *) malloc((pT->GetName().Len() * 4) + 1); 537 + strcpy(table, pT->GetName().ToUTF8()); 538 + sql = 539 + sqlite3_mprintf 540 + ("CREATE VIRTUAL TABLE IF NOT EXISTS main.\"%s\" " 541 + "USING VirtualPostgres(%Q, %Q, %Q, %Q, %Q)", xvirt_name, 542 + connection_string, schema, table, readOnly, textDates); 543 + free(xvirt_name); 544 + free(connection_string); 545 + free(schema); 546 + free(table); 547 + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); 548 + sqlite3_free(sql); 549 + if (ret != SQLITE_OK) 550 + { 551 + wxMessageBox(wxT("PostgreSQL wrapper: ") + 552 + wxString::FromUTF8(errMsg), 553 + wxT("spatialite_gui"), wxOK | wxICON_ERROR, 554 + this); 555 + sqlite3_free(errMsg); 556 + } 557 + if (pT->GetFirst() != NULL) 558 + { 559 + // creating some SpatiaLite-like Spatial View based on a PostgreSQL Table 560 + virt_name = 561 + (char *) malloc((pT->GetPostGisName().Len() * 4) + 1); 562 + strcpy(virt_name, pT->GetPostGisName().ToUTF8()); 563 + xvirt_name = gaiaDoubleQuotedSql(virt_name); 564 + free(virt_name); 565 + sql = 566 + sqlite3_mprintf 567 + ("CREATE VIEW IF NOT EXISTS main.\"%s\" AS\n", xvirt_name); 568 + free(xvirt_name); 569 + sql = DoCreatePostGisSpatialView(pT, sql); 570 + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); 571 + sqlite3_free(sql); 572 + if (ret != SQLITE_OK) 573 + { 574 + wxMessageBox(wxT("PostGIS wrapper: ") + 575 + wxString::FromUTF8(errMsg), 576 + wxT("spatialite_gui"), wxOK | wxICON_ERROR, 577 + this); 578 + sqlite3_free(errMsg); 579 + } 580 + char a[1024]; 581 + char b[1024]; 582 + strcpy(a, pS->GetName().ToUTF8()); 583 + strcpy(b, pT->GetPostGisName().ToUTF8()); 584 + if (pC->IsReadOnly() == false && pT->HasPK() == true 585 + && pT->CanInsertUpdateDelete() == true) 586 + { 587 + // creating all required Triggers so to get a Writable View 588 + DoCreatePostGisSpatialViewTriggers(pC, pS, pT); 589 + } 590 + // registering all Spatial Views 591 + MyPostGisGeometry *pG = pT->GetFirst(); 592 + while (pG != NULL) 593 + { 594 + // registering a Spatial View 595 + virt_name = 596 + (char *) malloc((pT->GetPostGisName().Len() * 4) + 1); 597 + strcpy(virt_name, pT->GetPostGisName().ToUTF8()); 598 + geom_name = 599 + (char *) malloc((pG->GetName().Len() * 4) + 1); 600 + strcpy(geom_name, pG->GetName().ToUTF8()); 601 + geo_type = 602 + (char *) malloc((pG->GetGeomType().Len() * 4) + 1); 603 + strcpy(geo_type, pG->GetGeomType().ToUTF8()); 604 + sql = 605 + sqlite3_mprintf 606 + ("INSERT INTO temp.postgis_geometry_columns " 607 + "(f_table_name, f_geometry_column, coord_dimension, srid, geometry_type) " 608 + "VALUES (%Q, %Q, %d, %d, %Q)", virt_name, geom_name, 609 + pG->GetDims(), pG->GetSrid(), geo_type); 610 + free(virt_name); 611 + free(geom_name); 612 + free(geo_type); 613 + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); 614 + sqlite3_free(sql); 615 + if (ret != SQLITE_OK) 616 + { 617 + wxMessageBox(wxT("PostgreSQL wrapper: ") + 618 + wxString::FromUTF8(errMsg), 619 + wxT("spatialite_gui"), 620 + wxOK | wxICON_ERROR, this); 621 + sqlite3_free(errMsg); 622 + } 623 + pG = pG->GetNext(); 624 + } 625 + } 626 + pT = pT->GetNext(); 627 + } 628 + MyPostgresView *pV = pS->GetFirstView(); 629 + while (pV != NULL) 630 + { 631 + // creating some VirtualPG View 632 + virt_name = (char *) malloc((pV->GetVirtName().Len() * 4) + 1); 633 + strcpy(virt_name, pV->GetVirtName().ToUTF8()); 634 + xvirt_name = gaiaDoubleQuotedSql(virt_name); 635 + free(virt_name); 636 + connection_string = 637 + (char *) malloc((pC->GetConnectionString().Len() * 4) + 1); 638 + strcpy(connection_string, pC->GetConnectionString().ToUTF8()); 639 + schema = (char *) malloc((pS->GetName().Len() * 4) + 1); 640 + strcpy(schema, pS->GetName().ToUTF8()); 641 + table = (char *) malloc((pV->GetName().Len() * 4) + 1); 642 + strcpy(table, pV->GetName().ToUTF8()); 643 + sql = 644 + sqlite3_mprintf 645 + ("CREATE VIRTUAL TABLE IF NOT EXISTS main.\"%s\" " 646 + "USING VirtualPostgres(%Q, %Q, %Q, '-', textDates)", 647 + xvirt_name, connection_string, schema, table, textDates); 648 + free(xvirt_name); 649 + free(connection_string); 650 + free(schema); 651 + free(table); 652 + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); 653 + sqlite3_free(sql); 654 + if (ret != SQLITE_OK) 655 + { 656 + wxMessageBox(wxT("PostgreSQL wrapper: ") + 657 + wxString::FromUTF8(errMsg), 658 + wxT("spatialite_gui"), wxOK | wxICON_ERROR, 659 + this); 660 + sqlite3_free(errMsg); 661 + } 662 + pV = pV->GetNext(); 663 + } 664 + pS = pS->GetNext(); 665 + } 666 + pC = pC->GetNext(); 667 + } 668 +} 669 + 670 +char *MyFrame::DoCreatePostGisSpatialView(MyPostgresTable * table, 671 + char *prev_sql) 672 +{ 673 +// 674 +// auto-writing the CREATE VIEW for some PostGIS geometry 675 +// 676 + int ret; 677 + int i; 678 + char **results; 679 + int rows; 680 + int columns; 681 + char *sql = prev_sql; 682 + char *prev; 683 + char *xtable = (char *) malloc((table->GetVirtName().Len() * 4) + 1); 684 + strcpy(xtable, table->GetVirtName().ToUTF8()); 685 + char *sql2 = sqlite3_mprintf("PRAGMA table_info(%Q)", xtable); 686 + free(xtable); 687 + ret = sqlite3_get_table(SqliteHandle, sql2, &results, &rows, &columns, NULL); 688 + sqlite3_free(sql2); 689 + if (ret != SQLITE_OK) 690 + return sql; 691 + if (rows < 1) 692 + ; 693 + else 694 + { 695 + prev = sql; 696 + sql = sqlite3_mprintf("%sSELECT ROWID AS ROWID", prev); 697 + sqlite3_free(prev); 698 + for (i = 1; i <= rows; i++) 699 + { 700 + prev = sql; 701 + const char *name = results[(i * columns) + 1]; 702 + char *xname = gaiaDoubleQuotedSql(name); 703 + wxString col = wxString::FromUTF8(name); 704 + MyPostGisGeometry *geom = table->Find(col); 705 + if (geom != NULL) 706 + { 707 + if (geom->IsMultiType() == true) 708 + sql = 709 + sqlite3_mprintf 710 + ("%s, CastToMulti(GeomFromEWKB(\"%s\")) AS \"%s\"", prev, 711 + xname, xname); 712 + else 713 + sql = 714 + sqlite3_mprintf("%s, GeomFromEWKB(\"%s\") AS \"%s\"", 715 + prev, xname, xname); 716 + } else 717 + { 718 + sql = sqlite3_mprintf("%s, \"%s\" AS \"%s\"", prev, xname, xname); 719 + } 720 + free(xname); 721 + sqlite3_free(prev); 722 + } 723 + } 724 + sqlite3_free_table(results); 725 + 726 + prev = sql; 727 + xtable = (char *) malloc((table->GetVirtName().Len() * 4) + 1); 728 + strcpy(xtable, table->GetVirtName().ToUTF8()); 729 + char *xxtable = gaiaDoubleQuotedSql(xtable); 730 + free(xtable); 731 + sql = sqlite3_mprintf("%s\nFROM MAIN.\"%s\"", prev, xxtable); 732 + free(xxtable); 733 + sqlite3_free(prev); 734 + return sql; 735 +} 736 + 737 +void MyFrame::DoCheckGrantPermissions(void *conn, wxString & user, 738 + MyPostgresSchema * schema, 739 + MyPostgresTable * table) 740 +{ 741 +// 742 +// testing Grant permissions for some PostgreSQL Table or View 743 +// 744 + PGconn *pg_conn = (PGconn *) conn; 745 + PGresult *res; 746 + int nRows; 747 + int nFields; 748 + int r; 749 + bool canSelect = false; 750 + bool canInsert = false; 751 + bool canUpdate = false; 752 + bool canDelete = false; 753 + bool canInsertUpdateDelete = false; 754 + char *cuser = (char *) malloc(user.Len() * 4 + 1); 755 + strcpy(cuser, user.ToUTF8()); 756 + char *cschema = (char *) malloc(schema->GetName().Len() * 4 + 1); 757 + strcpy(cschema, schema->GetName().ToUTF8()); 758 + char *ctable = (char *) malloc(table->GetName().Len() * 4 + 1); 759 + strcpy(ctable, table->GetName().ToUTF8()); 760 + char *name = sqlite3_mprintf("%s.%s", cschema, ctable); 761 +// testing for SELECT 762 + char *sql = 763 + sqlite3_mprintf("SELECT has_table_privilege(%Q, %Q, 'select')", cuser, 764 + name); 765 + res = vpgPQexec(pg_conn, sql); 766 + sqlite3_free(sql); 767 + if (vpgPQresultStatus(res) != PGRES_TUPLES_OK) 768 + goto end; 769 + nRows = vpgPQntuples(res); 770 + nFields = vpgPQnfields(res); 771 + if (nRows > 0 && nFields == 1) 772 + { 773 + for (r = 0; r < nRows; r++) 774 + { 775 + const char *permission = vpgPQgetvalue(res, r, 0); 776 + if (strcmp(permission, "t") == 0) 777 + canSelect = true; 778 + } 779 + } 780 + vpgPQclear(res); 781 + res = NULL; 782 +// testing for INSERT 783 + sql = 784 + sqlite3_mprintf("SELECT has_table_privilege(%Q, %Q, 'insert')", cuser, 785 + name); 786 + res = vpgPQexec(pg_conn, sql); 787 + sqlite3_free(sql); 788 + if (vpgPQresultStatus(res) != PGRES_TUPLES_OK) 789 + goto end; 790 + nRows = vpgPQntuples(res); 791 + nFields = vpgPQnfields(res); 792 + if (nRows > 0 && nFields == 1) 793 + { 794 + for (r = 0; r < nRows; r++) 795 + { 796 + const char *permission = vpgPQgetvalue(res, r, 0); 797 + if (strcmp(permission, "t") == 0) 798 + canInsert = true; 799 + } 800 + } 801 + vpgPQclear(res); 802 + res = NULL; 803 +// testing for UPDATE 804 + sql = 805 + sqlite3_mprintf("SELECT has_table_privilege(%Q, %Q, 'update')", cuser, 806 + name); 807 + res = vpgPQexec(pg_conn, sql); 808 + sqlite3_free(sql); 809 + if (vpgPQresultStatus(res) != PGRES_TUPLES_OK) 810 + goto end; 811 + nRows = vpgPQntuples(res); 812 + nFields = vpgPQnfields(res); 813 + if (nRows > 0 && nFields == 1) 814 + { 815 + for (r = 0; r < nRows; r++) 816 + { 817 + const char *permission = vpgPQgetvalue(res, r, 0); 818 + if (strcmp(permission, "t") == 0) 819 + canUpdate = true; 820 + } 821 + } 822 + vpgPQclear(res); 823 + res = NULL; 824 +// testing for DELETE 825 + sql = 826 + sqlite3_mprintf("SELECT has_table_privilege(%Q, %Q, 'delete')", cuser, 827 + name); 828 + res = vpgPQexec(pg_conn, sql); 829 + sqlite3_free(sql); 830 + if (vpgPQresultStatus(res) != PGRES_TUPLES_OK) 831 + goto end; 832 + nRows = vpgPQntuples(res); 833 + nFields = vpgPQnfields(res); 834 + if (nRows > 0 && nFields == 1) 835 + { 836 + for (r = 0; r < nRows; r++) 837 + { 838 + const char *permission = vpgPQgetvalue(res, r, 0); 839 + if (strcmp(permission, "t") == 0) 840 + canDelete = true; 841 + } 842 + } 843 + vpgPQclear(res); 844 + res = NULL; 845 + 846 + if (canInsert == true && canUpdate == true && canDelete == true) 847 + canInsertUpdateDelete = true; 848 + table->SetGrants(canSelect, canInsertUpdateDelete); 849 +end: 850 + if (res != NULL) 851 + vpgPQclear(res); 852 + free(cuser); 853 + free(cschema); 854 + free(ctable); 855 + sqlite3_free(name); 856 +} 857 + 858 +void MyFrame::DoCheckGrantPermissions(void *conn, wxString & user, 859 + MyPostgresSchema * schema, 860 + MyPostgresView * view) 861 +{ 862 +// 863 +// testing Grant permissions for some PostgreSQL Table or View 864 +// 865 + PGconn *pg_conn = (PGconn *) conn; 866 + PGresult *res; 867 + int nRows; 868 + int nFields; 869 + int r; 870 + bool canSelect = false; 871 + bool canInsert = false; 872 + bool canUpdate = false; 873 + bool canDelete = false; 874 + bool canInsertUpdateDelete = false; 875 + char *cuser = (char *) malloc(user.Len() * 4 + 1); 876 + strcpy(cuser, user.ToUTF8()); 877 + char *cschema = (char *) malloc(schema->GetName().Len() * 4 + 1); 878 + strcpy(cschema, schema->GetName().ToUTF8()); 879 + char *ctable = (char *) malloc(view->GetName().Len() * 4 + 1); 880 + strcpy(ctable, view->GetName().ToUTF8()); 881 + char *name = sqlite3_mprintf("%s.%s", cschema, ctable); 882 +// testing for SELECT 883 + char *sql = 884 + sqlite3_mprintf("SELECT has_table_privilege(%Q, %Q, 'select')", cuser, 885 + name); 886 + res = vpgPQexec(pg_conn, sql); 887 + sqlite3_free(sql); 888 + if (vpgPQresultStatus(res) != PGRES_TUPLES_OK) 889 + goto end; 890 + nRows = vpgPQntuples(res); 891 + nFields = vpgPQnfields(res); 892 + if (nRows > 0 && nFields == 1) 893 + { 894 + for (r = 0; r < nRows; r++) 895 + { 896 + const char *permission = vpgPQgetvalue(res, r, 0); 897 + if (strcmp(permission, "t") == 0) 898 + canSelect = true; 899 + } 900 + } 901 + vpgPQclear(res); 902 + res = NULL; 903 +// testing for INSERT 904 + sql = 905 + sqlite3_mprintf("SELECT has_table_privilege(%Q, %Q, 'insert')", cuser, 906 + name); 907 + res = vpgPQexec(pg_conn, sql); 908 + sqlite3_free(sql); 909 + if (vpgPQresultStatus(res) != PGRES_TUPLES_OK) 910 + goto end; 911 + nRows = vpgPQntuples(res); 912 + nFields = vpgPQnfields(res); 913 + if (nRows > 0 && nFields == 1) 914 + { 915 + for (r = 0; r < nRows; r++) 916 + { 917 + const char *permission = vpgPQgetvalue(res, r, 0); 918 + if (strcmp(permission, "t") == 0) 919 + canInsert = true; 920 + } 921 + } 922 + vpgPQclear(res); 923 + res = NULL; 924 +// testing for UPDATE 925 + sql = 926 + sqlite3_mprintf("SELECT has_table_privilege(%Q, %Q, 'update')", cuser, 927 + name); 928 + res = vpgPQexec(pg_conn, sql); 929 + sqlite3_free(sql); 930 + if (vpgPQresultStatus(res) != PGRES_TUPLES_OK) 931 + goto end; 932 + nRows = vpgPQntuples(res); 933 + nFields = vpgPQnfields(res); 934 + if (nRows > 0 && nFields == 1) 935 + { 936 + for (r = 0; r < nRows; r++) 937 + { 938 + const char *permission = vpgPQgetvalue(res, r, 0); 939 + if (strcmp(permission, "t") == 0) 940 + canUpdate = true; 941 + } 942 + } 943 + vpgPQclear(res); 944 + res = NULL; 945 +// testing for DELETE 946 + sql = 947 + sqlite3_mprintf("SELECT has_table_privilege(%Q, %Q, 'delete')", cuser, 948 + name); 949 + res = vpgPQexec(pg_conn, sql); 950 + sqlite3_free(sql); 951 + if (vpgPQresultStatus(res) != PGRES_TUPLES_OK) 952 + goto end; 953 + nRows = vpgPQntuples(res); 954 + nFields = vpgPQnfields(res); 955 + if (nRows > 0 && nFields == 1) 956 + { 957 + for (r = 0; r < nRows; r++) 958 + { 959 + const char *permission = vpgPQgetvalue(res, r, 0); 960 + if (strcmp(permission, "t") == 0) 961 + canDelete = true; 962 + } 963 + } 964 + vpgPQclear(res); 965 + res = NULL; 966 + 967 + if (canInsert == true && canUpdate == true && canDelete == true) 968 + canInsertUpdateDelete = true; 969 + view->SetGrants(canSelect, canInsertUpdateDelete); 970 +end: 971 + if (res != NULL) 972 + vpgPQclear(res); 973 + free(cuser); 974 + free(cschema); 975 + free(ctable); 976 + sqlite3_free(name); 977 +} 978 + 979 +void MyFrame::DoCreatePostGisSpatialViewTriggers(MyPostgresConn * conn, 980 + MyPostgresSchema * schema, 981 + MyPostgresTable * table) 982 +{ 983 +// 984 +// auto-writing the CREATE TRIGGERS for some PostGIS geometry (writable view) 985 +// 986 + char *sql; 987 + char *prev; 988 + char *ctrigger; 989 + char *xtrigger; 990 + char *ctable; 991 + char *xtable; 992 + char *cview; 993 + char *xview; 994 + char name[1024]; 995 + char *xname; 996 + char *where; 997 + int first; 998 + MyPostgresCol *pC; 999 + MyPostgresColumns *cols; 1000 + char *errMsg = NULL; 1001 + int ret; 1002 + 1003 + InitPostgresPkColumns(conn, schema, table); 1004 + cols = DoGetPostgresColumns(table); 1005 + 1006 +// preparing the INSERT Trigger 1007 + ctable = (char *) malloc(table->GetVirtName().Len() * 4 + 1); 1008 + strcpy(ctable, table->GetVirtName().ToUTF8()); 1009 + xtable = gaiaDoubleQuotedSql(ctable); 1010 + free(ctable); 1011 + cview = (char *) malloc(table->GetPostGisName().Len() * 4 + 1); 1012 + strcpy(cview, table->GetPostGisName().ToUTF8()); 1013 + xview = gaiaDoubleQuotedSql(cview); 1014 + ctrigger = sqlite3_mprintf("%s_trgins", cview); 1015 + free(cview); 1016 + xtrigger = gaiaDoubleQuotedSql(ctrigger); 1017 + sqlite3_free(ctrigger); 1018 + sql = sqlite3_mprintf("CREATE TRIGGER \"%s\"\n\tINSTEAD OF " 1019 + "INSERT ON \"%s\"\nBEGIN\n\tINSERT OR REPLACE INTO \"%s\"\n\t\t(", 1020 + xtrigger, xview, xtable); 1021 + free(xtrigger); 1022 + free(xtable); 1023 + free(xview); 1024 + pC = cols->GetFirst(); 1025 + first = 1; 1026 + while (pC != NULL) 1027 + { 1028 + prev = sql; 1029 + if (first) 1030 + { 1031 + first = 0; 1032 + strcpy(name, pC->GetName().ToUTF8()); 1033 + xname = gaiaDoubleQuotedSql(name); 1034 + sql = sqlite3_mprintf("%s\"%s\"", prev, xname); 1035 + free(xname); 1036 + } else 1037 + { 1038 + strcpy(name, pC->GetName().ToUTF8()); 1039 + xname = gaiaDoubleQuotedSql(name); 1040 + sql = sqlite3_mprintf("%s, \"%s\"", prev, xname); 1041 + free(xname); 1042 + } 1043 + sqlite3_free(prev); 1044 + pC = pC->GetNext(); 1045 + } 1046 + prev = sql; 1047 + sql = sqlite3_mprintf("%s)\n\tVALUES (", prev); 1048 + sqlite3_free(prev); 1049 + pC = cols->GetFirst(); 1050 + first = 1; 1051 + while (pC != NULL) 1052 + { 1053 + strcpy(name, pC->GetName().ToUTF8()); 1054 + xname = gaiaDoubleQuotedSql(name); 1055 + MyPostGisGeometry *geom = table->Find(pC->GetName()); 1056 + prev = sql; 1057 + if (first) 1058 + { 1059 + first = 0; 1060 + if (geom != NULL) 1061 + sql = sqlite3_mprintf("%sAsEWKB(NEW.\"%s\")", prev, xname); 1062 + else 1063 + sql = sqlite3_mprintf("%sNEW.\"%s\"", prev, xname); 1064 + } else 1065 + { 1066 + if (geom != NULL) 1067 + sql = sqlite3_mprintf("%s, AsEWKB(NEW.\"%s\")", prev, xname); 1068 + else 1069 + sql = sqlite3_mprintf("%s, NEW.\"%s\"", prev, xname); 1070 + } 1071 + free(xname); 1072 + sqlite3_free(prev); 1073 + pC = pC->GetNext(); 1074 + } 1075 + prev = sql; 1076 + sql = sqlite3_mprintf("%s);\nEND", prev); 1077 + sqlite3_free(prev); 1078 + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); 1079 + sqlite3_free(sql); 1080 + if (ret != SQLITE_OK) 1081 + { 1082 + wxMessageBox(wxT("CREATE TRIGGER error: ") + wxString::FromUTF8(errMsg), 1083 + wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 1084 + sqlite3_free(errMsg); 1085 + } 1086 +// preparing the UPDATE Trigger 1087 + ctable = (char *) malloc(table->GetVirtName().Len() * 4 + 1); 1088 + strcpy(ctable, table->GetVirtName().ToUTF8()); 1089 + xtable = gaiaDoubleQuotedSql(ctable); 1090 + free(ctable); 1091 + cview = (char *) malloc(table->GetPostGisName().Len() * 4 + 1); 1092 + strcpy(cview, table->GetPostGisName().ToUTF8()); 1093 + xview = gaiaDoubleQuotedSql(cview); 1094 + ctrigger = sqlite3_mprintf("%s_trgupd", cview); 1095 + free(cview); 1096 + xtrigger = gaiaDoubleQuotedSql(ctrigger); 1097 + sqlite3_free(ctrigger); 1098 + sql = sqlite3_mprintf("CREATE TRIGGER \"%s\"\n\tINSTEAD OF " 1099 + "UPDATE OF ", xtrigger); 1100 + free(xtrigger); 1101 + pC = cols->GetFirst(); 1102 + first = 1; 1103 + while (pC != NULL) 1104 + { 1105 + strcpy(name, pC->GetName().ToUTF8()); 1106 + xname = gaiaDoubleQuotedSql(name); 1107 + prev = sql; 1108 + if (first) 1109 + { 1110 + first = 0; 1111 + sql = sqlite3_mprintf("%s\"%s\"", prev, xname); 1112 + } else 1113 + sql = sqlite3_mprintf("%s, \"%s\"", prev, xname); 1114 + free(xname); 1115 + sqlite3_free(prev); 1116 + pC = pC->GetNext(); 1117 + } 1118 + prev = sql; 1119 + sql = 1120 + sqlite3_mprintf("%s\n\tON \"%s\"\nBEGIN\n\tUPDATE \"%s\" SET ", prev, xview, 1121 + xtable); 1122 + sqlite3_free(prev); 1123 + free(xtable); 1124 + free(xview); 1125 + pC = cols->GetFirst(); 1126 + first = 1; 1127 + while (pC != NULL) 1128 + { 1129 + strcpy(name, pC->GetName().ToUTF8()); 1130 + xname = gaiaDoubleQuotedSql(name); 1131 + MyPostGisGeometry *geom = table->Find(pC->GetName()); 1132 + prev = sql; 1133 + if (first) 1134 + { 1135 + first = 0; 1136 + if (geom != NULL) 1137 + sql = 1138 + sqlite3_mprintf("%s\"%s\" = AsEWKB(NEW.\"%s\")", prev, xname, 1139 + xname); 1140 + else 1141 + sql = sqlite3_mprintf("%s\"%s\" = NEW.\"%s\"", prev, xname, xname); 1142 + } else 1143 + { 1144 + if (geom != NULL) 1145 + sql = 1146 + sqlite3_mprintf("%s, \"%s\" = AsEWKB(NEW.\"%s\")", prev, xname, 1147 + xname); 1148 + else 1149 + sql = 1150 + sqlite3_mprintf("%s, \"%s\" = NEW.\"%s\"", prev, xname, xname); 1151 + } 1152 + free(xname); 1153 + sqlite3_free(prev); 1154 + pC = pC->GetNext(); 1155 + } 1156 + prev = sql; 1157 + where = cols->BuildWhere(); 1158 + sql = sqlite3_mprintf("%s\n\t%s;\nEND", prev, where); 1159 + sqlite3_free(prev); 1160 + sqlite3_free(where); 1161 + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); 1162 + sqlite3_free(sql); 1163 + if (ret != SQLITE_OK) 1164 + { 1165 + wxMessageBox(wxT("CREATE TRIGGER error: ") + wxString::FromUTF8(errMsg), 1166 + wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 1167 + sqlite3_free(errMsg); 1168 + } 1169 +// preparing the DELETE Trigger 1170 + ctable = (char *) malloc(table->GetVirtName().Len() * 4 + 1); 1171 + strcpy(ctable, table->GetVirtName().ToUTF8()); 1172 + xtable = gaiaDoubleQuotedSql(ctable); 1173 + free(ctable); 1174 + cview = (char *) malloc(table->GetPostGisName().Len() * 4 + 1); 1175 + strcpy(cview, table->GetPostGisName().ToUTF8()); 1176 + xview = gaiaDoubleQuotedSql(cview); 1177 + ctrigger = sqlite3_mprintf("%s_trgdel", cview); 1178 + free(cview); 1179 + xtrigger = gaiaDoubleQuotedSql(ctrigger); 1180 + sqlite3_free(ctrigger); 1181 + where = cols->BuildWhere(); 1182 + sql = sqlite3_mprintf("CREATE TRIGGER \"%s\"\n\tINSTEAD OF " 1183 + "DELETE ON \"%s\"\nBEGIN\n\tDELETE FROM \"%s\" %s;\nEND", 1184 + xtrigger, xview, xtable, where); 1185 + sqlite3_free(where); 1186 + free(xtrigger); 1187 + free(xtable); 1188 + free(xview); 1189 + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); 1190 + sqlite3_free(sql); 1191 + if (ret != SQLITE_OK) 1192 + { 1193 + wxMessageBox(wxT("CREATE TRIGGER error: ") + wxString::FromUTF8(errMsg), 1194 + wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 1195 + sqlite3_free(errMsg); 1196 + } 1197 + 1198 + delete cols; 1199 +} 1200 + 1201 +MyPostgresColumns *MyFrame::DoGetPostgresColumns(MyPostgresTable * table) 1202 +{ 1203 +// 1204 +// fetching all Columns for a given VirtualPG Table 1205 +// 1206 + MyPostgresColumns *cols = NULL; 1207 + int ret; 1208 + int i; 1209 + char **results; 1210 + int rows; 1211 + int columns; 1212 + char *xtable = (char *) malloc((table->GetVirtName().Len() * 4) + 1); 1213 + strcpy(xtable, table->GetVirtName().ToUTF8()); 1214 + char *sql = sqlite3_mprintf("PRAGMA table_info(%Q)", xtable); 1215 + free(xtable); 1216 + ret = sqlite3_get_table(SqliteHandle, sql, &results, &rows, &columns, NULL); 1217 + sqlite3_free(sql); 1218 + if (ret != SQLITE_OK) 1219 + return NULL; 1220 + if (rows < 1) 1221 + ; 1222 + else 1223 + { 1224 + cols = new MyPostgresColumns(); 1225 + for (i = 1; i <= rows; i++) 1226 + { 1227 + const char *name = results[(i * columns) + 1]; 1228 + wxString sName = wxString::FromUTF8(name); 1229 + cols->Add(sName); 1230 + } 1231 + } 1232 + sqlite3_free_table(results); 1233 + 1234 + MyPostgresPK *pK = table->GetFirstPK(); 1235 + while (pK != NULL) 1236 + { 1237 + // marking all PK Columns 1238 + cols->SetPK(pK->GetName()); 1239 + pK = pK->GetNext(); 1240 + } 1241 + 1242 + if (cols->GetFirst() == NULL) 1243 + { 1244 + // empyt list !!! 1245 + delete cols; 1246 + return NULL; 1247 + } 1248 + return cols; 1249 +} 1250 + 1251 +void MyFrame::DoDropPostgresTables() 1252 +{ 1253 +// 1254 +// attempting to drop any PostgreSQL/PostGIS table 1255 +// 1256 + char *sql; 1257 + char *virt_name; 1258 + char *xvirt_name; 1259 + char *geom_name; 1260 + int ret; 1261 + char *errMsg = NULL; 1262 + MyPostgresConn *pC = PostgresList.GetFirst(); 1263 + while (pC != NULL) 1264 + { 1265 + MyPostgresSchema *pS = pC->GetFirst(); 1266 + while (pS != NULL) 1267 + { 1268 + MyPostgresTable *pT = pS->GetFirstTable(); 1269 + while (pT != NULL) 1270 + { 1271 + if (pT->GetFirst() != NULL) 1272 + { 1273 + // dropping some SpatiaLite-like Spatial View based on a PostgreSQL Table 1274 + virt_name = 1275 + (char *) malloc((pT->GetPostGisName().Len() * 4) + 1); 1276 + strcpy(virt_name, pT->GetPostGisName().ToUTF8()); 1277 + xvirt_name = gaiaDoubleQuotedSql(virt_name); 1278 + free(virt_name); 1279 + sql = 1280 + sqlite3_mprintf("DROP VIEW IF EXISTS main.\"%s\"", 1281 + xvirt_name); 1282 + free(xvirt_name); 1283 + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); 1284 + sqlite3_free(sql); 1285 + if (ret != SQLITE_OK) 1286 + { 1287 + wxMessageBox(wxT("PostGIS wrapper: ") + 1288 + wxString::FromUTF8(errMsg), 1289 + wxT("spatialite_gui"), wxOK | wxICON_ERROR, 1290 + this); 1291 + sqlite3_free(errMsg); 1292 + } 1293 + MyPostGisGeometry *pG = pT->GetFirst(); 1294 + while (pG != NULL) 1295 + { 1296 + // removing from POSTGIS_GEOMETRY_COLUMNS 1297 + virt_name = 1298 + (char *) malloc((pT->GetPostGisName().Len() * 4) + 1); 1299 + strcpy(virt_name, pT->GetPostGisName().ToUTF8()); 1300 + geom_name = 1301 + (char *) malloc((pG->GetName().Len() * 4) + 1); 1302 + strcpy(geom_name, pG->GetName().ToUTF8()); 1303 + sql = 1304 + sqlite3_mprintf 1305 + ("DELETE FROM temp.postgis_geometry_columns " 1306 + "WHERE f_table_name = %Q AND f_geometry_column = %Q", 1307 + virt_name, geom_name); 1308 + free(virt_name); 1309 + free(geom_name); 1310 + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); 1311 + sqlite3_free(sql); 1312 + if (ret != SQLITE_OK) 1313 + { 1314 + wxMessageBox(wxT("PostGIS wrapper: ") + 1315 + wxString::FromUTF8(errMsg), 1316 + wxT("spatialite_gui"), 1317 + wxOK | wxICON_ERROR, this); 1318 + sqlite3_free(errMsg); 1319 + } 1320 + pG = pG->GetNext(); 1321 + } 1322 + } 1323 + // dropping some VirtualPG Table 1324 + virt_name = (char *) malloc((pT->GetVirtName().Len() * 4) + 1); 1325 + strcpy(virt_name, pT->GetVirtName().ToUTF8()); 1326 + xvirt_name = gaiaDoubleQuotedSql(virt_name); 1327 + free(virt_name); 1328 + sql = 1329 + sqlite3_mprintf("DROP TABLE IF EXISTS main.\"%s\"", xvirt_name); 1330 + free(xvirt_name); 1331 + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); 1332 + sqlite3_free(sql); 1333 + if (ret != SQLITE_OK) 1334 + { 1335 + wxMessageBox(wxT("PostgreSQL wrapper: ") + 1336 + wxString::FromUTF8(errMsg), 1337 + wxT("spatialite_gui"), wxOK | wxICON_ERROR, 1338 + this); 1339 + sqlite3_free(errMsg); 1340 + } 1341 + pT = pT->GetNext(); 1342 + } 1343 + MyPostgresView *pV = pS->GetFirstView(); 1344 + while (pV != NULL) 1345 + { 1346 + // dropping some VirtualPG View 1347 + virt_name = (char *) malloc((pV->GetVirtName().Len() * 4) + 1); 1348 + strcpy(virt_name, pV->GetVirtName().ToUTF8()); 1349 + xvirt_name = gaiaDoubleQuotedSql(virt_name); 1350 + free(virt_name); 1351 + sql = 1352 + sqlite3_mprintf("DROP TABLE IF EXISTS main.\"%s\"", xvirt_name); 1353 + free(xvirt_name); 1354 + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); 1355 + sqlite3_free(sql); 1356 + if (ret != SQLITE_OK) 1357 + { 1358 + wxMessageBox(wxT("PostgreSQL wrapper: ") + 1359 + wxString::FromUTF8(errMsg), 1360 + wxT("spatialite_gui"), wxOK | wxICON_ERROR, 1361 + this); 1362 + sqlite3_free(errMsg); 1363 + } 1364 + pV = pV->GetNext(); 1365 + } 1366 + pS = pS->GetNext(); 1367 + } 1368 + pC = pC->GetNext(); 1369 + } 1370 +} 1371 + 1372 +bool MyFrame::DoClosePostgreSqlConn(wxString & host, wxString & hostaddr, 1373 + int port, wxString & dbname, 1374 + wxString & user) 1375 +{ 1376 +// 1377 +// attempting to close a single connection to PostgreSQL 1378 +// 1379 + char *sql; 1380 + char *virt_name; 1381 + char *xvirt_name; 1382 + char *geom_name; 1383 + int ret; 1384 + char *errMsg = NULL; 1385 + MyPostgresConn *conn = NULL; 1386 + MyPostgresConn *pC = PostgresList.GetFirst(); 1387 + while (pC != NULL) 1388 + { 1389 + if (pC->GetHost().Cmp(host) == 0 && pC->GetHostAddr().Cmp(hostaddr) == 0 1390 + && pC->GetPort() == port && pC->GetDbName().Cmp(dbname) == 0 1391 + && pC->GetUser().Cmp(user) == 0) 1392 + conn = pC; 1393 + pC = pC->GetNext(); 1394 + } 1395 + if (conn == NULL) 1396 + return false; 1397 + 1398 + pC = conn; 1399 + MyPostgresSchema *pS = pC->GetFirst(); 1400 + while (pS != NULL) 1401 + { 1402 + MyPostgresTable *pT = pS->GetFirstTable(); 1403 + while (pT != NULL) 1404 + { 1405 + if (pT->GetFirst() != NULL) 1406 + { 1407 + // dropping some SpatiaLite-like Spatial View based on a PostgreSQL Table 1408 + virt_name = (char *) malloc((pT->GetPostGisName().Len() * 4) + 1); 1409 + strcpy(virt_name, pT->GetPostGisName().ToUTF8()); 1410 + xvirt_name = gaiaDoubleQuotedSql(virt_name); 1411 + free(virt_name); 1412 + sql = 1413 + sqlite3_mprintf("DROP VIEW IF EXISTS main.\"%s\"", xvirt_name); 1414 + free(xvirt_name); 1415 + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); 1416 + sqlite3_free(sql); 1417 + if (ret != SQLITE_OK) 1418 + { 1419 + wxMessageBox(wxT("PostGIS wrapper: ") + 1420 + wxString::FromUTF8(errMsg), 1421 + wxT("spatialite_gui"), wxOK | wxICON_ERROR, 1422 + this); 1423 + sqlite3_free(errMsg); 1424 + } 1425 + MyPostGisGeometry *pG = pT->GetFirst(); 1426 + while (pG != NULL) 1427 + { 1428 + // removing from POSTGIS_GEOMETRY_COLUMNS 1429 + virt_name = 1430 + (char *) malloc((pT->GetPostGisName().Len() * 4) + 1); 1431 + strcpy(virt_name, pT->GetPostGisName().ToUTF8()); 1432 + geom_name = (char *) malloc((pG->GetName().Len() * 4) + 1); 1433 + strcpy(geom_name, pG->GetName().ToUTF8()); 1434 + sql = 1435 + sqlite3_mprintf("DELETE FROM temp.postgis_geometry_columns " 1436 + "WHERE f_table_name = %Q AND f_geometry_column = %Q", 1437 + virt_name, geom_name); 1438 + free(virt_name); 1439 + free(geom_name); 1440 + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); 1441 + sqlite3_free(sql); 1442 + if (ret != SQLITE_OK) 1443 + { 1444 + wxMessageBox(wxT("PostGIS wrapper: ") + 1445 + wxString::FromUTF8(errMsg), 1446 + wxT("spatialite_gui"), wxOK | wxICON_ERROR, 1447 + this); 1448 + sqlite3_free(errMsg); 1449 + } 1450 + pG = pG->GetNext(); 1451 + } 1452 + } 1453 + // dropping some VirtualPG Table 1454 + virt_name = (char *) malloc((pT->GetVirtName().Len() * 4) + 1); 1455 + strcpy(virt_name, pT->GetVirtName().ToUTF8()); 1456 + xvirt_name = gaiaDoubleQuotedSql(virt_name); 1457 + free(virt_name); 1458 + sql = sqlite3_mprintf("DROP TABLE IF EXISTS main.\"%s\"", xvirt_name); 1459 + free(xvirt_name); 1460 + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); 1461 + sqlite3_free(sql); 1462 + if (ret != SQLITE_OK) 1463 + { 1464 + wxMessageBox(wxT("PostgreSQL wrapper: ") + 1465 + wxString::FromUTF8(errMsg), 1466 + wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 1467 + sqlite3_free(errMsg); 1468 + } 1469 + pT = pT->GetNext(); 1470 + } 1471 + MyPostgresView *pV = pS->GetFirstView(); 1472 + while (pV != NULL) 1473 + { 1474 + // dropping some VirtualPG View 1475 + virt_name = (char *) malloc((pV->GetVirtName().Len() * 4) + 1); 1476 + strcpy(virt_name, pV->GetVirtName().ToUTF8()); 1477 + xvirt_name = gaiaDoubleQuotedSql(virt_name); 1478 + free(virt_name); 1479 + sql = sqlite3_mprintf("DROP TABLE IF EXISTS main.\"%s\"", xvirt_name); 1480 + free(xvirt_name); 1481 + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); 1482 + sqlite3_free(sql); 1483 + if (ret != SQLITE_OK) 1484 + { 1485 + wxMessageBox(wxT("PostgreSQL wrapper: ") + 1486 + wxString::FromUTF8(errMsg), 1487 + wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 1488 + sqlite3_free(errMsg); 1489 + } 1490 + pV = pV->GetNext(); 1491 + } 1492 + pS = pS->GetNext(); 1493 + } 1494 +// removing the connection from the list 1495 + PostgresList.Remove(conn); 1496 + return true; 1497 +} 1498 + 1499 +bool MyFrame::DoCheckPostGisGeometry(wxString & virtName, wxString & columnName) 1500 +{ 1501 +// 1502 +// checking for a PostGIS Geometry column (wrapping View) 1503 +// 1504 + MyPostgresConn *pC = PostgresList.GetFirst(); 1505 + while (pC != NULL) 1506 + { 1507 + MyPostgresSchema *pS = pC->GetFirst(); 1508 + while (pS != NULL) 1509 + { 1510 + MyPostgresTable *pT = pS->GetFirstTable(); 1511 + while (pT != NULL) 1512 + { 1513 + if (pT->GetPostGisName().Cmp(virtName) == 0) 1514 + { 1515 + MyPostGisGeometry *pG = pT->GetFirst(); 1516 + while (pG != NULL) 1517 + { 1518 + if (pG->GetName().Cmp(columnName) == 0) 1519 + return true; 1520 + pG = pG->GetNext(); 1521 + } 1522 + } 1523 + pT = pT->GetNext(); 1524 + } 1525 + pS = pS->GetNext(); 1526 + } 1527 + pC = pC->GetNext(); 1528 + } 1529 + return false; 1530 +} 1531 + 1532 +void MyFrame::InitPostgresPkColumns(MyPostgresConn * conn, 1533 + MyPostgresSchema * schema, 1534 + MyPostgresTable * table) 1535 +{ 1536 +// 1537 +// attempting to initialize the PK columns for a PostgreSQL Table 1538 +// 1539 + PGconn *pg_conn; 1540 + PGresult *res; 1541 + int nRows; 1542 + int nFields; 1543 + const char *obj; 1544 + const char *schema_name; 1545 + const char *table_name; 1546 + const char *geometry; 1547 + const char *type; 1548 + int r; 1549 + char *connection_string; 1550 + 1551 + if (table->IsPkAlreadyChecked() == true) 1552 + return; // already initialized 1553 + 1554 +// attempting to establish a connection to Postgres 1555 + connection_string = 1556 + (char *) malloc((conn->GetConnectionString().Len() * 4) + 1); 1557 + strcpy(connection_string, conn->GetConnectionString().ToUTF8()); 1558 + 1559 + pg_conn = vpgPQconnectdb(connection_string); 1560 + if (vpgPQstatus(pg_conn) != CONNECTION_OK) 1561 + { 1562 + char *msg = sqlite3_mprintf("Connection to Postgres failed: %s", 1563 + vpgPQerrorMessage(pg_conn)); 1564 + wxMessageBox(wxString::FromUTF8(msg), 1565 + wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 1566 + sqlite3_free(msg); 1567 + vpgPQfinish(pg_conn); 1568 + free(connection_string); 1569 + return; 1570 + } 1571 + free(connection_string); 1572 + 1573 +// querying the PK columns 1574 + char *pg_schema = (char *) malloc(schema->GetName().Len() * 4 + 1); 1575 + strcpy(pg_schema, schema->GetName().ToUTF8()); 1576 + char *pg_table = (char *) malloc(table->GetName().Len() * 4 + 1); 1577 + strcpy(pg_table, table->GetName().ToUTF8()); 1578 + char *sql = 1579 + sqlite3_mprintf 1580 + ("SELECT a.attname FROM pg_index AS i " 1581 + "JOIN pg_attribute AS a ON (a.attrelid = i.indrelid AND a.attnum = ANY(i.indkey)) " 1582 + "WHERE i.indrelid = '%s.%s'::regclass AND i.indisprimary", pg_schema, 1583 + pg_table); 1584 + free(pg_schema); 1585 + free(pg_table); 1586 + res = vpgPQexec(pg_conn, sql); 1587 + sqlite3_free(sql); 1588 + if (vpgPQresultStatus(res) != PGRES_TUPLES_OK) 1589 + goto err; 1590 + nRows = vpgPQntuples(res); 1591 + nFields = vpgPQnfields(res); 1592 + if (nRows > 0 && nFields == 1) 1593 + { 1594 + for (r = 0; r < nRows; r++) 1595 + { 1596 + const char *col_name = vpgPQgetvalue(res, r, 0); 1597 + wxString column = wxString::FromUTF8(col_name); 1598 + table->AddPK(column); 1599 + } 1600 + } 1601 + vpgPQclear(res); 1602 + vpgPQfinish(pg_conn); 1603 + table->SetPkChecked(); 1604 + return; 1605 + 1606 +err: 1607 +// something has gone the wrong way 1608 + if (res != NULL) 1609 + vpgPQclear(res); 1610 + vpgPQfinish(pg_conn); 1611 +} 1612 + 1613 +void MyFrame::InitPostgresPks(void *conn, 1614 + MyPostgresSchema * schema, 1615 + MyPostgresTable * table) 1616 +{ 1617 +// 1618 +// attempting to initialize the PK columns for a PostgreSQL Table 1619 +// 1620 + PGconn *pg_conn = (PGconn *) conn; 1621 + PGresult *res; 1622 + int nRows; 1623 + int nFields; 1624 + const char *obj; 1625 + const char *schema_name; 1626 + const char *table_name; 1627 + const char *geometry; 1628 + const char *type; 1629 + int r; 1630 + char *connection_string; 1631 + 1632 + if (table->IsPkAlreadyChecked() == true) 1633 + return; // already initialized 1634 + 1635 +// querying the PK columns 1636 + char *pg_schema = (char *) malloc(schema->GetName().Len() * 4 + 1); 1637 + strcpy(pg_schema, schema->GetName().ToUTF8()); 1638 + char *pg_table = (char *) malloc(table->GetName().Len() * 4 + 1); 1639 + strcpy(pg_table, table->GetName().ToUTF8()); 1640 + char *sql = 1641 + sqlite3_mprintf 1642 + ("SELECT a.attname FROM pg_index AS i " 1643 + "JOIN pg_attribute AS a ON (a.attrelid = i.indrelid AND a.attnum = ANY(i.indkey)) " 1644 + "WHERE i.indrelid = '%s.%s'::regclass AND i.indisprimary", pg_schema, 1645 + pg_table); 1646 + free(pg_schema); 1647 + free(pg_table); 1648 + res = vpgPQexec(pg_conn, sql); 1649 + sqlite3_free(sql); 1650 + if (vpgPQresultStatus(res) != PGRES_TUPLES_OK) 1651 + return; 1652 + nRows = vpgPQntuples(res); 1653 + nFields = vpgPQnfields(res); 1654 + if (nRows > 0 && nFields == 1) 1655 + { 1656 + for (r = 0; r < nRows; r++) 1657 + { 1658 + const char *col_name = vpgPQgetvalue(res, r, 0); 1659 + wxString column = wxString::FromUTF8(col_name); 1660 + table->AddPK(column); 1661 + } 1662 + } 1663 + vpgPQclear(res); 1664 + table->SetPkChecked(); 1665 +} 1666 + 1667 +char *MyFrame::DropPostgreSqlOrphans() 1668 +{ 1669 +// 1670 +// attempting to Drop all PostgreSql Orphans 1671 +// 1672 + int ret; 1673 + int i; 1674 + char **results; 1675 + int rows; 1676 + int columns; 1677 + char *errMsg = NULL; 1678 + int first = 1; 1679 + char *sql_statement = NULL; 1680 + char *prev; 1681 + bool ok = false; 1682 + 1683 +// fetching all candidate Tables 1684 + const char *sql = "SELECT name FROM sqlite_master " 1685 + "WHERE type = 'table' AND name LIKE 'vpg_%' AND sql LIKE '%Using VirtualPostgres%'"; 1686 + ret = 1687 + sqlite3_get_table(SqliteHandle, sql, &results, &rows, &columns, &errMsg); 1688 + if (ret != SQLITE_OK) 1689 + goto error; 1690 + if (rows < 1) 1691 + ; 1692 + else 1693 + { 1694 + for (i = 1; i <= rows; i++) 1695 + { 1696 + const char *name = results[(i * columns) + 0]; 1697 + wxString xName = wxString::FromUTF8(name); 1698 + if (PostgresList.FindTable(NULL, xName) == NULL) 1699 + { 1700 + // found an Orphan Table - to be dropped 1701 + char *x_name = gaiaDoubleQuotedSql(name); 1702 + if (first) 1703 + { 1704 + first = 0; 1705 + sql_statement = 1706 + sqlite3_mprintf("BEGIN;\n;DROP TABLE MAIN.\"%s\";\n", 1707 + x_name); 1708 + } else 1709 + { 1710 + prev = sql_statement; 1711 + sql_statement = 1712 + sqlite3_mprintf("%sDROP TABLE MAIN.\"%s\";\n", prev, 1713 + x_name); 1714 + sqlite3_free(prev); 1715 + } 1716 + free(x_name); 1717 + ok = true; 1718 + } 1719 + } 1720 + } 1721 + sqlite3_free_table(results); 1722 + 1723 + 1724 +// fetching all candidate Views 1725 + sql = "SELECT name FROM sqlite_master " 1726 + "WHERE type = 'view' AND name LIKE 'vpg_%' AND sql LIKE '%GeomFromEWKB%'"; 1727 + ret = 1728 + sqlite3_get_table(SqliteHandle, sql, &results, &rows, &columns, &errMsg); 1729 + if (ret != SQLITE_OK) 1730 + goto error; 1731 + if (rows < 1) 1732 + ; 1733 + else 1734 + { 1735 + for (i = 1; i <= rows; i++) 1736 + { 1737 + const char *name = results[(i * columns) + 0]; 1738 + wxString xName = wxString::FromUTF8(name); 1739 + if (PostgresList.FindPostGisView(NULL, xName) == NULL) 1740 + { 1741 + // found an Orphan View - to be dropped 1742 + char *x_name = gaiaDoubleQuotedSql(name); 1743 + if (first) 1744 + { 1745 + first = 0; 1746 + sql_statement = 1747 + sqlite3_mprintf("BEGIN;\n;DROP VIEW MAIN.\"%s\";\n", 1748 + x_name); 1749 + } else 1750 + { 1751 + prev = sql_statement; 1752 + sql_statement = 1753 + sqlite3_mprintf("%sDROP VIEW MAIN.\"%s\";\n", prev, x_name); 1754 + sqlite3_free(prev); 1755 + } 1756 + free(x_name); 1757 + ok = true; 1758 + } 1759 + } 1760 + } 1761 + sqlite3_free_table(results); 1762 + if (ok == false) 1763 + return NULL; 1764 +// committing the transaction 1765 + prev = sql_statement; 1766 + sql_statement = sqlite3_mprintf("%sCOMMIT;\n", prev); 1767 + sqlite3_free(prev); 1768 + return sql_statement; 1769 + 1770 +error: 1771 + wxMessageBox(wxT("SQLite SQL error: ") + wxString::FromUTF8(errMsg), 1772 + wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 1773 + sqlite3_free(errMsg); 1774 + return NULL; 1775 +} 1776 + 1777 +bool PostgresConnectionDialog::Create(MyFrame * parent) 1778 +{ 1779 +// 1780 +// creating the dialog 1781 +// 1782 + MainFrame = parent; 1783 + if (wxDialog::Create(parent, wxID_ANY, wxT("Connecting to PostgreSQL")) == 1784 + false) 1785 + return false; 1786 +// populates individual controls 1787 + CreateControls(); 1788 +// sets dialog sizer 1789 + GetSizer()->Fit(this); 1790 + GetSizer()->SetSizeHints(this); 1791 +// centers the dialog window 1792 + Centre(); 1793 + return true; 1794 +} 1795 + 1796 +void PostgresConnectionDialog::CreateControls() 1797 +{ 1798 +// 1799 +// creating individual control and setting initial values 1800 +// 1801 + wxString user = wxGetUserId(); 1802 + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 1803 + this->SetSizer(topSizer); 1804 + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 1805 + topSizer->Add(boxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 1806 +// first row: HOST 1807 + wxBoxSizer *hostSizer = new wxBoxSizer(wxHORIZONTAL); 1808 + boxSizer->Add(hostSizer, 0, wxALIGN_RIGHT | wxALL, 5); 1809 + wxStaticText *hostLabel = 1810 + new wxStaticText(this, wxID_STATIC, wxT("Host Name")); 1811 + hostSizer->Add(hostLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1812 + wxTextCtrl *hostCtrl = new wxTextCtrl(this, ID_POSTGRES_HOST, 1813 + wxT("localhost"), wxDefaultPosition, 1814 + wxSize(250, 22)); 1815 + hostSizer->Add(hostCtrl, 0, wxALIGN_RIGHT | wxALL, 0); 1816 +// second row: HOSTADDR 1817 + wxBoxSizer *addrSizer = new wxBoxSizer(wxHORIZONTAL); 1818 + boxSizer->Add(addrSizer, 0, wxALIGN_RIGHT | wxALL, 5); 1819 + wxStaticText *addrLabel = 1820 + new wxStaticText(this, wxID_STATIC, wxT("Host Address")); 1821 + addrSizer->Add(addrLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1822 + wxTextCtrl *addrCtrl = new wxTextCtrl(this, ID_POSTGRES_HOSTADDR, 1823 + wxT("127.0.0.1"), wxDefaultPosition, 1824 + wxSize(250, 22)); 1825 + addrSizer->Add(addrCtrl, 0, wxALIGN_RIGHT | wxALL, 0); 1826 +// third row: PORT 1827 + wxBoxSizer *portSizer = new wxBoxSizer(wxHORIZONTAL); 1828 + boxSizer->Add(portSizer, 0, wxALIGN_RIGHT | wxALL, 5); 1829 + wxStaticText *portLabel = new wxStaticText(this, wxID_STATIC, wxT("Port:")); 1830 + portSizer->Add(portLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1831 + wxSpinCtrl *portCtrl = new wxSpinCtrl(this, ID_POSTGRES_PORT, wxT("5432"), 1832 + wxDefaultPosition, wxSize(80, 20), 1833 + wxSP_ARROW_KEYS, 1834 + 0, 65535, 5432); 1835 + portSizer->Add(portCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1836 +// fourth row: DBNAME 1837 + wxBoxSizer *dbSizer = new wxBoxSizer(wxHORIZONTAL); 1838 + boxSizer->Add(dbSizer, 0, wxALIGN_RIGHT | wxALL, 5); 1839 + wxStaticText *dbLabel = new wxStaticText(this, wxID_STATIC, wxT("DB Name")); 1840 + dbSizer->Add(dbLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1841 + wxTextCtrl *dbCtrl = new wxTextCtrl(this, ID_POSTGRES_DBNAME, 1842 + user, wxDefaultPosition, 1843 + wxSize(250, 22)); 1844 + dbSizer->Add(dbCtrl, 0, wxALIGN_RIGHT | wxALL, 0); 1845 +// fifth row: USER 1846 + wxBoxSizer *userSizer = new wxBoxSizer(wxHORIZONTAL); 1847 + boxSizer->Add(userSizer, 0, wxALIGN_RIGHT | wxALL, 5); 1848 + wxStaticText *userLabel = new wxStaticText(this, wxID_STATIC, wxT("User")); 1849 + userSizer->Add(userLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1850 + wxTextCtrl *userCtrl = new wxTextCtrl(this, ID_POSTGRES_USER, 1851 + user, wxDefaultPosition, 1852 + wxSize(250, 22)); 1853 + userSizer->Add(userCtrl, 0, wxALIGN_RIGHT | wxALL, 0); 1854 +// sixth row: PASSWORD 1855 + wxBoxSizer *pwdSizer = new wxBoxSizer(wxHORIZONTAL); 1856 + boxSizer->Add(pwdSizer, 0, wxALIGN_RIGHT | wxALL, 5); 1857 + wxStaticText *pwdLabel = new wxStaticText(this, wxID_STATIC, wxT("Password")); 1858 + pwdSizer->Add(pwdLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1859 + wxTextCtrl *pwdCtrl = new wxTextCtrl(this, ID_POSTGRES_PASSWORD, 1860 + wxT(""), wxDefaultPosition, 1861 + wxSize(250, 22), wxTE_PASSWORD); 1862 + pwdSizer->Add(pwdCtrl, 0, wxALIGN_RIGHT | wxALL, 0); 1863 +// seventh row: Options 1864 + wxBoxSizer *optSizer = new wxBoxSizer(wxHORIZONTAL); 1865 + boxSizer->Add(optSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1866 + wxString rdonly[2]; 1867 + rdonly[0] = wxT("Read Only"); 1868 + rdonly[1] = wxT("Read && Write"); 1869 + wxRadioBox *rdonly_sel = new wxRadioBox(this, ID_POSTGRES_RDONLY, 1870 + wxT("Connection Mode"), 1871 + wxDefaultPosition, 1872 + wxDefaultSize, 2, 1873 + rdonly, 2, 1874 + wxRA_SPECIFY_ROWS); 1875 + rdonly_sel->SetSelection(0); 1876 + optSizer->Add(rdonly_sel, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 1877 + 1878 + 1879 + wxString textdates[2]; 1880 + textdates[0] = wxT("as Julian Day numbers"); 1881 + textdates[1] = wxT("as PlainText strings"); 1882 + wxRadioBox *textdates_sel = new wxRadioBox(this, ID_POSTGRES_TEXTDATES, 1883 + wxT("&DATE/TIME values"), 1884 + wxDefaultPosition, 1885 + wxDefaultSize, 2, 1886 + textdates, 2, 1887 + wxRA_SPECIFY_ROWS); 1888 + textdates_sel->SetSelection(1); 1889 + optSizer->Add(textdates_sel, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 1890 +// OK - CANCEL buttons 1891 + wxBoxSizer *okCancelBox = new wxBoxSizer(wxHORIZONTAL); 1892 + boxSizer->Add(okCancelBox, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1893 + wxButton *ok = new wxButton(this, wxID_OK, wxT("&Connect")); 1894 + okCancelBox->Add(ok, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1895 + wxButton *cancel = new wxButton(this, wxID_CANCEL, wxT("&Cancel")); 1896 + okCancelBox->Add(cancel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1897 +// appends event handler for OK button 1898 + Connect(wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, 1899 + (wxObjectEventFunction) & PostgresConnectionDialog::OnOk); 1900 +} 1901 + 1902 +void PostgresConnectionDialog::OnOk(wxCommandEvent & WXUNUSED(event)) 1903 +{ 1904 +// 1905 +// all done: 1906 +// 1907 + wxTextCtrl *hostCtrl = (wxTextCtrl *) FindWindow(ID_POSTGRES_HOST); 1908 + wxTextCtrl *addrCtrl = (wxTextCtrl *) FindWindow(ID_POSTGRES_HOSTADDR); 1909 + wxSpinCtrl *portCtrl = (wxSpinCtrl *) FindWindow(ID_POSTGRES_PORT); 1910 + wxTextCtrl *dbCtrl = (wxTextCtrl *) FindWindow(ID_POSTGRES_DBNAME); 1911 + wxTextCtrl *userCtrl = (wxTextCtrl *) FindWindow(ID_POSTGRES_USER); 1912 + wxTextCtrl *pwdCtrl = (wxTextCtrl *) FindWindow(ID_POSTGRES_PASSWORD); 1913 + wxRadioBox *rdonly_sel = (wxRadioBox *) FindWindow(ID_POSTGRES_RDONLY); 1914 + wxRadioBox *textdates_sel = (wxRadioBox *) FindWindow(ID_POSTGRES_TEXTDATES); 1915 + wxString value = hostCtrl->GetValue(); 1916 + if (host != NULL) 1917 + free(host); 1918 + if (value.Len() == 0) 1919 + host = NULL; 1920 + else 1921 + { 1922 + host = (char *) malloc(value.Len() * 4 + 1); 1923 + strcpy(host, value.ToUTF8()); 1924 + } 1925 + value = addrCtrl->GetValue(); 1926 + if (hostaddr != NULL) 1927 + free(hostaddr); 1928 + if (value.Len() == 0) 1929 + hostaddr = NULL; 1930 + else 1931 + { 1932 + hostaddr = (char *) malloc(value.Len() * 4 + 1); 1933 + strcpy(hostaddr, value.ToUTF8()); 1934 + } 1935 + port = portCtrl->GetValue(); 1936 + value = dbCtrl->GetValue(); 1937 + if (dbname != NULL) 1938 + free(dbname); 1939 + if (value.Len() == 0) 1940 + dbname = NULL; 1941 + else 1942 + { 1943 + dbname = (char *) malloc(value.Len() * 4 + 1); 1944 + strcpy(dbname, value.ToUTF8()); 1945 + } 1946 + value = userCtrl->GetValue(); 1947 + if (user != NULL) 1948 + free(user); 1949 + if (value.Len() == 0) 1950 + user = NULL; 1951 + else 1952 + { 1953 + user = (char *) malloc(value.Len() * 4 + 1); 1954 + strcpy(user, value.ToUTF8()); 1955 + } 1956 + value = pwdCtrl->GetValue(); 1957 + if (password != NULL) 1958 + free(password); 1959 + if (value.Len() == 0) 1960 + password = NULL; 1961 + else 1962 + { 1963 + password = (char *) malloc(value.Len() * 4 + 1); 1964 + strcpy(password, value.ToUTF8()); 1965 + } 1966 + if (rdonly_sel->GetSelection() == 0) 1967 + ReadOnly = true; 1968 + else 1969 + ReadOnly = false; 1970 + if (textdates_sel->GetSelection() == 0) 1971 + TextDates = false; 1972 + else 1973 + TextDates = true; 1974 + wxDialog::EndModal(wxID_OK); 1975 +} 1976 + 1977 +MyPostGisGeometry::MyPostGisGeometry(wxString & name, wxString & type, int srid, 1978 + int dims) 1979 +{ 1980 +// ctor 1981 + Name = name; 1982 + GeomType = type; 1983 + MultiType = false; 1984 + Srid = srid; 1985 + Dims = dims; 1986 + if (type.Len() == 0) 1987 + return; 1988 + if (type.Cmp(wxT("MULTIPOINT")) == 0) 1989 + MultiType = true; 1990 + if (type.Cmp(wxT("MULTILINESTRING")) == 0) 1991 + MultiType = true; 1992 + if (type.Cmp(wxT("MULTIPOLYGON")) == 0) 1993 + MultiType = true; 1994 + Next = NULL; 1995 +} 1996 + 1997 +MyPostgresTable::MyPostgresTable(wxString & name) 1998 +{ 1999 +// ctor 2000 + Name = name; 2001 + PkChecked = false; 2002 + GrantSelect = false; 2003 + GrantInsertUpdateDelete = false; 2004 + FirstPK = NULL; 2005 + LastPK = NULL; 2006 + First = NULL; 2007 + Last = NULL; 2008 + Next = NULL; 2009 +} 2010 + 2011 +MyPostgresTable::~MyPostgresTable() 2012 +{ 2013 +// dtor 2014 + MyPostGisGeometry *pG; 2015 + MyPostGisGeometry *pGn; 2016 + MyPostgresPK *pK; 2017 + MyPostgresPK *pKn; 2018 + pG = First; 2019 + while (pG != NULL) 2020 + { 2021 + pGn = pG->GetNext(); 2022 + delete pG; 2023 + pG = pGn; 2024 + } 2025 + pK = FirstPK; 2026 + while (pK != NULL) 2027 + { 2028 + pKn = pK->GetNext(); 2029 + delete pK; 2030 + pK = pKn; 2031 + } 2032 +} 2033 + 2034 +void MyPostgresTable::AddPK(wxString & name) 2035 +{ 2036 +// adding a PostgreSQL PK column 2037 + MyPostgresPK *pK = FirstPK; 2038 + while (pK != NULL) 2039 + { 2040 + if (pK->GetName().Cmp(name) == 0) 2041 + return; // already defined 2042 + pK = pK->GetNext(); 2043 + } 2044 + 2045 +// inserting a new PostgreSQL PK column 2046 + pK = new MyPostgresPK(name); 2047 + if (FirstPK == NULL) 2048 + FirstPK = pK; 2049 + if (LastPK != NULL) 2050 + LastPK->SetNext(pK); 2051 + LastPK = pK; 2052 +} 2053 + 2054 +void MyPostgresTable::Add(wxString & geometry, wxString & type, int srid, 2055 + int dims) 2056 +{ 2057 +// 2058 +// adding a PostGIS geometry to a Table 2059 +// 2060 + bool is_multi = false; 2061 + if (type.Len() == 0) 2062 + return; 2063 + if (type.Cmp(wxT("MULTIPOINT")) == 0) 2064 + is_multi = true; 2065 + if (type.Cmp(wxT("MULTILINESTRING")) == 0) 2066 + is_multi = true; 2067 + if (type.Cmp(wxT("MULTIPOLYGON")) == 0) 2068 + is_multi = true; 2069 + 2070 + if (geometry.Len() == 0) 2071 + return; 2072 + 2073 + MyPostGisGeometry *pG = First; 2074 + while (pG != NULL) 2075 + { 2076 + if (pG->GetName().Cmp(geometry) == 0) 2077 + return; // already defined 2078 + pG = pG->GetNext(); 2079 + } 2080 + 2081 +// inserting a new PostGIS geometry 2082 + pG = new MyPostGisGeometry(geometry, type, srid, dims); 2083 + if (First == NULL) 2084 + First = pG; 2085 + if (Last != NULL) 2086 + Last->SetNext(pG); 2087 + Last = pG; 2088 +} 2089 + 2090 +bool MyPostgresTable::IsPkColumn(wxString & name) 2091 +{ 2092 +// checks if a PostgreSQL Column is a PK column 2093 + MyPostgresPK *pK = FirstPK; 2094 + while (pK != NULL) 2095 + { 2096 + if (pK->GetName().Cmp(name) == 0) 2097 + return true; 2098 + pK = pK->GetNext(); 2099 + } 2100 + return false; 2101 +} 2102 + 2103 +bool MyPostgresTable::HasPK() 2104 +{ 2105 +// checks if a PostgreSQL Table has any PK column 2106 + if (FirstPK == NULL) 2107 + return false; 2108 + return true; 2109 +} 2110 + 2111 +MyPostGisGeometry *MyPostgresTable::Find(wxString & name) 2112 +{ 2113 +// attempting to find a Geometry Column 2114 + MyPostGisGeometry *pG = First; 2115 + while (pG != NULL) 2116 + { 2117 + if (pG->GetName().Cmp(name) == 0) 2118 + return pG; 2119 + pG = pG->GetNext(); 2120 + } 2121 + return NULL; 2122 +} 2123 + 2124 +MyPostgresView::MyPostgresView(wxString & name) 2125 +{ 2126 +// ctor 2127 + Name = name; 2128 + GrantSelect = false; 2129 + GrantInsertUpdateDelete = false; 2130 + Next = NULL; 2131 +} 2132 + 2133 +MyPostgresSchema::MyPostgresSchema(wxString & name) 2134 +{ 2135 +// ctor 2136 + Name = name; 2137 + FirstTable = NULL; 2138 + LastTable = NULL; 2139 + CurrentTable = NULL; 2140 + FirstView = NULL; 2141 + LastView = NULL; 2142 + Next = NULL; 2143 +} 2144 + 2145 +MyPostgresSchema::~MyPostgresSchema() 2146 +{ 2147 +// dtor 2148 + MyPostgresTable *pT; 2149 + MyPostgresTable *pTn; 2150 + MyPostgresView *pV; 2151 + MyPostgresView *pVn; 2152 + pT = FirstTable; 2153 + while (pT != NULL) 2154 + { 2155 + pTn = pT->GetNext(); 2156 + delete pT; 2157 + pT = pTn; 2158 + } 2159 + pV = FirstView; 2160 + while (pV != NULL) 2161 + { 2162 + pVn = pV->GetNext(); 2163 + delete pV; 2164 + pV = pVn; 2165 + } 2166 +} 2167 + 2168 +void MyPostgresSchema::Add(wxString & name, wxString & geometry, 2169 + wxString & type, int srid, int dims) 2170 +{ 2171 +// 2172 +// adding a Table to a Schema 2173 +// 2174 + MyPostgresTable *pT = CurrentTable; 2175 + if (pT != NULL) 2176 + { 2177 + if (pT->GetName().Cmp(name) == 0) 2178 + { 2179 + // continuing with the current table 2180 + if (geometry.Len() > 0 && type.Len() > 0) 2181 + pT->Add(geometry, type, srid, dims); 2182 + return; 2183 + } 2184 + } 2185 + 2186 + pT = FirstTable; 2187 + while (pT != NULL) 2188 + { 2189 + if (pT->GetName().Cmp(name) == 0) 2190 + { 2191 + // already defined 2192 + if (geometry.Len() > 0 && type.Len() > 0) 2193 + pT->Add(geometry, type, srid, dims); 2194 + return; 2195 + } 2196 + pT = pT->GetNext(); 2197 + } 2198 + 2199 +// adding a new Table 2200 + pT = new MyPostgresTable(name); 2201 + if (geometry.Len() > 0 && type.Len() > 0) 2202 + pT->Add(geometry, type, srid, dims); 2203 + if (FirstTable == NULL) 2204 + FirstTable = pT; 2205 + if (LastTable != NULL) 2206 + LastTable->SetNext(pT); 2207 + LastTable = pT; 2208 + CurrentTable = pT; 2209 +} 2210 + 2211 +void MyPostgresSchema::Add(wxString & name) 2212 +{ 2213 +// 2214 +// adding a View to a Schema 2215 +// 2216 + MyPostgresView *pV = FirstView; 2217 + while (pV != NULL) 2218 + { 2219 + if (pV->GetName().Cmp(name) == 0) 2220 + return; // already defined 2221 + pV = pV->GetNext(); 2222 + } 2223 + 2224 +// adding a new View 2225 + pV = new MyPostgresView(name); 2226 + if (FirstView == NULL) 2227 + FirstView = pV; 2228 + if (LastView != NULL) 2229 + LastView->SetNext(pV); 2230 + LastView = pV; 2231 +} 2232 + 2233 +MyPostgresConn::MyPostgresConn(wxString & host, wxString & hostaddr, int port, 2234 + wxString & dbname, wxString & user, 2235 + bool readOnly, bool textDates) 2236 +{ 2237 +// ctor 2238 + Host = host; 2239 + HostAddr = hostaddr; 2240 + Port = port; 2241 + DbName = dbname; 2242 + User = user; 2243 + ReadOnly = readOnly; 2244 + TextDates = textDates; 2245 + First = NULL; 2246 + Last = NULL; 2247 + Current = NULL; 2248 + Prev = NULL; 2249 + Next = NULL; 2250 +} 2251 + 2252 +MyPostgresConn::~MyPostgresConn() 2253 +{ 2254 +// dtor 2255 + MyPostgresSchema *pS; 2256 + MyPostgresSchema *pSn; 2257 + pS = First; 2258 + while (pS != NULL) 2259 + { 2260 + pSn = pS->GetNext(); 2261 + delete pS; 2262 + pS = pSn; 2263 + } 2264 +} 2265 + 2266 +void MyPostgresConn::Add(wxString & schema, wxString & table, 2267 + wxString & geometry, wxString & type, int srid, 2268 + int dims) 2269 +{ 2270 +// 2271 +// adding a Table to a PostgreSQL connection 2272 +// 2273 + MyPostgresSchema *pS = Current; 2274 + if (pS != NULL) 2275 + { 2276 + if (pS->GetName().Cmp(schema) == 0) 2277 + { 2278 + // continuing with the current Schema 2279 + pS->Add(table, geometry, type, srid, dims); 2280 + return; 2281 + } 2282 + } 2283 + 2284 + pS = First; 2285 + while (pS != NULL) 2286 + { 2287 + if (pS->GetName().Cmp(schema) == 0) 2288 + { 2289 + // the Schema is already defined 2290 + pS->Add(table, geometry, type, srid, dims); 2291 + return; 2292 + } 2293 + pS = pS->GetNext(); 2294 + } 2295 + 2296 +// adding a new Schema 2297 + pS = new MyPostgresSchema(schema); 2298 + pS->Add(table, geometry, type, srid, dims); 2299 + if (First == NULL) 2300 + First = pS; 2301 + if (Last != NULL) 2302 + Last->SetNext(pS); 2303 + Last = pS; 2304 + Current = pS; 2305 +} 2306 + 2307 +void MyPostgresConn::Add(wxString & schema, wxString & view) 2308 +{ 2309 +// 2310 +// adding a View to a PostgreSQL connection 2311 +// 2312 + MyPostgresSchema *pS = Current; 2313 + if (pS != NULL) 2314 + { 2315 + if (pS->GetName().Cmp(schema) == 0) 2316 + { 2317 + // continuing with the current Schema 2318 + pS->Add(view); 2319 + return; 2320 + } 2321 + pS = pS->GetNext(); 2322 + } 2323 + 2324 + pS = First; 2325 + while (pS != NULL) 2326 + { 2327 + if (pS->GetName().Cmp(schema) == 0) 2328 + { 2329 + // the Schema is already defined 2330 + pS->Add(view); 2331 + return; 2332 + } 2333 + pS = pS->GetNext(); 2334 + } 2335 + 2336 +// adding a new Schema 2337 + pS = new MyPostgresSchema(schema); 2338 + pS->Add(view); 2339 + if (First == NULL) 2340 + First = pS; 2341 + if (Last != NULL) 2342 + Last->SetNext(pS); 2343 + Last = pS; 2344 + Current = pS; 2345 +} 2346 + 2347 +void MyPostgres::Clear() 2348 +{ 2349 +// 2350 +// memory cleanup - clearing a MyPostgres object 2351 +// 2352 + MyPostgresConn *pC; 2353 + MyPostgresConn *pCn; 2354 + pC = First; 2355 + while (pC != NULL) 2356 + { 2357 + pCn = pC->GetNext(); 2358 + delete pC; 2359 + pC = pCn; 2360 + } 2361 + First = NULL; 2362 + Last = NULL; 2363 + Current = NULL; 2364 +} 2365 + 2366 +MyPostgresConn *MyPostgres::Insert(wxString & host, wxString & hostaddr, 2367 + int port, wxString & dbname, wxString & user, 2368 + bool readOnly, bool textDates) 2369 +{ 2370 +// 2371 +// inserting into the list a new connection to PostgreSQL 2372 +// (or returning an already existing one) 2373 +// 2374 + MyPostgresConn *pC = Current; 2375 + if (pC != NULL) 2376 + { 2377 + if (pC->GetHost().Cmp(host) == 0 && pC->GetHostAddr().Cmp(hostaddr) == 0 2378 + && pC->GetPort() == port && pC->GetDbName().Cmp(dbname) == 0 2379 + && pC->GetUser().Cmp(user) == 0) 2380 + return pC; // continuing with the current connection 2381 + } 2382 + 2383 + pC = Find(host, hostaddr, port, dbname, user); 2384 + if (pC != NULL) 2385 + return pC; // already defined 2386 + 2387 +// adding a new connection 2388 + pC = 2389 + new MyPostgresConn(host, hostaddr, port, dbname, user, readOnly, textDates); 2390 + if (First == NULL) 2391 + First = pC; 2392 + pC->SetPrev(Last); 2393 + if (Last != NULL) 2394 + Last->SetNext(pC); 2395 + Last = pC; 2396 + Current = pC; 2397 + return pC; 2398 +} 2399 + 2400 +MyPostgresConn *MyPostgres::Find(wxString & host, wxString & hostaddr, int port, 2401 + wxString & dbname, wxString & user) 2402 +{ 2403 +// 2404 +// searching for a given connection 2405 +// 2406 + MyPostgresConn *pC = First; 2407 + while (pC != NULL) 2408 + { 2409 + if (pC->GetHost().Cmp(host) == 0 && pC->GetHostAddr().Cmp(hostaddr) == 0 2410 + && pC->GetPort() == port && pC->GetDbName().Cmp(dbname) == 0 2411 + && pC->GetUser().Cmp(user) == 0) 2412 + return pC; 2413 + pC = pC->GetNext(); 2414 + } 2415 + return NULL; 2416 +} 2417 + 2418 +void MyPostgres::Remove(MyPostgresConn * conn) 2419 +{ 2420 +// 2421 +// removing a connection from the list 2422 +// 2423 + MyPostgresConn *pC = First; 2424 + while (pC != NULL) 2425 + { 2426 + if (pC == conn) 2427 + { 2428 + MyPostgresConn *x = pC->GetPrev(); 2429 + if (x != NULL) 2430 + x->SetNext(pC->GetNext()); 2431 + x = pC->GetNext(); 2432 + if (x != NULL) 2433 + x->SetPrev(pC->GetPrev()); 2434 + if (pC == First) 2435 + First = pC->GetNext(); 2436 + if (pC == Last) 2437 + Last = pC->GetPrev(); 2438 + if (pC == Current) 2439 + Current = Last; 2440 + delete pC; 2441 + return; 2442 + } 2443 + pC = pC->GetNext(); 2444 + } 2445 +} 2446 + 2447 +bool MyPostgres::CheckUniqueVirtName(wxString & virtName) 2448 +{ 2449 +// 2450 +// testing for PostgreSQL unique virtual names 2451 +// 2452 + MyPostgresConn *pC = First; 2453 + while (pC != NULL) 2454 + { 2455 + MyPostgresSchema *pS = pC->GetFirst(); 2456 + while (pS != NULL) 2457 + { 2458 + MyPostgresTable *pT = pS->GetFirstTable(); 2459 + while (pT != NULL) 2460 + { 2461 + if (virtName.Cmp(pT->GetVirtName()) == 0) 2462 + return false; 2463 + if (virtName.Cmp(pT->GetPostGisName()) == 0) 2464 + return false; 2465 + pT = pT->GetNext(); 2466 + } 2467 + MyPostgresView *pV = pS->GetFirstView(); 2468 + while (pV != NULL) 2469 + { 2470 + if (virtName.Cmp(pV->GetVirtName()) == 0) 2471 + return false; 2472 + pV = pV->GetNext(); 2473 + } 2474 + pS = pS->GetNext(); 2475 + } 2476 + pC = pC->GetNext(); 2477 + } 2478 + return true; 2479 +} 2480 + 2481 +void MyPostgres::MakeUniqueVirtName(wxString & baseName, wxString & uniqueName) 2482 +{ 2483 +// 2484 +// ensuring to create PostgreSQL unique virtual names 2485 +// 2486 + if (CheckUniqueVirtName(baseName) == true) 2487 + { 2488 + uniqueName = baseName; 2489 + return; 2490 + } 2491 + 2492 + int alias = 0; 2493 + while (1) 2494 + { 2495 + wxString suffix; 2496 + suffix.Printf(wxT("_%d"), alias); 2497 + wxString test = baseName + suffix; 2498 + if (CheckUniqueVirtName(test) == true) 2499 + { 2500 + uniqueName = test; 2501 + return; 2502 + } 2503 + alias++; 2504 + } 2505 +} 2506 + 2507 +MyPostgresTable *MyPostgres::FindTable(MyFrame * parent, wxString & virtName) 2508 +{ 2509 +// attempting to retrieve a PostgreSQL Table 2510 + MyPostgresConn *pC = First; 2511 + while (pC != NULL) 2512 + { 2513 + MyPostgresSchema *pS = pC->GetFirst(); 2514 + while (pS != NULL) 2515 + { 2516 + MyPostgresTable *pT = pS->GetFirstTable(); 2517 + while (pT != NULL) 2518 + { 2519 + if (virtName.Cmp(pT->GetVirtName()) == 0) 2520 + { 2521 + if (parent != NULL) 2522 + parent->InitPostgresPkColumns(pC, pS, pT); 2523 + return pT; 2524 + } 2525 + pT = pT->GetNext(); 2526 + } 2527 + pS = pS->GetNext(); 2528 + } 2529 + pC = pC->GetNext(); 2530 + } 2531 + return NULL; 2532 +} 2533 + 2534 +MyPostgresTable *MyPostgres::FindPostGisView(MyFrame * parent, 2535 + wxString & virtName) 2536 +{ 2537 +// attempting to retrieve the PostgreSQL Table supporting a PostGIS View (wrapper) 2538 + MyPostgresConn *pC = First; 2539 + while (pC != NULL) 2540 + { 2541 + MyPostgresSchema *pS = pC->GetFirst(); 2542 + while (pS != NULL) 2543 + { 2544 + MyPostgresTable *pT = pS->GetFirstTable(); 2545 + while (pT != NULL) 2546 + { 2547 + if (virtName.Cmp(pT->GetPostGisName()) == 0) 2548 + { 2549 + if (parent != NULL) 2550 + parent->InitPostgresPkColumns(pC, pS, pT); 2551 + return pT; 2552 + } 2553 + pT = pT->GetNext(); 2554 + } 2555 + pS = pS->GetNext(); 2556 + } 2557 + pC = pC->GetNext(); 2558 + } 2559 + return NULL; 2560 +} 2561 + 2562 +MyPostgresColumns::~MyPostgresColumns() 2563 +{ 2564 +// dtor 2565 + MyPostgresCol *pC; 2566 + MyPostgresCol *pCn; 2567 + pC = First; 2568 + while (pC != NULL) 2569 + { 2570 + pCn = pC->GetNext(); 2571 + delete pC; 2572 + pC = pCn; 2573 + } 2574 +} 2575 + 2576 +void MyPostgresColumns::Add(wxString & name) 2577 +{ 2578 +// adding a Column into the list 2579 + MyPostgresCol *col = new MyPostgresCol(name); 2580 + if (First == NULL) 2581 + First = col; 2582 + if (Last != NULL) 2583 + Last->SetNext(col); 2584 + Last = col; 2585 +} 2586 + 2587 +void MyPostgresColumns::SetPK(wxString & name) 2588 +{ 2589 +// setting a PK Column 2590 + MyPostgresCol *pC; 2591 + pC = First; 2592 + while (pC != NULL) 2593 + { 2594 + if (pC->GetName().Cmp(name) == 0) 2595 + { 2596 + pC->SetPK(); 2597 + return; 2598 + } 2599 + pC = pC->GetNext(); 2600 + } 2601 +} 2602 + 2603 +char *MyPostgresColumns::BuildWhere() 2604 +{ 2605 +// building a WHERE clause 2606 + char *where = NULL; 2607 + char *prev; 2608 + int first = 1; 2609 + char name[1024]; 2610 + char *xname; 2611 + MyPostgresCol *pC = First; 2612 + while (pC != NULL) 2613 + { 2614 + if (pC->IsPK() == false) 2615 + { 2616 + pC = pC->GetNext(); 2617 + continue; 2618 + } 2619 + if (first) 2620 + { 2621 + first = 0; 2622 + strcpy(name, pC->GetName().ToUTF8()); 2623 + xname = gaiaDoubleQuotedSql(name); 2624 + where = sqlite3_mprintf("WHERE \"%s\" = OLD.\"%s\"", xname, xname); 2625 + free(xname); 2626 + } else 2627 + { 2628 + prev = where; 2629 + strcpy(name, pC->GetName().ToUTF8()); 2630 + xname = gaiaDoubleQuotedSql(name); 2631 + where = sqlite3_mprintf("%s AND \"%s\" = OLD.\"%s\"", xname, xname); 2632 + free(xname); 2633 + sqlite3_free(prev); 2634 + } 2635 + pC = pC->GetNext(); 2636 + } 2637 + return where; 2638 + 2639 +}
Changes to QueryView.cpp.
1 1 /* 2 2 / QueryView.cpp 3 3 / a panel to set SQL queries 4 4 / 5 5 / version 1.7, 2013 May 8 6 6 / 7 -/ Author: Sandro Furieri a-furieri@lqt.it 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 8 / 9 9 / Copyright (C) 2008-2013 Alessandro Furieri 10 10 / 11 11 / This program is free software: you can redistribute it and/or modify 12 12 / it under the terms of the GNU General Public License as published by 13 13 / the Free Software Foundation, either version 3 of the License, or 14 14 / (at your option) any later version. ................................................................................ 533 533 return true; 534 534 if (str.CmpNoCase(wxT("hasGeoCallbacks")) == 0) 535 535 return true; 536 536 if (str.CmpNoCase(wxT("hasGeos")) == 0) 537 537 return true; 538 538 if (str.CmpNoCase(wxT("hasProj")) == 0) 539 539 return true; 540 + if (str.CmpNoCase(wxT("hasProjGeodesic")) == 0) 541 + return true; 540 542 if (str.CmpNoCase(wxT("hasGeosAdvanced")) == 0) 541 543 return true; 542 544 if (str.CmpNoCase(wxT("hasGeosTrunk")) == 0) 543 545 return true; 544 546 if (str.CmpNoCase(wxT("hasGeosReentrant")) == 0) 545 547 return true; 546 548 if (str.CmpNoCase(wxT("hasGeosOnlyReentrant")) == 0) ................................................................................ 557 559 return true; 558 560 if (str.CmpNoCase(wxT("hasGGP")) == 0) 559 561 return true; 560 562 if (str.CmpNoCase(wxT("hasGroundControlPoints")) == 0) 561 563 return true; 562 564 if (str.CmpNoCase(wxT("hasTopology")) == 0) 563 565 return true; 566 + if (str.CmpNoCase(wxT("hasKNN")) == 0) 567 + return true; 568 + if (str.CmpNoCase(wxT("hasRouting")) == 0) 569 + return true; 564 570 565 571 if (str.CmpNoCase(wxT("EnableGpkgAmphibiousMode")) == 0) 566 572 return true; 567 573 if (str.CmpNoCase(wxT("DisableGpkgAmphibiousMode")) == 0) 568 574 return true; 569 575 if (str.CmpNoCase(wxT("GetGpkgAmphibiousMode")) == 0) 570 576 return true; 571 577 if (str.CmpNoCase(wxT("EnableGpkgMode")) == 0) 572 578 return true; 573 579 if (str.CmpNoCase(wxT("DisableGpkgMode")) == 0) 574 580 return true; 575 581 if (str.CmpNoCase(wxT("GetGpkgMode")) == 0) 576 582 return true; 583 + if (str.CmpNoCase(wxT("EnableTinyPoint")) == 0) 584 + return true; 585 + if (str.CmpNoCase(wxT("DisableTInyPoint")) == 0) 586 + return true; 587 + if (str.CmpNoCase(wxT("IsTinyPointEnabled")) == 0) 588 + return true; 577 589 if (str.CmpNoCase(wxT("SetDecimalPrecision")) == 0) 578 590 return true; 579 591 if (str.CmpNoCase(wxT("GetDecimalPrecision")) == 0) 580 592 return true; 581 593 if (str.CmpNoCase(wxT("GetShapefileExtent")) == 0) 582 594 return true; 583 595 if (str.CmpNoCase(wxT("IsLowASCII")) == 0) ................................................................................ 638 650 return true; 639 651 if (str.CmpNoCase(wxT("RecoverFDOGeometryColumn")) == 0) 640 652 return true; 641 653 if (str.CmpNoCase(wxT("DiscardFDOGeometryColumn")) == 0) 642 654 return true; 643 655 if (str.CmpNoCase(wxT("InitSpatialMetaData")) == 0) 644 656 return true; 657 + if (str.CmpNoCase(wxT("InitSpatialMetaDataFull")) == 0) 658 + return true; 645 659 if (str.CmpNoCase(wxT("AddGeometryColumn")) == 0) 646 660 return true; 647 661 if (str.CmpNoCase(wxT("RecoverGeometryColumn")) == 0) 648 662 return true; 649 663 if (str.CmpNoCase(wxT("DiscardGeometryColumn")) == 0) 650 664 return true; 651 665 if (str.CmpNoCase(wxT("RegisterVirtualGeometry")) == 0) ................................................................................ 667 681 if (str.CmpNoCase(wxT("RebuildGeometryTriggers")) == 0) 668 682 return true; 669 683 if (str.CmpNoCase(wxT("UpgradeGeometryTriggers")) == 0) 670 684 return true; 671 685 if (str.CmpNoCase(wxT("CheckSpatialIndex")) == 0) 672 686 return true; 673 687 if (str.CmpNoCase(wxT("RecoverSpatialIndex")) == 0) 688 + return true; 689 + if (str.CmpNoCase(wxT("GetSpatialIndexExtent")) == 0) 674 690 return true; 675 691 if (str.CmpNoCase(wxT("CheckShadowedRowid")) == 0) 676 692 return true; 677 693 if (str.CmpNoCase(wxT("CheckWithoutRowid")) == 0) 678 694 return true; 679 695 if (str.CmpNoCase(wxT("CreateMetaCatalogTables")) == 0) 680 696 return true; ................................................................................ 779 795 if (str.CmpNoCase(wxT("RegisterIsoMetadata")) == 0) 780 796 return true; 781 797 if (str.CmpNoCase(wxT("XB_LoadXML")) == 0) 782 798 return true; 783 799 if (str.CmpNoCase(wxT("XB_StoreXML")) == 0) 784 800 return true; 785 801 if (str.CmpNoCase(wxT("CountUnsafeTriggers")) == 0) 802 + return true; 803 + if (str.CmpNoCase(wxT("IsInteger")) == 0) 804 + return true; 805 + if (str.CmpNoCase(wxT("IsDecimalNumber")) == 0) 806 + return true; 807 + if (str.CmpNoCase(wxT("IsNumber")) == 0) 786 808 return true; 787 809 if (str.CmpNoCase(wxT("CastToInteger")) == 0) 788 810 return true; 789 811 if (str.CmpNoCase(wxT("CastToDouble")) == 0) 790 812 return true; 791 813 if (str.CmpNoCase(wxT("CastToText")) == 0) 792 814 return true; ................................................................................ 807 829 if (str.CmpNoCase(wxT("DirNameFromPath")) == 0) 808 830 return true; 809 831 if (str.CmpNoCase(wxT("FullFileNameFromPath")) == 0) 810 832 return true; 811 833 if (str.CmpNoCase(wxT("FileNameFromPath")) == 0) 812 834 return true; 813 835 if (str.CmpNoCase(wxT("FileExtFromPath")) == 0) 836 + return true; 837 + if (str.CmpNoCase(wxT("MakeStringList")) == 0) 814 838 return true; 815 839 if (str.CmpNoCase(wxT("ATM_Create")) == 0) 816 840 return true; 817 841 if (str.CmpNoCase(wxT("ATM_CreateTranslate")) == 0) 818 842 return true; 819 843 if (str.CmpNoCase(wxT("ATM_CreateScale")) == 0) 820 844 return true; ................................................................................ 867 891 if (str.CmpNoCase(wxT("GetCutterMessage")) == 0) 868 892 return true; 869 893 if (str.CmpNoCase(wxT("CreateRasterCoveragesTable")) == 0) 870 894 return true; 871 895 if (str.CmpNoCase(wxT("CreateVectorCoveragesTables")) == 0) 872 896 return true; 873 897 if (str.CmpNoCase(wxT("CloneTable")) == 0) 898 + return true; 899 + if (str.CmpNoCase(wxT("CreateClonedTable")) == 0) 874 900 return true; 875 901 if (str.CmpNoCase(wxT("CheckDuplicateRows")) == 0) 876 902 return true; 877 903 if (str.CmpNoCase(wxT("RemoveDuplicateRows")) == 0) 878 904 return true; 879 905 if (str.CmpNoCase(wxT("ElementaryGeometries")) == 0) 880 906 return true; ................................................................................ 896 922 return true; 897 923 if (str.CmpNoCase(wxT("ImportWFS")) == 0) 898 924 return true; 899 925 if (str.CmpNoCase(wxT("ImportDXF")) == 0) 900 926 return true; 901 927 if (str.CmpNoCase(wxT("ImportDXFfromDir")) == 0) 902 928 return true; 929 + 930 + if (str.CmpNoCase(wxT("SqlProc_GetLastError")) == 0) 931 + return true; 932 + if (str.CmpNoCase(wxT("SqlProc_SetLogfile")) == 0) 933 + return true; 934 + if (str.CmpNoCase(wxT("SqlProc_GetLogfile")) == 0) 935 + return true; 936 + if (str.CmpNoCase(wxT("SqlProc_FromFile")) == 0) 937 + return true; 938 + if (str.CmpNoCase(wxT("SqlProc_FromText")) == 0) 939 + return true; 940 + if (str.CmpNoCase(wxT("SqlProc_IsValid")) == 0) 941 + return true; 942 + if (str.CmpNoCase(wxT("SqlProc_NumVariables")) == 0) 943 + return true; 944 + if (str.CmpNoCase(wxT("SqlProc_VariableN")) == 0) 945 + return true; 946 + if (str.CmpNoCase(wxT("SqlProc_AllVariables")) == 0) 947 + return true; 948 + if (str.CmpNoCase(wxT("SqlProc_RawSQL")) == 0) 949 + return true; 950 + if (str.CmpNoCase(wxT("SqlProc_VarValue")) == 0) 951 + return true; 952 + if (str.CmpNoCase(wxT("SqlProc_IsValidVarValue")) == 0) 953 + return true; 954 + if (str.CmpNoCase(wxT("SqlProc_CookedSQL")) == 0) 955 + return true; 956 + if (str.CmpNoCase(wxT("SqlProc_Execute")) == 0) 957 + return true; 958 + if (str.CmpNoCase(wxT("SqlProc_Exit")) == 0) 959 + return true; 960 + if (str.CmpNoCase(wxT("StoredProc_CreateTables")) == 0) 961 + return true; 962 + if (str.CmpNoCase(wxT("StoredProc_Register")) == 0) 963 + return true; 964 + if (str.CmpNoCase(wxT("StoredProc_Get")) == 0) 965 + return true; 966 + if (str.CmpNoCase(wxT("StoredProc_Delete")) == 0) 967 + return true; 968 + if (str.CmpNoCase(wxT("StoredProc_UpdateTitle")) == 0) 969 + return true; 970 + if (str.CmpNoCase(wxT("StoredProc_UpdateSqlBody")) == 0) 971 + return true; 972 + if (str.CmpNoCase(wxT("StoredProc_Execute")) == 0) 973 + return true; 974 + if (str.CmpNoCase(wxT("StoredProc_Exit")) == 0) 975 + return true; 976 + if (str.CmpNoCase(wxT("StoredVar_Register")) == 0) 977 + return true; 978 + if (str.CmpNoCase(wxT("StoredVar_Get")) == 0) 979 + return true; 980 + if (str.CmpNoCase(wxT("StoredVar_GetValue")) == 0) 981 + return true; 982 + if (str.CmpNoCase(wxT("StoredVar_Delete")) == 0) 983 + return true; 984 + if (str.CmpNoCase(wxT("StoredVar_UpdateTitle")) == 0) 985 + return true; 986 + if (str.CmpNoCase(wxT("StoredVar_UpdateValue")) == 0) 987 + return true; 988 + 989 + if (str.CmpNoCase(wxT("PostgreSql_ResetLastError")) == 0) 990 + return true; 991 + if (str.CmpNoCase(wxT("PostgreSql_SetLastError")) == 0) 992 + return true; 993 + if (str.CmpNoCase(wxT("PostgreSql_GetLastError")) == 0) 994 + return true; 995 + 996 + if (str.CmpNoCase(wxT("CreateRoutingNodes")) == 0) 997 + return true; 998 + if (str.CmpNoCase(wxT("CreateRouting")) == 0) 999 + return true; 1000 + if (str.CmpNoCase(wxT("CreateRouting_GetLastError")) == 0) 1001 + return true; 903 1002 904 1003 if (str.CmpNoCase(wxT("sequence_nextval")) == 0) 905 1004 return true; 906 1005 if (str.CmpNoCase(wxT("sequence_currval")) == 0) 907 1006 return true; 908 1007 if (str.CmpNoCase(wxT("sequence_lastval")) == 0) 909 1008 return true; ................................................................................ 966 1065 return true; 967 1066 if (str.CmpNoCase(wxT("Var_pop")) == 0) 968 1067 return true; 969 1068 if (str.CmpNoCase(wxT("Var_samp")) == 0) 970 1069 return true; 971 1070 if (str.CmpNoCase(wxT("Tan")) == 0) 972 1071 return true; 1072 + if (str.CmpNoCase(wxT("IsGeometryBlob")) == 0) 1073 + return true; 1074 + if (str.CmpNoCase(wxT("IsTinyPointBlob")) == 0) 1075 + return true; 973 1076 if (str.CmpNoCase(wxT("IsZipBlob")) == 0) 974 1077 return true; 975 1078 if (str.CmpNoCase(wxT("IsPdfBlob")) == 0) 976 1079 return true; 977 1080 if (str.CmpNoCase(wxT("IsGifBlob")) == 0) 978 1081 return true; 979 1082 if (str.CmpNoCase(wxT("IsPngBlob")) == 0) ................................................................................ 996 1099 return true; 997 1100 if (str.CmpNoCase(wxT("BlobFromFile")) == 0) 998 1101 return true; 999 1102 if (str.CmpNoCase(wxT("BlobToFile")) == 0) 1000 1103 return true; 1001 1104 if (str.CmpNoCase(wxT("ExportDXF")) == 0) 1002 1105 return true; 1106 + if (str.CmpNoCase(wxT("TinyPointEncode")) == 0) 1107 + return true; 1108 + if (str.CmpNoCase(wxT("GeometryPointEncode")) == 0) 1109 + return true; 1003 1110 if (str.CmpNoCase(wxT("MakePoint")) == 0) 1004 1111 return true; 1005 1112 if (str.CmpNoCase(wxT("ST_Point")) == 0) 1006 1113 return true; 1007 1114 if (str.CmpNoCase(wxT("MakePointZ")) == 0) 1008 1115 return true; 1009 1116 if (str.CmpNoCase(wxT("ST_PointZ")) == 0) ................................................................................ 1238 1345 return true; 1239 1346 if (str.CmpNoCase(wxT("GeomFromEWKB")) == 0) 1240 1347 return true; 1241 1348 if (str.CmpNoCase(wxT("AsTWKB")) == 0) 1242 1349 return true; 1243 1350 if (str.CmpNoCase(wxT("GeomFromTWKB")) == 0) 1244 1351 return true; 1352 + if (str.CmpNoCase(wxT("ST_AsEncodedPolyline")) == 0) 1353 + return true; 1354 + if (str.CmpNoCase(wxT("ST_LineFromEncodedPolyline")) == 0) 1355 + return true; 1245 1356 if (str.CmpNoCase(wxT("AsEWKT")) == 0) 1246 1357 return true; 1247 1358 if (str.CmpNoCase(wxT("GeomFromEWKT")) == 0) 1248 1359 return true; 1249 1360 if (str.CmpNoCase(wxT("CompressGeometry")) == 0) 1250 1361 return true; 1251 1362 if (str.CmpNoCase(wxT("UncompressGeometry")) == 0) ................................................................................ 1283 1394 if (str.CmpNoCase(wxT("CastToXYM")) == 0) 1284 1395 return true; 1285 1396 if (str.CmpNoCase(wxT("CastToXYZM")) == 0) 1286 1397 return true; 1287 1398 if (str.CmpNoCase(wxT("ST_Reverse")) == 0) 1288 1399 return true; 1289 1400 if (str.CmpNoCase(wxT("ST_ForceLHR")) == 0) 1401 + return true; 1402 + if (str.CmpNoCase(wxT("ST_ForcePolygonCW")) == 0) 1403 + return true; 1404 + if (str.CmpNoCase(wxT("ST_ForcePolygonCCW")) == 0) 1405 + return true; 1406 + if (str.CmpNoCase(wxT("ST_IsPolygonCW")) == 0) 1407 + return true; 1408 + if (str.CmpNoCase(wxT("ST_IsPolygonCCW")) == 0) 1290 1409 return true; 1291 1410 if (str.CmpNoCase(wxT("Dimension")) == 0) 1292 1411 return true; 1293 1412 if (str.CmpNoCase(wxT("ST_Dimension")) == 0) 1294 1413 return true; 1295 1414 if (str.CmpNoCase(wxT("CoordDimension")) == 0) 1296 1415 return true; ................................................................................ 1397 1516 if (str.CmpNoCase(wxT("SimplifyPreserveTopology")) == 0) 1398 1517 return true; 1399 1518 if (str.CmpNoCase(wxT("ST_SimplifyPreserveTopology")) == 0) 1400 1519 return true; 1401 1520 if (str.CmpNoCase(wxT("GeodesicLength")) == 0) 1402 1521 return true; 1403 1522 if (str.CmpNoCase(wxT("GreatCircleLength")) == 0) 1523 + return true; 1524 + if (str.CmpNoCase(wxT("GeodesicArcLength")) == 0) 1525 + return true; 1526 + if (str.CmpNoCase(wxT("GeodesicChordLength")) == 0) 1527 + return true; 1528 + if (str.CmpNoCase(wxT("GeodesicCentralAngle")) == 0) 1529 + return true; 1530 + if (str.CmpNoCase(wxT("GeodesicArcArea")) == 0) 1531 + return true; 1532 + if (str.CmpNoCase(wxT("GeodesicArcHeigth")) == 0) 1404 1533 return true; 1405 1534 if (str.CmpNoCase(wxT("NumPoints")) == 0) 1406 1535 return true; 1407 1536 if (str.CmpNoCase(wxT("ST_NumPoints")) == 0) 1408 1537 return true; 1409 1538 if (str.CmpNoCase(wxT("PointN")) == 0) 1410 1539 return true; ................................................................................ 1582 1711 return true; 1583 1712 if (str.CmpNoCase(wxT("ST_ConvexHull")) == 0) 1584 1713 return true; 1585 1714 if (str.CmpNoCase(wxT("Transform")) == 0) 1586 1715 return true; 1587 1716 if (str.CmpNoCase(wxT("ST_Transform")) == 0) 1588 1717 return true; 1718 + if (str.CmpNoCase(wxT("TransformXY")) == 0) 1719 + return true; 1720 + if (str.CmpNoCase(wxT("ST_TransformXY")) == 0) 1721 + return true; 1589 1722 if (str.CmpNoCase(wxT("ST_Shift_Longitude")) == 0) 1590 1723 return true; 1591 1724 if (str.CmpNoCase(wxT("NormalizeLonLat")) == 0) 1592 1725 return true; 1593 1726 if (str.CmpNoCase(wxT("Line_Interpolate_Point")) == 0) 1594 1727 return true; 1595 1728 if (str.CmpNoCase(wxT("ST_Line_Interpolate_Point")) == 0) ................................................................................ 1668 1801 return true; 1669 1802 if (str.CmpNoCase(wxT("ExtractMultiPoint")) == 0) 1670 1803 return true; 1671 1804 if (str.CmpNoCase(wxT("ExtractMultiLinestring")) == 0) 1672 1805 return true; 1673 1806 if (str.CmpNoCase(wxT("ExtractMultiPolygon")) == 0) 1674 1807 return true; 1808 + if (str.CmpNoCase(wxT("ST_AddMeasure")) == 0) 1809 + return true; 1810 + if (str.CmpNoCase(wxT("ST_InterpolatePoint")) == 0) 1811 + return true; 1675 1812 if (str.CmpNoCase(wxT("ST_Locate_Along_Measure")) == 0) 1813 + return true; 1814 + if (str.CmpNoCase(wxT("ST_LocateAlong")) == 0) 1676 1815 return true; 1677 1816 if (str.CmpNoCase(wxT("ST_Locate_Between_Measures")) == 0) 1678 1817 return true; 1818 + if (str.CmpNoCase(wxT("ST_LocateBetween")) == 0) 1819 + return true; 1820 + if (str.CmpNoCase(wxT("ST_IsValidTrajectory")) == 0) 1821 + return true; 1822 + if (str.CmpNoCase(wxT("ST_TrajectoryInterpolatePoint")) == 0) 1823 + return true; 1679 1824 if (str.CmpNoCase(wxT("SquareGrid")) == 0) 1680 1825 return true; 1681 1826 if (str.CmpNoCase(wxT("ST_SquareGrid")) == 0) 1682 1827 return true; 1683 1828 if (str.CmpNoCase(wxT("TriangularGrid")) == 0) 1684 1829 return true; 1685 1830 if (str.CmpNoCase(wxT("ST_TriangularGrid")) == 0) ................................................................................ 2142 2287 return true; 2143 2288 if (str.CmpNoCase(wxT("RL2_SetMaxThreads")) == 0) 2144 2289 return true; 2145 2290 if (str.CmpNoCase(wxT("IsValidPixel")) == 0) 2146 2291 return true; 2147 2292 if (str.CmpNoCase(wxT("RL2_IsValidPixel")) == 0) 2148 2293 return true; 2294 + if (str.CmpNoCase(wxT("IsPixelNone")) == 0) 2295 + return true; 2296 + if (str.CmpNoCase(wxT("RL2_IsPixelNone")) == 0) 2297 + return true; 2149 2298 if (str.CmpNoCase(wxT("IsValidRasterPalette")) == 0) 2150 2299 return true; 2151 2300 if (str.CmpNoCase(wxT("RL2_IsValidRasterPalette")) == 0) 2152 2301 return true; 2153 2302 if (str.CmpNoCase(wxT("IsValidRasterStatistics")) == 0) 2154 2303 return true; 2155 2304 if (str.CmpNoCase(wxT("RL2_IsValidRasterStatistics")) == 0) ................................................................................ 2210 2359 return true; 2211 2360 if (str.CmpNoCase(wxT("RL2_PaletteEquals")) == 0) 2212 2361 return true; 2213 2362 if (str.CmpNoCase(wxT("CreatePixel")) == 0) 2214 2363 return true; 2215 2364 if (str.CmpNoCase(wxT("RL2_CreatePixel")) == 0) 2216 2365 return true; 2366 + if (str.CmpNoCase(wxT("CreatePixelNone")) == 0) 2367 + return true; 2368 + if (str.CmpNoCase(wxT("RL2_CreatePixelNone")) == 0) 2369 + return true; 2217 2370 if (str.CmpNoCase(wxT("GetPixelType")) == 0) 2218 2371 return true; 2219 2372 if (str.CmpNoCase(wxT("RL2_GetPixelType")) == 0) 2220 2373 return true; 2221 2374 if (str.CmpNoCase(wxT("GetPixelSampleType")) == 0) 2222 2375 return true; 2223 2376 if (str.CmpNoCase(wxT("RL2_GetPixelSampleType")) == 0) ................................................................................ 2314 2467 return true; 2315 2468 if (str.CmpNoCase(wxT("RL2_GetMapImageFromRaster")) == 0) 2316 2469 return true; 2317 2470 if (str.CmpNoCase(wxT("GetMapImageFromVector")) == 0) 2318 2471 return true; 2319 2472 if (str.CmpNoCase(wxT("RL2_GetMapImageFromVector")) == 0) 2320 2473 return true; 2474 + if (str.CmpNoCase(wxT("GetMapImageFromWMS")) == 0) 2475 + return true; 2476 + if (str.CmpNoCase(wxT("RL2_GetMapImageFromWMS")) == 0) 2477 + return true; 2321 2478 if (str.CmpNoCase(wxT("GetTileImage")) == 0) 2322 2479 return true; 2323 2480 if (str.CmpNoCase(wxT("RL2_GetTileImage")) == 0) 2324 2481 return true; 2325 2482 if (str.CmpNoCase(wxT("GetTripleBandTileImage")) == 0) 2326 2483 return true; 2327 2484 if (str.CmpNoCase(wxT("RL2_GetTripleBandTileImage")) == 0)
Changes to QueryViewComposer.cpp.
1 1 /* 2 2 / QueryViewComposer.cpp 3 3 / Query/View Composer 4 4 / 5 5 / version 1.7, 2013 May 8 6 6 / 7 -/ Author: Sandro Furieri a-furieri@lqt.it 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 8 / 9 9 / Copyright (C) 2009-2013 Alessandro Furieri 10 10 / 11 11 / This program is free software: you can redistribute it and/or modify 12 12 / it under the terms of the GNU General Public License as published by 13 13 / the Free Software Foundation, either version 3 of the License, or 14 14 / (at your option) any later version.
Deleted QuickStyles.cpp.
1 -/* 2 -/ QuickStyles.cpp 3 -/ Quick Styles wizards 4 -/ 5 -/ version 2.0, 2017 May 26 6 -/ 7 -/ Author: Sandro Furieri a-furieri@lqt.it 8 -/ 9 -/ Copyright (C) 2017 Alessandro Furieri 10 -/ 11 -/ This program is free software: you can redistribute it and/or modify 12 -/ it under the terms of the GNU General Public License as published by 13 -/ the Free Software Foundation, either version 3 of the License, or 14 -/ (at your option) any later version. 15 -/ 16 -/ This program is distributed in the hope that it will be useful, 17 -/ but WITHOUT ANY WARRANTY; without even the implied warranty of 18 -/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 -/ GNU General Public License for more details. 20 -/ 21 -/ You should have received a copy of the GNU General Public License 22 -/ along with this program. If not, see <http://www.gnu.org/licenses/>. 23 -/ 24 -*/ 25 - 26 -#include "Classdef.h" 27 - 28 -#include "wx/imaglist.h" 29 -#include "wx/colordlg.h" 30 -#include "wx/filename.h" 31 -#include "wx/clipbrd.h" 32 - 33 -QuickStyleObj::QuickStyleObj(int type) 34 -{ 35 -// ctor 36 - DoGetUUID(UUID); 37 - Type = type; 38 - MinScaleEnabled = false; 39 - MaxScaleEnabled = false; 40 - ScaleMin = 0.0; 41 - ScaleMax = 0.0; 42 - SymbolOpacity = 1.0; 43 - SymbolSize = 16; 44 - SymbolRotation = 0.0; 45 - SymbolAnchorX = 0.5; 46 - SymbolAnchorY = 0.5; 47 - SymbolDisplacementX = 0.0; 48 - SymbolDisplacementY = 0.0; 49 - SymbolWellKnownMark = RandomWellKnownMark(); 50 - RandomColor(SymbolFillColor); 51 - RandomColor(SymbolStrokeColor); 52 - LineOpacity = 1.0; 53 - LinePerpendicularOffset = 0.0; 54 - LineStrokeWidth = 1.0; 55 - RandomColor(LineStrokeColor); 56 - LineDotStyle = QUICK_STYLE_SOLID_LINE; 57 - PolygonFill = true; 58 - PolygonStroke = true; 59 - PolygonDisplacementX = 0.0; 60 - PolygonDisplacementY = 0.0; 61 - PolygonPerpendicularOffset = 0.0; 62 - PolygonFillOpacity = 1.0; 63 - RandomColor(PolygonFillColor); 64 - PolygonStrokeOpacity = 1.0; 65 - PolygonStrokeWidth = 1.0; 66 - RandomColor(PolygonStrokeColor); 67 - LabelLinePlacement = true; 68 - LabelPrint = false; 69 - LabelColumn = NULL; 70 - FontFacename = NULL; 71 - FontSize = 10.0; 72 - FontStyle = RL2_FONTSTYLE_NORMAL; 73 - FontWeight = RL2_FONTWEIGHT_NORMAL; 74 - FontOpacity = 1.0; 75 - strcpy(FontColor, "#000000"); 76 - HasHalo = false; 77 - HaloRadius = 1.0; 78 - HaloOpacity = 1.0; 79 - strcpy(HaloColor, "#ffffff"); 80 - LabelAnchorX = 0.5; 81 - LabelAnchorY = 0.5; 82 - LabelDisplacementX = 0.0; 83 - LabelDisplacementY = 0.0; 84 - LabelRotation = 0.0; 85 - LabelPerpendicularOffset = 0.0; 86 - RepeatedLabel = false; 87 - LabelInitialGap = 0.0; 88 - LabelGap = 0.0; 89 - LabelIsAligned = false; 90 - LabelGeneralizeLine = false; 91 - XmlStyle = NULL; 92 -} 93 - 94 -QuickStyleObj *QuickStyleObj::Clone() 95 -{ 96 -// 97 -// cloning a Quick Style 98 -// 99 - QuickStyleObj *Style = new QuickStyleObj(this->Type); 100 - strcpy(Style->UUID, this->UUID); 101 - Style->MinScaleEnabled = this->MinScaleEnabled; 102 - Style->MaxScaleEnabled = this->MaxScaleEnabled; 103 - Style->ScaleMin = this->ScaleMin; 104 - Style->ScaleMax = this->ScaleMax; 105 - Style->SymbolOpacity = this->SymbolOpacity; 106 - Style->SymbolSize = this->SymbolSize; 107 - Style->SymbolRotation = this->SymbolRotation; 108 - Style->SymbolAnchorX = this->SymbolAnchorX; 109 - Style->SymbolAnchorY = this->SymbolAnchorY; 110 - Style->SymbolDisplacementX = this->SymbolDisplacementX; 111 - Style->SymbolDisplacementY = this->SymbolDisplacementY; 112 - Style->SymbolWellKnownMark = this->SymbolWellKnownMark; 113 - strcpy(Style->SymbolFillColor, this->SymbolFillColor); 114 - strcpy(Style->SymbolStrokeColor, this->SymbolStrokeColor); 115 - Style->LineOpacity = this->LineOpacity; 116 - Style->LinePerpendicularOffset = this->LinePerpendicularOffset; 117 - Style->LineStrokeWidth = this->LineStrokeWidth; 118 - strcpy(Style->LineStrokeColor, this->LineStrokeColor); 119 - Style->LineDotStyle = this->LineDotStyle; 120 - Style->PolygonFill = this->PolygonFill; 121 - Style->PolygonStroke = this->PolygonStroke; 122 - Style->PolygonDisplacementX = this->PolygonDisplacementX; 123 - Style->PolygonDisplacementY = this->PolygonDisplacementY; 124 - Style->PolygonPerpendicularOffset = this->PolygonPerpendicularOffset; 125 - Style->PolygonFillOpacity = this->PolygonFillOpacity; 126 - strcpy(Style->PolygonFillColor, this->PolygonFillColor); 127 - Style->PolygonStrokeOpacity = this->PolygonStrokeOpacity; 128 - Style->PolygonStrokeWidth = this->PolygonStrokeWidth; 129 - strcpy(Style->PolygonStrokeColor, this->PolygonStrokeColor); 130 - Style->LabelLinePlacement = this->LabelLinePlacement; 131 - Style->LabelPrint = this->LabelPrint; 132 - if (this->LabelColumn == NULL) 133 - Style->LabelColumn = NULL; 134 - else 135 - { 136 - int len = strlen(this->LabelColumn); 137 - Style->LabelColumn = (char *) malloc(len + 1); 138 - strcpy(Style->LabelColumn, this->LabelColumn); 139 - } 140 - if (this->FontFacename == NULL) 141 - Style->FontFacename = NULL; 142 - else 143 - { 144 - int len = strlen(this->FontFacename); 145 - Style->FontFacename = (char *) malloc(len + 1); 146 - strcpy(Style->FontFacename, this->FontFacename); 147 - } 148 - Style->FontSize = this->FontSize; 149 - Style->FontStyle = this->FontStyle; 150 - Style->FontWeight = this->FontWeight; 151 - Style->FontOpacity = this->FontOpacity; 152 - strcpy(Style->FontColor, this->FontColor); 153 - Style->HasHalo = this->HasHalo; 154 - Style->HaloRadius = this->HaloRadius; 155 - Style->HaloOpacity = this->HaloOpacity; 156 - strcpy(Style->HaloColor, this->HaloColor); 157 - Style->LabelAnchorX = this->LabelAnchorX; 158 - Style->LabelAnchorY = this->LabelAnchorY; 159 - Style->LabelDisplacementX = this->LabelDisplacementX; 160 - Style->LabelDisplacementY = this->LabelDisplacementY; 161 - Style->LabelRotation = this->LabelRotation; 162 - Style->LabelPerpendicularOffset = this->LabelPerpendicularOffset; 163 - Style->RepeatedLabel = this->RepeatedLabel; 164 - Style->LabelInitialGap = this->LabelInitialGap; 165 - Style->LabelGap = this->LabelGap; 166 - Style->LabelIsAligned = this->LabelIsAligned; 167 - Style->LabelGeneralizeLine = this->LabelGeneralizeLine; 168 - Style->XmlStyle = NULL; 169 - return Style; 170 -} 171 - 172 -bool QuickStyleObj::Compare(QuickStyleObj * Style) 173 -{ 174 -// 175 -// comparing two Quick Style objects 176 -// 177 - if (Style == NULL) 178 - return false; 179 - if (strcmp(Style->UUID, this->UUID) != 0) 180 - return false; 181 - if (Style->MinScaleEnabled != this->MinScaleEnabled) 182 - return false; 183 - if (Style->MaxScaleEnabled != this->MaxScaleEnabled) 184 - return false; 185 - if (Style->ScaleMin != this->ScaleMin) 186 - return false; 187 - if (Style->ScaleMax != this->ScaleMax) 188 - return false; 189 - if (Style->SymbolOpacity != this->SymbolOpacity) 190 - return false; 191 - if (Style->SymbolSize != this->SymbolSize) 192 - return false; 193 - if (Style->SymbolRotation != this->SymbolRotation) 194 - return false; 195 - if (Style->SymbolAnchorX != this->SymbolAnchorX) 196 - return false; 197 - if (Style->SymbolAnchorY != this->SymbolAnchorY) 198 - return false; 199 - if (Style->SymbolDisplacementX != this->SymbolDisplacementX) 200 - return false; 201 - if (Style->SymbolDisplacementY != this->SymbolDisplacementY) 202 - return false; 203 - if (Style->SymbolWellKnownMark != this->SymbolWellKnownMark) 204 - return false; 205 - if (strcmp(Style->SymbolFillColor, this->SymbolFillColor) != 0) 206 - return false; 207 - if (strcmp(Style->SymbolStrokeColor, this->SymbolStrokeColor) != 0) 208 - return false; 209 - if (Style->LineOpacity != this->LineOpacity) 210 - return false; 211 - if (Style->LinePerpendicularOffset != this->LinePerpendicularOffset) 212 - return false; 213 - if (Style->LineStrokeWidth != this->LineStrokeWidth) 214 - return false; 215 - if (strcmp(Style->LineStrokeColor, this->LineStrokeColor) != 0) 216 - return false; 217 - if (Style->LineDotStyle != this->LineDotStyle) 218 - return false; 219 - if (Style->PolygonFill != this->PolygonFill) 220 - return false; 221 - if (Style->PolygonStroke != this->PolygonStroke) 222 - return false; 223 - if (Style->PolygonDisplacementX != this->PolygonDisplacementX) 224 - return false; 225 - if (Style->PolygonDisplacementY != this->PolygonDisplacementY) 226 - return false; 227 - if (Style->PolygonPerpendicularOffset != this->PolygonPerpendicularOffset) 228 - return false; 229 - if (Style->PolygonFillOpacity != this->PolygonFillOpacity) 230 - return false; 231 - if (strcmp(Style->PolygonFillColor, this->PolygonFillColor) != 0) 232 - return false; 233 - if (Style->PolygonStrokeOpacity != this->PolygonStrokeOpacity) 234 - return false; 235 - if (Style->PolygonStrokeWidth != this->PolygonStrokeWidth) 236 - return false; 237 - if (strcmp(Style->PolygonStrokeColor, this->PolygonStrokeColor) != 0) 238 - return false; 239 - if (Style->LabelLinePlacement != this->LabelLinePlacement) 240 - return false; 241 - if (Style->LabelPrint != this->LabelPrint) 242 - return false; 243 - if (Style->LabelColumn == NULL && this->LabelColumn == NULL) 244 - ; 245 - else if (Style->LabelColumn == NULL && this->LabelColumn != NULL) 246 - return false; 247 - else if (Style->LabelColumn != NULL && this->LabelColumn == NULL) 248 - return false; 249 - else if (strcmp(Style->LabelColumn, this->LabelColumn) != 0) 250 - return false; 251 - if (Style->FontFacename == NULL && this->FontFacename == NULL) 252 - ; 253 - else if (Style->FontFacename == NULL && this->FontFacename != NULL) 254 - return false; 255 - else if (Style->FontFacename != NULL && this->FontFacename == NULL) 256 - return false; 257 - else if (strcmp(Style->FontFacename, this->FontFacename) != 0) 258 - return false; 259 - if (Style->FontSize != this->FontSize) 260 - return false; 261 - if (Style->FontStyle != this->FontStyle) 262 - return false; 263 - if (Style->FontWeight != this->FontWeight) 264 - return false; 265 - if (Style->FontOpacity != this->FontOpacity) 266 - return false; 267 - if (strcmp(Style->FontColor, this->FontColor) != 0) 268 - return false; 269 - if (Style->HasHalo != this->HasHalo) 270 - return false; 271 - if (Style->HaloRadius != this->HaloRadius) 272 - return false; 273 - if (Style->HaloOpacity != this->HaloOpacity) 274 - return false; 275 - if (strcmp(Style->HaloColor, this->HaloColor) != 0) 276 - return false; 277 - if (Style->LabelAnchorX != this->LabelAnchorX) 278 - return false; 279 - if (Style->LabelAnchorY != this->LabelAnchorY) 280 - return false; 281 - if (Style->LabelDisplacementX != this->LabelDisplacementX) 282 - return false; 283 - if (Style->LabelDisplacementY != this->LabelDisplacementY) 284 - return false; 285 - if (Style->LabelRotation != this->LabelRotation) 286 - return false; 287 - if (Style->LabelPerpendicularOffset != this->LabelPerpendicularOffset) 288 - return false; 289 - if (Style->RepeatedLabel != this->RepeatedLabel) 290 - return false; 291 - if (Style->LabelInitialGap != this->LabelInitialGap) 292 - return false; 293 - if (Style->LabelGap != this->LabelGap) 294 - return false; 295 - if (Style->LabelIsAligned != this->LabelIsAligned) 296 - return false; 297 - if (Style->LabelGeneralizeLine != this->LabelGeneralizeLine) 298 - return false; 299 - return true; 300 -} 301 - 302 -void QuickStyleObj::SetLabelColumn(const char *x) 303 -{ 304 -// 305 -// setting the Label Column 306 -// 307 - int len; 308 - if (LabelColumn != NULL) 309 - free(LabelColumn); 310 - LabelColumn = NULL; 311 - if (x == NULL) 312 - return; 313 - len = strlen(x); 314 - LabelColumn = (char *) malloc(len + 1); 315 - strcpy(LabelColumn, x); 316 -} 317 - 318 -void QuickStyleObj::SetFontFacename(const char *x) 319 -{ 320 -// 321 -// setting the Font Facename 322 -// 323 - int len; 324 - if (FontFacename != NULL) 325 - free(FontFacename); 326 - FontFacename = NULL; 327 - if (x == NULL) 328 - return; 329 - len = strlen(x); 330 - FontFacename = (char *) malloc(len + 1); 331 - strcpy(FontFacename, x); 332 -} 333 - 334 -void QuickStyleObj::UpdateXmlStyle() 335 -{ 336 -// 337 -// updating the XML Style 338 -// 339 - if (XmlStyle != NULL) 340 - sqlite3_free(XmlStyle); 341 - XmlStyle = CreateXmlStyle(); 342 -} 343 - 344 -char *QuickStyleObj::CreateXmlStyle() 345 -{ 346 -// 347 -// creating the XML Style 348 -// 349 - char *xml; 350 - if ((MinScaleEnabled == true || MaxScaleEnabled == true) || LabelPrint == true 351 - || Type == QUICK_STYLE_GEOMETRY) 352 - xml = DoCreateFeatureTypeXML(); 353 - else 354 - xml = DoCreateSymbolizerXML(false); 355 - return xml; 356 - 357 -} 358 - 359 -char *QuickStyleObj::DoCreateFeatureTypeXML() 360 -{ 361 -// 362 -// creating a FeatureType XML Style 363 -// 364 - const char *cstr; 365 - char *prev; 366 - char *xml2; 367 - char *xml = sqlite3_mprintf("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"); 368 - prev = xml; 369 - xml = sqlite3_mprintf("%s<FeatureTypeStyle version=\"1.1.0\" ", prev); 370 - sqlite3_free(prev); 371 - prev = xml; 372 - xml = 373 - sqlite3_mprintf 374 - ("%sxsi:schemaLocation=\"http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/FeatureStyle.xsd\" ", 375 - prev); 376 - sqlite3_free(prev); 377 - prev = xml; 378 - xml = sqlite3_mprintf 379 - ("%sxmlns=\"http://www.opengis.net/se\" xmlns:ogc=\"http://www.opengis.net/ogc\" ", 380 - prev); 381 - sqlite3_free(prev); 382 - prev = xml; 383 - xml = 384 - sqlite3_mprintf("%sxmlns:xlink=\"http://www.w3.org/1999/xlink\" ", prev); 385 - sqlite3_free(prev); 386 - prev = xml; 387 - xml = 388 - sqlite3_mprintf 389 - ("%sxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n", prev); 390 - sqlite3_free(prev); 391 - prev = xml; 392 - xml = sqlite3_mprintf("%s\t<Name>%s</Name>\r\n", prev, UUID); 393 - sqlite3_free(prev); 394 - prev = xml; 395 - xml = sqlite3_mprintf("%s\t<Description>\r\n", prev); 396 - sqlite3_free(prev); 397 - prev = xml; 398 - xml = sqlite3_mprintf("%s\t\t<Title>%s</Title>\r\n", prev, "Quick Style"); 399 - sqlite3_free(prev); 400 - prev = xml; 401 - xml = 402 - sqlite3_mprintf("%s\t\t<Abstract>%s</Abstract>\r\n", prev, 403 - "Created by SpatialiteGUI"); 404 - sqlite3_free(prev); 405 - prev = xml; 406 - xml = sqlite3_mprintf("%s\t</Description>\r\n", prev); 407 - sqlite3_free(prev); 408 - prev = xml; 409 - xml = sqlite3_mprintf("%s\t<Rule>\r\n", prev); 410 - sqlite3_free(prev); 411 - prev = xml; 412 - if (MinScaleEnabled == true) 413 - { 414 - xml = 415 - sqlite3_mprintf 416 - ("%s\t\t<MinScaleDenominator>%1.2f</MinScaleDenominator>\r\n", prev, 417 - ScaleMin); 418 - sqlite3_free(prev); 419 - prev = xml; 420 - } 421 - if (MaxScaleEnabled == true) 422 - { 423 - xml = 424 - sqlite3_mprintf 425 - ("%s\t\t<MaxScaleDenominator>%1.2f</MaxScaleDenominator>\r\n", prev, 426 - ScaleMax); 427 - sqlite3_free(prev); 428 - prev = xml; 429 - } 430 - xml2 = NULL; 431 - if (Type == QUICK_STYLE_POINT) 432 - xml2 = DoCreatePointSymbolizerXML(true); 433 - if (Type == QUICK_STYLE_LINE) 434 - xml2 = DoCreateLineSymbolizerXML(true); 435 - if (Type == QUICK_STYLE_POLYGON) 436 - xml2 = DoCreatePolygonSymbolizerXML(true); 437 - else 438 - { 439 - // mixed-type Symbolizers 440 - xml2 = DoCreatePointSymbolizerXML(true); 441 - if (xml2 != NULL) 442 - { 443 - xml = sqlite3_mprintf("%s%s", prev, xml2); 444 - sqlite3_free(prev); 445 - sqlite3_free(xml2); 446 - prev = xml; 447 - } 448 - xml2 = DoCreateLineSymbolizerXML(true); 449 - if (xml2 != NULL) 450 - { 451 - xml = sqlite3_mprintf("%s%s", prev, xml2); 452 - sqlite3_free(prev); 453 - sqlite3_free(xml2); 454 - prev = xml; 455 - } 456 - xml2 = DoCreatePolygonSymbolizerXML(true); 457 - if (xml2 != NULL) 458 - { 459 - xml = sqlite3_mprintf("%s%s", prev, xml2); 460 - sqlite3_free(prev); 461 - sqlite3_free(xml2); 462 - xml2 = NULL; 463 - prev = xml; 464 - } 465 - } 466 - if (xml2 != NULL) 467 - { 468 - xml = sqlite3_mprintf("%s%s", prev, xml2); 469 - sqlite3_free(prev); 470 - sqlite3_free(xml2); 471 - prev = xml; 472 - } 473 - if (LabelPrint == true) 474 - { 475 - // adding a Text Symbolizer 476 - xml2 = NULL; 477 - if (Type == QUICK_STYLE_POINT || QUICK_STYLE_POLYGON) 478 - xml2 = DoCreateTextPointSymbolizerXML(); 479 - if (Type == QUICK_STYLE_LINE) 480 - xml2 = DoCreateTextLineSymbolizerXML(); 481 - if (xml2 != NULL) 482 - { 483 - xml = sqlite3_mprintf("%s%s", prev, xml2); 484 - sqlite3_free(prev); 485 - sqlite3_free(xml2); 486 - prev = xml; 487 - } 488 - } 489 - xml = sqlite3_mprintf("%s\t</Rule>\r\n</FeatureTypeStyle>\r\n", prev); 490 - sqlite3_free(prev); 491 - return xml; 492 -} 493 - 494 -char *QuickStyleObj::DoCreateSymbolizerXML(bool subordered) 495 -{ 496 -// 497 -// creating a Symbolizer XML Style 498 -// 499 - if (Type == QUICK_STYLE_POINT) 500 - return DoCreatePointSymbolizerXML(subordered); 501 - if (Type == QUICK_STYLE_LINE) 502 - return DoCreateLineSymbolizerXML(subordered); 503 - if (Type == QUICK_STYLE_POLYGON) 504 - return DoCreatePolygonSymbolizerXML(subordered); 505 - return NULL; 506 -} 507 - 508 -char *QuickStyleObj::DoCreatePointSymbolizerXML(bool subordered) 509 -{ 510 -// 511 -// creating a Point Symbolizer XML Style 512 -// 513 - const char *cstr; 514 - char *prev; 515 - const char *extra = ""; 516 - char *xml = sqlite3_mprintf("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"); 517 - if (subordered == true) 518 - { 519 - extra = "\t\t"; 520 - sqlite3_free(xml); 521 - prev = (char *) ""; 522 - xml = sqlite3_mprintf("%s%s<PointSymbolizer>\r\n", prev, extra); 523 - } else 524 - { 525 - prev = xml; 526 - xml = sqlite3_mprintf("%s<PointSymbolizer version=\"1.1.0\" ", prev); 527 - sqlite3_free(prev); 528 - prev = xml; 529 - xml = 530 - sqlite3_mprintf 531 - ("%sxsi:schemaLocation=\"http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd\" ", 532 - prev); 533 - sqlite3_free(prev); 534 - prev = xml; 535 - xml = sqlite3_mprintf 536 - ("%sxmlns=\"http://www.opengis.net/se\" xmlns:ogc=\"http://www.opengis.net/ogc\" ", 537 - prev); 538 - sqlite3_free(prev); 539 - prev = xml; 540 - xml = 541 - sqlite3_mprintf("%sxmlns:xlink=\"http://www.w3.org/1999/xlink\" ", 542 - prev); 543 - sqlite3_free(prev); 544 - prev = xml; 545 - cstr = "http://www.opengeospatial.org/se/units/pixel"; 546 - xml = 547 - sqlite3_mprintf 548 - ("%sxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" uom=\"%s\">\r\n", 549 - prev, cstr); 550 - sqlite3_free(prev); 551 - } 552 - prev = xml; 553 - if (subordered != true) 554 - { 555 - xml = sqlite3_mprintf("%s\t<Name>%s</Name>\r\n", prev, UUID); 556 - sqlite3_free(prev); 557 - prev = xml; 558 - xml = sqlite3_mprintf("%s\t<Description>\r\n", prev); 559 - sqlite3_free(prev); 560 - prev = xml; 561 - xml = 562 - sqlite3_mprintf("%s\t\t<Title>%s</Title>\r\n", prev, 563 - "Quick Style - PointSymbolizer"); 564 - sqlite3_free(prev); 565 - prev = xml; 566 - xml = 567 - sqlite3_mprintf("%s\t\t<Abstract>%s</Abstract>\r\n", prev, 568 - "Created by SpatialiteGUI"); 569 - sqlite3_free(prev); 570 - prev = xml; 571 - xml = sqlite3_mprintf("%s\t</Description>\r\n", prev); 572 - sqlite3_free(prev); 573 - prev = xml; 574 - } 575 - xml = sqlite3_mprintf("%s%s\t<Graphic>\r\n", prev, extra); 576 - sqlite3_free(prev); 577 - prev = xml; 578 -// mark symbol 579 - xml = sqlite3_mprintf("%s%s\t\t<Mark>\r\n", prev, extra); 580 - sqlite3_free(prev); 581 - prev = xml; 582 - switch (SymbolWellKnownMark) 583 - { 584 - case RL2_GRAPHIC_MARK_CIRCLE: 585 - cstr = "circle"; 586 - break; 587 - case RL2_GRAPHIC_MARK_TRIANGLE: 588 - cstr = "triangle"; 589 - break; 590 - case RL2_GRAPHIC_MARK_STAR: 591 - cstr = "star"; 592 - break; 593 - case RL2_GRAPHIC_MARK_CROSS: 594 - cstr = "cross"; 595 - break; 596 - case RL2_GRAPHIC_MARK_X: 597 - cstr = "x"; 598 - break; 599 - default: 600 - cstr = "square"; 601 - break; 602 - }; 603 - xml = 604 - sqlite3_mprintf("%s%s\t\t\t<WellKnownName>%s</WellKnownName>\r\n", prev, 605 - extra, cstr); 606 - sqlite3_free(prev); 607 - prev = xml; 608 -// Mark Fill 609 - xml = sqlite3_mprintf("%s%s\t\t\t<Fill>\r\n", prev, extra); 610 - sqlite3_free(prev); 611 - prev = xml; 612 - xml = 613 - sqlite3_mprintf 614 - ("%s%s\t\t\t\t<SvgParameter name=\"fill\">%s</SvgParameter>\r\n", 615 - prev, extra, SymbolFillColor); 616 - sqlite3_free(prev); 617 - prev = xml; 618 - xml = sqlite3_mprintf("%s%s\t\t\t</Fill>\r\n", prev, extra); 619 - sqlite3_free(prev); 620 - prev = xml; 621 -// Mark Stroke 622 - xml = sqlite3_mprintf("%s%s\t\t\t<Stroke>\r\n", prev, extra); 623 - sqlite3_free(prev); 624 - prev = xml; 625 - xml = 626 - sqlite3_mprintf 627 - ("%s%s\t\t\t\t<SvgParameter name=\"stroke\">%s</SvgParameter>\r\n", 628 - prev, extra, SymbolStrokeColor); 629 - sqlite3_free(prev); 630 - prev = xml; 631 - xml = 632 - sqlite3_mprintf 633 - ("%s%s\t\t\t\t<SvgParameter name=\"stroke-width\">%1.2f</SvgParameter>\r\n", 634 - prev, extra, 1.0); 635 - sqlite3_free(prev); 636 - prev = xml; 637 - xml = 638 - sqlite3_mprintf 639 - ("%s%s\t\t\t\t<SvgParameter name=\"stroke-linejoin\">round</SvgParameter>\r\n", 640 - prev, extra); 641 - sqlite3_free(prev); 642 - prev = xml; 643 - xml = 644 - sqlite3_mprintf 645 - ("%s%s\t\t\t\t<SvgParameter name=\"stroke-linecap\">round</SvgParameter>\r\n", 646 - prev, extra); 647 - sqlite3_free(prev); 648 - prev = xml; 649 - xml = sqlite3_mprintf("%s%s\t\t\t</Stroke>\r\n", prev, extra); 650 - sqlite3_free(prev); 651 - prev = xml; 652 - xml = sqlite3_mprintf("%s%s\t\t</Mark>\r\n", prev, extra); 653 - sqlite3_free(prev); 654 - prev = xml; 655 - if (SymbolOpacity != 1.0) 656 - { 657 - xml = 658 - sqlite3_mprintf("%s%s\t\t<Opacity>%1.2f</Opacity>\r\n", prev, extra, 659 - SymbolOpacity); 660 - sqlite3_free(prev); 661 - prev = xml; 662 - } 663 - xml = 664 - sqlite3_mprintf("%s%s\t\t<Size>%1.2f</Size>\r\n", prev, extra, SymbolSize); 665 - sqlite3_free(prev); 666 - prev = xml; 667 - if (SymbolRotation != 0.0) 668 - { 669 - xml = 670 - sqlite3_mprintf("%s%s\t\t<Rotation>%1.2f</Rotation>\r\n", prev, extra, 671 - SymbolRotation); 672 - sqlite3_free(prev); 673 - prev = xml; 674 - } 675 - if (SymbolAnchorX != 0.5 || SymbolAnchorY != 0.5) 676 - { 677 - xml = sqlite3_mprintf("%s%s\t\t<AnchorPoint>\r\n", prev, extra); 678 - sqlite3_free(prev); 679 - prev = xml; 680 - xml = 681 - sqlite3_mprintf("%s%s\t\t\t<AnchorPointX>%1.4f</AnchorPointX>\r\n", 682 - prev, extra, SymbolAnchorX); 683 - sqlite3_free(prev); 684 - prev = xml; 685 - xml = 686 - sqlite3_mprintf("%s%s\t\t\t<AnchorPointY>%1.4f</AnchorPointY>\r\n", 687 - prev, extra, SymbolAnchorY); 688 - sqlite3_free(prev); 689 - prev = xml; 690 - xml = sqlite3_mprintf("%s%s\t\t</AnchorPoint>\r\n", prev, extra); 691 - sqlite3_free(prev); 692 - prev = xml; 693 - } 694 - if (SymbolDisplacementX != 0.0 || SymbolDisplacementY != 0.0) 695 - { 696 - xml = sqlite3_mprintf("%s%s\t\t<Displacement>\r\n", prev, extra); 697 - sqlite3_free(prev); 698 - prev = xml; 699 - xml = 700 - sqlite3_mprintf("%s%s\t\t\t<DisplacementX>%1.4f</DisplacementX>\r\n", 701 - prev, extra, SymbolDisplacementX); 702 - sqlite3_free(prev); 703 - prev = xml; 704 - xml = 705 - sqlite3_mprintf("%s%s\t\t\t<DisplacementY>%1.4f</DisplacementY>\r\n", 706 - prev, extra, SymbolDisplacementY); 707 - sqlite3_free(prev); 708 - prev = xml; 709 - xml = sqlite3_mprintf("%s%s\t\t</Displacement>\r\n", prev, extra); 710 - sqlite3_free(prev); 711 - prev = xml; 712 - } 713 - xml = sqlite3_mprintf("%s%s\t</Graphic>\r\n", prev, extra); 714 - sqlite3_free(prev); 715 - prev = xml; 716 - xml = sqlite3_mprintf("%s%s</PointSymbolizer>\r\n", prev, extra); 717 - sqlite3_free(prev); 718 - return xml; 719 -} 720 - 721 -char *QuickStyleObj::DoCreateLineSymbolizerXML(bool subordered) 722 -{ 723 -// 724 -// creating a Line Symbolizer XML Style 725 -// 726 - const char *cstr; 727 - char *prev; 728 - const char *extra = ""; 729 - char *xml = sqlite3_mprintf("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"); 730 - prev = xml; 731 - if (subordered == true) 732 - { 733 - extra = "\t\t"; 734 - sqlite3_free(xml); 735 - prev = (char *) ""; 736 - xml = sqlite3_mprintf("%s%s<LineSymbolizer>\r\n", prev, extra); 737 - } else 738 - { 739 - xml = sqlite3_mprintf("%s<LineSymbolizer version=\"1.1.0\" ", prev); 740 - sqlite3_free(prev); 741 - prev = xml; 742 - xml = 743 - sqlite3_mprintf 744 - ("%sxsi:schemaLocation=\"http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd\" ", 745 - prev); 746 - sqlite3_free(prev); 747 - prev = xml; 748 - xml = sqlite3_mprintf 749 - ("%sxmlns=\"http://www.opengis.net/se\" xmlns:ogc=\"http://www.opengis.net/ogc\" ", 750 - prev); 751 - sqlite3_free(prev); 752 - prev = xml; 753 - xml = 754 - sqlite3_mprintf("%sxmlns:xlink=\"http://www.w3.org/1999/xlink\" ", 755 - prev); 756 - sqlite3_free(prev); 757 - prev = xml; 758 - cstr = "http://www.opengeospatial.org/se/units/pixel"; 759 - xml = 760 - sqlite3_mprintf 761 - ("%sxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" uom=\"%s\">\r\n", 762 - prev, cstr); 763 - sqlite3_free(prev); 764 - } 765 - prev = xml; 766 - if (subordered != true) 767 - { 768 - xml = sqlite3_mprintf("%s\t<Name>%s</Name>\r\n", prev, UUID); 769 - sqlite3_free(prev); 770 - prev = xml; 771 - xml = sqlite3_mprintf("%s\t<Description>\r\n", prev); 772 - sqlite3_free(prev); 773 - prev = xml; 774 - xml = 775 - sqlite3_mprintf("%s\t\t<Title>%s</Title>\r\n", prev, 776 - "Quick Style - LineSymbolizer"); 777 - sqlite3_free(prev); 778 - prev = xml; 779 - xml = 780 - sqlite3_mprintf("%s\t\t<Abstract>%s</Abstract>\r\n", prev, 781 - "Created by SpatialiteGUI"); 782 - sqlite3_free(prev); 783 - prev = xml; 784 - xml = sqlite3_mprintf("%s\t</Description>\r\n", prev); 785 - sqlite3_free(prev); 786 - prev = xml; 787 - } 788 - xml = sqlite3_mprintf("%s%s\t<Stroke>\r\n", prev, extra); 789 - sqlite3_free(prev); 790 - prev = xml; 791 -// using a Solid Color 792 - xml = 793 - sqlite3_mprintf 794 - ("%s%s\t\t<SvgParameter name=\"stroke\">%s</SvgParameter>\r\n", prev, extra, 795 - LineStrokeColor); 796 - sqlite3_free(prev); 797 - prev = xml; 798 - xml = 799 - sqlite3_mprintf 800 - ("%s%s\t\t<SvgParameter name=\"stroke-opacity\">%1.2f</SvgParameter>\r\n", 801 - prev, extra, LineOpacity); 802 - sqlite3_free(prev); 803 - prev = xml; 804 - xml = 805 - sqlite3_mprintf 806 - ("%s%s\t\t<SvgParameter name=\"stroke-width\">%1.2f</SvgParameter>\r\n", 807 - prev, extra, LineStrokeWidth); 808 - sqlite3_free(prev); 809 - prev = xml; 810 - xml = 811 - sqlite3_mprintf 812 - ("%s%s\t\t<SvgParameter name=\"stroke-linejoin\">round</SvgParameter>\r\n", 813 - prev, extra); 814 - sqlite3_free(prev); 815 - prev = xml; 816 - xml = 817 - sqlite3_mprintf 818 - ("%s%s\t\t<SvgParameter name=\"stroke-linecap\">round</SvgParameter>\r\n", 819 - prev, extra); 820 - sqlite3_free(prev); 821 - prev = xml; 822 - const char *dashArray; 823 - switch (LineDotStyle) 824 - { 825 - case QUICK_STYLE_DOT_LINE: 826 - dashArray = "5.0, 10.0"; 827 - break; 828 - case QUICK_STYLE_DASH_LINE: 829 - dashArray = "20.0, 20.0"; 830 - break; 831 - case QUICK_STYLE_DASH_DOT_LINE: 832 - dashArray = "20.0, 10.0, 5.0, 10.0"; 833 - break; 834 - default: 835 - dashArray = NULL; 836 - break; 837 - }; 838 - if (dashArray != NULL) 839 - { 840 - xml = 841 - sqlite3_mprintf 842 - ("%s%s\t\t<SvgParameter name=\"stroke-dasharray\">%s</SvgParameter>\r\n", 843 - prev, extra, dashArray); 844 - sqlite3_free(prev); 845 - prev = xml; 846 - } 847 - xml = sqlite3_mprintf("%s%s\t</Stroke>\r\n", prev, extra); 848 - sqlite3_free(prev); 849 - prev = xml; 850 - if (LinePerpendicularOffset != 0.0) 851 - { 852 - xml = 853 - sqlite3_mprintf 854 - ("%s%s\t<PerpendicularOffset>%1.2f</PerpendicularOffset>\r\n", prev, 855 - extra, LinePerpendicularOffset); 856 - sqlite3_free(prev); 857 - prev = xml; 858 - } 859 - xml = sqlite3_mprintf("%s%s</LineSymbolizer>\r\n", prev, extra); 860 - sqlite3_free(prev); 861 - return xml; 862 -} 863 - 864 -char *QuickStyleObj::DoCreatePolygonSymbolizerXML(bool subordered) 865 -{ 866 -// 867 -// creating a Polygon Symbolizer XML Style 868 -// 869 - const char *cstr; 870 - char *prev; 871 - const char *extra = ""; 872 - char *xml = sqlite3_mprintf("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"); 873 - prev = xml; 874 - if (subordered == true) 875 - { 876 - extra = "\t\t"; 877 - sqlite3_free(xml); 878 - prev = (char *) ""; 879 - xml = sqlite3_mprintf("%s%s<PolygonSymbolizer>\r\n", prev, extra); 880 - } else 881 - { 882 - xml = sqlite3_mprintf("%s<PolygonSymbolizer version=\"1.1.0\" ", prev); 883 - sqlite3_free(prev); 884 - prev = xml; 885 - xml = 886 - sqlite3_mprintf 887 - ("%sxsi:schemaLocation=\"http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd\" ", 888 - prev); 889 - sqlite3_free(prev); 890 - prev = xml; 891 - xml = sqlite3_mprintf 892 - ("%sxmlns=\"http://www.opengis.net/se\" xmlns:ogc=\"http://www.opengis.net/ogc\" ", 893 - prev); 894 - sqlite3_free(prev); 895 - prev = xml; 896 - xml = 897 - sqlite3_mprintf("%sxmlns:xlink=\"http://www.w3.org/1999/xlink\" ", 898 - prev); 899 - sqlite3_free(prev); 900 - prev = xml; 901 - cstr = "http://www.opengeospatial.org/se/units/pixel"; 902 - xml = 903 - sqlite3_mprintf 904 - ("%sxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" uom=\"%s\">\r\n", 905 - prev, cstr); 906 - sqlite3_free(prev); 907 - } 908 - prev = xml; 909 - if (subordered != true) 910 - { 911 - xml = sqlite3_mprintf("%s\t<Name>%s</Name>\r\n", prev, UUID); 912 - sqlite3_free(prev); 913 - prev = xml; 914 - xml = sqlite3_mprintf("%s\t<Description>\r\n", prev); 915 - sqlite3_free(prev); 916 - prev = xml; 917 - xml = 918 - sqlite3_mprintf("%s\t\t<Title>%s</Title>\r\n", prev, 919 - "Quick Style - Polygon Symbolizer"); 920 - sqlite3_free(prev); 921 - prev = xml; 922 - xml = 923 - sqlite3_mprintf("%s\t\t<Abstract>%s</Abstract>\r\n", prev, 924 - "Created by SpatialiteGUI"); 925 - sqlite3_free(prev); 926 - prev = xml; 927 - xml = sqlite3_mprintf("%s\t</Description>\r\n", prev); 928 - sqlite3_free(prev); 929 - prev = xml; 930 - } 931 - if (PolygonFill == true) 932 - { 933 - // Polygon Fill 934 - xml = sqlite3_mprintf("%s%s\t<Fill>\r\n", prev, extra); 935 - sqlite3_free(prev); 936 - prev = xml; 937 - // using a Solid Color 938 - xml = 939 - sqlite3_mprintf 940 - ("%s%s\t\t<SvgParameter name=\"fill\">%s</SvgParameter>\r\n", prev, 941 - extra, PolygonFillColor); 942 - sqlite3_free(prev); 943 - prev = xml; 944 - xml = 945 - sqlite3_mprintf 946 - ("%s%s\t\t<SvgParameter name=\"fill-opacity\">%1.2f</SvgParameter>\r\n", 947 - prev, extra, PolygonFillOpacity); 948 - sqlite3_free(prev); 949 - prev = xml; 950 - xml = sqlite3_mprintf("%s%s\t</Fill>\r\n", prev, extra); 951 - sqlite3_free(prev); 952 - prev = xml; 953 - } 954 - if (PolygonStroke == true) 955 - { 956 - // Polygon Stroke 957 - xml = sqlite3_mprintf("%s%s\t<Stroke>\r\n", prev, extra); 958 - sqlite3_free(prev); 959 - prev = xml; 960 - // using a Solid Color 961 - xml = 962 - sqlite3_mprintf 963 - ("%s%s\t\t<SvgParameter name=\"stroke\">%s</SvgParameter>\r\n", prev, 964 - extra, PolygonStrokeColor); 965 - sqlite3_free(prev); 966 - prev = xml; 967 - xml = 968 - sqlite3_mprintf 969 - ("%s%s\t\t<SvgParameter name=\"stroke-opacity\">%1.2f</SvgParameter>\r\n", 970 - prev, extra, PolygonStrokeOpacity); 971 - sqlite3_free(prev); 972 - prev = xml; 973 - xml = 974 - sqlite3_mprintf 975 - ("%s%s\t\t<SvgParameter name=\"stroke-width\">%1.2f</SvgParameter>\r\n", 976 - prev, extra, PolygonStrokeWidth); 977 - sqlite3_free(prev); 978 - prev = xml; 979 - xml = 980 - sqlite3_mprintf 981 - ("%s%s\t\t<SvgParameter name=\"stroke-linejoin\">round</SvgParameter>\r\n", 982 - prev, extra); 983 - sqlite3_free(prev); 984 - prev = xml; 985 - xml = 986 - sqlite3_mprintf 987 - ("%s%s\t\t<SvgParameter name=\"stroke-linecap\">round</SvgParameter>\r\n", 988 - prev, extra); 989 - sqlite3_free(prev); 990 - prev = xml; 991 - xml = sqlite3_mprintf("%s%s\t</Stroke>\r\n", prev, extra); 992 - sqlite3_free(prev); 993 - prev = xml; 994 - } 995 - if (PolygonDisplacementX != 0.0 || PolygonDisplacementY != 0.0) 996 - { 997 - xml = sqlite3_mprintf("%s%s\t<Displacement>\r\n", prev, extra); 998 - sqlite3_free(prev); 999 - prev = xml; 1000 - xml = 1001 - sqlite3_mprintf("%s%s\t\t<DisplacementX>%1.4f</DisplacementX>\r\n", 1002 - prev, extra, PolygonDisplacementX); 1003 - sqlite3_free(prev); 1004 - prev = xml; 1005 - xml = 1006 - sqlite3_mprintf("%s%s\t\t<DisplacementY>%1.4f</DisplacementY>\r\n", 1007 - prev, extra, PolygonDisplacementY); 1008 - sqlite3_free(prev); 1009 - prev = xml; 1010 - xml = sqlite3_mprintf("%s%s\t</Displacement>\r\n", prev, extra); 1011 - sqlite3_free(prev); 1012 - prev = xml; 1013 - } 1014 - if (PolygonPerpendicularOffset != 0.0) 1015 - { 1016 - xml = 1017 - sqlite3_mprintf 1018 - ("%s%s\t<PerpendicularOffset>%1.4f</PerpendicularOffset>\r\n", prev, 1019 - extra, PolygonPerpendicularOffset); 1020 - sqlite3_free(prev); 1021 - prev = xml; 1022 - } 1023 - xml = sqlite3_mprintf("%s%s</PolygonSymbolizer>\r\n", prev, extra); 1024 - sqlite3_free(prev); 1025 - return xml; 1026 -} 1027 - 1028 -char *QuickStyleObj::DoCreateTextPointSymbolizerXML() 1029 -{ 1030 -// 1031 -// creating a Text Symbolizer (Point Placement) 1032 -// 1033 - const char *cstr; 1034 - char *xml; 1035 - char *prev; 1036 - xml = sqlite3_mprintf("\t\t<TextSymbolizer>\r\n"); 1037 - prev = xml; 1038 - xml = sqlite3_mprintf("%s\t\t\t<Label>%s</Label>\r\n", prev, LabelColumn); 1039 - sqlite3_free(prev); 1040 - prev = xml; 1041 - xml = sqlite3_mprintf("%s\t\t\t<Font>\r\n", prev); 1042 - sqlite3_free(prev); 1043 - prev = xml; 1044 - xml = 1045 - sqlite3_mprintf 1046 - ("%s\t\t\t\t<SvgParameter name=\"font-family\">%s</SvgParameter>\r\n", prev, 1047 - FontFacename); 1048 - sqlite3_free(prev); 1049 - prev = xml; 1050 - if (FontStyle == RL2_FONTSTYLE_ITALIC) 1051 - xml = 1052 - sqlite3_mprintf 1053 - ("%s\t\t\t\t<SvgParameter name=\"font-style\">italic</SvgParameter>\r\n", 1054 - prev); 1055 - else if (FontStyle == RL2_FONTSTYLE_OBLIQUE) 1056 - xml = 1057 - sqlite3_mprintf 1058 - ("%s\t\t\t\t<SvgParameter name=\"font-style\">oblique</SvgParameter>\r\n", 1059 - prev); 1060 - else 1061 - xml = 1062 - sqlite3_mprintf 1063 - ("%s\t\t\t\t<SvgParameter name=\"font-style\">normal</SvgParameter>\r\n", 1064 - prev); 1065 - sqlite3_free(prev); 1066 - prev = xml; 1067 - if (FontWeight == RL2_FONTWEIGHT_BOLD) 1068 - xml = 1069 - sqlite3_mprintf 1070 - ("%s\t\t\t\t<SvgParameter name=\"font-weight\">bold</SvgParameter>\r\n", 1071 - prev); 1072 - else 1073 - xml = 1074 - sqlite3_mprintf 1075 - ("%s\t\t\t\t<SvgParameter name=\"font-weight\">normal</SvgParameter>\r\n", 1076 - prev); 1077 - sqlite3_free(prev); 1078 - prev = xml; 1079 - xml = 1080 - sqlite3_mprintf 1081 - ("%s\t\t\t\t<SvgParameter name=\"font-size\">%1.2f</SvgParameter>\r\n", 1082 - prev, FontSize); 1083 - sqlite3_free(prev); 1084 - prev = xml; 1085 - xml = sqlite3_mprintf("%s\t\t\t</Font>\r\n", prev); 1086 - sqlite3_free(prev); 1087 - prev = xml; 1088 - xml = sqlite3_mprintf("%s\t\t\t<LabelPlacement>\n", prev); 1089 - sqlite3_free(prev); 1090 - prev = xml; 1091 -// PointPlacement 1092 - xml = sqlite3_mprintf("%s\t\t\t\t<PointPlacement>\n", prev); 1093 - sqlite3_free(prev); 1094 - prev = xml; 1095 - if (LabelAnchorX != 0.5 || LabelAnchorY != 0.5) 1096 - { 1097 - xml = sqlite3_mprintf("%s\t\t\t\t\t<AnchorPoint>\r\n", prev); 1098 - sqlite3_free(prev); 1099 - prev = xml; 1100 - xml = 1101 - sqlite3_mprintf 1102 - ("%s\t\t\t\t\t\t<AnchorPointX>%1.4f</AnchorPointX>\r\n", prev, 1103 - LabelAnchorX); 1104 - sqlite3_free(prev); 1105 - prev = xml; 1106 - xml = 1107 - sqlite3_mprintf 1108 - ("%s\t\t\t\t\t\t<AnchorPointY>%1.4f</AnchorPointY>\r\n", prev, 1109 - LabelAnchorY); 1110 - sqlite3_free(prev); 1111 - prev = xml; 1112 - xml = sqlite3_mprintf("%s\t\t\t\t\t</AnchorPoint>\r\n", prev); 1113 - sqlite3_free(prev); 1114 - prev = xml; 1115 - } 1116 - if (LabelDisplacementX != 0.0 || LabelDisplacementY != 0.0) 1117 - { 1118 - xml = sqlite3_mprintf("%s\t\t\t\t\t<Displacement>\r\n", prev); 1119 - sqlite3_free(prev); 1120 - prev = xml; 1121 - xml = 1122 - sqlite3_mprintf 1123 - ("%s\t\t\t\t\t\t<DisplacementX>%1.4f</DisplacementX>\r\n", prev, 1124 - LabelDisplacementX); 1125 - sqlite3_free(prev); 1126 - prev = xml; 1127 - xml = 1128 - sqlite3_mprintf 1129 - ("%s\t\t\t\t\t\t<DisplacementY>%1.4f</DisplacementY>\r\n", prev, 1130 - LabelDisplacementY); 1131 - sqlite3_free(prev); 1132 - prev = xml; 1133 - xml = sqlite3_mprintf("%s\t\t\t\t\t</Displacement>\r\n", prev); 1134 - sqlite3_free(prev); 1135 - prev = xml; 1136 - } 1137 - if (LabelRotation != 0.0) 1138 - { 1139 - xml = 1140 - sqlite3_mprintf 1141 - ("%s\t\t\t\t\t<Rotation>%1.2f</Rotation>\r\n", prev, LabelRotation); 1142 - sqlite3_free(prev); 1143 - prev = xml; 1144 - } 1145 - xml = sqlite3_mprintf("%s\t\t\t\t</PointPlacement>\r\n", prev); 1146 - sqlite3_free(prev); 1147 - prev = xml; 1148 - xml = sqlite3_mprintf("%s\t\t\t</LabelPlacement>\r\n", prev); 1149 - sqlite3_free(prev); 1150 - prev = xml; 1151 - if (HasHalo == true) 1152 - { 1153 - // Halo 1154 - xml = sqlite3_mprintf("%s\t\t\t<Halo>\r\n", prev); 1155 - sqlite3_free(prev); 1156 - prev = xml; 1157 - xml = 1158 - sqlite3_mprintf("%s\t\t\t\t<Radius>%1.2f</Radius>\r\n", prev, 1159 - HaloRadius); 1160 - sqlite3_free(prev); 1161 - prev = xml; 1162 - xml = sqlite3_mprintf("%s\t\t\t\t<Fill>\r\n", prev); 1163 - sqlite3_free(prev); 1164 - prev = xml; 1165 - xml = 1166 - sqlite3_mprintf 1167 - ("%s\t\t\t\t\t<SvgParameter name=\"fill\">%s</SvgParameter>\r\n", 1168 - prev, HaloColor); 1169 - sqlite3_free(prev); 1170 - prev = xml; 1171 - xml = 1172 - sqlite3_mprintf 1173 - ("%s\t\t\t\t\t<SvgParameter name=\"fill-opacity\">%1.2f</SvgParameter>\r\n", 1174 - prev, HaloOpacity); 1175 - sqlite3_free(prev); 1176 - prev = xml; 1177 - xml = sqlite3_mprintf("%s\t\t\t\t</Fill>\r\n", prev); 1178 - sqlite3_free(prev); 1179 - prev = xml; 1180 - xml = sqlite3_mprintf("%s\t\t\t</Halo>\r\n", prev); 1181 - sqlite3_free(prev); 1182 - prev = xml; 1183 - } 1184 - xml = sqlite3_mprintf("%s\t\t\t<Fill>\r\n", prev); 1185 - sqlite3_free(prev); 1186 - prev = xml; 1187 - xml = 1188 - sqlite3_mprintf 1189 - ("%s\t\t\t\t<SvgParameter name=\"fill\">%s</SvgParameter>\r\n", prev, 1190 - FontColor); 1191 - sqlite3_free(prev); 1192 - prev = xml; 1193 - xml = 1194 - sqlite3_mprintf 1195 - ("%s\t\t\t\t<SvgParameter name=\"fill-opacity\">%1.2f</SvgParameter>\r\n", 1196 - prev, FontOpacity); 1197 - sqlite3_free(prev); 1198 - prev = xml; 1199 - xml = sqlite3_mprintf("%s\t\t\t</Fill>\r\n", prev); 1200 - sqlite3_free(prev); 1201 - prev = xml; 1202 - xml = sqlite3_mprintf("%s\t\t</TextSymbolizer>\r\n", prev); 1203 - sqlite3_free(prev); 1204 - return xml; 1205 -} 1206 - 1207 -char *QuickStyleObj::DoCreateTextLineSymbolizerXML() 1208 -{ 1209 -// 1210 -// creating a Text Symbolizer (Line Placement) 1211 -// 1212 - const char *cstr; 1213 - char *xml; 1214 - char *prev; 1215 - xml = sqlite3_mprintf("\t\t<TextSymbolizer>\r\n"); 1216 - prev = xml; 1217 - xml = sqlite3_mprintf("%s\t\t\t<Label>%s</Label>\r\n", prev, LabelColumn); 1218 - sqlite3_free(prev); 1219 - prev = xml; 1220 - xml = sqlite3_mprintf("%s\t\t\t<Font>\r\n", prev); 1221 - sqlite3_free(prev); 1222 - prev = xml; 1223 - xml = 1224 - sqlite3_mprintf 1225 - ("%s\t\t\t\t<SvgParameter name=\"font-family\">%s</SvgParameter>\r\n", prev, 1226 - FontFacename); 1227 - sqlite3_free(prev); 1228 - prev = xml; 1229 - if (FontStyle == RL2_FONTSTYLE_ITALIC) 1230 - xml = 1231 - sqlite3_mprintf 1232 - ("%s\t\t\t\t<SvgParameter name=\"font-style\">italic</SvgParameter>\r\n", 1233 - prev); 1234 - else if (FontStyle == RL2_FONTSTYLE_OBLIQUE) 1235 - xml = 1236 - sqlite3_mprintf 1237 - ("%s\t\t\t\t<SvgParameter name=\"font-style\">oblique</SvgParameter>\r\n", 1238 - prev); 1239 - else 1240 - xml = 1241 - sqlite3_mprintf 1242 - ("%s\t\t\t\t<SvgParameter name=\"font-style\">normal</SvgParameter>\r\n", 1243 - prev); 1244 - sqlite3_free(prev); 1245 - prev = xml; 1246 - if (FontWeight == RL2_FONTWEIGHT_BOLD) 1247 - xml = 1248 - sqlite3_mprintf 1249 - ("%s\t\t\t\t<SvgParameter name=\"font-weight\">bold</SvgParameter>\r\n", 1250 - prev); 1251 - else 1252 - xml = 1253 - sqlite3_mprintf 1254 - ("%s\t\t\t\t<SvgParameter name=\"font-weight\">normal</SvgParameter>\r\n", 1255 - prev); 1256 - sqlite3_free(prev); 1257 - prev = xml; 1258 - xml = 1259 - sqlite3_mprintf 1260 - ("%s\t\t\t\t<SvgParameter name=\"font-size\">%1.2f</SvgParameter>\r\n", 1261 - prev, FontSize); 1262 - sqlite3_free(prev); 1263 - prev = xml; 1264 - xml = sqlite3_mprintf("%s%s\t\t\t</Font>\r\n", prev); 1265 - sqlite3_free(prev); 1266 - prev = xml; 1267 - xml = sqlite3_mprintf("%s\t\t\t<LabelPlacement>\n", prev); 1268 - sqlite3_free(prev); 1269 - prev = xml; 1270 -// LinePlacement 1271 - xml = sqlite3_mprintf("%s\t\t\t\t<LinePlacement>\n", prev); 1272 - sqlite3_free(prev); 1273 - prev = xml; 1274 - if (LabelPerpendicularOffset != 0.0) 1275 - { 1276 - xml = 1277 - sqlite3_mprintf 1278 - ("%s\t\t\t\t\t<PerpendicularOffset>%1.4f</PerpendicularOffset>\r\n", 1279 - prev, LabelPerpendicularOffset); 1280 - sqlite3_free(prev); 1281 - prev = xml; 1282 - } 1283 - if (RepeatedLabel == true) 1284 - { 1285 - // Repeated: InitialGap and Gap 1286 - xml = 1287 - sqlite3_mprintf("%s\t\t\t\t\t<IsRepeated>true</IsRepeated>\r\n", prev); 1288 - sqlite3_free(prev); 1289 - prev = xml; 1290 - xml = 1291 - sqlite3_mprintf 1292 - ("%s\t\t\t\t\t<InitialGap>%1.4f</InitialGap>\r\n", prev, 1293 - LabelInitialGap); 1294 - sqlite3_free(prev); 1295 - prev = xml; 1296 - xml = sqlite3_mprintf("%s\t\t\t\t\t<Gap>%1.4f</Gap>\r\n", prev, LabelGap); 1297 - sqlite3_free(prev); 1298 - prev = xml; 1299 - } 1300 - if (LabelIsAligned == true) 1301 - { 1302 - xml = 1303 - sqlite3_mprintf("%s\t\t\t\t\t<IsAligned>true</IsAligned>\r\n", prev); 1304 - sqlite3_free(prev); 1305 - prev = xml; 1306 - } 1307 - if (LabelGeneralizeLine == true) 1308 - { 1309 - xml = 1310 - sqlite3_mprintf 1311 - ("%s\t\t\t\t\t<GeneralizeLine>true</GeneralizeLine>\r\n", prev); 1312 - sqlite3_free(prev); 1313 - prev = xml; 1314 - } 1315 - xml = sqlite3_mprintf("%s\t\t\t\t</LinePlacement>\r\n", prev); 1316 - sqlite3_free(prev); 1317 - prev = xml; 1318 - xml = sqlite3_mprintf("%s\t\t\t</LabelPlacement>\r\n", prev); 1319 - sqlite3_free(prev); 1320 - prev = xml; 1321 - if (HasHalo == true) 1322 - { 1323 - // Halo 1324 - xml = sqlite3_mprintf("%s\t\t\t<Halo>\r\n", prev); 1325 - sqlite3_free(prev); 1326 - prev = xml; 1327 - xml = 1328 - sqlite3_mprintf("%s\t\t\t\t<Radius>%1.2f</Radius>\r\n", prev, 1329 - HaloRadius); 1330 - sqlite3_free(prev); 1331 - prev = xml; 1332 - xml = sqlite3_mprintf("%s\t\t\t\t<Fill>\r\n", prev); 1333 - sqlite3_free(prev); 1334 - prev = xml; 1335 - xml = 1336 - sqlite3_mprintf 1337 - ("%s\t\t\t\t\t<SvgParameter name=\"fill\">%s</SvgParameter>\r\n", 1338 - prev, HaloColor); 1339 - sqlite3_free(prev); 1340 - prev = xml; 1341 - xml = 1342 - sqlite3_mprintf 1343 - ("%s\t\t\t\t\t<SvgParameter name=\"fill-opacity\">%1.2f</SvgParameter>\r\n", 1344 - prev, HaloOpacity); 1345 - sqlite3_free(prev); 1346 - prev = xml; 1347 - xml = sqlite3_mprintf("%s\t\t\t\t</Fill>\r\n", prev); 1348 - sqlite3_free(prev); 1349 - prev = xml; 1350 - xml = sqlite3_mprintf("%s\t\t\t</Halo>\r\n", prev); 1351 - sqlite3_free(prev); 1352 - prev = xml; 1353 - } 1354 - xml = sqlite3_mprintf("%s\t\t\t<Fill>\r\n", prev); 1355 - sqlite3_free(prev); 1356 - prev = xml; 1357 - xml = 1358 - sqlite3_mprintf 1359 - ("%s\t\t\t\t<SvgParameter name=\"fill\">%s</SvgParameter>\r\n", prev, 1360 - FontColor); 1361 - sqlite3_free(prev); 1362 - prev = xml; 1363 - xml = 1364 - sqlite3_mprintf 1365 - ("%s\t\t\t\t<SvgParameter name=\"fill-opacity\">%1.2f</SvgParameter>\r\n", 1366 - prev, FontOpacity); 1367 - sqlite3_free(prev); 1368 - prev = xml; 1369 - xml = sqlite3_mprintf("%s\t\t\t</Fill>\r\n", prev); 1370 - sqlite3_free(prev); 1371 - prev = xml; 1372 - xml = sqlite3_mprintf("%s\t\t</TextSymbolizer>\r\n", prev); 1373 - sqlite3_free(prev); 1374 - return xml; 1375 -} 1376 - 1377 -const unsigned char *QuickStyleObj::CloneXmlStyle() 1378 -{ 1379 -// 1380 -// cloning the XML Style definition 1381 -// 1382 - if (XmlStyle == NULL) 1383 - XmlStyle = CreateXmlStyle(); 1384 - if (XmlStyle == NULL) 1385 - return NULL; 1386 - int len = strlen(XmlStyle); 1387 - char *cloned = (char *) malloc(len + 1); 1388 - strcpy(cloned, XmlStyle); 1389 - return (const unsigned char *) cloned; 1390 -} 1391 - 1392 -void QuickStyleObj::DoGetUUID(char *uuid) 1393 -{ 1394 -// 1395 -// creating an UUID value 1396 -// 1397 - unsigned char rnd[16]; 1398 - char *p = uuid; 1399 - int i; 1400 - sqlite3_randomness(16, rnd); 1401 - for (i = 0; i < 16; i++) 1402 - { 1403 - if (i == 4 || i == 6 || i == 8 || i == 10) 1404 - *p++ = '-'; 1405 - sprintf(p, "%02x", rnd[i]); 1406 - p += 2; 1407 - } 1408 - *p = '\0'; 1409 - uuid[14] = '4'; 1410 - uuid[19] = '8'; 1411 -} 1412 - 1413 -int QuickStyleObj::RandomWellKnownMark() 1414 -{ 1415 -// 1416 -// returning a random Symbol Well Known Mark 1417 -// 1418 - int wkt; 1419 - int mod = rand() % 6; 1420 - switch (mod) 1421 - { 1422 - case 0: 1423 - wkt = RL2_GRAPHIC_MARK_SQUARE; 1424 - break; 1425 - case 1: 1426 - wkt = RL2_GRAPHIC_MARK_CIRCLE; 1427 - break; 1428 - case 2: 1429 - wkt = RL2_GRAPHIC_MARK_TRIANGLE; 1430 - break; 1431 - case 3: 1432 - wkt = RL2_GRAPHIC_MARK_STAR; 1433 - break; 1434 - case 4: 1435 - wkt = RL2_GRAPHIC_MARK_CROSS; 1436 - break; 1437 - default: 1438 - wkt = RL2_GRAPHIC_MARK_X; 1439 - break; 1440 - }; 1441 - return wkt; 1442 -} 1443 - 1444 -void QuickStyleObj::RandomColor(char *color) 1445 -{ 1446 -// 1447 -// setting a random Color 1448 -// 1449 - unsigned char red = rand() % 256; 1450 - unsigned char green = rand() % 256; 1451 - unsigned char blue = rand() % 256; 1452 - sprintf(color, "#%02x%02x%02x", red, green, blue); 1453 -} 1454 - 1455 -QuickStyleTopologyObj::QuickStyleTopologyObj(int type) 1456 -{ 1457 -// ctor 1458 - QuickStyleObj::DoGetUUID(UUID); 1459 - Type = type; 1460 - MinScaleEnabled = false; 1461 - MaxScaleEnabled = false; 1462 - ScaleMin = 0.0; 1463 - ScaleMax = 0.0; 1464 - NodeOpacity = 1.0; 1465 - NodeSize = 16; 1466 - NodeRotation = 0.0; 1467 - NodeAnchorX = 0.5; 1468 - NodeAnchorY = 0.5; 1469 - NodeDisplacementX = 0.0; 1470 - NodeDisplacementY = 0.0; 1471 - NodeWellKnownMark = QuickStyleObj::RandomWellKnownMark(); 1472 - QuickStyleObj::RandomColor(NodeFillColor); 1473 - QuickStyleObj::RandomColor(NodeStrokeColor); 1474 - EdgeLinkOpacity = 1.0; 1475 - EdgeLinkPerpendicularOffset = 0.0; 1476 - EdgeLinkStrokeWidth = 1.0; 1477 - QuickStyleObj::RandomColor(EdgeLinkStrokeColor); 1478 - EdgeLinkDotStyle = QUICK_STYLE_SOLID_LINE; 1479 - FaceFill = true; 1480 - FaceStroke = true; 1481 - FaceDisplacementX = 0.0; 1482 - FaceDisplacementY = 0.0; 1483 - FacePerpendicularOffset = 0.0; 1484 - FaceFillOpacity = 1.0; 1485 - QuickStyleObj::RandomColor(FaceFillColor); 1486 - FaceStrokeOpacity = 1.0; 1487 - FaceStrokeWidth = 1.0; 1488 - QuickStyleObj::RandomColor(FaceStrokeColor); 1489 - EdgeLinkSeedOpacity = 1.0; 1490 - EdgeLinkSeedSize = 16; 1491 - EdgeLinkSeedRotation = 0.0; 1492 - EdgeLinkSeedAnchorX = 0.5; 1493 - EdgeLinkSeedAnchorY = 0.5; 1494 - EdgeLinkSeedDisplacementX = 0.0; 1495 - EdgeLinkSeedDisplacementY = 0.0; 1496 - EdgeLinkSeedWellKnownMark = QuickStyleObj::RandomWellKnownMark(); 1497 - QuickStyleObj::RandomColor(EdgeLinkSeedFillColor); 1498 - QuickStyleObj::RandomColor(EdgeLinkSeedStrokeColor); 1499 - FaceSeedOpacity = 1.0; 1500 - FaceSeedSize = 16; 1501 - FaceSeedRotation = 0.0; 1502 - FaceSeedAnchorX = 0.5; 1503 - FaceSeedAnchorY = 0.5; 1504 - FaceSeedDisplacementX = 0.0; 1505 - FaceSeedDisplacementY = 0.0; 1506 - FaceSeedWellKnownMark = QuickStyleObj::RandomWellKnownMark(); 1507 - QuickStyleObj::RandomColor(FaceSeedFillColor); 1508 - QuickStyleObj::RandomColor(FaceSeedStrokeColor); 1509 - XmlStyle = NULL; 1510 -} 1511 - 1512 -QuickStyleTopologyObj *QuickStyleTopologyObj::Clone() 1513 -{ 1514 -// 1515 -// cloning a Quick Style Topology 1516 -// 1517 - QuickStyleTopologyObj *Style = new QuickStyleTopologyObj(this->Type); 1518 - strcpy(Style->UUID, this->UUID); 1519 - Style->MinScaleEnabled = this->MinScaleEnabled; 1520 - Style->MaxScaleEnabled = this->MaxScaleEnabled; 1521 - Style->ScaleMin = this->ScaleMin; 1522 - Style->ScaleMax = this->ScaleMax; 1523 - Style->NodeOpacity = this->NodeOpacity; 1524 - Style->NodeSize = this->NodeSize; 1525 - Style->NodeRotation = this->NodeRotation; 1526 - Style->NodeAnchorX = this->NodeAnchorX; 1527 - Style->NodeAnchorY = this->NodeAnchorY; 1528 - Style->NodeDisplacementX = this->NodeDisplacementX; 1529 - Style->NodeDisplacementY = this->NodeDisplacementY; 1530 - Style->NodeWellKnownMark = this->NodeWellKnownMark; 1531 - strcpy(Style->NodeFillColor, this->NodeFillColor); 1532 - strcpy(Style->NodeStrokeColor, this->NodeStrokeColor); 1533 - Style->EdgeLinkOpacity = this->EdgeLinkOpacity; 1534 - Style->EdgeLinkPerpendicularOffset = this->EdgeLinkPerpendicularOffset; 1535 - Style->EdgeLinkStrokeWidth = this->EdgeLinkStrokeWidth; 1536 - strcpy(Style->EdgeLinkStrokeColor, this->EdgeLinkStrokeColor); 1537 - Style->EdgeLinkDotStyle = this->EdgeLinkDotStyle; 1538 - Style->FaceFill = this->FaceFill; 1539 - Style->FaceStroke = this->FaceStroke; 1540 - Style->FaceDisplacementX = this->FaceDisplacementX; 1541 - Style->FaceDisplacementY = this->FaceDisplacementY; 1542 - Style->FacePerpendicularOffset = this->FacePerpendicularOffset; 1543 - Style->FaceFillOpacity = this->FaceFillOpacity; 1544 - strcpy(Style->FaceFillColor, this->FaceFillColor); 1545 - Style->FaceStrokeOpacity = this->FaceStrokeOpacity; 1546 - Style->FaceStrokeWidth = this->FaceStrokeWidth; 1547 - strcpy(Style->FaceStrokeColor, this->FaceStrokeColor); 1548 - Style->EdgeLinkSeedOpacity = this->EdgeLinkSeedOpacity; 1549 - Style->EdgeLinkSeedSize = this->EdgeLinkSeedSize; 1550 - Style->EdgeLinkSeedRotation = this->EdgeLinkSeedRotation; 1551 - Style->EdgeLinkSeedAnchorX = this->EdgeLinkSeedAnchorX; 1552 - Style->EdgeLinkSeedAnchorY = this->EdgeLinkSeedAnchorY; 1553 - Style->EdgeLinkSeedDisplacementX = this->EdgeLinkSeedDisplacementX; 1554 - Style->EdgeLinkSeedDisplacementY = this->EdgeLinkSeedDisplacementY; 1555 - Style->EdgeLinkSeedWellKnownMark = this->EdgeLinkSeedWellKnownMark; 1556 - strcpy(Style->EdgeLinkSeedFillColor, this->EdgeLinkSeedFillColor); 1557 - strcpy(Style->EdgeLinkSeedStrokeColor, this->EdgeLinkSeedStrokeColor); 1558 - Style->FaceSeedOpacity = this->FaceSeedOpacity; 1559 - Style->FaceSeedSize = this->FaceSeedSize; 1560 - Style->FaceSeedRotation = this->FaceSeedRotation; 1561 - Style->FaceSeedAnchorX = this->FaceSeedAnchorX; 1562 - Style->FaceSeedAnchorY = this->FaceSeedAnchorY; 1563 - Style->FaceSeedDisplacementX = this->FaceSeedDisplacementX; 1564 - Style->FaceSeedDisplacementY = this->FaceSeedDisplacementY; 1565 - Style->FaceSeedWellKnownMark = this->FaceSeedWellKnownMark; 1566 - strcpy(Style->FaceSeedFillColor, this->FaceSeedFillColor); 1567 - strcpy(Style->FaceSeedStrokeColor, this->FaceSeedStrokeColor); 1568 - Style->XmlStyle = NULL; 1569 - return Style; 1570 -} 1571 - 1572 -bool QuickStyleTopologyObj::Compare(QuickStyleTopologyObj * Style) 1573 -{ 1574 -// 1575 -// comparing two Quick Style objects (Topology) 1576 -// 1577 - if (strcmp(Style->UUID, this->UUID) != 0) 1578 - return false; 1579 - if (Style->MinScaleEnabled != this->MinScaleEnabled) 1580 - return false; 1581 - if (Style->MaxScaleEnabled != this->MaxScaleEnabled) 1582 - return false; 1583 - if (Style->ScaleMin != this->ScaleMin) 1584 - return false; 1585 - if (Style->ScaleMax != this->ScaleMax) 1586 - return false; 1587 - if (Style->NodeOpacity != this->NodeOpacity) 1588 - return false; 1589 - if (Style->NodeSize != this->NodeSize) 1590 - return false; 1591 - if (Style->NodeRotation != this->NodeRotation) 1592 - return false; 1593 - if (Style->NodeAnchorX != this->NodeAnchorX) 1594 - return false; 1595 - if (Style->NodeAnchorY != this->NodeAnchorY) 1596 - return false; 1597 - if (Style->NodeDisplacementX != this->NodeDisplacementX) 1598 - return false; 1599 - if (Style->NodeDisplacementY != this->NodeDisplacementY) 1600 - return false; 1601 - if (Style->NodeWellKnownMark != this->NodeWellKnownMark) 1602 - return false; 1603 - if (strcmp(Style->NodeFillColor, this->NodeFillColor) != 0) 1604 - return false; 1605 - if (strcmp(Style->NodeStrokeColor, this->NodeStrokeColor) != 0) 1606 - return false; 1607 - if (Style->EdgeLinkOpacity != this->EdgeLinkOpacity) 1608 - return false; 1609 - if (Style->EdgeLinkPerpendicularOffset != this->EdgeLinkPerpendicularOffset) 1610 - return false; 1611 - if (Style->EdgeLinkStrokeWidth != this->EdgeLinkStrokeWidth) 1612 - return false; 1613 - if (strcmp(Style->EdgeLinkStrokeColor, this->EdgeLinkStrokeColor) != 0) 1614 - return false; 1615 - if (Style->EdgeLinkDotStyle != this->EdgeLinkDotStyle) 1616 - return false; 1617 - if (Style->FaceFill != this->FaceFill) 1618 - return false; 1619 - if (Style->FaceStroke != this->FaceStroke) 1620 - return false; 1621 - if (Style->FaceDisplacementX != this->FaceDisplacementX) 1622 - return false; 1623 - if (Style->FaceDisplacementY != this->FaceDisplacementY) 1624 - return false; 1625 - if (Style->FacePerpendicularOffset != this->FacePerpendicularOffset) 1626 - return false; 1627 - if (Style->FaceFillOpacity != this->FaceFillOpacity) 1628 - return false; 1629 - if (strcmp(Style->FaceFillColor, this->FaceFillColor) != 0) 1630 - return false; 1631 - if (Style->FaceStrokeOpacity != this->FaceStrokeOpacity) 1632 - return false; 1633 - if (Style->FaceStrokeWidth != this->FaceStrokeWidth) 1634 - return false; 1635 - if (strcmp(Style->FaceStrokeColor, this->FaceStrokeColor) != 0) 1636 - return false; 1637 - if (Style->EdgeLinkSeedOpacity != this->EdgeLinkSeedOpacity) 1638 - return false; 1639 - if (Style->EdgeLinkSeedSize != this->EdgeLinkSeedSize) 1640 - return false; 1641 - if (Style->EdgeLinkSeedRotation != this->EdgeLinkSeedRotation) 1642 - return false; 1643 - if (Style->EdgeLinkSeedAnchorX != this->EdgeLinkSeedAnchorX) 1644 - return false; 1645 - if (Style->EdgeLinkSeedAnchorY != this->EdgeLinkSeedAnchorY) 1646 - return false; 1647 - if (Style->EdgeLinkSeedDisplacementX != this->EdgeLinkSeedDisplacementX) 1648 - return false; 1649 - if (Style->EdgeLinkSeedDisplacementY != this->EdgeLinkSeedDisplacementY) 1650 - return false; 1651 - if (Style->EdgeLinkSeedWellKnownMark != this->EdgeLinkSeedWellKnownMark) 1652 - return false; 1653 - if (strcmp(Style->EdgeLinkSeedFillColor, this->EdgeLinkSeedFillColor) != 0) 1654 - return false; 1655 - if (strcmp(Style->EdgeLinkSeedStrokeColor, this->EdgeLinkSeedStrokeColor) != 1656 - 0) 1657 - return false; 1658 - if (Style->FaceSeedOpacity != this->FaceSeedOpacity) 1659 - return false; 1660 - if (Style->FaceSeedSize != this->FaceSeedSize) 1661 - return false; 1662 - if (Style->FaceSeedRotation != this->FaceSeedRotation) 1663 - return false; 1664 - if (Style->FaceSeedAnchorX != this->FaceSeedAnchorX) 1665 - return false; 1666 - if (Style->FaceSeedAnchorY != this->FaceSeedAnchorY) 1667 - return false; 1668 - if (Style->FaceSeedDisplacementX != this->FaceSeedDisplacementX) 1669 - return false; 1670 - if (Style->FaceSeedDisplacementY != this->FaceSeedDisplacementY) 1671 - return false; 1672 - if (Style->FaceSeedWellKnownMark != this->FaceSeedWellKnownMark) 1673 - return false; 1674 - if (strcmp(Style->FaceSeedFillColor, this->FaceSeedFillColor) != 0) 1675 - return false; 1676 - if (strcmp(Style->FaceSeedStrokeColor, this->FaceSeedStrokeColor) != 0) 1677 - return false; 1678 - return true; 1679 -} 1680 - 1681 -void QuickStyleTopologyObj::UpdateXmlStyle() 1682 -{ 1683 -// 1684 -// updating the XML Style 1685 -// 1686 - if (XmlStyle != NULL) 1687 - sqlite3_free(XmlStyle); 1688 - XmlStyle = CreateXmlStyle(); 1689 -} 1690 - 1691 -char *QuickStyleTopologyObj::CreateXmlStyle() 1692 -{ 1693 -// 1694 -// creating the XML Style 1695 -// 1696 - const char *cstr; 1697 - char *prev; 1698 - char *xml2; 1699 - char *xml = sqlite3_mprintf("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"); 1700 - prev = xml; 1701 - xml = sqlite3_mprintf("%s<FeatureTypeStyle version=\"1.1.0\" ", prev); 1702 - sqlite3_free(prev); 1703 - prev = xml; 1704 - xml = 1705 - sqlite3_mprintf 1706 - ("%sxsi:schemaLocation=\"http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/FeatureStyle.xsd\" ", 1707 - prev); 1708 - sqlite3_free(prev); 1709 - prev = xml; 1710 - xml = sqlite3_mprintf 1711 - ("%sxmlns=\"http://www.opengis.net/se\" xmlns:ogc=\"http://www.opengis.net/ogc\" ", 1712 - prev); 1713 - sqlite3_free(prev); 1714 - prev = xml; 1715 - xml = 1716 - sqlite3_mprintf("%sxmlns:xlink=\"http://www.w3.org/1999/xlink\" ", prev); 1717 - sqlite3_free(prev); 1718 - prev = xml; 1719 - xml = 1720 - sqlite3_mprintf 1721 - ("%sxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n", prev); 1722 - sqlite3_free(prev); 1723 - prev = xml; 1724 - xml = sqlite3_mprintf("%s\t<Name>%s</Name>\r\n", prev, UUID); 1725 - sqlite3_free(prev); 1726 - prev = xml; 1727 - xml = sqlite3_mprintf("%s\t<Description>\r\n", prev); 1728 - sqlite3_free(prev); 1729 - prev = xml; 1730 - xml = 1731 - sqlite3_mprintf("%s\t\t<Title>%s</Title>\r\n", prev, 1732 - "Quick Style - Topology"); 1733 - sqlite3_free(prev); 1734 - prev = xml; 1735 - xml = 1736 - sqlite3_mprintf("%s\t\t<Abstract>%s</Abstract>\r\n", prev, 1737 - "Created by SpatialiteGUI"); 1738 - sqlite3_free(prev); 1739 - prev = xml; 1740 - xml = sqlite3_mprintf("%s\t</Description>\r\n", prev); 1741 - sqlite3_free(prev); 1742 - prev = xml; 1743 - if (Type == MAP_LAYER_NETWORK) 1744 - { 1745 - // Links 1746 - xml2 = DoCreateEdgeLinkXML(); 1747 - if (xml2 != NULL) 1748 - { 1749 - xml = sqlite3_mprintf("%s%s", prev, xml2); 1750 - sqlite3_free(prev); 1751 - sqlite3_free(xml2); 1752 - prev = xml; 1753 - } 1754 - // Nodes 1755 - xml2 = DoCreateNodeXML(); 1756 - if (xml2 != NULL) 1757 - { 1758 - xml = sqlite3_mprintf("%s%s", prev, xml2); 1759 - sqlite3_free(prev); 1760 - sqlite3_free(xml2); 1761 - prev = xml; 1762 - } 1763 - // LinkSeeds 1764 - xml2 = DoCreateEdgeLinkSeedXML(); 1765 - if (xml2 != NULL) 1766 - { 1767 - xml = sqlite3_mprintf("%s%s", prev, xml2); 1768 - sqlite3_free(prev); 1769 - sqlite3_free(xml2); 1770 - prev = xml; 1771 - } 1772 - } else 1773 - { 1774 - // Faces 1775 - xml2 = DoCreateFaceXML(); 1776 - if (xml2 != NULL) 1777 - { 1778 - xml = sqlite3_mprintf("%s%s", prev, xml2); 1779 - sqlite3_free(prev); 1780 - sqlite3_free(xml2); 1781 - prev = xml; 1782 - } 1783 - // Edges 1784 - xml2 = DoCreateEdgeLinkXML(); 1785 - if (xml2 != NULL) 1786 - { 1787 - xml = sqlite3_mprintf("%s%s", prev, xml2); 1788 - sqlite3_free(prev); 1789 - sqlite3_free(xml2); 1790 - prev = xml; 1791 - } 1792 - // Nodes 1793 - xml2 = DoCreateNodeXML(); 1794 - if (xml2 != NULL) 1795 - { 1796 - xml = sqlite3_mprintf("%s%s", prev, xml2); 1797 - sqlite3_free(prev); 1798 - sqlite3_free(xml2); 1799 - prev = xml; 1800 - } 1801 - // EdgeSeeds 1802 - xml2 = DoCreateEdgeLinkSeedXML(); 1803 - if (xml2 != NULL) 1804 - { 1805 - xml = sqlite3_mprintf("%s%s", prev, xml2); 1806 - sqlite3_free(prev); 1807 - sqlite3_free(xml2); 1808 - prev = xml; 1809 - } 1810 - // EdgeSeeds 1811 - xml2 = DoCreateFaceSeedXML(); 1812 - if (xml2 != NULL) 1813 - { 1814 - xml = sqlite3_mprintf("%s%s", prev, xml2); 1815 - sqlite3_free(prev); 1816 - sqlite3_free(xml2); 1817 - prev = xml; 1818 - } 1819 - } 1820 - xml = sqlite3_mprintf("%s</FeatureTypeStyle>\r\n", prev); 1821 - sqlite3_free(prev); 1822 - return xml; 1823 -} 1824 - 1825 -char *QuickStyleTopologyObj::DoCreateFaceXML() 1826 -{ 1827 -// 1828 -// creating the XML Style - Face 1829 -// 1830 - const char *cstr; 1831 - char *prev; 1832 - char *xml = sqlite3_mprintf("\t<Rule>\r\n"); 1833 - prev = xml; 1834 - if (MinScaleEnabled == true) 1835 - { 1836 - xml = 1837 - sqlite3_mprintf 1838 - ("%s\t\t<MinScaleDenominator>%1.2f</MinScaleDenominator>\r\n", prev, 1839 - ScaleMin); 1840 - sqlite3_free(prev); 1841 - prev = xml; 1842 - } 1843 - if (MaxScaleEnabled == true) 1844 - { 1845 - xml = 1846 - sqlite3_mprintf 1847 - ("%s\t\t<MaxScaleDenominator>%1.2f</MaxScaleDenominator>\r\n", prev, 1848 - ScaleMax); 1849 - sqlite3_free(prev); 1850 - prev = xml; 1851 - } 1852 - xml = sqlite3_mprintf("%s\t\t<Name>Face</Name>\r\n", prev); 1853 - sqlite3_free(prev); 1854 - prev = xml; 1855 - xml = 1856 - sqlite3_mprintf("%s\t\t<ogc:Filter>\r\n\t\t\t<ogc:PropertyIsEqualTo>\r\n", 1857 - prev); 1858 - sqlite3_free(prev); 1859 - prev = xml; 1860 - xml = 1861 - sqlite3_mprintf 1862 - ("%s\t\t\t\t<ogc:PropertyName>topoclass</ogc:PropertyName>\r\n", prev); 1863 - sqlite3_free(prev); 1864 - prev = xml; 1865 - xml = sqlite3_mprintf("%s\t\t\t\t<ogc:Literal>face</ogc:Literal>\r\n", prev); 1866 - sqlite3_free(prev); 1867 - prev = xml; 1868 - xml = 1869 - sqlite3_mprintf("%s\t\t\t</ogc:PropertyIsEqualTo>\r\n\t\t</ogc:Filter>\r\n", 1870 - prev); 1871 - sqlite3_free(prev); 1872 - prev = xml; 1873 - 1874 - const char *extra = "\t\t"; 1875 - xml = sqlite3_mprintf("%s%s<PolygonSymbolizer>\r\n", prev, extra); 1876 - prev = xml; 1877 - if (FaceFill == true) 1878 - { 1879 - // Polygon Fill 1880 - xml = sqlite3_mprintf("%s%s\t<Fill>\r\n", prev, extra); 1881 - sqlite3_free(prev); 1882 - prev = xml; 1883 - // using a Solid Color 1884 - xml = 1885 - sqlite3_mprintf 1886 - ("%s%s\t\t<SvgParameter name=\"fill\">%s</SvgParameter>\r\n", prev, 1887 - extra, FaceFillColor); 1888 - sqlite3_free(prev); 1889 - prev = xml; 1890 - xml = 1891 - sqlite3_mprintf 1892 - ("%s%s\t\t<SvgParameter name=\"fill-opacity\">%1.2f</SvgParameter>\r\n", 1893 - prev, extra, FaceFillOpacity); 1894 - sqlite3_free(prev); 1895 - prev = xml; 1896 - xml = sqlite3_mprintf("%s%s\t</Fill>\r\n", prev, extra); 1897 - sqlite3_free(prev); 1898 - prev = xml; 1899 - } 1900 - if (FaceStroke == true) 1901 - { 1902 - // Polygon Stroke 1903 - xml = sqlite3_mprintf("%s%s\t<Stroke>\r\n", prev, extra); 1904 - sqlite3_free(prev); 1905 - prev = xml; 1906 - // using a Solid Color 1907 - xml = 1908 - sqlite3_mprintf 1909 - ("%s%s\t\t<SvgParameter name=\"stroke\">%s</SvgParameter>\r\n", prev, 1910 - extra, FaceStrokeColor); 1911 - sqlite3_free(prev); 1912 - prev = xml; 1913 - xml = 1914 - sqlite3_mprintf 1915 - ("%s%s\t\t<SvgParameter name=\"stroke-opacity\">%1.2f</SvgParameter>\r\n", 1916 - prev, extra, FaceStrokeOpacity); 1917 - sqlite3_free(prev); 1918 - prev = xml; 1919 - xml = 1920 - sqlite3_mprintf 1921 - ("%s%s\t\t<SvgParameter name=\"stroke-width\">%1.2f</SvgParameter>\r\n", 1922 - prev, extra, FaceStrokeWidth); 1923 - sqlite3_free(prev); 1924 - prev = xml; 1925 - xml = 1926 - sqlite3_mprintf 1927 - ("%s%s\t\t<SvgParameter name=\"stroke-linejoin\">round</SvgParameter>\r\n", 1928 - prev, extra); 1929 - sqlite3_free(prev); 1930 - prev = xml; 1931 - xml = 1932 - sqlite3_mprintf 1933 - ("%s%s\t\t<SvgParameter name=\"stroke-linecap\">round</SvgParameter>\r\n", 1934 - prev, extra); 1935 - sqlite3_free(prev); 1936 - prev = xml; 1937 - xml = sqlite3_mprintf("%s%s\t</Stroke>\r\n", prev, extra); 1938 - sqlite3_free(prev); 1939 - prev = xml; 1940 - } 1941 - if (FaceDisplacementX != 0.0 || FaceDisplacementY != 0.0) 1942 - { 1943 - xml = sqlite3_mprintf("%s%s\t<Displacement>\r\n", prev, extra); 1944 - sqlite3_free(prev); 1945 - prev = xml; 1946 - xml = 1947 - sqlite3_mprintf("%s%s\t\t<DisplacementX>%1.4f</DisplacementX>\r\n", 1948 - prev, extra, FaceDisplacementX); 1949 - sqlite3_free(prev); 1950 - prev = xml; 1951 - xml = 1952 - sqlite3_mprintf("%s%s\t\t<DisplacementY>%1.4f</DisplacementY>\r\n", 1953 - prev, extra, FaceDisplacementY); 1954 - sqlite3_free(prev); 1955 - prev = xml; 1956 - xml = sqlite3_mprintf("%s%s\t</Displacement>\r\n", prev, extra); 1957 - sqlite3_free(prev); 1958 - prev = xml; 1959 - } 1960 - if (FacePerpendicularOffset != 0.0) 1961 - { 1962 - xml = 1963 - sqlite3_mprintf 1964 - ("%s%s\t<PerpendicularOffset>%1.4f</PerpendicularOffset>\r\n", prev, 1965 - extra, FacePerpendicularOffset); 1966 - sqlite3_free(prev); 1967 - prev = xml; 1968 - } 1969 - xml = sqlite3_mprintf("%s%s</PolygonSymbolizer>\r\n", prev, extra); 1970 - sqlite3_free(prev); 1971 - prev = xml; 1972 - xml = sqlite3_mprintf("%s\t</Rule>\r\n", prev); 1973 - sqlite3_free(prev); 1974 - return xml; 1975 -} 1976 - 1977 -char *QuickStyleTopologyObj::DoCreateEdgeLinkXML() 1978 -{ 1979 -// 1980 -// creating the XML Style - Edge or Link 1981 -// 1982 - const char *cstr; 1983 - char *prev; 1984 - char *xml = sqlite3_mprintf("\t<Rule>\r\n"); 1985 - prev = xml; 1986 - if (MinScaleEnabled == true) 1987 - { 1988 - xml = 1989 - sqlite3_mprintf 1990 - ("%s\t\t<MinScaleDenominator>%1.2f</MinScaleDenominator>\r\n", prev, 1991 - ScaleMin); 1992 - sqlite3_free(prev); 1993 - prev = xml; 1994 - } 1995 - if (MaxScaleEnabled == true) 1996 - { 1997 - xml = 1998 - sqlite3_mprintf 1999 - ("%s\t\t<MaxScaleDenominator>%1.2f</MaxScaleDenominator>\r\n", prev, 2000 - ScaleMax); 2001 - sqlite3_free(prev); 2002 - prev = xml; 2003 - } 2004 - if (Type == MAP_LAYER_NETWORK) 2005 - xml = sqlite3_mprintf("%s\t\t<Name>Link</Name>\r\n", prev); 2006 - else 2007 - xml = sqlite3_mprintf("%s\t\t<Name>Edge</Name>\r\n", prev); 2008 - sqlite3_free(prev); 2009 - prev = xml; 2010 - xml = 2011 - sqlite3_mprintf("%s\t\t<ogc:Filter>\r\n\t\t\t<ogc:PropertyIsEqualTo>\r\n", 2012 - prev); 2013 - sqlite3_free(prev); 2014 - prev = xml; 2015 - xml = 2016 - sqlite3_mprintf 2017 - ("%s\t\t\t\t<ogc:PropertyName>topoclass</ogc:PropertyName>\r\n", prev); 2018 - sqlite3_free(prev); 2019 - prev = xml; 2020 - if (Type == MAP_LAYER_NETWORK) 2021 - xml = 2022 - sqlite3_mprintf("%s\t\t\t\t<ogc:Literal>link</ogc:Literal>\r\n", prev); 2023 - else 2024 - xml = 2025 - sqlite3_mprintf("%s\t\t\t\t<ogc:Literal>edge</ogc:Literal>\r\n", prev); 2026 - sqlite3_free(prev); 2027 - prev = xml; 2028 - xml = 2029 - sqlite3_mprintf("%s\t\t\t</ogc:PropertyIsEqualTo>\r\n\t\t</ogc:Filter>\r\n", 2030 - prev); 2031 - sqlite3_free(prev); 2032 - prev = xml; 2033 - 2034 - const char *extra = "\t\t"; 2035 - xml = sqlite3_mprintf("%s%s<LineSymbolizer>\r\n", prev, extra); 2036 - prev = xml; 2037 - xml = sqlite3_mprintf("%s%s\t<Stroke>\r\n", prev, extra); 2038 - sqlite3_free(prev); 2039 - prev = xml; 2040 -// using a Solid Color 2041 - xml = 2042 - sqlite3_mprintf 2043 - ("%s%s\t\t<SvgParameter name=\"stroke\">%s</SvgParameter>\r\n", prev, extra, 2044 - EdgeLinkStrokeColor); 2045 - sqlite3_free(prev); 2046 - prev = xml; 2047 - xml = 2048 - sqlite3_mprintf 2049 - ("%s%s\t\t<SvgParameter name=\"stroke-opacity\">%1.2f</SvgParameter>\r\n", 2050 - prev, extra, EdgeLinkOpacity); 2051 - sqlite3_free(prev); 2052 - prev = xml; 2053 - xml = 2054 - sqlite3_mprintf 2055 - ("%s%s\t\t<SvgParameter name=\"stroke-width\">%1.2f</SvgParameter>\r\n", 2056 - prev, extra, EdgeLinkStrokeWidth); 2057 - sqlite3_free(prev); 2058 - prev = xml; 2059 - xml = 2060 - sqlite3_mprintf 2061 - ("%s%s\t\t<SvgParameter name=\"stroke-linejoin\">round</SvgParameter>\r\n", 2062 - prev, extra); 2063 - sqlite3_free(prev); 2064 - prev = xml; 2065 - xml = 2066 - sqlite3_mprintf 2067 - ("%s%s\t\t<SvgParameter name=\"stroke-linecap\">round</SvgParameter>\r\n", 2068 - prev, extra); 2069 - sqlite3_free(prev); 2070 - prev = xml; 2071 - const char *dashArray; 2072 - switch (EdgeLinkDotStyle) 2073 - { 2074 - case QUICK_STYLE_DOT_LINE: 2075 - dashArray = "5.0, 10.0"; 2076 - break; 2077 - case QUICK_STYLE_DASH_LINE: 2078 - dashArray = "20.0, 20.0"; 2079 - break; 2080 - case QUICK_STYLE_DASH_DOT_LINE: 2081 - dashArray = "20.0, 10.0, 5.0, 10.0"; 2082 - break; 2083 - default: 2084 - dashArray = NULL; 2085 - break; 2086 - }; 2087 - if (dashArray != NULL) 2088 - { 2089 - xml = 2090 - sqlite3_mprintf 2091 - ("%s%s\t\t<SvgParameter name=\"stroke-dasharray\">%s</SvgParameter>\r\n", 2092 - prev, extra, dashArray); 2093 - sqlite3_free(prev); 2094 - prev = xml; 2095 - } 2096 - xml = sqlite3_mprintf("%s%s\t</Stroke>\r\n", prev, extra); 2097 - sqlite3_free(prev); 2098 - prev = xml; 2099 - if (EdgeLinkPerpendicularOffset != 0.0) 2100 - { 2101 - xml = 2102 - sqlite3_mprintf 2103 - ("%s%s\t<PerpendicularOffset>%1.2f</PerpendicularOffset>\r\n", prev, 2104 - extra, EdgeLinkPerpendicularOffset); 2105 - sqlite3_free(prev); 2106 - prev = xml; 2107 - } 2108 - xml = sqlite3_mprintf("%s%s</LineSymbolizer>\r\n", prev, extra); 2109 - sqlite3_free(prev); 2110 - prev = xml; 2111 - xml = sqlite3_mprintf("%s\t</Rule>\r\n", prev); 2112 - sqlite3_free(prev); 2113 - return xml; 2114 -} 2115 - 2116 -char *QuickStyleTopologyObj::DoCreateNodeXML() 2117 -{ 2118 -// 2119 -// creating the XML Style - Node 2120 -// 2121 - const char *cstr; 2122 - char *prev; 2123 - char *xml = sqlite3_mprintf("\t<Rule>\r\n"); 2124 - prev = xml; 2125 - if (MinScaleEnabled == true) 2126 - { 2127 - xml = 2128 - sqlite3_mprintf 2129 - ("%s\t\t<MinScaleDenominator>%1.2f</MinScaleDenominator>\r\n", prev, 2130 - ScaleMin); 2131 - sqlite3_free(prev); 2132 - prev = xml; 2133 - } 2134 - if (MaxScaleEnabled == true) 2135 - { 2136 - xml = 2137 - sqlite3_mprintf 2138 - ("%s\t\t<MaxScaleDenominator>%1.2f</MaxScaleDenominator>\r\n", prev, 2139 - ScaleMax); 2140 - sqlite3_free(prev); 2141 - prev = xml; 2142 - } 2143 - xml = sqlite3_mprintf("%s\t\t<Name>Node</Name>\r\n", prev); 2144 - sqlite3_free(prev); 2145 - prev = xml; 2146 - xml = 2147 - sqlite3_mprintf("%s\t\t<ogc:Filter>\r\n\t\t\t<ogc:PropertyIsEqualTo>\r\n", 2148 - prev); 2149 - sqlite3_free(prev); 2150 - prev = xml; 2151 - xml = 2152 - sqlite3_mprintf 2153 - ("%s\t\t\t\t<ogc:PropertyName>topoclass</ogc:PropertyName>\r\n", prev); 2154 - sqlite3_free(prev); 2155 - prev = xml; 2156 - xml = sqlite3_mprintf("%s\t\t\t\t<ogc:Literal>node</ogc:Literal>\r\n", prev); 2157 - sqlite3_free(prev); 2158 - prev = xml; 2159 - xml = 2160 - sqlite3_mprintf("%s\t\t\t</ogc:PropertyIsEqualTo>\r\n\t\t</ogc:Filter>\r\n", 2161 - prev); 2162 - sqlite3_free(prev); 2163 - prev = xml; 2164 - 2165 - const char *extra = "\t\t"; 2166 - xml = sqlite3_mprintf("%s%s<PointSymbolizer>\r\n", prev, extra); 2167 - prev = xml; 2168 - xml = sqlite3_mprintf("%s%s\t<Graphic>\r\n", prev, extra); 2169 - sqlite3_free(prev); 2170 - prev = xml; 2171 -// mark symbol 2172 - xml = sqlite3_mprintf("%s%s\t\t<Mark>\r\n", prev, extra); 2173 - sqlite3_free(prev); 2174 - prev = xml; 2175 - switch (NodeWellKnownMark) 2176 - { 2177 - case RL2_GRAPHIC_MARK_CIRCLE: 2178 - cstr = "circle"; 2179 - break; 2180 - case RL2_GRAPHIC_MARK_TRIANGLE: 2181 - cstr = "triangle"; 2182 - break; 2183 - case RL2_GRAPHIC_MARK_STAR: 2184 - cstr = "star"; 2185 - break; 2186 - case RL2_GRAPHIC_MARK_CROSS: 2187 - cstr = "cross"; 2188 - break; 2189 - case RL2_GRAPHIC_MARK_X: 2190 - cstr = "x"; 2191 - break; 2192 - default: 2193 - cstr = "square"; 2194 - break; 2195 - }; 2196 - xml = 2197 - sqlite3_mprintf("%s%s\t\t\t<WellKnownName>%s</WellKnownName>\r\n", prev, 2198 - extra, cstr); 2199 - sqlite3_free(prev); 2200 - prev = xml; 2201 -// Mark Fill 2202 - xml = sqlite3_mprintf("%s%s\t\t\t<Fill>\r\n", prev, extra); 2203 - sqlite3_free(prev); 2204 - prev = xml; 2205 - xml = 2206 - sqlite3_mprintf 2207 - ("%s%s\t\t\t\t<SvgParameter name=\"fill\">%s</SvgParameter>\r\n", 2208 - prev, extra, NodeFillColor); 2209 - sqlite3_free(prev); 2210 - prev = xml; 2211 - xml = sqlite3_mprintf("%s%s\t\t\t</Fill>\r\n", prev, extra); 2212 - sqlite3_free(prev); 2213 - prev = xml; 2214 -// Mark Stroke 2215 - xml = sqlite3_mprintf("%s%s\t\t\t<Stroke>\r\n", prev, extra); 2216 - sqlite3_free(prev); 2217 - prev = xml; 2218 - xml = 2219 - sqlite3_mprintf 2220 - ("%s%s\t\t\t\t<SvgParameter name=\"stroke\">%s</SvgParameter>\r\n", 2221 - prev, extra, NodeStrokeColor); 2222 - sqlite3_free(prev); 2223 - prev = xml; 2224 - xml = 2225 - sqlite3_mprintf 2226 - ("%s%s\t\t\t\t<SvgParameter name=\"stroke-width\">%1.2f</SvgParameter>\r\n", 2227 - prev, extra, 1.0); 2228 - sqlite3_free(prev); 2229 - prev = xml; 2230 - xml = 2231 - sqlite3_mprintf 2232 - ("%s%s\t\t\t\t<SvgParameter name=\"stroke-linejoin\">round</SvgParameter>\r\n", 2233 - prev, extra); 2234 - sqlite3_free(prev); 2235 - prev = xml; 2236 - xml = 2237 - sqlite3_mprintf 2238 - ("%s%s\t\t\t\t<SvgParameter name=\"stroke-linecap\">round</SvgParameter>\r\n", 2239 - prev, extra); 2240 - sqlite3_free(prev); 2241 - prev = xml; 2242 - xml = sqlite3_mprintf("%s%s\t\t\t</Stroke>\r\n", prev, extra); 2243 - sqlite3_free(prev); 2244 - prev = xml; 2245 - xml = sqlite3_mprintf("%s%s\t\t</Mark>\r\n", prev, extra); 2246 - sqlite3_free(prev); 2247 - prev = xml; 2248 - if (NodeOpacity != 1.0) 2249 - { 2250 - xml = 2251 - sqlite3_mprintf("%s%s\t\t<Opacity>%1.2f</Opacity>\r\n", prev, extra, 2252 - NodeOpacity); 2253 - sqlite3_free(prev); 2254 - prev = xml; 2255 - } 2256 - xml = 2257 - sqlite3_mprintf("%s%s\t\t<Size>%1.2f</Size>\r\n", prev, extra, NodeSize); 2258 - sqlite3_free(prev); 2259 - prev = xml; 2260 - if (NodeRotation != 0.0) 2261 - { 2262 - xml = 2263 - sqlite3_mprintf("%s%s\t\t<Rotation>%1.2f</Rotation>\r\n", prev, extra, 2264 - NodeRotation); 2265 - sqlite3_free(prev); 2266 - prev = xml; 2267 - } 2268 - if (NodeAnchorX != 0.5 || NodeAnchorY != 0.5) 2269 - { 2270 - xml = sqlite3_mprintf("%s%s\t\t<AnchorPoint>\r\n", prev, extra); 2271 - sqlite3_free(prev); 2272 - prev = xml; 2273 - xml = 2274 - sqlite3_mprintf("%s%s\t\t\t<AnchorPointX>%1.4f</AnchorPointX>\r\n", 2275 - prev, extra, NodeAnchorX); 2276 - sqlite3_free(prev); 2277 - prev = xml; 2278 - xml = 2279 - sqlite3_mprintf("%s%s\t\t\t<AnchorPointY>%1.4f</AnchorPointY>\r\n", 2280 - prev, extra, NodeAnchorY); 2281 - sqlite3_free(prev); 2282 - prev = xml; 2283 - xml = sqlite3_mprintf("%s%s\t\t</AnchorPoint>\r\n", prev, extra); 2284 - sqlite3_free(prev); 2285 - prev = xml; 2286 - } 2287 - if (NodeDisplacementX != 0.0 || NodeDisplacementY != 0.0) 2288 - { 2289 - xml = sqlite3_mprintf("%s%s\t\t<Displacement>\r\n", prev, extra); 2290 - sqlite3_free(prev); 2291 - prev = xml; 2292 - xml = 2293 - sqlite3_mprintf("%s%s\t\t\t<DisplacementX>%1.4f</DisplacementX>\r\n", 2294 - prev, extra, NodeDisplacementX); 2295 - sqlite3_free(prev); 2296 - prev = xml; 2297 - xml = 2298 - sqlite3_mprintf("%s%s\t\t\t<DisplacementY>%1.4f</DisplacementY>\r\n", 2299 - prev, extra, NodeDisplacementY); 2300 - sqlite3_free(prev); 2301 - prev = xml; 2302 - xml = sqlite3_mprintf("%s%s\t\t</Displacement>\r\n", prev, extra); 2303 - sqlite3_free(prev); 2304 - prev = xml; 2305 - } 2306 - xml = sqlite3_mprintf("%s%s\t</Graphic>\r\n", prev, extra); 2307 - sqlite3_free(prev); 2308 - prev = xml; 2309 - xml = sqlite3_mprintf("%s%s</PointSymbolizer>\r\n", prev, extra); 2310 - sqlite3_free(prev); 2311 - prev = xml; 2312 - xml = sqlite3_mprintf("%s\t</Rule>\r\n", prev); 2313 - sqlite3_free(prev); 2314 - return xml; 2315 -} 2316 - 2317 -char *QuickStyleTopologyObj::DoCreateEdgeLinkSeedXML() 2318 -{ 2319 -// 2320 -// creating the XML Style - Edge or Link Seed 2321 -// 2322 - const char *cstr; 2323 - char *prev; 2324 - char *xml = sqlite3_mprintf("\t<Rule>\r\n"); 2325 - prev = xml; 2326 - if (MinScaleEnabled == true) 2327 - { 2328 - xml = 2329 - sqlite3_mprintf 2330 - ("%s\t\t<MinScaleDenominator>%1.2f</MinScaleDenominator>\r\n", prev, 2331 - ScaleMin); 2332 - sqlite3_free(prev); 2333 - prev = xml; 2334 - } 2335 - if (MaxScaleEnabled == true) 2336 - { 2337 - xml = 2338 - sqlite3_mprintf 2339 - ("%s\t\t<MaxScaleDenominator>%1.2f</MaxScaleDenominator>\r\n", prev, 2340 - ScaleMax); 2341 - sqlite3_free(prev); 2342 - prev = xml; 2343 - } 2344 - if (Type == MAP_LAYER_NETWORK) 2345 - xml = sqlite3_mprintf("%s\t\t<Name>LinkSeed</Name>\r\n", prev); 2346 - else 2347 - xml = sqlite3_mprintf("%s\t\t<Name>EdgeSeed</Name>\r\n", prev); 2348 - sqlite3_free(prev); 2349 - prev = xml; 2350 - xml = 2351 - sqlite3_mprintf("%s\t\t<ogc:Filter>\r\n\t\t\t<ogc:PropertyIsEqualTo>\r\n", 2352 - prev); 2353 - sqlite3_free(prev); 2354 - prev = xml; 2355 - xml = 2356 - sqlite3_mprintf 2357 - ("%s\t\t\t\t<ogc:PropertyName>topoclass</ogc:PropertyName>\r\n", prev); 2358 - sqlite3_free(prev); 2359 - prev = xml; 2360 - if (Type == MAP_LAYER_NETWORK) 2361 - xml = 2362 - sqlite3_mprintf("%s\t\t\t\t<ogc:Literal>link_seed</ogc:Literal>\r\n", 2363 - prev); 2364 - else 2365 - xml = 2366 - sqlite3_mprintf("%s\t\t\t\t<ogc:Literal>edge_seed</ogc:Literal>\r\n", 2367 - prev); 2368 - sqlite3_free(prev); 2369 - prev = xml; 2370 - xml = 2371 - sqlite3_mprintf("%s\t\t\t</ogc:PropertyIsEqualTo>\r\n\t\t</ogc:Filter>\r\n", 2372 - prev); 2373 - sqlite3_free(prev); 2374 - prev = xml; 2375 - 2376 - const char *extra = "\t\t"; 2377 - xml = sqlite3_mprintf("%s%s<PointSymbolizer>\r\n", prev, extra); 2378 - prev = xml; 2379 - xml = sqlite3_mprintf("%s%s\t<Graphic>\r\n", prev, extra); 2380 - sqlite3_free(prev); 2381 - prev = xml; 2382 -// mark symbol 2383 - xml = sqlite3_mprintf("%s%s\t\t<Mark>\r\n", prev, extra); 2384 - sqlite3_free(prev); 2385 - prev = xml; 2386 - switch (EdgeLinkSeedWellKnownMark) 2387 - { 2388 - case RL2_GRAPHIC_MARK_CIRCLE: 2389 - cstr = "circle"; 2390 - break; 2391 - case RL2_GRAPHIC_MARK_TRIANGLE: 2392 - cstr = "triangle"; 2393 - break; 2394 - case RL2_GRAPHIC_MARK_STAR: 2395 - cstr = "star"; 2396 - break; 2397 - case RL2_GRAPHIC_MARK_CROSS: 2398 - cstr = "cross"; 2399 - break; 2400 - case RL2_GRAPHIC_MARK_X: 2401 - cstr = "x"; 2402 - break; 2403 - default: 2404 - cstr = "square"; 2405 - break; 2406 - }; 2407 - xml = 2408 - sqlite3_mprintf("%s%s\t\t\t<WellKnownName>%s</WellKnownName>\r\n", prev, 2409 - extra, cstr); 2410 - sqlite3_free(prev); 2411 - prev = xml; 2412 -// Mark Fill 2413 - xml = sqlite3_mprintf("%s%s\t\t\t<Fill>\r\n", prev, extra); 2414 - sqlite3_free(prev); 2415 - prev = xml; 2416 - xml = 2417 - sqlite3_mprintf 2418 - ("%s%s\t\t\t\t<SvgParameter name=\"fill\">%s</SvgParameter>\r\n", 2419 - prev, extra, EdgeLinkSeedFillColor); 2420 - sqlite3_free(prev); 2421 - prev = xml; 2422 - xml = sqlite3_mprintf("%s%s\t\t\t</Fill>\r\n", prev, extra); 2423 - sqlite3_free(prev); 2424 - prev = xml; 2425 -// Mark Stroke 2426 - xml = sqlite3_mprintf("%s%s\t\t\t<Stroke>\r\n", prev, extra); 2427 - sqlite3_free(prev); 2428 - prev = xml; 2429 - xml = 2430 - sqlite3_mprintf 2431 - ("%s%s\t\t\t\t<SvgParameter name=\"stroke\">%s</SvgParameter>\r\n", 2432 - prev, extra, EdgeLinkSeedStrokeColor); 2433 - sqlite3_free(prev); 2434 - prev = xml; 2435 - xml = 2436 - sqlite3_mprintf 2437 - ("%s%s\t\t\t\t<SvgParameter name=\"stroke-width\">%1.2f</SvgParameter>\r\n", 2438 - prev, extra, 1.0); 2439 - sqlite3_free(prev); 2440 - prev = xml; 2441 - xml = 2442 - sqlite3_mprintf 2443 - ("%s%s\t\t\t\t<SvgParameter name=\"stroke-linejoin\">round</SvgParameter>\r\n", 2444 - prev, extra); 2445 - sqlite3_free(prev); 2446 - prev = xml; 2447 - xml = 2448 - sqlite3_mprintf 2449 - ("%s%s\t\t\t\t<SvgParameter name=\"stroke-linecap\">round</SvgParameter>\r\n", 2450 - prev, extra); 2451 - sqlite3_free(prev); 2452 - prev = xml; 2453 - xml = sqlite3_mprintf("%s%s\t\t\t</Stroke>\r\n", prev, extra); 2454 - sqlite3_free(prev); 2455 - prev = xml; 2456 - xml = sqlite3_mprintf("%s%s\t\t</Mark>\r\n", prev, extra); 2457 - sqlite3_free(prev); 2458 - prev = xml; 2459 - if (EdgeLinkSeedOpacity != 1.0) 2460 - { 2461 - xml = 2462 - sqlite3_mprintf("%s%s\t\t<Opacity>%1.2f</Opacity>\r\n", prev, extra, 2463 - EdgeLinkSeedOpacity); 2464 - sqlite3_free(prev); 2465 - prev = xml; 2466 - } 2467 - xml = 2468 - sqlite3_mprintf("%s%s\t\t<Size>%1.2f</Size>\r\n", prev, extra, 2469 - EdgeLinkSeedSize); 2470 - sqlite3_free(prev); 2471 - prev = xml; 2472 - if (EdgeLinkSeedRotation != 0.0) 2473 - { 2474 - xml = 2475 - sqlite3_mprintf("%s%s\t\t<Rotation>%1.2f</Rotation>\r\n", prev, extra, 2476 - EdgeLinkSeedRotation); 2477 - sqlite3_free(prev); 2478 - prev = xml; 2479 - } 2480 - if (EdgeLinkSeedAnchorX != 0.5 || EdgeLinkSeedAnchorY != 0.5) 2481 - { 2482 - xml = sqlite3_mprintf("%s%s\t\t<AnchorPoint>\r\n", prev, extra); 2483 - sqlite3_free(prev); 2484 - prev = xml; 2485 - xml = 2486 - sqlite3_mprintf("%s%s\t\t\t<AnchorPointX>%1.4f</AnchorPointX>\r\n", 2487 - prev, extra, EdgeLinkSeedAnchorX); 2488 - sqlite3_free(prev); 2489 - prev = xml; 2490 - xml = 2491 - sqlite3_mprintf("%s%s\t\t\t<AnchorPointY>%1.4f</AnchorPointY>\r\n", 2492 - prev, extra, EdgeLinkSeedAnchorY); 2493 - sqlite3_free(prev); 2494 - prev = xml; 2495 - xml = sqlite3_mprintf("%s%s\t\t</AnchorPoint>\r\n", prev, extra); 2496 - sqlite3_free(prev); 2497 - prev = xml; 2498 - } 2499 - if (EdgeLinkSeedDisplacementX != 0.0 || EdgeLinkSeedDisplacementY != 0.0) 2500 - { 2501 - xml = sqlite3_mprintf("%s%s\t\t<Displacement>\r\n", prev, extra); 2502 - sqlite3_free(prev); 2503 - prev = xml; 2504 - xml = 2505 - sqlite3_mprintf("%s%s\t\t\t<DisplacementX>%1.4f</DisplacementX>\r\n", 2506 - prev, extra, EdgeLinkSeedDisplacementX); 2507 - sqlite3_free(prev); 2508 - prev = xml; 2509 - xml = 2510 - sqlite3_mprintf("%s%s\t\t\t<DisplacementY>%1.4f</DisplacementY>\r\n", 2511 - prev, extra, EdgeLinkSeedDisplacementY); 2512 - sqlite3_free(prev); 2513 - prev = xml; 2514 - xml = sqlite3_mprintf("%s%s\t\t</Displacement>\r\n", prev, extra); 2515 - sqlite3_free(prev); 2516 - prev = xml; 2517 - } 2518 - xml = sqlite3_mprintf("%s%s\t</Graphic>\r\n", prev, extra); 2519 - sqlite3_free(prev); 2520 - prev = xml; 2521 - xml = sqlite3_mprintf("%s%s</PointSymbolizer>\r\n", prev, extra); 2522 - sqlite3_free(prev); 2523 - prev = xml; 2524 - xml = sqlite3_mprintf("%s\t</Rule>\r\n", prev); 2525 - sqlite3_free(prev); 2526 - return xml; 2527 -} 2528 - 2529 -char *QuickStyleTopologyObj::DoCreateFaceSeedXML() 2530 -{ 2531 -// 2532 -// creating the XML Style - FaceSeed 2533 -// 2534 - const char *cstr; 2535 - char *prev; 2536 - char *xml = sqlite3_mprintf("\t<Rule>\r\n"); 2537 - prev = xml; 2538 - if (MinScaleEnabled == true) 2539 - { 2540 - xml = 2541 - sqlite3_mprintf 2542 - ("%s\t\t<MinScaleDenominator>%1.2f</MinScaleDenominator>\r\n", prev, 2543 - ScaleMin); 2544 - sqlite3_free(prev); 2545 - prev = xml; 2546 - } 2547 - if (MaxScaleEnabled == true) 2548 - { 2549 - xml = 2550 - sqlite3_mprintf 2551 - ("%s\t\t<MaxScaleDenominator>%1.2f</MaxScaleDenominator>\r\n", prev, 2552 - ScaleMax); 2553 - sqlite3_free(prev); 2554 - prev = xml; 2555 - } 2556 - xml = sqlite3_mprintf("%s\t\t<Name>FaceSeed</Name>\r\n", prev); 2557 - sqlite3_free(prev); 2558 - prev = xml; 2559 - xml = 2560 - sqlite3_mprintf("%s\t\t<ogc:Filter>\r\n\t\t\t<ogc:PropertyIsEqualTo>\r\n", 2561 - prev); 2562 - sqlite3_free(prev); 2563 - prev = xml; 2564 - xml = 2565 - sqlite3_mprintf 2566 - ("%s\t\t\t\t<ogc:PropertyName>topoclass</ogc:PropertyName>\r\n", prev); 2567 - sqlite3_free(prev); 2568 - prev = xml; 2569 - xml = 2570 - sqlite3_mprintf("%s\t\t\t\t<ogc:Literal>face_seed</ogc:Literal>\r\n", prev); 2571 - sqlite3_free(prev); 2572 - prev = xml; 2573 - xml = 2574 - sqlite3_mprintf("%s\t\t\t</ogc:PropertyIsEqualTo>\r\n\t\t</ogc:Filter>\r\n", 2575 - prev); 2576 - sqlite3_free(prev); 2577 - prev = xml; 2578 - 2579 - const char *extra = "\t\t"; 2580 - xml = sqlite3_mprintf("%s%s<PointSymbolizer>\r\n", prev, extra); 2581 - prev = xml; 2582 - xml = sqlite3_mprintf("%s%s\t<Graphic>\r\n", prev, extra); 2583 - sqlite3_free(prev); 2584 - prev = xml; 2585 -// mark symbol 2586 - xml = sqlite3_mprintf("%s%s\t\t<Mark>\r\n", prev, extra); 2587 - sqlite3_free(prev); 2588 - prev = xml; 2589 - switch (FaceSeedWellKnownMark) 2590 - { 2591 - case RL2_GRAPHIC_MARK_CIRCLE: 2592 - cstr = "circle"; 2593 - break; 2594 - case RL2_GRAPHIC_MARK_TRIANGLE: 2595 - cstr = "triangle"; 2596 - break; 2597 - case RL2_GRAPHIC_MARK_STAR: 2598 - cstr = "star"; 2599 - break; 2600 - case RL2_GRAPHIC_MARK_CROSS: 2601 - cstr = "cross"; 2602 - break; 2603 - case RL2_GRAPHIC_MARK_X: 2604 - cstr = "x"; 2605 - break; 2606 - default: 2607 - cstr = "square"; 2608 - break; 2609 - }; 2610 - xml = 2611 - sqlite3_mprintf("%s%s\t\t\t<WellKnownName>%s</WellKnownName>\r\n", prev, 2612 - extra, cstr); 2613 - sqlite3_free(prev); 2614 - prev = xml; 2615 -// Mark Fill 2616 - xml = sqlite3_mprintf("%s%s\t\t\t<Fill>\r\n", prev, extra); 2617 - sqlite3_free(prev); 2618 - prev = xml; 2619 - xml = 2620 - sqlite3_mprintf 2621 - ("%s%s\t\t\t\t<SvgParameter name=\"fill\">%s</SvgParameter>\r\n", 2622 - prev, extra, FaceSeedFillColor); 2623 - sqlite3_free(prev); 2624 - prev = xml; 2625 - xml = sqlite3_mprintf("%s%s\t\t\t</Fill>\r\n", prev, extra); 2626 - sqlite3_free(prev); 2627 - prev = xml; 2628 -// Mark Stroke 2629 - xml = sqlite3_mprintf("%s%s\t\t\t<Stroke>\r\n", prev, extra); 2630 - sqlite3_free(prev); 2631 - prev = xml; 2632 - xml = 2633 - sqlite3_mprintf 2634 - ("%s%s\t\t\t\t<SvgParameter name=\"stroke\">%s</SvgParameter>\r\n", 2635 - prev, extra, FaceSeedStrokeColor); 2636 - sqlite3_free(prev); 2637 - prev = xml; 2638 - xml = 2639 - sqlite3_mprintf 2640 - ("%s%s\t\t\t\t<SvgParameter name=\"stroke-width\">%1.2f</SvgParameter>\r\n", 2641 - prev, extra, 1.0); 2642 - sqlite3_free(prev); 2643 - prev = xml; 2644 - xml = 2645 - sqlite3_mprintf 2646 - ("%s%s\t\t\t\t<SvgParameter name=\"stroke-linejoin\">round</SvgParameter>\r\n", 2647 - prev, extra); 2648 - sqlite3_free(prev); 2649 - prev = xml; 2650 - xml = 2651 - sqlite3_mprintf 2652 - ("%s%s\t\t\t\t<SvgParameter name=\"stroke-linecap\">round</SvgParameter>\r\n", 2653 - prev, extra); 2654 - sqlite3_free(prev); 2655 - prev = xml; 2656 - xml = sqlite3_mprintf("%s%s\t\t\t</Stroke>\r\n", prev, extra); 2657 - sqlite3_free(prev); 2658 - prev = xml; 2659 - xml = sqlite3_mprintf("%s%s\t\t</Mark>\r\n", prev, extra); 2660 - sqlite3_free(prev); 2661 - prev = xml; 2662 - if (FaceSeedOpacity != 1.0) 2663 - { 2664 - xml = 2665 - sqlite3_mprintf("%s%s\t\t<Opacity>%1.2f</Opacity>\r\n", prev, extra, 2666 - FaceSeedOpacity); 2667 - sqlite3_free(prev); 2668 - prev = xml; 2669 - } 2670 - xml = 2671 - sqlite3_mprintf("%s%s\t\t<Size>%1.2f</Size>\r\n", prev, extra, 2672 - FaceSeedSize); 2673 - sqlite3_free(prev); 2674 - prev = xml; 2675 - if (FaceSeedRotation != 0.0) 2676 - { 2677 - xml = 2678 - sqlite3_mprintf("%s%s\t\t<Rotation>%1.2f</Rotation>\r\n", prev, extra, 2679 - FaceSeedRotation); 2680 - sqlite3_free(prev); 2681 - prev = xml; 2682 - } 2683 - if (FaceSeedAnchorX != 0.5 || FaceSeedAnchorY != 0.5) 2684 - { 2685 - xml = sqlite3_mprintf("%s%s\t\t<AnchorPoint>\r\n", prev, extra); 2686 - sqlite3_free(prev); 2687 - prev = xml; 2688 - xml = 2689 - sqlite3_mprintf("%s%s\t\t\t<AnchorPointX>%1.4f</AnchorPointX>\r\n", 2690 - prev, extra, FaceSeedAnchorX); 2691 - sqlite3_free(prev); 2692 - prev = xml; 2693 - xml = 2694 - sqlite3_mprintf("%s%s\t\t\t<AnchorPointY>%1.4f</AnchorPointY>\r\n", 2695 - prev, extra, FaceSeedAnchorY); 2696 - sqlite3_free(prev); 2697 - prev = xml; 2698 - xml = sqlite3_mprintf("%s%s\t\t</AnchorPoint>\r\n", prev, extra); 2699 - sqlite3_free(prev); 2700 - prev = xml; 2701 - } 2702 - if (FaceSeedDisplacementX != 0.0 || FaceSeedDisplacementY != 0.0) 2703 - { 2704 - xml = sqlite3_mprintf("%s%s\t\t<Displacement>\r\n", prev, extra); 2705 - sqlite3_free(prev); 2706 - prev = xml; 2707 - xml = 2708 - sqlite3_mprintf("%s%s\t\t\t<DisplacementX>%1.4f</DisplacementX>\r\n", 2709 - prev, extra, FaceSeedDisplacementX); 2710 - sqlite3_free(prev); 2711 - prev = xml; 2712 - xml = 2713 - sqlite3_mprintf("%s%s\t\t\t<DisplacementY>%1.4f</DisplacementY>\r\n", 2714 - prev, extra, FaceSeedDisplacementY); 2715 - sqlite3_free(prev); 2716 - prev = xml; 2717 - xml = sqlite3_mprintf("%s%s\t\t</Displacement>\r\n", prev, extra); 2718 - sqlite3_free(prev); 2719 - prev = xml; 2720 - } 2721 - xml = sqlite3_mprintf("%s%s\t</Graphic>\r\n", prev, extra); 2722 - sqlite3_free(prev); 2723 - prev = xml; 2724 - xml = sqlite3_mprintf("%s%s</PointSymbolizer>\r\n", prev, extra); 2725 - sqlite3_free(prev); 2726 - prev = xml; 2727 - xml = sqlite3_mprintf("%s\t</Rule>\r\n", prev); 2728 - sqlite3_free(prev); 2729 - return xml; 2730 -} 2731 - 2732 -const unsigned char *QuickStyleTopologyObj::CloneXmlStyle() 2733 -{ 2734 -// 2735 -// cloning the XML Style definition 2736 -// 2737 - if (XmlStyle == NULL) 2738 - XmlStyle = CreateXmlStyle(); 2739 - if (XmlStyle == NULL) 2740 - return NULL; 2741 - int len = strlen(XmlStyle); 2742 - char *cloned = (char *) malloc(len + 1); 2743 - strcpy(cloned, XmlStyle); 2744 - return (const unsigned char *) cloned; 2745 -} 2746 - 2747 -bool QuickStyleVectorDialog::Create(MyMapPanel * parent, MapLayer * layer, 2748 - int type) 2749 -{ 2750 -// 2751 -// creating the dialog 2752 -// 2753 - MainFrame = parent->GetParent(); 2754 - MapPanel = parent; 2755 - Layer = layer; 2756 - Type = type; 2757 - DbPrefix = layer->GetDbPrefix(); 2758 - LayerName = layer->GetName(); 2759 - IsConfigChanged = false; 2760 - 2761 - if (wxPropertySheetDialog::Create 2762 - (parent, wxID_ANY, wxT("QuickStyle (Vector) Edit")) == false) 2763 - return false; 2764 - if (Layer->GetQuickStyle() != NULL) 2765 - Style = Layer->CloneQuickStyle(); 2766 - else 2767 - Style = new QuickStyleObj(Type); 2768 - 2769 - wxBookCtrlBase *book = GetBookCtrl(); 2770 -// creates individual panels 2771 - int next = 1; 2772 - PagePointIndex = 0; 2773 - PageLineIndex = 0; 2774 - PagePolygonIndex = 0; 2775 - PageTextPointIndex = 0; 2776 - PageTextLineIndex = 0; 2777 - wxPanel *mainPage = CreateMainPage(book); 2778 - book->AddPage(mainPage, wxT("General"), true); 2779 - if (Type == QUICK_STYLE_POINT || Type == QUICK_STYLE_GEOMETRY) 2780 - { 2781 - wxPanel *pointPage = CreatePointPage(book); 2782 - book->AddPage(pointPage, wxT("Point Symbolizer"), false); 2783 - PagePointIndex = next++; 2784 - } 2785 - if (Type == QUICK_STYLE_LINE || Type == QUICK_STYLE_GEOMETRY) 2786 - { 2787 - wxPanel *linePage = CreateLinePage(book); 2788 - book->AddPage(linePage, wxT("Line Symbolyzer"), false); 2789 - PageLineIndex = next++; 2790 - } 2791 - if (Type == QUICK_STYLE_POLYGON || Type == QUICK_STYLE_GEOMETRY) 2792 - { 2793 - wxPanel *polygonPage = CreatePolygonPage(book); 2794 - book->AddPage(polygonPage, wxT("Polygon Symbolizer"), false); 2795 - PagePolygonIndex = next++; 2796 - } 2797 - if (Type == QUICK_STYLE_POINT || Type == QUICK_STYLE_POLYGON) 2798 - { 2799 - wxPanel *textPointPage = CreateTextPointPage(book); 2800 - book->AddPage(textPointPage, wxT("Text Symbolizer"), false); 2801 - PageTextPointIndex = next++; 2802 - } 2803 - if (Type == QUICK_STYLE_LINE) 2804 - { 2805 - wxPanel *textLinePage = CreateTextLinePage(book); 2806 - book->AddPage(textLinePage, wxT("Text Symbolizer"), false); 2807 - PageTextLineIndex = next++; 2808 - } 2809 - 2810 - CreateButtons(); 2811 - LayoutDialog(); 2812 -// appends event handler for TAB/PAGE changing 2813 - Connect(wxID_ANY, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, 2814 - (wxObjectEventFunction) & QuickStyleVectorDialog::OnPageChanging); 2815 - Connect(wxID_ANY, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, 2816 - (wxObjectEventFunction) & QuickStyleVectorDialog::OnPageChanged); 2817 -// appends event handler for buttons 2818 - Connect(wxID_CANCEL, wxEVT_COMMAND_BUTTON_CLICKED, 2819 - (wxObjectEventFunction) & QuickStyleVectorDialog::OnQuit); 2820 - Connect(wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, 2821 - (wxObjectEventFunction) & QuickStyleVectorDialog::OnOk); 2822 - Connect(ID_QUICK_STYLE_APPLY, wxEVT_COMMAND_BUTTON_CLICKED, 2823 - (wxObjectEventFunction) & QuickStyleVectorDialog::OnApply); 2824 - Connect(ID_QUICK_STYLE_EXPORT, wxEVT_COMMAND_BUTTON_CLICKED, 2825 - (wxObjectEventFunction) & QuickStyleVectorDialog::OnExport); 2826 - Connect(ID_QUICK_STYLE_COPY, wxEVT_COMMAND_BUTTON_CLICKED, 2827 - (wxObjectEventFunction) & QuickStyleVectorDialog::OnCopy); 2828 -// centers the dialog window 2829 - Centre(); 2830 - UpdateMainPage(); 2831 - return true; 2832 -} 2833 - 2834 -void QuickStyleVectorDialog::CreateButtons() 2835 -{ 2836 -// 2837 -// adding the common Buttons 2838 -// 2839 - wxBoxSizer *topSizer = (wxBoxSizer *) (this->GetSizer()); 2840 - wxBoxSizer *btnBox = new wxBoxSizer(wxHORIZONTAL); 2841 - topSizer->Add(btnBox, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2842 - wxButton *save = new wxButton(this, ID_QUICK_STYLE_APPLY, wxT("&Apply")); 2843 - btnBox->Add(save, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2844 - wxButton *exp = 2845 - new wxButton(this, ID_QUICK_STYLE_EXPORT, wxT("&Export to file")); 2846 - btnBox->Add(exp, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2847 - wxButton *copy = new wxButton(this, ID_QUICK_STYLE_COPY, wxT("&Copy")); 2848 - btnBox->Add(copy, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2849 - btnBox->AddSpacer(100); 2850 - wxButton *ok = new wxButton(this, wxID_OK, wxT("&Ok")); 2851 - btnBox->Add(ok, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2852 - wxButton *cancel = new wxButton(this, wxID_CANCEL, wxT("&Cancel")); 2853 - btnBox->Add(cancel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2854 -} 2855 - 2856 -wxPanel *QuickStyleVectorDialog::CreateMainPage(wxWindow * parent) 2857 -{ 2858 -// 2859 -// creating the MAIN page 2860 -// 2861 - wxPanel *panel = new wxPanel(parent, ID_PANE_MAIN); 2862 - wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 2863 - panel->SetSizer(topSizer); 2864 - wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 2865 - topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 2866 -// First row: Layer name 2867 - boxSizer->AddSpacer(50); 2868 - wxBoxSizer *lyrBoxSizer = new wxBoxSizer(wxVERTICAL); 2869 - boxSizer->Add(lyrBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2870 - wxBoxSizer *nameSizer = new wxBoxSizer(wxVERTICAL); 2871 - lyrBoxSizer->Add(nameSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2872 - wxStaticBox *nameBox = new wxStaticBox(panel, wxID_ANY, 2873 - wxT("Layer FullName"), 2874 - wxDefaultPosition, 2875 - wxDefaultSize); 2876 - wxBoxSizer *nameBoxSizer = new wxStaticBoxSizer(nameBox, wxHORIZONTAL); 2877 - nameSizer->Add(nameBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2878 - wxString fullName = DbPrefix + wxT(".") + LayerName; 2879 - wxTextCtrl *nameCtrl = new wxTextCtrl(panel, ID_VECTOR_LAYER, fullName, 2880 - wxDefaultPosition, wxSize(370, 22), 2881 - wxTE_READONLY); 2882 - nameBoxSizer->Add(nameCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2883 - wxStaticBox *typeBox = new wxStaticBox(panel, wxID_ANY, 2884 - wxT("Geometry Type"), 2885 - wxDefaultPosition, 2886 - wxDefaultSize); 2887 - wxBoxSizer *typeBoxSizer = new wxStaticBoxSizer(typeBox, wxHORIZONTAL); 2888 - nameSizer->Add(typeBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2889 - wxString typeName = wxT("UNKNOWN"); 2890 - if (Type == QUICK_STYLE_POINT) 2891 - typeName = wxT("POINT-Type Geometries"); 2892 - if (Type == QUICK_STYLE_LINE) 2893 - typeName = wxT("LINE-Type Geometries"); 2894 - if (Type == QUICK_STYLE_POLYGON) 2895 - typeName = wxT("POLYGON-Type Geometries"); 2896 - if (Type == QUICK_STYLE_GEOMETRY) 2897 - typeName = wxT("MIXED-Type Geometries"); 2898 - wxTextCtrl *typeCtrl = new wxTextCtrl(panel, ID_VECTOR_TYPE, typeName, 2899 - wxDefaultPosition, wxSize(370, 22), 2900 - wxTE_READONLY); 2901 - typeBoxSizer->Add(typeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2902 - wxStaticBox *uuidBox = new wxStaticBox(panel, wxID_ANY, 2903 - wxT("QuickStyle Name"), 2904 - wxDefaultPosition, 2905 - wxDefaultSize); 2906 - wxBoxSizer *uuidBoxSizer = new wxStaticBoxSizer(uuidBox, wxHORIZONTAL); 2907 - nameSizer->Add(uuidBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2908 - wxString uuid = wxString::FromUTF8(Style->GetUUID()); 2909 - wxTextCtrl *uuidCtrl = new wxTextCtrl(panel, ID_VECTOR_UUID, uuid, 2910 - wxDefaultPosition, wxSize(370, 22), 2911 - wxTE_READONLY); 2912 - uuidBoxSizer->Add(uuidCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2913 - boxSizer->AddSpacer(25); 2914 -// second row: Visibility Range 2915 - wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); 2916 - boxSizer->Add(miscSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2917 - wxBoxSizer *visibilityBoxSizer = new wxBoxSizer(wxHORIZONTAL); 2918 - miscSizer->Add(visibilityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2919 - wxStaticBox *visibilityBox = new wxStaticBox(panel, wxID_STATIC, 2920 - wxT("Visibility Range"), 2921 - wxDefaultPosition, 2922 - wxDefaultSize); 2923 - wxBoxSizer *visibilitySizer = 2924 - new wxStaticBoxSizer(visibilityBox, wxHORIZONTAL); 2925 - visibilityBoxSizer->Add(visibilitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2926 - 5); 2927 - wxString range[4]; 2928 - range[0] = wxT("&None"); 2929 - range[1] = wxT("&Min"); 2930 - range[2] = wxT("&Max"); 2931 - range[3] = wxT("&Both"); 2932 - wxRadioBox *rangeBox = new wxRadioBox(panel, ID_SYMBOLIZER_MINMAX_SCALE, 2933 - wxT("&Range Type"), 2934 - wxDefaultPosition, 2935 - wxDefaultSize, 4, 2936 - range, 2, 2937 - wxRA_SPECIFY_COLS); 2938 - visibilitySizer->Add(rangeBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2939 - rangeBox->SetSelection(0); 2940 - visibilitySizer->AddSpacer(20); 2941 - wxBoxSizer *scaleBoxSizer = new wxBoxSizer(wxVERTICAL); 2942 - visibilitySizer->Add(scaleBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2943 - wxBoxSizer *scaleMinSizer = new wxBoxSizer(wxHORIZONTAL); 2944 - scaleBoxSizer->Add(scaleMinSizer, 0, wxALIGN_RIGHT | wxALL, 5); 2945 - wxStaticText *minScaleLabel = 2946 - new wxStaticText(panel, wxID_STATIC, wxT("&Min Scale:")); 2947 - scaleMinSizer->Add(minScaleLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2948 - wxTextCtrl *minScaleCtrl = 2949 - new wxTextCtrl(panel, ID_SYMBOLIZER_MIN_SCALE, wxT("0.0"), 2950 - wxDefaultPosition, wxSize(100, 22)); 2951 - minScaleCtrl->Enable(false); 2952 - scaleMinSizer->Add(minScaleCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2953 - wxBoxSizer *scaleMaxSizer = new wxBoxSizer(wxHORIZONTAL); 2954 - scaleBoxSizer->Add(scaleMaxSizer, 0, wxALIGN_RIGHT | wxALL, 0); 2955 - wxStaticText *maxScaleLabel = 2956 - new wxStaticText(panel, wxID_STATIC, wxT("&Max Scale:")); 2957 - scaleMaxSizer->Add(maxScaleLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2958 - wxTextCtrl *maxScaleCtrl = 2959 - new wxTextCtrl(panel, ID_SYMBOLIZER_MAX_SCALE, wxT("+Infinite"), 2960 - wxDefaultPosition, wxSize(100, 22)); 2961 - maxScaleCtrl->Enable(false); 2962 - scaleMaxSizer->Add(maxScaleCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2963 - panel->SetSizer(topSizer); 2964 - topSizer->Fit(panel); 2965 -// appends event handlers 2966 - Connect(ID_SYMBOLIZER_MINMAX_SCALE, wxEVT_COMMAND_RADIOBOX_SELECTED, 2967 - (wxObjectEventFunction) & QuickStyleVectorDialog::OnCmdScaleChanged); 2968 - return panel; 2969 -} 2970 - 2971 -void QuickStyleVectorDialog:: 2972 -OnCmdScaleChanged(wxCommandEvent & WXUNUSED(event)) 2973 -{ 2974 -// 2975 -// Visibility Range selection changed 2976 -// 2977 - wxRadioBox *scaleModeCtrl = 2978 - (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MINMAX_SCALE); 2979 - wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); 2980 - wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); 2981 - switch (scaleModeCtrl->GetSelection()) 2982 - { 2983 - case 0: 2984 - Style->EnableMinScale(false); 2985 - Style->EnableMaxScale(false); 2986 - minCtrl->SetValue(wxT("0.0")); 2987 - minCtrl->Enable(false); 2988 - maxCtrl->SetValue(wxT("+Infinite")); 2989 - maxCtrl->Enable(false); 2990 - break; 2991 - case 1: 2992 - Style->EnableMinScale(true); 2993 - Style->EnableMaxScale(false); 2994 - minCtrl->SetValue(wxT("")); 2995 - minCtrl->Enable(true); 2996 - maxCtrl->SetValue(wxT("+Infinite")); 2997 - maxCtrl->Enable(false); 2998 - break; 2999 - case 2: 3000 - Style->EnableMinScale(false); 3001 - Style->EnableMaxScale(true); 3002 - minCtrl->SetValue(wxT("0.0")); 3003 - minCtrl->Enable(false); 3004 - maxCtrl->SetValue(wxT("")); 3005 - maxCtrl->Enable(true); 3006 - break; 3007 - case 3: 3008 - Style->EnableMinScale(true); 3009 - Style->EnableMaxScale(true); 3010 - minCtrl->SetValue(wxT("")); 3011 - minCtrl->Enable(true); 3012 - maxCtrl->SetValue(wxT("")); 3013 - maxCtrl->Enable(true); 3014 - break; 3015 - }; 3016 -} 3017 - 3018 -wxPanel *QuickStyleVectorDialog::CreatePointPage(wxWindow * parent) 3019 -{ 3020 -// 3021 -// creating the Point Symbolizer page 3022 -// 3023 - wxString StrokeColor = wxT("#000000"); 3024 - wxString FillColor = wxT("#808080"); 3025 - wxPanel *panel = new wxPanel(parent, ID_PANE_POINT); 3026 - wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 3027 - panel->SetSizer(topSizer); 3028 - wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 3029 - topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 3030 -// first row A: Opacity 3031 - wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); 3032 - boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3033 - wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, 3034 - wxT("Opacity"), 3035 - wxDefaultPosition, 3036 - wxDefaultSize); 3037 - wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); 3038 - opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3039 - wxSlider *opacityCtrl = 3040 - new wxSlider(panel, ID_SYMBOLIZER_OPACITY, 100, 0, 100, 3041 - wxDefaultPosition, wxSize(600, 45), 3042 - wxSL_HORIZONTAL | wxSL_LABELS); 3043 - opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3044 -// Well Known Mark Name 3045 - wxBoxSizer *box1Sizer = new wxBoxSizer(wxHORIZONTAL); 3046 - boxSizer->Add(box1Sizer, 0, wxALIGN_CENTER | wxALL, 5); 3047 - wxBoxSizer *markSizer = new wxBoxSizer(wxHORIZONTAL); 3048 - box1Sizer->Add(markSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3049 - wxString mark[6]; 3050 - mark[0] = wxT("&Square"); 3051 - mark[1] = wxT("&Circle"); 3052 - mark[2] = wxT("&Triangle"); 3053 - mark[3] = wxT("&Star"); 3054 - mark[4] = wxT("&Cross"); 3055 - mark[5] = wxT("&X"); 3056 - wxRadioBox *markBox = new wxRadioBox(panel, ID_SYMBOLIZER_MARK, 3057 - wxT("&Mark"), 3058 - wxDefaultPosition, 3059 - wxDefaultSize, 6, 3060 - mark, 1, 3061 - wxRA_SPECIFY_COLS); 3062 - markSizer->Add(markBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3063 - markBox->SetSelection(0); 3064 -// second row: Size and Rotation 3065 - wxBoxSizer *box2Sizer = new wxBoxSizer(wxVERTICAL); 3066 - box1Sizer->Add(box2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3067 - wxBoxSizer *sizeBoxSizer = new wxBoxSizer(wxHORIZONTAL); 3068 - box2Sizer->Add(sizeBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3069 -// second row A: Size 3070 - wxStaticBox *sizeBox = new wxStaticBox(panel, wxID_STATIC, 3071 - wxT("Size"), 3072 - wxDefaultPosition, 3073 - wxDefaultSize); 3074 - wxBoxSizer *sizeSizer = new wxStaticBoxSizer(sizeBox, wxVERTICAL); 3075 - sizeBoxSizer->Add(sizeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 3076 - wxBoxSizer *size1Sizer = new wxBoxSizer(wxHORIZONTAL); 3077 - sizeSizer->Add(size1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3078 - wxTextCtrl *sizeCtrl = new wxTextCtrl(panel, ID_SYMBOLIZER_SIZE, wxT("16.0"), 3079 - wxDefaultPosition, wxSize(100, 22)); 3080 - size1Sizer->Add(sizeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3081 -// second row B: Rotation 3082 - wxStaticBox *rotBox = new wxStaticBox(panel, wxID_STATIC, 3083 - wxT("Rotation"), 3084 - wxDefaultPosition, 3085 - wxDefaultSize); 3086 - wxBoxSizer *rotSizer = new wxStaticBoxSizer(rotBox, wxVERTICAL); 3087 - sizeBoxSizer->Add(rotSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 3088 - wxBoxSizer *rot1Sizer = new wxBoxSizer(wxHORIZONTAL); 3089 - rotSizer->Add(rot1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3090 - wxTextCtrl *rotCtrl = 3091 - new wxTextCtrl(panel, ID_SYMBOLIZER_ROTATION, wxT("0.0"), 3092 - wxDefaultPosition, wxSize(100, 22)); 3093 - rot1Sizer->Add(rotCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3094 -// third row: AnchorPoint and Displacement 3095 - wxBoxSizer *anchorBoxSizer = new wxBoxSizer(wxHORIZONTAL); 3096 - box2Sizer->Add(anchorBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3097 -// third row A: Anchor Point 3098 - wxStaticBox *anchorBox = new wxStaticBox(panel, wxID_STATIC, 3099 - wxT("Anchor Point"), 3100 - wxDefaultPosition, 3101 - wxDefaultSize); 3102 - wxBoxSizer *anchorSizer = new wxStaticBoxSizer(anchorBox, wxVERTICAL); 3103 - anchorBoxSizer->Add(anchorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 3104 - wxBoxSizer *anchor1Sizer = new wxBoxSizer(wxHORIZONTAL); 3105 - anchorSizer->Add(anchor1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3106 - wxStaticText *anchor1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); 3107 - anchor1Sizer->Add(anchor1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3108 - wxTextCtrl *anchorXCtrl = 3109 - new wxTextCtrl(panel, ID_SYMBOLIZER_ANCHOR_X, wxT("0.5"), 3110 - wxDefaultPosition, wxSize(100, 22)); 3111 - anchor1Sizer->Add(anchorXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3112 - wxBoxSizer *anchor2Sizer = new wxBoxSizer(wxHORIZONTAL); 3113 - anchorSizer->Add(anchor2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3114 - wxStaticText *anchor2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); 3115 - anchor2Sizer->Add(anchor2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3116 - wxTextCtrl *anchorYCtrl = 3117 - new wxTextCtrl(panel, ID_SYMBOLIZER_ANCHOR_Y, wxT("0.5"), 3118 - wxDefaultPosition, wxSize(100, 22)); 3119 - anchor2Sizer->Add(anchorYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3120 -// third row B: Displacement 3121 - wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, 3122 - wxT("Displacement"), 3123 - wxDefaultPosition, 3124 - wxDefaultSize); 3125 - wxBoxSizer *displacementSizer = 3126 - new wxStaticBoxSizer(displacementBox, wxVERTICAL); 3127 - anchorBoxSizer->Add(displacementSizer, 0, 3128 - wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 3129 - wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); 3130 - displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3131 - wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); 3132 - displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3133 - wxTextCtrl *displacementXCtrl = 3134 - new wxTextCtrl(panel, ID_SYMBOLIZER_DISPLACEMENT_X, wxT("0.0"), 3135 - wxDefaultPosition, wxSize(100, 22)); 3136 - displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3137 - wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); 3138 - displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3139 - wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); 3140 - displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3141 - wxTextCtrl *displacementYCtrl = 3142 - new wxTextCtrl(panel, ID_SYMBOLIZER_DISPLACEMENT_Y, wxT("0.0"), 3143 - wxDefaultPosition, wxSize(100, 22)); 3144 - displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3145 -// fourth row: colors 3146 - wxBoxSizer *box3Sizer = new wxBoxSizer(wxHORIZONTAL); 3147 - boxSizer->Add(box3Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3148 -// first row A: Fill Color 3149 - wxBoxSizer *fillBoxSizer = new wxBoxSizer(wxVERTICAL); 3150 - box3Sizer->Add(fillBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3151 - wxStaticBox *colorFillBox = new wxStaticBox(panel, wxID_STATIC, 3152 - wxT("Fill Color"), 3153 - wxDefaultPosition, 3154 - wxDefaultSize); 3155 - wxBoxSizer *colorFillSizer = new wxStaticBoxSizer(colorFillBox, wxVERTICAL); 3156 - box3Sizer->Add(colorFillSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 3157 - wxBoxSizer *fill1Sizer = new wxBoxSizer(wxHORIZONTAL); 3158 - colorFillSizer->Add(fill1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3159 - wxTextCtrl *fillColorCtrl = 3160 - new wxTextCtrl(panel, ID_SYMBOLIZER_FILL_COLOR, FillColor, 3161 - wxDefaultPosition, wxSize(80, 22)); 3162 - fill1Sizer->Add(fillColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3163 - wxBitmap bmp; 3164 - wxColour color(0, 0, 0); 3165 - ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 3166 - wxStaticBitmap *sampleFillCtrl = 3167 - new wxStaticBitmap(panel, ID_SYMBOLIZER_FILL_PICKER_HEX, bmp, 3168 - wxDefaultPosition, wxSize(32, 32)); 3169 - fill1Sizer->Add(sampleFillCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3170 - wxButton *pickFill = 3171 - new wxButton(panel, ID_SYMBOLIZER_FILL_PICKER_BTN, wxT("&Pick a color")); 3172 - fill1Sizer->Add(pickFill, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3173 -// second row B: Stroke Color 3174 - box3Sizer->AddSpacer(30); 3175 - wxStaticBox *colorStrokeBox = new wxStaticBox(panel, wxID_STATIC, 3176 - wxT("Stroke Color"), 3177 - wxDefaultPosition, 3178 - wxDefaultSize); 3179 - wxBoxSizer *colorStrokeSizer = 3180 - new wxStaticBoxSizer(colorStrokeBox, wxVERTICAL); 3181 - box3Sizer->Add(colorStrokeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 3182 - wxBoxSizer *stroke1Sizer = new wxBoxSizer(wxHORIZONTAL); 3183 - colorStrokeSizer->Add(stroke1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3184 - wxTextCtrl *strokeColorCtrl = 3185 - new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE_COLOR, StrokeColor, 3186 - wxDefaultPosition, wxSize(80, 22)); 3187 - stroke1Sizer->Add(strokeColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3188 - wxStaticBitmap *sampleStrokeCtrl = 3189 - new wxStaticBitmap(panel, ID_SYMBOLIZER_STROKE_PICKER_HEX, bmp, 3190 - wxDefaultPosition, wxSize(32, 32)); 3191 - stroke1Sizer->Add(sampleStrokeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3192 - wxButton *pickStroke = 3193 - new wxButton(panel, ID_SYMBOLIZER_STROKE_PICKER_BTN, wxT("&Pick a color")); 3194 - stroke1Sizer->Add(pickStroke, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3195 - panel->SetSizer(topSizer); 3196 - topSizer->Fit(panel); 3197 -// appends event handlers 3198 - Connect(ID_SYMBOLIZER_MARK, wxEVT_COMMAND_RADIOBOX_SELECTED, 3199 - (wxObjectEventFunction) & QuickStyleVectorDialog::OnCmdMarkChanged); 3200 - Connect(ID_SYMBOLIZER_FILL_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 3201 - (wxObjectEventFunction) & 3202 - QuickStyleVectorDialog::OnCmdPointColorFillPicker); 3203 - Connect(ID_SYMBOLIZER_FILL_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 3204 - (wxObjectEventFunction) & 3205 - QuickStyleVectorDialog::OnCmdPointColorFillChanged); 3206 - Connect(ID_SYMBOLIZER_STROKE_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 3207 - (wxObjectEventFunction) & 3208 - QuickStyleVectorDialog::OnCmdPointColorStrokePicker); 3209 - Connect(ID_SYMBOLIZER_STROKE_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 3210 - (wxObjectEventFunction) & 3211 - QuickStyleVectorDialog::OnCmdPointColorStrokeChanged); 3212 - return panel; 3213 -} 3214 - 3215 -void QuickStyleVectorDialog::OnCmdMarkChanged(wxCommandEvent & WXUNUSED(event)) 3216 -{ 3217 -// 3218 -// Mark selection changed 3219 -// 3220 - wxRadioBox *markCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MARK); 3221 - switch (markCtrl->GetSelection()) 3222 - { 3223 - case 1: 3224 - Style->SetSymbolWellKnownMark(RL2_GRAPHIC_MARK_CIRCLE); 3225 - break; 3226 - case 2: 3227 - Style->SetSymbolWellKnownMark(RL2_GRAPHIC_MARK_TRIANGLE); 3228 - break; 3229 - case 3: 3230 - Style->SetSymbolWellKnownMark(RL2_GRAPHIC_MARK_STAR); 3231 - break; 3232 - case 4: 3233 - Style->SetSymbolWellKnownMark(RL2_GRAPHIC_MARK_CROSS); 3234 - break; 3235 - case 5: 3236 - Style->SetSymbolWellKnownMark(RL2_GRAPHIC_MARK_X); 3237 - break; 3238 - default: 3239 - Style->SetSymbolWellKnownMark(RL2_GRAPHIC_MARK_SQUARE); 3240 - break; 3241 - }; 3242 -} 3243 - 3244 -void QuickStyleVectorDialog:: 3245 -OnCmdPointColorFillChanged(wxCommandEvent & WXUNUSED(event)) 3246 -{ 3247 -// 3248 -// Fill color changed: updating the visual sample 3249 -// 3250 - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL_COLOR); 3251 - wxStaticBitmap *sampleCtrl = 3252 - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FILL_PICKER_HEX); 3253 - wxColour back = wxColour(255, 255, 255); 3254 - wxString str = colorCtrl->GetValue(); 3255 - if (ColorMapEntry::IsValidColor(str) == true) 3256 - ColorMapEntry::GetWxColor(str, back); 3257 - wxBitmap bmp; 3258 - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 3259 - sampleCtrl->SetBitmap(bmp); 3260 - sampleCtrl->Refresh(); 3261 - sampleCtrl->Update(); 3262 -} 3263 - 3264 -void QuickStyleVectorDialog:: 3265 -OnCmdPointColorFillPicker(wxCommandEvent & WXUNUSED(event)) 3266 -{ 3267 -// 3268 -// color picker 3269 -// 3270 - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL_COLOR); 3271 - wxColour clr = wxNullColour; 3272 - wxString str = colorCtrl->GetValue(); 3273 - if (ColorMapEntry::IsValidColor(str) == true) 3274 - ColorMapEntry::GetWxColor(str, clr); 3275 - wxColour color = wxGetColourFromUser(this, clr); 3276 - if (color.IsOk() == true) 3277 - { 3278 - char hex[16]; 3279 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 3280 - wxString str = wxString::FromUTF8(hex); 3281 - colorCtrl->SetValue(str); 3282 - } 3283 -} 3284 - 3285 -void QuickStyleVectorDialog:: 3286 -OnCmdPointColorStrokeChanged(wxCommandEvent & WXUNUSED(event)) 3287 -{ 3288 -// 3289 -// Stroke color changed: updating the visual sample 3290 -// 3291 - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE_COLOR); 3292 - wxStaticBitmap *sampleCtrl = 3293 - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_STROKE_PICKER_HEX); 3294 - wxColour back = wxColour(255, 255, 255); 3295 - wxString str = colorCtrl->GetValue(); 3296 - if (ColorMapEntry::IsValidColor(str) == true) 3297 - ColorMapEntry::GetWxColor(str, back); 3298 - wxBitmap bmp; 3299 - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 3300 - sampleCtrl->SetBitmap(bmp); 3301 - sampleCtrl->Refresh(); 3302 - sampleCtrl->Update(); 3303 -} 3304 - 3305 -void QuickStyleVectorDialog:: 3306 -OnCmdPointColorStrokePicker(wxCommandEvent & WXUNUSED(event)) 3307 -{ 3308 -// 3309 -// color picker 3310 -// 3311 - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE_COLOR); 3312 - wxColour clr = wxNullColour; 3313 - wxString str = colorCtrl->GetValue(); 3314 - if (ColorMapEntry::IsValidColor(str) == true) 3315 - ColorMapEntry::GetWxColor(str, clr); 3316 - wxColour color = wxGetColourFromUser(this, clr); 3317 - if (color.IsOk() == true) 3318 - { 3319 - char hex[16]; 3320 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 3321 - wxString str = wxString::FromUTF8(hex); 3322 - colorCtrl->SetValue(str); 3323 - } 3324 -} 3325 - 3326 -wxPanel *QuickStyleVectorDialog::CreateLinePage(wxWindow * parent) 3327 -{ 3328 -// 3329 -// creating the Line Symbolizer page 3330 -// 3331 - wxString StrokeColor = wxT("#000000"); 3332 - wxPanel *panel = new wxPanel(parent, ID_PANE_LINE); 3333 - wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 3334 - panel->SetSizer(topSizer); 3335 - wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 3336 - topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 3337 -// first row A: the Stroke #1 Opacity and Perpendicular Offset 3338 - boxSizer->AddSpacer(50); 3339 - wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxVERTICAL); 3340 - boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3341 - wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, 3342 - wxT("Opacity"), 3343 - wxDefaultPosition, 3344 - wxDefaultSize); 3345 - wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxHORIZONTAL); 3346 - opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3347 - wxSlider *opacityCtrl = 3348 - new wxSlider(panel, ID_SYMBOLIZER_STROKE1_OPACITY, 100, 0, 100, 3349 - wxDefaultPosition, wxSize(600, 45), 3350 - wxSL_HORIZONTAL | wxSL_LABELS); 3351 - opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3352 -// first row B: PerpendicularOffset 3353 - wxBoxSizer *perpendicularBoxSizer = new wxBoxSizer(wxHORIZONTAL); 3354 - opacityBoxSizer->Add(perpendicularBoxSizer, 0, 3355 - wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3356 - wxStaticBox *perpendicularBox = new wxStaticBox(panel, wxID_STATIC, 3357 - wxT("Perpendicular Offset"), 3358 - wxDefaultPosition, 3359 - wxDefaultSize); 3360 - wxBoxSizer *perpendicularSizer = 3361 - new wxStaticBoxSizer(perpendicularBox, wxVERTICAL); 3362 - perpendicularBoxSizer->Add(perpendicularSizer, 0, 3363 - wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 3364 - wxBoxSizer *perp1Sizer = new wxBoxSizer(wxHORIZONTAL); 3365 - perpendicularSizer->Add(perp1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3366 - wxTextCtrl *perpendicularCtrl = 3367 - new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE1_PERPENDICULAR, wxT("0.0"), 3368 - wxDefaultPosition, wxSize(100, 22)); 3369 - perp1Sizer->Add(perpendicularCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 3370 - wxStaticText *perp1Label = new wxStaticText(panel, wxID_STATIC, 3371 - wxT 3372 - ("Draw lines in parallel to the original geometry.")); 3373 - perp1Sizer->Add(perp1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 3374 - wxStaticText *perp2Label = new wxStaticText(panel, wxID_STATIC, 3375 - wxT 3376 - ("Positive to the left-hand side. Negative numbers mean right.")); 3377 - perpendicularSizer->Add(perp2Label, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3378 -// second row: Stroke color or Graphic 3379 - wxBoxSizer *strokeSizer = new wxBoxSizer(wxHORIZONTAL); 3380 - boxSizer->Add(strokeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3381 -// second row B: Stroke Color 3382 - wxBoxSizer *colorBoxSizer = new wxBoxSizer(wxHORIZONTAL); 3383 - strokeSizer->Add(colorBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3384 - wxStaticBox *colorBox = new wxStaticBox(panel, wxID_STATIC, 3385 - wxT("Stroke Color"), 3386 - wxDefaultPosition, 3387 - wxDefaultSize); 3388 - wxBoxSizer *colorSizer = new wxStaticBoxSizer(colorBox, wxVERTICAL); 3389 - colorBoxSizer->Add(colorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3390 - wxBoxSizer *color1Sizer = new wxBoxSizer(wxHORIZONTAL); 3391 - colorSizer->Add(color1Sizer, 0, wxALIGN_RIGHT | wxALL, 0); 3392 - wxTextCtrl *colorCtrl = 3393 - new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE1_COLOR, StrokeColor, 3394 - wxDefaultPosition, wxSize(80, 22)); 3395 - color1Sizer->Add(colorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3396 - wxBitmap bmp; 3397 - wxColour color(0, 0, 0); 3398 - ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 3399 - wxStaticBitmap *sampleCtrl = 3400 - new wxStaticBitmap(panel, ID_SYMBOLIZER_STROKE1_PICKER_HEX, bmp, 3401 - wxDefaultPosition, wxSize(32, 32)); 3402 - color1Sizer->Add(sampleCtrl, 0, wxALIGN_RIGHT | wxALL, 5); 3403 - wxBoxSizer *pickerSizer = new wxBoxSizer(wxHORIZONTAL); 3404 - colorSizer->Add(pickerSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3405 - wxButton *pick = 3406 - new wxButton(panel, ID_SYMBOLIZER_STROKE1_PICKER_BTN, wxT("&Pick a color")); 3407 - pickerSizer->Add(pick, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3408 -// third row: Stroke-Width 3409 - wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); 3410 - colorBoxSizer->Add(miscSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3411 -// third row A: StrokeWidth 3412 - wxBoxSizer *widthBoxSizer = new wxBoxSizer(wxHORIZONTAL); 3413 - miscSizer->Add(widthBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3414 - wxStaticBox *widthBox = new wxStaticBox(panel, wxID_STATIC, 3415 - wxT("Stroke Width"), 3416 - wxDefaultPosition, 3417 - wxDefaultSize); 3418 - wxBoxSizer *widthSizer = new wxStaticBoxSizer(widthBox, wxVERTICAL); 3419 - widthBoxSizer->Add(widthSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 3420 - wxTextCtrl *widthCtrl = 3421 - new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE1_WIDTH, wxT("1.0"), 3422 - wxDefaultPosition, wxSize(100, 22)); 3423 - widthSizer->Add(widthCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3424 -// third row D: DashArray and DashOffset 3425 - wxBoxSizer *dashBoxSizer = new wxBoxSizer(wxHORIZONTAL); 3426 - miscSizer->Add(dashBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3427 - wxString dot[4]; 3428 - dot[0] = wxT("&Solid Line"); 3429 - dot[1] = wxT("&Dotted Line"); 3430 - dot[2] = wxT("&Dashed Line"); 3431 - dot[3] = wxT("&Dashed/Dotted Line"); 3432 - wxRadioBox *dotBox = new wxRadioBox(panel, ID_SYMBOLIZER_DASH_DOT, 3433 - wxT("&Dash/Dot Style"), 3434 - wxDefaultPosition, 3435 - wxDefaultSize, 4, 3436 - dot, 1, 3437 - wxRA_SPECIFY_COLS); 3438 - dotBox->SetSelection(0); 3439 - dashBoxSizer->Add(dotBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3440 - panel->SetSizer(topSizer); 3441 - topSizer->Fit(panel); 3442 -// appends event handlers 3443 - Connect(ID_SYMBOLIZER_STROKE1_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 3444 - (wxObjectEventFunction) & 3445 - QuickStyleVectorDialog::OnCmdLineColorChanged); 3446 - Connect(ID_SYMBOLIZER_STROKE1_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 3447 - (wxObjectEventFunction) & 3448 - QuickStyleVectorDialog::OnCmdLineColorPicker); 3449 - return panel; 3450 -} 3451 - 3452 -void QuickStyleVectorDialog:: 3453 -OnCmdLineColorChanged(wxCommandEvent & WXUNUSED(event)) 3454 -{ 3455 -// 3456 -// Stroke color changed: updating the visual sample 3457 -// 3458 - wxTextCtrl *colorCtrl = 3459 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); 3460 - wxStaticBitmap *sampleCtrl = 3461 - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_STROKE1_PICKER_HEX); 3462 - wxColour back = wxColour(255, 255, 255); 3463 - wxString str = colorCtrl->GetValue(); 3464 - if (ColorMapEntry::IsValidColor(str) == true) 3465 - ColorMapEntry::GetWxColor(str, back); 3466 - wxBitmap bmp; 3467 - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 3468 - sampleCtrl->SetBitmap(bmp); 3469 - sampleCtrl->Refresh(); 3470 - sampleCtrl->Update(); 3471 -} 3472 - 3473 -void QuickStyleVectorDialog:: 3474 -OnCmdLineColorPicker(wxCommandEvent & WXUNUSED(event)) 3475 -{ 3476 -// 3477 -// color picker 3478 -// 3479 - wxTextCtrl *colorCtrl = 3480 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); 3481 - wxColour clr = wxNullColour; 3482 - wxString str = colorCtrl->GetValue(); 3483 - if (ColorMapEntry::IsValidColor(str) == true) 3484 - ColorMapEntry::GetWxColor(str, clr); 3485 - wxColour color = wxGetColourFromUser(this, clr); 3486 - if (color.IsOk() == true) 3487 - { 3488 - char hex[16]; 3489 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 3490 - wxString str = wxString::FromUTF8(hex); 3491 - colorCtrl->SetValue(str); 3492 - } 3493 -} 3494 - 3495 -wxPanel *QuickStyleVectorDialog::CreatePolygonPage(wxWindow * parent) 3496 -{ 3497 -// 3498 -// creating the Polygon Symbolizer page 3499 -// 3500 - wxString StrokeColor = wxT("#000000"); 3501 - wxString FillColor = wxT("#808080"); 3502 - wxPanel *panel = new wxPanel(parent, ID_PANE_FILL2); 3503 - wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 3504 - panel->SetSizer(topSizer); 3505 - wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 3506 - topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 3507 -// first row: the Polygon Displacement and Perpendicular Offset 3508 - wxBoxSizer *polygonBoxSizer = new wxBoxSizer(wxHORIZONTAL); 3509 - boxSizer->Add(polygonBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 3510 -// first row A: Displacement 3511 - wxBoxSizer *displacementBoxSizer = new wxBoxSizer(wxHORIZONTAL); 3512 - polygonBoxSizer->Add(displacementBoxSizer, 0, 3513 - wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3514 - wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, 3515 - wxT("Displacement"), 3516 - wxDefaultPosition, 3517 - wxDefaultSize); 3518 - wxBoxSizer *displacementSizer = 3519 - new wxStaticBoxSizer(displacementBox, wxVERTICAL); 3520 - displacementBoxSizer->Add(displacementSizer, 0, 3521 - wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 3522 - wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); 3523 - displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3524 - wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); 3525 - displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 3526 - wxTextCtrl *displacementXCtrl = 3527 - new wxTextCtrl(panel, ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_X, wxT("0.0"), 3528 - wxDefaultPosition, wxSize(100, 22)); 3529 - displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 3530 - wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); 3531 - displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3532 - wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); 3533 - displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 3534 - wxTextCtrl *displacementYCtrl = 3535 - new wxTextCtrl(panel, ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_Y, wxT("0.0"), 3536 - wxDefaultPosition, wxSize(100, 22)); 3537 - displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 3538 -// first row B: PerpendicularOffset 3539 - wxBoxSizer *perpendicularBoxSizer = new wxBoxSizer(wxHORIZONTAL); 3540 - polygonBoxSizer->Add(perpendicularBoxSizer, 0, 3541 - wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3542 - wxStaticBox *perpendicularBox = new wxStaticBox(panel, wxID_STATIC, 3543 - wxT("Perpendicular Offset"), 3544 - wxDefaultPosition, 3545 - wxDefaultSize); 3546 - wxBoxSizer *perpendicularSizer = 3547 - new wxStaticBoxSizer(perpendicularBox, wxVERTICAL); 3548 - perpendicularBoxSizer->Add(perpendicularSizer, 0, 3549 - wxALIGN_CENTER_VERTICAL | wxALL, 5); 3550 - wxBoxSizer *perp1Sizer = new wxBoxSizer(wxHORIZONTAL); 3551 - perpendicularSizer->Add(perp1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3552 - wxTextCtrl *perpendicularCtrl = 3553 - new wxTextCtrl(panel, ID_SYMBOLIZER_POLYGON1_PERPENDICULAR, wxT("0.0"), 3554 - wxDefaultPosition, wxSize(100, 22)); 3555 - perp1Sizer->Add(perpendicularCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 3556 - wxStaticText *perp1Label = new wxStaticText(panel, wxID_STATIC, 3557 - wxT 3558 - ("Positive: larger. / Negative: smaller.")); 3559 - perp1Sizer->Add(perp1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 3560 - wxStaticText *perp2Label = new wxStaticText(panel, wxID_STATIC, 3561 - wxT 3562 - ("Drawing polygons smaller or larger than their actual geometry (Buffer).")); 3563 - perpendicularSizer->Add(perp2Label, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3564 -// second row: Fill Opacity 3565 - wxBoxSizer *auxBoxSizer = new wxBoxSizer(wxHORIZONTAL); 3566 - boxSizer->Add(auxBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3567 - wxStaticBox *auxBox = new wxStaticBox(panel, wxID_STATIC, 3568 - wxT("Polygon Fill"), 3569 - wxDefaultPosition, 3570 - wxDefaultSize); 3571 - wxBoxSizer *auxSizer = new wxStaticBoxSizer(auxBox, wxHORIZONTAL); 3572 - auxBoxSizer->Add(auxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3573 - wxBoxSizer *enableSizer = new wxBoxSizer(wxHORIZONTAL); 3574 - auxSizer->Add(enableSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 3575 - wxCheckBox *enableCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_FILL2_ENABLE, 3576 - wxT("Enable"), 3577 - wxDefaultPosition, wxDefaultSize); 3578 - enableCtrl->SetValue(Style->IsPolygonFill()); 3579 - enableSizer->Add(enableCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3580 - wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); 3581 - enableSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3582 - wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, 3583 - wxT("Opacity"), 3584 - wxDefaultPosition, 3585 - wxDefaultSize); 3586 - wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); 3587 - opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3588 - wxSlider *opacityCtrl = 3589 - new wxSlider(panel, ID_SYMBOLIZER_FILL2_OPACITY, 100, 0, 100, 3590 - wxDefaultPosition, wxSize(400, 45), 3591 - wxSL_HORIZONTAL | wxSL_LABELS); 3592 - opacityCtrl->Enable(Style->IsPolygonFill()); 3593 - opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3594 -// third row B: Fill Color 3595 - wxBoxSizer *colorBoxSizer = new wxBoxSizer(wxVERTICAL); 3596 - auxSizer->Add(colorBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3597 - wxStaticBox *colorBox = new wxStaticBox(panel, wxID_STATIC, 3598 - wxT("Fill Color"), 3599 - wxDefaultPosition, 3600 - wxDefaultSize); 3601 - wxBoxSizer *colorSizer = new wxStaticBoxSizer(colorBox, wxVERTICAL); 3602 - colorBoxSizer->Add(colorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3603 - wxBoxSizer *color1Sizer = new wxBoxSizer(wxHORIZONTAL); 3604 - colorSizer->Add(color1Sizer, 0, wxALIGN_RIGHT | wxALL, 0); 3605 - wxTextCtrl *colorCtrl = 3606 - new wxTextCtrl(panel, ID_SYMBOLIZER_FILL2_COLOR, FillColor, 3607 - wxDefaultPosition, wxSize(80, 22)); 3608 - color1Sizer->Add(colorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3609 - wxBitmap bmp; 3610 - wxColour color(0, 0, 0); 3611 - ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 3612 - wxStaticBitmap *sampleCtrl = 3613 - new wxStaticBitmap(panel, ID_SYMBOLIZER_FILL2_PICKER_HEX, bmp, 3614 - wxDefaultPosition, wxSize(32, 32)); 3615 - sampleCtrl->Enable(Style->IsPolygonFill()); 3616 - color1Sizer->Add(sampleCtrl, 0, wxALIGN_RIGHT | wxALL, 5); 3617 - wxBoxSizer *pickerSizer = new wxBoxSizer(wxHORIZONTAL); 3618 - colorSizer->Add(pickerSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3619 - wxButton *pick = 3620 - new wxButton(panel, ID_SYMBOLIZER_FILL2_PICKER_BTN, wxT("&Pick a color")); 3621 - pick->Enable(Style->IsPolygonFill()); 3622 - pickerSizer->Add(pick, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3623 -// first row A: the Stroke #1 Opacity 3624 - wxBoxSizer *opacity2BoxSizer = new wxBoxSizer(wxHORIZONTAL); 3625 - boxSizer->Add(opacity2BoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 3626 - wxStaticBox *enableBox = new wxStaticBox(panel, wxID_STATIC, 3627 - wxT("Polygon Stroke"), 3628 - wxDefaultPosition, 3629 - wxDefaultSize); 3630 - wxBoxSizer *enable2Sizer = new wxStaticBoxSizer(enableBox, wxHORIZONTAL); 3631 - opacity2BoxSizer->Add(enable2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3632 - wxCheckBox *enable2Ctrl = new wxCheckBox(panel, ID_SYMBOLIZER_STROKE2_ENABLE, 3633 - wxT("Enable"), 3634 - wxDefaultPosition, wxDefaultSize); 3635 - enable2Ctrl->SetValue(Style->IsPolygonStroke()); 3636 - enable2Sizer->Add(enable2Ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3637 - wxStaticBox *opacity2Box = new wxStaticBox(panel, wxID_STATIC, 3638 - wxT("Opacity"), 3639 - wxDefaultPosition, 3640 - wxDefaultSize); 3641 - wxBoxSizer *opacity2Sizer = new wxStaticBoxSizer(opacity2Box, wxVERTICAL); 3642 - enable2Sizer->Add(opacity2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3643 - wxSlider *opacity2Ctrl = 3644 - new wxSlider(panel, ID_SYMBOLIZER_STROKE2_OPACITY, 100, 0, 100, 3645 - wxDefaultPosition, wxSize(250, 45), 3646 - wxSL_HORIZONTAL | wxSL_LABELS); 3647 - opacity2Ctrl->Enable(Style->IsPolygonStroke()); 3648 - opacity2Sizer->Add(opacity2Ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3649 -// second row B: Stroke Color 3650 - wxStaticBox *color2Box = new wxStaticBox(panel, wxID_STATIC, 3651 - wxT("Stroke Color"), 3652 - wxDefaultPosition, 3653 - wxDefaultSize); 3654 - wxBoxSizer *color2Sizer = new wxStaticBoxSizer(color2Box, wxVERTICAL); 3655 - enable2Sizer->Add(color2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 3656 - wxBoxSizer *color3Sizer = new wxBoxSizer(wxHORIZONTAL); 3657 - color2Sizer->Add(color3Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3658 - wxTextCtrl *color2Ctrl = 3659 - new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE2_COLOR, StrokeColor, 3660 - wxDefaultPosition, wxSize(80, 22)); 3661 - color2Ctrl->Enable(Style->IsPolygonStroke()); 3662 - color3Sizer->Add(color2Ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3663 - wxStaticBitmap *sample2Ctrl = 3664 - new wxStaticBitmap(panel, ID_SYMBOLIZER_STROKE2_PICKER_HEX, bmp, 3665 - wxDefaultPosition, wxSize(32, 32)); 3666 - sample2Ctrl->Enable(Style->IsPolygonStroke()); 3667 - color3Sizer->Add(sample2Ctrl, 0, wxALIGN_RIGHT | wxALL, 5); 3668 - wxBoxSizer *picker2Sizer = new wxBoxSizer(wxHORIZONTAL); 3669 - color2Sizer->Add(picker2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3670 - wxButton *pick2 = 3671 - new wxButton(panel, ID_SYMBOLIZER_STROKE2_PICKER_BTN, wxT("&Pick a color")); 3672 - pick2->Enable(Style->IsPolygonStroke()); 3673 - picker2Sizer->Add(pick2, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3674 -// third row: Stroke-Width, 3675 - wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); 3676 - enable2Sizer->Add(miscSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3677 -// third row A: StrokeWidth 3678 - wxBoxSizer *widthBoxSizer = new wxBoxSizer(wxHORIZONTAL); 3679 - miscSizer->Add(widthBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3680 - wxStaticBox *widthBox = new wxStaticBox(panel, wxID_STATIC, 3681 - wxT("Stroke Width"), 3682 - wxDefaultPosition, 3683 - wxDefaultSize); 3684 - wxBoxSizer *widthSizer = new wxStaticBoxSizer(widthBox, wxVERTICAL); 3685 - widthBoxSizer->Add(widthSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3686 - wxTextCtrl *widthCtrl = 3687 - new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE2_WIDTH, wxT("1.0"), 3688 - wxDefaultPosition, wxSize(100, 22)); 3689 - widthCtrl->Enable(false); 3690 - widthSizer->Add(widthCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3691 - 3692 - panel->SetSizer(topSizer); 3693 - topSizer->Fit(panel); 3694 -// appends event handlers 3695 - Connect(ID_SYMBOLIZER_STROKE2_ENABLE, wxEVT_COMMAND_CHECKBOX_CLICKED, 3696 - (wxObjectEventFunction) & 3697 - QuickStyleVectorDialog::OnCmdPolygonStrokeChanged); 3698 - Connect(ID_SYMBOLIZER_FILL2_ENABLE, wxEVT_COMMAND_CHECKBOX_CLICKED, 3699 - (wxObjectEventFunction) & 3700 - QuickStyleVectorDialog::OnCmdPolygonFillChanged); 3701 - Connect(ID_SYMBOLIZER_FILL2_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 3702 - (wxObjectEventFunction) & 3703 - QuickStyleVectorDialog::OnCmdPolygonColorFillChanged); 3704 - Connect(ID_SYMBOLIZER_FILL2_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 3705 - (wxObjectEventFunction) & 3706 - QuickStyleVectorDialog::OnCmdPolygonColorFillPicker); 3707 - Connect(ID_SYMBOLIZER_STROKE2_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 3708 - (wxObjectEventFunction) & 3709 - QuickStyleVectorDialog::OnCmdPolygonColorStrokeChanged); 3710 - Connect(ID_SYMBOLIZER_STROKE2_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 3711 - (wxObjectEventFunction) & 3712 - QuickStyleVectorDialog::OnCmdPolygonColorStrokePicker); 3713 - return panel; 3714 -} 3715 - 3716 -void QuickStyleVectorDialog:: 3717 -OnCmdPolygonStrokeChanged(wxCommandEvent & WXUNUSED(event)) 3718 -{ 3719 -// 3720 -// Stroke enable/disable 3721 -// 3722 - wxCheckBox *enableCtrl = 3723 - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_STROKE2_ENABLE); 3724 - if (enableCtrl->IsChecked() == true) 3725 - Style->SetPolygonStroke(true); 3726 - else 3727 - Style->SetPolygonStroke(false); 3728 - RetrievePolygonPage(false); 3729 - UpdatePolygonPage(); 3730 -} 3731 - 3732 -void QuickStyleVectorDialog:: 3733 -OnCmdPolygonFillChanged(wxCommandEvent & WXUNUSED(event)) 3734 -{ 3735 -// 3736 -// Fill enable/disable 3737 -// 3738 - wxCheckBox *enableCtrl = 3739 - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_FILL2_ENABLE); 3740 - if (enableCtrl->IsChecked() == true) 3741 - Style->SetPolygonFill(true); 3742 - else 3743 - Style->SetPolygonFill(false); 3744 - RetrievePolygonPage(false); 3745 - UpdatePolygonPage(); 3746 -} 3747 - 3748 -void QuickStyleVectorDialog:: 3749 -OnCmdPolygonColorFillChanged(wxCommandEvent & WXUNUSED(event)) 3750 -{ 3751 -// 3752 -// Fill color changed: updating the visual sample 3753 -// 3754 - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); 3755 - wxStaticBitmap *sampleCtrl = 3756 - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FILL2_PICKER_HEX); 3757 - wxColour back = wxColour(255, 255, 255); 3758 - wxString str = colorCtrl->GetValue(); 3759 - if (ColorMapEntry::IsValidColor(str) == true) 3760 - ColorMapEntry::GetWxColor(str, back); 3761 - wxBitmap bmp; 3762 - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 3763 - sampleCtrl->SetBitmap(bmp); 3764 - sampleCtrl->Refresh(); 3765 - sampleCtrl->Update(); 3766 -} 3767 - 3768 -void QuickStyleVectorDialog:: 3769 -OnCmdPolygonColorFillPicker(wxCommandEvent & WXUNUSED(event)) 3770 -{ 3771 -// 3772 -// color picker 3773 -// 3774 - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); 3775 - wxColour clr = wxNullColour; 3776 - wxString str = colorCtrl->GetValue(); 3777 - if (ColorMapEntry::IsValidColor(str) == true) 3778 - ColorMapEntry::GetWxColor(str, clr); 3779 - wxColour color = wxGetColourFromUser(this, clr); 3780 - if (color.IsOk() == true) 3781 - { 3782 - char hex[16]; 3783 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 3784 - wxString str = wxString::FromUTF8(hex); 3785 - colorCtrl->SetValue(str); 3786 - } 3787 -} 3788 - 3789 -void QuickStyleVectorDialog:: 3790 -OnCmdPolygonColorStrokeChanged(wxCommandEvent & WXUNUSED(event)) 3791 -{ 3792 -// 3793 -// Stroke color changed: updating the visual sample 3794 -// 3795 - wxTextCtrl *colorCtrl = 3796 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); 3797 - wxStaticBitmap *sampleCtrl = 3798 - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_STROKE2_PICKER_HEX); 3799 - wxColour back = wxColour(255, 255, 255); 3800 - wxString str = colorCtrl->GetValue(); 3801 - if (ColorMapEntry::IsValidColor(str) == true) 3802 - ColorMapEntry::GetWxColor(str, back); 3803 - wxBitmap bmp; 3804 - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 3805 - sampleCtrl->SetBitmap(bmp); 3806 - sampleCtrl->Refresh(); 3807 - sampleCtrl->Update(); 3808 -} 3809 - 3810 -void QuickStyleVectorDialog:: 3811 -OnCmdPolygonColorStrokePicker(wxCommandEvent & WXUNUSED(event)) 3812 -{ 3813 -// 3814 -// color picker 3815 -// 3816 - wxTextCtrl *colorCtrl = 3817 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); 3818 - wxColour clr = wxNullColour; 3819 - wxString str = colorCtrl->GetValue(); 3820 - if (ColorMapEntry::IsValidColor(str) == true) 3821 - ColorMapEntry::GetWxColor(str, clr); 3822 - wxColour color = wxGetColourFromUser(this, clr); 3823 - if (color.IsOk() == true) 3824 - { 3825 - char hex[16]; 3826 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 3827 - wxString str = wxString::FromUTF8(hex); 3828 - colorCtrl->SetValue(str); 3829 - } 3830 -} 3831 - 3832 -bool QuickStyleVectorDialog::DoCheckDatasource(const char *prefix, 3833 - const char *coverage, 3834 - char *table, char *geometry) 3835 -{ 3836 -// 3837 -// retrieving the real table and geometry column names 3838 -// 3839 - sqlite3 *sqlite = MainFrame->GetSqlite(); 3840 - char *sql; 3841 - int ret; 3842 - char **results; 3843 - int rows; 3844 - int columns; 3845 - int i; 3846 - char *qprefix; 3847 - bool ok = false; 3848 - 3849 - qprefix = gaiaDoubleQuotedSql(prefix); 3850 - sql = sqlite3_mprintf("SELECT f_table_name, f_geometry_column, view_name, " 3851 - "view_geometry, virt_name, virt_geometry " 3852 - "FROM \"%s\".vector_coverages WHERE coverage_name = %Q", 3853 - qprefix, coverage); 3854 - free(qprefix); 3855 - ret = sqlite3_get_table(sqlite, sql, &results, &rows, &columns, NULL); 3856 - sqlite3_free(sql); 3857 - if (ret != SQLITE_OK) 3858 - return false; 3859 - if (rows < 1) 3860 - ; 3861 - else 3862 - { 3863 - for (i = 1; i <= rows; i++) 3864 - { 3865 - const char *t = results[(i * columns) + 0]; 3866 - const char *g = results[(i * columns) + 1]; 3867 - if (t != NULL && g != NULL) 3868 - { 3869 - strcpy(table, t); 3870 - strcpy(geometry, g); 3871 - ok = true; 3872 - } 3873 - t = results[(i * columns) + 2]; 3874 - g = results[(i * columns) + 3]; 3875 - if (t != NULL && g != NULL) 3876 - { 3877 - strcpy(table, t); 3878 - strcpy(geometry, g); 3879 - ok = true; 3880 - } 3881 - t = results[(i * columns) + 4]; 3882 - g = results[(i * columns) + 5]; 3883 - if (t != NULL && g != NULL) 3884 - { 3885 - strcpy(table, t); 3886 - strcpy(geometry, g); 3887 - ok = true; 3888 - } 3889 - } 3890 - } 3891 - sqlite3_free_table(results); 3892 - return ok; 3893 -} 3894 - 3895 -void QuickStyleVectorDialog::InitializeComboColumns(wxComboBox * ctrl) 3896 -{ 3897 -// 3898 -// initializing a Column list ComboBox 3899 -// 3900 - sqlite3 *sqlite = MainFrame->GetSqlite(); 3901 - char *sql; 3902 - int ret; 3903 - char **results; 3904 - int rows; 3905 - int columns; 3906 - int i; 3907 - char prefix[1024]; 3908 - char coverage[1024]; 3909 - char table[1024]; 3910 - char geometry[1024]; 3911 - char *qprefix; 3912 - char *qtable; 3913 - char *qgeometry; 3914 - 3915 - if (DbPrefix.Len() == 0) 3916 - strcpy(prefix, "MAIN"); 3917 - else 3918 - strcpy(prefix, DbPrefix.ToUTF8()); 3919 - strcpy(coverage, LayerName.ToUTF8()); 3920 - if (DoCheckDatasource(prefix, coverage, table, geometry) != true) 3921 - return; 3922 - 3923 - qprefix = gaiaDoubleQuotedSql(prefix); 3924 - qtable = gaiaDoubleQuotedSql(table); 3925 - sql = sqlite3_mprintf("PRAGMA \"%s\".table_info(\"%s\")", qprefix, qtable); 3926 - free(qprefix); 3927 - free(qtable); 3928 - ret = sqlite3_get_table(sqlite, sql, &results, &rows, &columns, NULL); 3929 - sqlite3_free(sql); 3930 - if (ret != SQLITE_OK) 3931 - return; 3932 - if (rows < 1) 3933 - ; 3934 - else 3935 - { 3936 - for (i = 1; i <= rows; i++) 3937 - { 3938 - const char *value = results[(i * columns) + 1]; 3939 - if (strcasecmp(value, geometry) == 0) 3940 - continue; // skipping the Geometry column 3941 - wxString col = wxString::FromUTF8(value); 3942 - ctrl->Append(col); 3943 - } 3944 - } 3945 - sqlite3_free_table(results); 3946 -} 3947 - 3948 -void QuickStyleVectorDialog::InitializeComboFonts(wxComboBox * ctrl) 3949 -{ 3950 -// 3951 -// initializing a Font list ComboBox 3952 -// 3953 - sqlite3 *sqlite = MainFrame->GetSqlite(); 3954 - char *sql; 3955 - int ret; 3956 - char **results; 3957 - int rows; 3958 - int columns; 3959 - int i; 3960 - char prefix[1024]; 3961 - char *qprefix; 3962 - 3963 -// inserting the default TOY FONTS 3964 - wxString font = wxT("ToyFont: serif"); 3965 - ctrl->Append(font); 3966 - font = wxT("ToyFont: sans-serif"); 3967 - ctrl->Append(font); 3968 - font = wxT("ToyFont: monospace"); 3969 - ctrl->Append(font); 3970 - 3971 - if (DbPrefix.Len() == 0) 3972 - strcpy(prefix, "MAIN"); 3973 - else 3974 - strcpy(prefix, DbPrefix.ToUTF8()); 3975 - qprefix = gaiaDoubleQuotedSql(prefix); 3976 - sql = 3977 - sqlite3_mprintf 3978 - ("SELECT font_facename FROM \"%s\".SE_fonts ORDER BY font_facename", 3979 - qprefix); 3980 - free(qprefix); 3981 - ret = sqlite3_get_table(sqlite, sql, &results, &rows, &columns, NULL); 3982 - sqlite3_free(sql); 3983 - if (ret != SQLITE_OK) 3984 - return; 3985 - if (rows < 1) 3986 - ; 3987 - else 3988 - { 3989 - for (i = 1; i <= rows; i++) 3990 - { 3991 - const char *value = results[(i * columns) + 0]; 3992 - wxString col = wxString::FromUTF8(value); 3993 - ctrl->Append(col); 3994 - } 3995 - } 3996 - sqlite3_free_table(results); 3997 -} 3998 - 3999 -wxPanel *QuickStyleVectorDialog::CreateTextPointPage(wxWindow * parent) 4000 -{ 4001 -// 4002 -// creating the Text Symbolizer page (Point Placement) 4003 -// 4004 - wxString FillColor = wxT("#808080"); 4005 - wxPanel *panel = new wxPanel(parent, ID_PANE_TEXT1); 4006 - wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 4007 - panel->SetSizer(topSizer); 4008 - wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 4009 - topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 4010 -// enable/disable Labels 4011 - wxBoxSizer *auxBoxSizer = new wxBoxSizer(wxHORIZONTAL); 4012 - boxSizer->Add(auxBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4013 - wxStaticBox *auxBox = new wxStaticBox(panel, wxID_STATIC, 4014 - wxT("Labels"), 4015 - wxDefaultPosition, 4016 - wxDefaultSize); 4017 - wxBoxSizer *auxSizer = new wxStaticBoxSizer(auxBox, wxVERTICAL); 4018 - auxBoxSizer->Add(auxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 4019 - wxBoxSizer *enableSizer = new wxBoxSizer(wxHORIZONTAL); 4020 - auxSizer->Add(enableSizer, 0, wxALIGN_LEFT | wxALL, 5); 4021 - wxCheckBox *enableCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_TEXT1_ENABLE, 4022 - wxT("Enable"), 4023 - wxDefaultPosition, wxDefaultSize); 4024 - enableCtrl->SetValue(Style->IsLabelPrint()); 4025 - enableSizer->Add(enableCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 4026 - enableSizer->AddSpacer(20); 4027 - enableSizer->AddSpacer(20); 4028 - enableSizer->AddSpacer(20); 4029 - enableSizer->AddSpacer(20); 4030 - wxStaticText *columnLabel = 4031 - new wxStaticText(panel, wxID_STATIC, wxT("&Column:")); 4032 - enableSizer->Add(columnLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 4033 - wxComboBox *columnList = 4034 - new wxComboBox(panel, ID_SYMBOLIZER_TEXT1_LABEL, wxT(""), wxDefaultPosition, 4035 - wxSize(400, 22), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); 4036 - InitializeComboColumns(columnList); 4037 - enableSizer->Add(columnList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 4038 - 4039 - 4040 - wxStaticBox *fontBox = new wxStaticBox(panel, wxID_STATIC, 4041 - wxT("Font"), 4042 - wxDefaultPosition, 4043 - wxDefaultSize); 4044 - wxBoxSizer *font9Sizer = new wxStaticBoxSizer(fontBox, wxHORIZONTAL); 4045 - auxSizer->Add(font9Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4046 -// Second row: Font Name, Size and Fill 4047 - wxBoxSizer *fontSizer = new wxBoxSizer(wxHORIZONTAL); 4048 - font9Sizer->Add(fontSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 4049 - wxBoxSizer *font0Sizer = new wxBoxSizer(wxHORIZONTAL); 4050 - fontSizer->Add(font0Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 4051 -// Font Name 4052 - wxBoxSizer *fontXSizer = new wxBoxSizer(wxVERTICAL); 4053 - font0Sizer->Add(fontXSizer, 0, wxALIGN_LEFT | wxALL, 0); 4054 - wxComboBox *fontList = 4055 - new wxComboBox(panel, ID_SYMBOLIZER_FONT1_NAME, wxT(""), wxDefaultPosition, 4056 - wxSize(250, 21), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); 4057 - InitializeComboFonts(fontList); 4058 - fontList->Select(0); 4059 - fontXSizer->Add(fontList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4060 -// Font Size 4061 - wxBoxSizer *fontYSizer = new wxBoxSizer(wxHORIZONTAL); 4062 - fontXSizer->Add(fontYSizer, 0, wxALIGN_LEFT | wxALL, 0); 4063 - wxStaticBox *sizeBox = new wxStaticBox(panel, wxID_STATIC, 4064 - wxT("Font Size"), 4065 - wxDefaultPosition, 4066 - wxDefaultSize); 4067 - wxBoxSizer *sizeSizer = new wxStaticBoxSizer(sizeBox, wxHORIZONTAL); 4068 - fontYSizer->Add(sizeSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4069 - wxTextCtrl *sizeCtrl = 4070 - new wxTextCtrl(panel, ID_SYMBOLIZER_FONT1_SIZE, wxT("15.0"), 4071 - wxDefaultPosition, wxSize(100, 22)); 4072 - sizeSizer->Add(sizeCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 4073 - wxBoxSizer *boldBoxSizer = new wxBoxSizer(wxVERTICAL); 4074 - fontYSizer->Add(boldBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4075 - wxStaticBox *boldBox = new wxStaticBox(panel, wxID_STATIC, 4076 - wxT("Font Style"), 4077 - wxDefaultPosition, 4078 - wxDefaultSize); 4079 - wxBoxSizer *boldSizer = new wxStaticBoxSizer(boldBox, wxVERTICAL); 4080 - boldBoxSizer->Add(boldSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 4081 - wxBoxSizer *italicSizer = new wxBoxSizer(wxVERTICAL); 4082 - boldSizer->Add(italicSizer, 0, wxALIGN_LEFT | wxALL, 5); 4083 - wxCheckBox *italicCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_TEXT1_ITALIC, 4084 - wxT("Italic"), 4085 - wxDefaultPosition, wxDefaultSize); 4086 - italicCtrl->SetValue(false); 4087 - italicCtrl->Enable(false); 4088 - italicSizer->Add(italicCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 4089 - wxCheckBox *boldCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_TEXT1_BOLD, 4090 - wxT("Bold"), 4091 - wxDefaultPosition, wxDefaultSize); 4092 - boldCtrl->SetValue(false); 4093 - boldCtrl->Enable(false); 4094 - italicSizer->Add(boldCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 4095 -// Font Opacity 4096 - wxStaticBox *opacityFontBox = new wxStaticBox(panel, wxID_STATIC, 4097 - wxT("Opacity"), 4098 - wxDefaultPosition, 4099 - wxDefaultSize); 4100 - wxBoxSizer *opacityFontSizer = 4101 - new wxStaticBoxSizer(opacityFontBox, wxVERTICAL); 4102 - fontSizer->Add(opacityFontSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4103 - wxSlider *opacityFontCtrl = 4104 - new wxSlider(panel, ID_SYMBOLIZER_FONT1_OPACITY, 100, 0, 100, 4105 - wxDefaultPosition, wxSize(150, 45), 4106 - wxSL_HORIZONTAL | wxSL_LABELS); 4107 - opacityFontSizer->Add(opacityFontCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4108 -// Font color 4109 - wxStaticBox *fontColorBox = new wxStaticBox(panel, wxID_STATIC, 4110 - wxT("Color"), 4111 - wxDefaultPosition, 4112 - wxDefaultSize); 4113 - wxBoxSizer *fontColorSizer = new wxStaticBoxSizer(fontColorBox, wxVERTICAL); 4114 - fontSizer->Add(fontColorSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4115 - wxBoxSizer *font2Sizer = new wxBoxSizer(wxHORIZONTAL); 4116 - fontColorSizer->Add(font2Sizer, 0, wxALIGN_RIGHT | wxALL, 0); 4117 - wxTextCtrl *fontCtrl = new wxTextCtrl(panel, ID_SYMBOLIZER_FONT1_COLOR, 4118 - FillColor, 4119 - wxDefaultPosition, wxSize(80, 22)); 4120 - font2Sizer->Add(fontCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4121 - wxBitmap bmp; 4122 - wxColour color(0, 0, 0); 4123 - ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 4124 - wxStaticBitmap *sampleFontCtrl = 4125 - new wxStaticBitmap(panel, ID_SYMBOLIZER_FONT1_PICKER_HEX, bmp, 4126 - wxDefaultPosition, wxSize(32, 32)); 4127 - font2Sizer->Add(sampleFontCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 4128 - wxButton *pickFont = new wxButton(panel, ID_SYMBOLIZER_FONT1_PICKER_BTN, 4129 - wxT("&Pick a color")); 4130 - fontColorSizer->Add(pickFont, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 4131 -// first row: PointPlacement 4132 - wxBoxSizer *pointBoxSizer = new wxBoxSizer(wxHORIZONTAL); 4133 - auxSizer->Add(pointBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 4134 - wxStaticBox *pointBox = new wxStaticBox(panel, wxID_STATIC, 4135 - wxT("Label Point Placement"), 4136 - wxDefaultPosition, 4137 - wxDefaultSize); 4138 - wxBoxSizer *pointSizer = new wxStaticBoxSizer(pointBox, wxHORIZONTAL); 4139 - pointBoxSizer->Add(pointSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4140 -// first row A: Anchor Point 4141 - wxStaticBox *anchorBox = new wxStaticBox(panel, wxID_STATIC, 4142 - wxT("Anchor Point"), 4143 - wxDefaultPosition, 4144 - wxDefaultSize); 4145 - wxBoxSizer *anchorSizer = new wxStaticBoxSizer(anchorBox, wxVERTICAL); 4146 - pointSizer->Add(anchorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 4147 - wxBoxSizer *anchor1Sizer = new wxBoxSizer(wxHORIZONTAL); 4148 - anchorSizer->Add(anchor1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 4149 - wxStaticText *anchor1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); 4150 - anchor1Sizer->Add(anchor1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4151 - wxTextCtrl *anchorXCtrl = 4152 - new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_ANCHOR_X, wxT("0.5"), 4153 - wxDefaultPosition, wxSize(60, 22)); 4154 - anchor1Sizer->Add(anchorXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4155 - wxBoxSizer *anchor2Sizer = new wxBoxSizer(wxHORIZONTAL); 4156 - anchorSizer->Add(anchor2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 4157 - wxStaticText *anchor2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); 4158 - anchor2Sizer->Add(anchor2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4159 - wxTextCtrl *anchorYCtrl = 4160 - new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_ANCHOR_Y, wxT("0.5"), 4161 - wxDefaultPosition, wxSize(60, 22)); 4162 - anchor2Sizer->Add(anchorYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4163 -// first row B: Displacement 4164 - wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, 4165 - wxT("Displacement"), 4166 - wxDefaultPosition, 4167 - wxDefaultSize); 4168 - wxBoxSizer *displacementSizer = 4169 - new wxStaticBoxSizer(displacementBox, wxVERTICAL); 4170 - pointSizer->Add(displacementSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 4171 - wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); 4172 - displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 4173 - wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); 4174 - displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4175 - wxTextCtrl *displacementXCtrl = 4176 - new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_DISPLACEMENT_X, wxT("0.0"), 4177 - wxDefaultPosition, wxSize(60, 22)); 4178 - displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4179 - wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); 4180 - displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 4181 - wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); 4182 - displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4183 - wxTextCtrl *displacementYCtrl = 4184 - new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_DISPLACEMENT_Y, wxT("0.0"), 4185 - wxDefaultPosition, wxSize(60, 22)); 4186 - displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4187 -// first row C: Rotation 4188 - wxStaticBox *rotBox = new wxStaticBox(panel, wxID_STATIC, 4189 - wxT("Rotation"), 4190 - wxDefaultPosition, 4191 - wxDefaultSize); 4192 - wxBoxSizer *rotSizer = new wxStaticBoxSizer(rotBox, wxVERTICAL); 4193 - pointSizer->Add(rotSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4194 - wxBoxSizer *rot1Sizer = new wxBoxSizer(wxHORIZONTAL); 4195 - rotSizer->Add(rot1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 4196 - wxTextCtrl *rotCtrl = 4197 - new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_ROTATION, wxT("0.0"), 4198 - wxDefaultPosition, wxSize(60, 22)); 4199 - rot1Sizer->Add(rotCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4200 -// Font Halo 4201 - wxStaticBox *haloBox = new wxStaticBox(panel, wxID_STATIC, 4202 - wxT("Font Halo"), 4203 - wxDefaultPosition, 4204 - wxDefaultSize); 4205 - wxBoxSizer *haloSizer = new wxStaticBoxSizer(haloBox, wxVERTICAL); 4206 - pointBoxSizer->Add(haloSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4207 - wxBoxSizer *halo1Sizer = new wxBoxSizer(wxHORIZONTAL); 4208 - haloSizer->Add(halo1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4209 - wxCheckBox *enableHaloCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_HALO1_ENABLE, 4210 - wxT("Enable"), 4211 - wxDefaultPosition, wxDefaultSize); 4212 - enableHaloCtrl->SetValue(Style->IsHaloEnabled()); 4213 - enableHaloCtrl->Enable(false); 4214 - halo1Sizer->Add(enableHaloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4215 -// Halo Radius 4216 - wxStaticBox *radiusBox = new wxStaticBox(panel, wxID_STATIC, 4217 - wxT("Radius"), 4218 - wxDefaultPosition, 4219 - wxDefaultSize); 4220 - wxBoxSizer *radiusSizer = new wxStaticBoxSizer(radiusBox, wxVERTICAL); 4221 - halo1Sizer->Add(radiusSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4222 - wxTextCtrl *radiusCtrl = 4223 - new wxTextCtrl(panel, ID_SYMBOLIZER_HALO1_RADIUS, wxT("1.0"), 4224 - wxDefaultPosition, wxSize(50, 22)); 4225 - radiusCtrl->Enable(false); 4226 - radiusSizer->Add(radiusCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4227 -// Halo Opacity 4228 - wxStaticBox *opacityHaloBox = new wxStaticBox(panel, wxID_STATIC, 4229 - wxT("Opacity"), 4230 - wxDefaultPosition, 4231 - wxDefaultSize); 4232 - wxBoxSizer *opacityHaloSizer = 4233 - new wxStaticBoxSizer(opacityHaloBox, wxVERTICAL); 4234 - halo1Sizer->Add(opacityHaloSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 4235 - wxSlider *opacityHaloCtrl = 4236 - new wxSlider(panel, ID_SYMBOLIZER_HALO1_OPACITY, 100, 0, 100, 4237 - wxDefaultPosition, wxSize(75, 45), 4238 - wxSL_HORIZONTAL | wxSL_LABELS); 4239 - opacityHaloSizer->Add(opacityHaloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 4240 - opacityHaloCtrl->Enable(false); 4241 -// Halo color 4242 - wxStaticBox *haloColorBox = new wxStaticBox(panel, wxID_STATIC, 4243 - wxT("Color"), 4244 - wxDefaultPosition, 4245 - wxDefaultSize); 4246 - wxBoxSizer *haloColorSizer = new wxStaticBoxSizer(haloColorBox, wxHORIZONTAL); 4247 - haloSizer->Add(haloColorSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 4248 - wxTextCtrl *haloCtrl = new wxTextCtrl(panel, ID_SYMBOLIZER_HALO1_COLOR, 4249 - FillColor, 4250 - wxDefaultPosition, wxSize(80, 22)); 4251 - haloColorSizer->Add(haloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4252 - haloCtrl->Enable(false); 4253 - color = wxColour(0, 0, 0); 4254 - ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 4255 - wxStaticBitmap *sampleHaloCtrl = 4256 - new wxStaticBitmap(panel, ID_SYMBOLIZER_HALO1_PICKER_HEX, bmp, 4257 - wxDefaultPosition, wxSize(32, 32)); 4258 - haloColorSizer->Add(sampleHaloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 4259 - wxButton *pickHalo = new wxButton(panel, ID_SYMBOLIZER_HALO1_PICKER_BTN, 4260 - wxT("&Pick a color")); 4261 - haloColorSizer->Add(pickHalo, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4262 - pickHalo->Enable(false); 4263 - 4264 - panel->SetSizer(topSizer); 4265 - topSizer->Fit(panel); 4266 -// appends event handlers 4267 - Connect(ID_SYMBOLIZER_TEXT1_ENABLE, 4268 - wxEVT_COMMAND_CHECKBOX_CLICKED, 4269 - (wxObjectEventFunction) & QuickStyleVectorDialog::OnCmdLabel1Changed); 4270 - Connect(ID_SYMBOLIZER_FONT1_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 4271 - (wxObjectEventFunction) & 4272 - QuickStyleVectorDialog::OnCmdFont1ColorPicker); 4273 - Connect(ID_SYMBOLIZER_FONT1_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 4274 - (wxObjectEventFunction) & 4275 - QuickStyleVectorDialog::OnCmdFont1ColorChanged); 4276 - Connect(ID_SYMBOLIZER_FONT1_NAME, wxEVT_COMMAND_COMBOBOX_SELECTED, 4277 - (wxObjectEventFunction) & QuickStyleVectorDialog::OnFont1Changed); 4278 - Connect(ID_SYMBOLIZER_HALO1_ENABLE, 4279 - wxEVT_COMMAND_CHECKBOX_CLICKED, 4280 - (wxObjectEventFunction) & 4281 - QuickStyleVectorDialog::OnCmdHalo1EnableChanged); 4282 - Connect(ID_SYMBOLIZER_HALO1_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 4283 - (wxObjectEventFunction) & 4284 - QuickStyleVectorDialog::OnCmdColorHalo1Picker); 4285 - Connect(ID_SYMBOLIZER_HALO1_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 4286 - (wxObjectEventFunction) & 4287 - QuickStyleVectorDialog::OnCmdColorHalo1Changed); 4288 - return panel; 4289 -} 4290 - 4291 -void QuickStyleVectorDialog:: 4292 -OnCmdLabel1Changed(wxCommandEvent & WXUNUSED(event)) 4293 -{ 4294 -// 4295 -// Label enable/disable 4296 -// 4297 - wxCheckBox *enableCtrl = 4298 - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_ENABLE); 4299 - if (enableCtrl->IsChecked() == true) 4300 - { 4301 - Style->SetLabelPrint(true); 4302 - Style->SetLabelLinePlacement(false); 4303 - } else 4304 - Style->SetLabelPrint(false); 4305 - RetrieveTextPointPage(false); 4306 - UpdateTextPointPage(); 4307 -} 4308 - 4309 -void QuickStyleVectorDialog::OnFont1Changed(wxCommandEvent & WXUNUSED(event)) 4310 -{ 4311 -// 4312 -// the Font is changed 4313 -// 4314 - wxCheckBox *boldCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_BOLD); 4315 - wxCheckBox *italicCtrl = 4316 - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_ITALIC); 4317 - wxComboBox *fontList = (wxComboBox *) FindWindow(ID_SYMBOLIZER_FONT1_NAME); 4318 - wxString font = fontList->GetValue(); 4319 - char facename[1024]; 4320 - strcpy(facename, font.ToUTF8()); 4321 - if (strncmp(facename, "ToyFont: ", 9) == 0) 4322 - { 4323 - boldCtrl->Enable(true); 4324 - italicCtrl->Enable(true); 4325 - } else 4326 - { 4327 - bool bold = false; 4328 - bool italic = false; 4329 - MainFrame->CheckTTFont(facename, &bold, &italic); 4330 - boldCtrl->SetValue(bold); 4331 - italicCtrl->SetValue(italic); 4332 - boldCtrl->Enable(false); 4333 - italicCtrl->Enable(false); 4334 - } 4335 -} 4336 - 4337 -void QuickStyleVectorDialog:: 4338 -OnCmdFont1ColorPicker(wxCommandEvent & WXUNUSED(event)) 4339 -{ 4340 -// 4341 -// color picker 4342 -// 4343 - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT1_COLOR); 4344 - wxColour clr = wxNullColour; 4345 - wxString str = colorCtrl->GetValue(); 4346 - if (ColorMapEntry::IsValidColor(str) == true) 4347 - ColorMapEntry::GetWxColor(str, clr); 4348 - wxColour color = wxGetColourFromUser(this, clr); 4349 - if (color.IsOk() == true) 4350 - { 4351 - char hex[16]; 4352 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 4353 - wxString str = wxString::FromUTF8(hex); 4354 - colorCtrl->SetValue(str); 4355 - } 4356 -} 4357 - 4358 -void QuickStyleVectorDialog:: 4359 -OnCmdFont1ColorChanged(wxCommandEvent & WXUNUSED(event)) 4360 -{ 4361 -// 4362 -// Font Color changed: updating the visual sample 4363 -// 4364 - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT1_COLOR); 4365 - wxStaticBitmap *sampleCtrl = 4366 - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FONT1_PICKER_HEX); 4367 - wxColour back = wxColour(255, 255, 255); 4368 - wxString str = colorCtrl->GetValue(); 4369 - if (ColorMapEntry::IsValidColor(str) == true) 4370 - ColorMapEntry::GetWxColor(str, back); 4371 - wxBitmap bmp; 4372 - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 4373 - sampleCtrl->SetBitmap(bmp); 4374 - sampleCtrl->Refresh(); 4375 - sampleCtrl->Update(); 4376 -} 4377 - 4378 -void QuickStyleVectorDialog:: 4379 -OnCmdColorHalo1Picker(wxCommandEvent & WXUNUSED(event)) 4380 -{ 4381 -// 4382 -// color picker 4383 -// 4384 - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO1_COLOR); 4385 - wxColour clr = wxNullColour; 4386 - wxString str = colorCtrl->GetValue(); 4387 - if (ColorMapEntry::IsValidColor(str) == true) 4388 - ColorMapEntry::GetWxColor(str, clr); 4389 - wxColour color = wxGetColourFromUser(this, clr); 4390 - if (color.IsOk() == true) 4391 - { 4392 - char hex[16]; 4393 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 4394 - wxString str = wxString::FromUTF8(hex); 4395 - colorCtrl->SetValue(str); 4396 - } 4397 -} 4398 - 4399 -void QuickStyleVectorDialog:: 4400 -OnCmdColorHalo1Changed(wxCommandEvent & WXUNUSED(event)) 4401 -{ 4402 -// 4403 -// Halo Color changed: updating the visual sample 4404 -// 4405 - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO1_COLOR); 4406 - wxStaticBitmap *sampleCtrl = 4407 - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_HALO1_PICKER_HEX); 4408 - wxColour back = wxColour(255, 255, 255); 4409 - wxString str = colorCtrl->GetValue(); 4410 - if (ColorMapEntry::IsValidColor(str) == true) 4411 - ColorMapEntry::GetWxColor(str, back); 4412 - wxBitmap bmp; 4413 - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 4414 - sampleCtrl->SetBitmap(bmp); 4415 - sampleCtrl->Refresh(); 4416 - sampleCtrl->Update(); 4417 -} 4418 - 4419 -void QuickStyleVectorDialog:: 4420 -OnCmdHalo1EnableChanged(wxCommandEvent & WXUNUSED(event)) 4421 -{ 4422 -// 4423 -// Graphic Halo enable/disable 4424 -// 4425 - wxCheckBox *enableCtrl = 4426 - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_HALO1_ENABLE); 4427 - if (enableCtrl->IsChecked() == true) 4428 - Style->EnableHalo(true); 4429 - else 4430 - Style->EnableHalo(false); 4431 - RetrieveTextPointPage(false); 4432 - UpdateTextPointPage(); 4433 -} 4434 - 4435 -wxPanel *QuickStyleVectorDialog::CreateTextLinePage(wxWindow * parent) 4436 -{ 4437 -// 4438 -// creating the Text Symbolizer page (Line Placement) 4439 -// 4440 - wxString FillColor = wxT("#808080"); 4441 - wxPanel *panel = new wxPanel(parent, ID_PANE_TEXT1); 4442 - wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 4443 - panel->SetSizer(topSizer); 4444 - wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 4445 - topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 4446 -// enable/disable Labels 4447 - wxBoxSizer *auxBoxSizer = new wxBoxSizer(wxHORIZONTAL); 4448 - boxSizer->Add(auxBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4449 - wxStaticBox *auxBox = new wxStaticBox(panel, wxID_STATIC, 4450 - wxT("Labels"), 4451 - wxDefaultPosition, 4452 - wxDefaultSize); 4453 - wxBoxSizer *auxSizer = new wxStaticBoxSizer(auxBox, wxVERTICAL); 4454 - auxBoxSizer->Add(auxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 4455 - wxBoxSizer *enableSizer = new wxBoxSizer(wxHORIZONTAL); 4456 - auxSizer->Add(enableSizer, 0, wxALIGN_LEFT | wxALL, 5); 4457 - wxCheckBox *enableCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_TEXT2_ENABLE, 4458 - wxT("Enable"), 4459 - wxDefaultPosition, wxDefaultSize); 4460 - enableCtrl->SetValue(Style->IsLabelPrint()); 4461 - enableSizer->Add(enableCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 4462 - enableSizer->AddSpacer(20); 4463 - enableSizer->AddSpacer(20); 4464 - enableSizer->AddSpacer(20); 4465 - enableSizer->AddSpacer(20); 4466 - wxStaticText *columnLabel = 4467 - new wxStaticText(panel, wxID_STATIC, wxT("&Column:")); 4468 - enableSizer->Add(columnLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 4469 - wxComboBox *columnList = 4470 - new wxComboBox(panel, ID_SYMBOLIZER_TEXT2_LABEL, wxT(""), wxDefaultPosition, 4471 - wxSize(400, 22), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); 4472 - InitializeComboColumns(columnList); 4473 - enableSizer->Add(columnList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 4474 - 4475 - 4476 - wxStaticBox *fontBox = new wxStaticBox(panel, wxID_STATIC, 4477 - wxT("Font"), 4478 - wxDefaultPosition, 4479 - wxDefaultSize); 4480 - wxBoxSizer *font9Sizer = new wxStaticBoxSizer(fontBox, wxHORIZONTAL); 4481 - auxSizer->Add(font9Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4482 -// Second row: Font Name, Size and Fill 4483 - wxBoxSizer *fontSizer = new wxBoxSizer(wxHORIZONTAL); 4484 - font9Sizer->Add(fontSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 4485 - wxBoxSizer *font0Sizer = new wxBoxSizer(wxHORIZONTAL); 4486 - fontSizer->Add(font0Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 4487 -// Font Name 4488 - wxBoxSizer *fontXSizer = new wxBoxSizer(wxVERTICAL); 4489 - font0Sizer->Add(fontXSizer, 0, wxALIGN_LEFT | wxALL, 0); 4490 - wxComboBox *fontList = 4491 - new wxComboBox(panel, ID_SYMBOLIZER_FONT2_NAME, wxT(""), wxDefaultPosition, 4492 - wxSize(250, 21), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); 4493 - InitializeComboFonts(fontList); 4494 - fontList->Select(0); 4495 - fontXSizer->Add(fontList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4496 -// Font Size 4497 - wxBoxSizer *fontYSizer = new wxBoxSizer(wxHORIZONTAL); 4498 - fontXSizer->Add(fontYSizer, 0, wxALIGN_LEFT | wxALL, 0); 4499 - wxStaticBox *sizeBox = new wxStaticBox(panel, wxID_STATIC, 4500 - wxT("Font Size"), 4501 - wxDefaultPosition, 4502 - wxDefaultSize); 4503 - wxBoxSizer *sizeSizer = new wxStaticBoxSizer(sizeBox, wxVERTICAL); 4504 - fontYSizer->Add(sizeSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4505 - wxTextCtrl *sizeCtrl = 4506 - new wxTextCtrl(panel, ID_SYMBOLIZER_FONT2_SIZE, wxT("15.0"), 4507 - wxDefaultPosition, wxSize(100, 22)); 4508 - sizeSizer->Add(sizeCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 4509 - wxBoxSizer *boldBoxSizer = new wxBoxSizer(wxHORIZONTAL); 4510 - fontYSizer->Add(boldBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4511 - wxStaticBox *boldBox = new wxStaticBox(panel, wxID_STATIC, 4512 - wxT("Font Style"), 4513 - wxDefaultPosition, 4514 - wxDefaultSize); 4515 - wxBoxSizer *boldSizer = new wxStaticBoxSizer(boldBox, wxHORIZONTAL); 4516 - boldBoxSizer->Add(boldSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 4517 - wxBoxSizer *italicSizer = new wxBoxSizer(wxHORIZONTAL); 4518 - boldSizer->Add(italicSizer, 0, wxALIGN_LEFT | wxALL, 5); 4519 - wxCheckBox *italicCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_TEXT2_ITALIC, 4520 - wxT("Italic"), 4521 - wxDefaultPosition, wxDefaultSize); 4522 - italicCtrl->SetValue(false); 4523 - italicCtrl->Enable(false); 4524 - italicSizer->Add(italicCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 4525 - wxCheckBox *boldCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_TEXT2_BOLD, 4526 - wxT("Bold"), 4527 - wxDefaultPosition, wxDefaultSize); 4528 - boldCtrl->SetValue(false); 4529 - boldCtrl->Enable(false); 4530 - italicSizer->Add(boldCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 4531 -// Font Opacity 4532 - wxStaticBox *opacityFontBox = new wxStaticBox(panel, wxID_STATIC, 4533 - wxT("Opacity"), 4534 - wxDefaultPosition, 4535 - wxDefaultSize); 4536 - wxBoxSizer *opacityFontSizer = 4537 - new wxStaticBoxSizer(opacityFontBox, wxVERTICAL); 4538 - fontSizer->Add(opacityFontSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4539 - wxSlider *opacityFontCtrl = 4540 - new wxSlider(panel, ID_SYMBOLIZER_FONT2_OPACITY, 100, 0, 100, 4541 - wxDefaultPosition, wxSize(150, 35), 4542 - wxSL_HORIZONTAL | wxSL_LABELS); 4543 - opacityFontSizer->Add(opacityFontCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4544 -// Font color 4545 - wxStaticBox *fontColorBox = new wxStaticBox(panel, wxID_STATIC, 4546 - wxT("Color"), 4547 - wxDefaultPosition, 4548 - wxDefaultSize); 4549 - wxBoxSizer *fontColorSizer = new wxStaticBoxSizer(fontColorBox, wxHORIZONTAL); 4550 - fontSizer->Add(fontColorSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 4551 - wxBoxSizer *font2Sizer = new wxBoxSizer(wxVERTICAL); 4552 - fontColorSizer->Add(font2Sizer, 0, wxALIGN_RIGHT | wxALL, 0); 4553 - wxTextCtrl *fontCtrl = new wxTextCtrl(panel, ID_SYMBOLIZER_FONT2_COLOR, 4554 - FillColor, 4555 - wxDefaultPosition, wxSize(80, 22)); 4556 - font2Sizer->Add(fontCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2); 4557 - wxBitmap bmp; 4558 - wxColour color(0, 0, 0); 4559 - ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 4560 - wxStaticBitmap *sampleFontCtrl = 4561 - new wxStaticBitmap(panel, ID_SYMBOLIZER_FONT2_PICKER_HEX, bmp, 4562 - wxDefaultPosition, wxSize(32, 32)); 4563 - fontColorSizer->Add(sampleFontCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 4564 - wxButton *pickFont = new wxButton(panel, ID_SYMBOLIZER_FONT2_PICKER_BTN, 4565 - wxT("&Pick a color")); 4566 - font2Sizer->Add(pickFont, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2); 4567 -// second row: LinePlacement 4568 - wxBoxSizer *lineBoxSizer = new wxBoxSizer(wxHORIZONTAL); 4569 - auxSizer->Add(lineBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 4570 - wxStaticBox *lineBox = new wxStaticBox(panel, wxID_STATIC, 4571 - wxT("Label Line Placement"), 4572 - wxDefaultPosition, 4573 - wxDefaultSize); 4574 - wxBoxSizer *lineSizer = new wxStaticBoxSizer(lineBox, wxVERTICAL); 4575 - lineBoxSizer->Add(lineSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4576 -// second row A: PerpendicularOffset 4577 - wxBoxSizer *perpendicularBoxSizer = new wxBoxSizer(wxHORIZONTAL); 4578 - lineSizer->Add(perpendicularBoxSizer, 0, 4579 - wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 4580 - wxStaticBox *perpendicularBox = new wxStaticBox(panel, wxID_STATIC, 4581 - wxT("Perpendicular Offset"), 4582 - wxDefaultPosition, 4583 - wxDefaultSize); 4584 - wxBoxSizer *perpendicularSizer = 4585 - new wxStaticBoxSizer(perpendicularBox, wxVERTICAL); 4586 - perpendicularBoxSizer->Add(perpendicularSizer, 0, 4587 - wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 4588 - wxBoxSizer *perp1Sizer = new wxBoxSizer(wxHORIZONTAL); 4589 - perpendicularSizer->Add(perp1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 4590 - wxTextCtrl *perpendicularCtrl = 4591 - new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_PERPENDICULAR, wxT("0.0"), 4592 - wxDefaultPosition, wxSize(100, 22)); 4593 - perp1Sizer->Add(perpendicularCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 4594 - perpendicularCtrl->Enable(false); 4595 - wxStaticText *perp1Label = new wxStaticText(panel, wxID_STATIC, 4596 - wxT 4597 - ("Draw lines in parallel to the original geometry.")); 4598 - perp1Sizer->Add(perp1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 4599 - wxStaticText *perp2Label = new wxStaticText(panel, wxID_STATIC, 4600 - wxT 4601 - ("Positive to the left-hand side. Negative numbers mean right.")); 4602 - perpendicularSizer->Add(perp2Label, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 4603 -// second row B: IsRepeated, InitialGap and Gap 4604 - wxBoxSizer *repeatedBoxSizer = new wxBoxSizer(wxHORIZONTAL); 4605 - lineSizer->Add(repeatedBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 4606 - wxStaticBox *repeatedBox = new wxStaticBox(panel, wxID_STATIC, 4607 - wxT("Repeated Label"), 4608 - wxDefaultPosition, 4609 - wxDefaultSize); 4610 - wxBoxSizer *repeatedSizer = new wxStaticBoxSizer(repeatedBox, wxHORIZONTAL); 4611 - repeatedBoxSizer->Add(repeatedSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 4612 - wxCheckBox *isRepeatedCtrl = 4613 - new wxCheckBox(panel, ID_SYMBOLIZER_TEXT_IS_REPEATED, 4614 - wxT("Repeated"), 4615 - wxDefaultPosition, wxDefaultSize); 4616 - isRepeatedCtrl->SetValue(false); 4617 - isRepeatedCtrl->Enable(false); 4618 - repeatedSizer->Add(isRepeatedCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4619 - wxStaticBox *inigapBox = new wxStaticBox(panel, wxID_STATIC, 4620 - wxT("Initial Gap"), 4621 - wxDefaultPosition, 4622 - wxDefaultSize); 4623 - wxBoxSizer *inigapSizer = new wxStaticBoxSizer(inigapBox, wxVERTICAL); 4624 - repeatedSizer->Add(inigapSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 4625 - wxTextCtrl *inigapCtrl = 4626 - new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_INITIAL_GAP, wxT("0.0"), 4627 - wxDefaultPosition, wxSize(60, 22)); 4628 - inigapCtrl->Enable(false); 4629 - inigapSizer->Add(inigapCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4630 - wxStaticBox *gapBox = new wxStaticBox(panel, wxID_STATIC, 4631 - wxT("Gap"), 4632 - wxDefaultPosition, 4633 - wxDefaultSize); 4634 - wxBoxSizer *gapSizer = new wxStaticBoxSizer(gapBox, wxVERTICAL); 4635 - repeatedSizer->Add(gapSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 4636 - wxTextCtrl *gapCtrl = 4637 - new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_GAP, wxT("0.0"), 4638 - wxDefaultPosition, wxSize(60, 22)); 4639 - gapCtrl->Enable(false); 4640 - gapSizer->Add(gapCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4641 -// second row C: IsAligned and Generalize 4642 - wxBoxSizer *optBoxSizer = new wxBoxSizer(wxHORIZONTAL); 4643 - repeatedBoxSizer->Add(optBoxSizer, 0, wxALIGN_LEFT | wxALL, 0); 4644 - wxStaticBox *optBox = new wxStaticBox(panel, wxID_STATIC, 4645 - wxT("Options"), 4646 - wxDefaultPosition, 4647 - wxDefaultSize); 4648 - wxBoxSizer *optSizer = new wxStaticBoxSizer(optBox, wxVERTICAL); 4649 - optBoxSizer->Add(optSizer, 0, wxALIGN_LEFT | wxALL, 5); 4650 - wxCheckBox *isAlignedCtrl = 4651 - new wxCheckBox(panel, ID_SYMBOLIZER_TEXT_IS_ALIGNED, 4652 - wxT("Aligned"), 4653 - wxDefaultPosition, wxDefaultSize); 4654 - isAlignedCtrl->SetValue(false); 4655 - isAlignedCtrl->Enable(false); 4656 - optSizer->Add(isAlignedCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4657 - wxCheckBox *generalizeCtrl = 4658 - new wxCheckBox(panel, ID_SYMBOLIZER_TEXT_GENERALIZE, 4659 - wxT("Generalize"), 4660 - wxDefaultPosition, wxDefaultSize); 4661 - generalizeCtrl->SetValue(false); 4662 - generalizeCtrl->Enable(false); 4663 - optSizer->Add(generalizeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4664 -// Halo 4665 - wxBoxSizer *haloBoxSizer = new wxBoxSizer(wxVERTICAL); 4666 - lineBoxSizer->Add(haloBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 4667 - wxStaticBox *haloBox = new wxStaticBox(panel, wxID_STATIC, 4668 - wxT("Font Halo"), 4669 - wxDefaultPosition, 4670 - wxDefaultSize); 4671 - wxBoxSizer *haloSizer = new wxStaticBoxSizer(haloBox, wxVERTICAL); 4672 - haloBoxSizer->Add(haloSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 4673 - wxBoxSizer *halo0Sizer = new wxBoxSizer(wxHORIZONTAL); 4674 - haloSizer->Add(halo0Sizer, 0, wxALIGN_LEFT | wxALL, 0); 4675 - wxCheckBox *enableHaloCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_HALO2_ENABLE, 4676 - wxT("Enable"), 4677 - wxDefaultPosition, wxDefaultSize); 4678 - enableHaloCtrl->SetValue(Style->IsHaloEnabled()); 4679 - enableHaloCtrl->Enable(false); 4680 - halo0Sizer->Add(enableHaloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 4681 -// Halo Radius 4682 - wxStaticBox *radiusBox = new wxStaticBox(panel, wxID_STATIC, 4683 - wxT("Radius"), 4684 - wxDefaultPosition, 4685 - wxDefaultSize); 4686 - wxBoxSizer *radiusSizer = new wxStaticBoxSizer(radiusBox, wxVERTICAL); 4687 - halo0Sizer->Add(radiusSizer, 0, wxALIGN_RIGHT | wxALL, 2); 4688 - wxTextCtrl *radiusCtrl = 4689 - new wxTextCtrl(panel, ID_SYMBOLIZER_HALO2_RADIUS, wxT("1.0"), 4690 - wxDefaultPosition, wxSize(50, 22)); 4691 - radiusCtrl->Enable(false); 4692 - radiusSizer->Add(radiusCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 4693 -// Halo Opacity 4694 - wxStaticBox *opacityHaloBox = new wxStaticBox(panel, wxID_STATIC, 4695 - wxT("Opacity"), 4696 - wxDefaultPosition, 4697 - wxDefaultSize); 4698 - wxBoxSizer *opacityHaloSizer = 4699 - new wxStaticBoxSizer(opacityHaloBox, wxVERTICAL); 4700 - haloSizer->Add(opacityHaloSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2); 4701 - wxSlider *opacityHaloCtrl = 4702 - new wxSlider(panel, ID_SYMBOLIZER_HALO2_OPACITY, 100, 0, 100, 4703 - wxDefaultPosition, wxSize(130, 35), 4704 - wxSL_HORIZONTAL | wxSL_LABELS); 4705 - opacityHaloSizer->Add(opacityHaloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 4706 - opacityHaloCtrl->Enable(false); 4707 -// Halo color 4708 - wxStaticBox *haloColorBox = new wxStaticBox(panel, wxID_STATIC, 4709 - wxT("Color"), 4710 - wxDefaultPosition, 4711 - wxDefaultSize); 4712 - wxBoxSizer *haloColorSizer = new wxStaticBoxSizer(haloColorBox, wxHORIZONTAL); 4713 - haloSizer->Add(haloColorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2); 4714 - wxBoxSizer *halo2Sizer = new wxBoxSizer(wxVERTICAL); 4715 - haloColorSizer->Add(halo2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 4716 - wxTextCtrl *haloCtrl = new wxTextCtrl(panel, ID_SYMBOLIZER_HALO2_COLOR, 4717 - FillColor, 4718 - wxDefaultPosition, wxSize(80, 22)); 4719 - halo2Sizer->Add(haloCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2); 4720 - haloCtrl->Enable(false); 4721 - color = wxColour(0, 0, 0); 4722 - ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 4723 - wxStaticBitmap *sampleHaloCtrl = 4724 - new wxStaticBitmap(panel, ID_SYMBOLIZER_HALO2_PICKER_HEX, bmp, 4725 - wxDefaultPosition, wxSize(32, 32)); 4726 - haloColorSizer->Add(sampleHaloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 4727 - wxButton *pickHalo = new wxButton(panel, ID_SYMBOLIZER_HALO2_PICKER_BTN, 4728 - wxT("&Pick a color")); 4729 - halo2Sizer->Add(pickHalo, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2); 4730 - pickHalo->Enable(false); 4731 - 4732 - panel->SetSizer(topSizer); 4733 - topSizer->Fit(panel); 4734 -// appends event handlers 4735 - Connect(ID_SYMBOLIZER_TEXT2_ENABLE, 4736 - wxEVT_COMMAND_CHECKBOX_CLICKED, 4737 - (wxObjectEventFunction) & QuickStyleVectorDialog::OnCmdLabel2Changed); 4738 - Connect(ID_SYMBOLIZER_FONT2_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 4739 - (wxObjectEventFunction) & 4740 - QuickStyleVectorDialog::OnCmdFont2ColorPicker); 4741 - Connect(ID_SYMBOLIZER_FONT2_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 4742 - (wxObjectEventFunction) & 4743 - QuickStyleVectorDialog::OnCmdFont2ColorChanged); 4744 - Connect(ID_SYMBOLIZER_TEXT_IS_REPEATED, 4745 - wxEVT_COMMAND_CHECKBOX_CLICKED, 4746 - (wxObjectEventFunction) & 4747 - QuickStyleVectorDialog::OnCmdIsRepeatedChanged); 4748 - Connect(ID_SYMBOLIZER_TEXT_IS_ALIGNED, 4749 - wxEVT_COMMAND_CHECKBOX_CLICKED, 4750 - (wxObjectEventFunction) & 4751 - QuickStyleVectorDialog::OnCmdIsAlignedChanged); 4752 - Connect(ID_SYMBOLIZER_TEXT_GENERALIZE, 4753 - wxEVT_COMMAND_CHECKBOX_CLICKED, 4754 - (wxObjectEventFunction) & 4755 - QuickStyleVectorDialog::OnCmdGeneralizeLineChanged); 4756 - Connect(ID_SYMBOLIZER_FONT2_NAME, wxEVT_COMMAND_COMBOBOX_SELECTED, 4757 - (wxObjectEventFunction) & QuickStyleVectorDialog::OnFont2Changed); 4758 - Connect(ID_SYMBOLIZER_HALO2_ENABLE, 4759 - wxEVT_COMMAND_CHECKBOX_CLICKED, 4760 - (wxObjectEventFunction) & 4761 - QuickStyleVectorDialog::OnCmdHalo2EnableChanged); 4762 - Connect(ID_SYMBOLIZER_HALO2_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 4763 - (wxObjectEventFunction) & 4764 - QuickStyleVectorDialog::OnCmdColorHalo2Picker); 4765 - Connect(ID_SYMBOLIZER_HALO2_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 4766 - (wxObjectEventFunction) & 4767 - QuickStyleVectorDialog::OnCmdColorHalo2Changed); 4768 - return panel; 4769 -} 4770 - 4771 -void QuickStyleVectorDialog:: 4772 -OnCmdLabel2Changed(wxCommandEvent & WXUNUSED(event)) 4773 -{ 4774 -// 4775 -// Label enable/disable 4776 -// 4777 - wxCheckBox *enableCtrl = 4778 - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_ENABLE); 4779 - if (enableCtrl->IsChecked() == true) 4780 - { 4781 - Style->SetLabelPrint(true); 4782 - Style->SetLabelLinePlacement(true); 4783 - } else 4784 - Style->SetLabelPrint(false); 4785 - RetrieveTextLinePage(false); 4786 - UpdateTextLinePage(); 4787 -} 4788 - 4789 -void QuickStyleVectorDialog::OnFont2Changed(wxCommandEvent & WXUNUSED(event)) 4790 -{ 4791 -// 4792 -// the Font is changed 4793 -// 4794 - wxCheckBox *boldCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_BOLD); 4795 - wxCheckBox *italicCtrl = 4796 - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_ITALIC); 4797 - wxComboBox *fontList = (wxComboBox *) FindWindow(ID_SYMBOLIZER_FONT2_NAME); 4798 - wxString font = fontList->GetValue(); 4799 - char facename[1024]; 4800 - strcpy(facename, font.ToUTF8()); 4801 - if (strncmp(facename, "ToyFont: ", 9) == 0) 4802 - { 4803 - boldCtrl->Enable(true); 4804 - italicCtrl->Enable(true); 4805 - } else 4806 - { 4807 - bool bold = false; 4808 - bool italic = false; 4809 - MainFrame->CheckTTFont(facename, &bold, &italic); 4810 - boldCtrl->SetValue(bold); 4811 - italicCtrl->SetValue(italic); 4812 - boldCtrl->Enable(false); 4813 - italicCtrl->Enable(false); 4814 - } 4815 -} 4816 - 4817 -void QuickStyleVectorDialog:: 4818 -OnCmdFont2ColorPicker(wxCommandEvent & WXUNUSED(event)) 4819 -{ 4820 -// 4821 -// color picker 4822 -// 4823 - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT2_COLOR); 4824 - wxColour clr = wxNullColour; 4825 - wxString str = colorCtrl->GetValue(); 4826 - if (ColorMapEntry::IsValidColor(str) == true) 4827 - ColorMapEntry::GetWxColor(str, clr); 4828 - wxColour color = wxGetColourFromUser(this, clr); 4829 - if (color.IsOk() == true) 4830 - { 4831 - char hex[16]; 4832 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 4833 - wxString str = wxString::FromUTF8(hex); 4834 - colorCtrl->SetValue(str); 4835 - } 4836 -} 4837 - 4838 -void QuickStyleVectorDialog:: 4839 -OnCmdFont2ColorChanged(wxCommandEvent & WXUNUSED(event)) 4840 -{ 4841 -// 4842 -// Font Color changed: updating the visual sample 4843 -// 4844 - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT2_COLOR); 4845 - wxStaticBitmap *sampleCtrl = 4846 - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FONT2_PICKER_HEX); 4847 - wxColour back = wxColour(255, 255, 255); 4848 - wxString str = colorCtrl->GetValue(); 4849 - if (ColorMapEntry::IsValidColor(str) == true) 4850 - ColorMapEntry::GetWxColor(str, back); 4851 - wxBitmap bmp; 4852 - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 4853 - sampleCtrl->SetBitmap(bmp); 4854 - sampleCtrl->Refresh(); 4855 - sampleCtrl->Update(); 4856 -} 4857 - 4858 -void QuickStyleVectorDialog:: 4859 -OnCmdIsRepeatedChanged(wxCommandEvent & WXUNUSED(event)) 4860 -{ 4861 -// 4862 -// Label IsRepeated enable/disable 4863 -// 4864 - wxCheckBox *repeatedCtrl = 4865 - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT_IS_REPEATED); 4866 - if (repeatedCtrl->IsChecked() == true) 4867 - Style->SetRepeatedLabel(true); 4868 - else 4869 - Style->SetRepeatedLabel(false); 4870 - RetrieveTextLinePage(false); 4871 - UpdateTextLinePage(); 4872 -} 4873 - 4874 -void QuickStyleVectorDialog:: 4875 -OnCmdIsAlignedChanged(wxCommandEvent & WXUNUSED(event)) 4876 -{ 4877 -// 4878 -// Label IsAligned enable/disable 4879 -// 4880 - wxCheckBox *alignedCtrl = 4881 - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT_IS_ALIGNED); 4882 - if (alignedCtrl->IsChecked() == true) 4883 - Style->SetLabelIsAligned(true); 4884 - else 4885 - Style->SetLabelIsAligned(false); 4886 -} 4887 - 4888 -void QuickStyleVectorDialog:: 4889 -OnCmdGeneralizeLineChanged(wxCommandEvent & WXUNUSED(event)) 4890 -{ 4891 -// 4892 -// Label GeneralizeLine enable/disable 4893 -// 4894 - wxCheckBox *generalizeCtrl = 4895 - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT_GENERALIZE); 4896 - if (generalizeCtrl->IsChecked() == true) 4897 - Style->SetLabelGeneralizeLine(true); 4898 - else 4899 - Style->SetLabelGeneralizeLine(false); 4900 -} 4901 - 4902 -void QuickStyleVectorDialog:: 4903 -OnCmdColorHalo2Picker(wxCommandEvent & WXUNUSED(event)) 4904 -{ 4905 -// 4906 -// color picker 4907 -// 4908 - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO2_COLOR); 4909 - wxColour clr = wxNullColour; 4910 - wxString str = colorCtrl->GetValue(); 4911 - if (ColorMapEntry::IsValidColor(str) == true) 4912 - ColorMapEntry::GetWxColor(str, clr); 4913 - wxColour color = wxGetColourFromUser(this, clr); 4914 - if (color.IsOk() == true) 4915 - { 4916 - char hex[16]; 4917 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 4918 - wxString str = wxString::FromUTF8(hex); 4919 - colorCtrl->SetValue(str); 4920 - } 4921 -} 4922 - 4923 -void QuickStyleVectorDialog:: 4924 -OnCmdColorHalo2Changed(wxCommandEvent & WXUNUSED(event)) 4925 -{ 4926 -// 4927 -// Halo Color changed: updating the visual sample 4928 -// 4929 - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO2_COLOR); 4930 - wxStaticBitmap *sampleCtrl = 4931 - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_HALO2_PICKER_HEX); 4932 - wxColour back = wxColour(255, 255, 255); 4933 - wxString str = colorCtrl->GetValue(); 4934 - if (ColorMapEntry::IsValidColor(str) == true) 4935 - ColorMapEntry::GetWxColor(str, back); 4936 - wxBitmap bmp; 4937 - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 4938 - sampleCtrl->SetBitmap(bmp); 4939 - sampleCtrl->Refresh(); 4940 - sampleCtrl->Update(); 4941 -} 4942 - 4943 -void QuickStyleVectorDialog:: 4944 -OnCmdHalo2EnableChanged(wxCommandEvent & WXUNUSED(event)) 4945 -{ 4946 -// 4947 -// Graphic Halo enable/disable 4948 -// 4949 - wxCheckBox *enableCtrl = 4950 - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_HALO2_ENABLE); 4951 - if (enableCtrl->IsChecked() == true) 4952 - Style->EnableHalo(true); 4953 - else 4954 - Style->EnableHalo(false); 4955 - RetrieveTextLinePage(false); 4956 - UpdateTextLinePage(); 4957 -} 4958 - 4959 -bool QuickStyleVectorDialog::RetrieveMainPage() 4960 -{ 4961 -// 4962 -// retrieving params from the MAIN page 4963 -// 4964 - double min = Style->GetScaleMin(); 4965 - double max = Style->GetScaleMax(); 4966 - if (Style->IsMinScaleEnabled() == true) 4967 - { 4968 - wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); 4969 - wxString value = minCtrl->GetValue(); 4970 - if (value.ToDouble(&min) != true) 4971 - { 4972 - wxMessageBox(wxT 4973 - ("MIN_SCALE isn't a valid decimal number !!!"), 4974 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4975 - return false; 4976 - } 4977 - if (min < 0.0) 4978 - { 4979 - wxMessageBox(wxT 4980 - ("MIN_SCALE must be a positive number !!!"), 4981 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4982 - return false; 4983 - } 4984 - } 4985 - if (Style->IsMaxScaleEnabled() == true) 4986 - { 4987 - wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); 4988 - wxString value = maxCtrl->GetValue(); 4989 - if (value.ToDouble(&max) != true) 4990 - { 4991 - wxMessageBox(wxT 4992 - ("MAX_SCALE isn't a valid decimal number !!!"), 4993 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4994 - return false; 4995 - } 4996 - if (max < 0.0) 4997 - { 4998 - wxMessageBox(wxT 4999 - ("MAX_SCALE must be a positive number !!!"), 5000 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5001 - return false; 5002 - } 5003 - } 5004 - if (Style->IsMinScaleEnabled() == true && Style->IsMaxScaleEnabled() == true) 5005 - { 5006 - if (min >= max) 5007 - { 5008 - wxMessageBox(wxT 5009 - ("MAX_SCALE is always expected to be greater than MIN_SCALE !!!"), 5010 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5011 - return false; 5012 - } 5013 - } 5014 - Style->SetScaleMin(min); 5015 - Style->SetScaleMax(max); 5016 - return true; 5017 -} 5018 - 5019 -void QuickStyleVectorDialog::UpdateMainPage() 5020 -{ 5021 -// 5022 -// updating the MAIN page 5023 -// 5024 - wxRadioBox *rangeBox = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MINMAX_SCALE); 5025 - if (Style->IsMinScaleEnabled() != true && Style->IsMaxScaleEnabled() != true) 5026 - rangeBox->SetSelection(0); 5027 - else if (Style->IsMinScaleEnabled() == true 5028 - && Style->IsMaxScaleEnabled() != true) 5029 - rangeBox->SetSelection(1); 5030 - else if (Style->IsMinScaleEnabled() != true 5031 - && Style->IsMaxScaleEnabled() == true) 5032 - rangeBox->SetSelection(2); 5033 - else 5034 - rangeBox->SetSelection(3); 5035 - wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); 5036 - char dummy[64]; 5037 - wxString str; 5038 - if (Style->IsMinScaleEnabled() == true) 5039 - { 5040 - sprintf(dummy, "%1.2f", Style->GetScaleMin()); 5041 - str = wxString::FromUTF8(dummy); 5042 - minCtrl->SetValue(str); 5043 - minCtrl->Enable(true); 5044 - } else 5045 - { 5046 - str = wxT("0.0"); 5047 - minCtrl->SetValue(str); 5048 - minCtrl->Enable(false); 5049 - } 5050 - wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); 5051 - if (Style->IsMaxScaleEnabled() == true) 5052 - { 5053 - sprintf(dummy, "%1.2f", Style->GetScaleMax()); 5054 - str = wxString::FromUTF8(dummy); 5055 - maxCtrl->SetValue(str); 5056 - maxCtrl->Enable(true); 5057 - } else 5058 - { 5059 - str = wxT("+Infinite"); 5060 - maxCtrl->SetValue(str); 5061 - maxCtrl->Enable(false); 5062 - } 5063 -} 5064 - 5065 -bool QuickStyleVectorDialog::RetrievePointPage(bool check) 5066 -{ 5067 -// 5068 -// retrieving params from the Point Symbolizer page 5069 -// 5070 - double opacity; 5071 - double size; 5072 - double rotation; 5073 - double anchorPointX; 5074 - double anchorPointY; 5075 - double displacementX; 5076 - double displacementY; 5077 - char fillColor[8]; 5078 - char strokeColor[8]; 5079 - wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_OPACITY); 5080 - opacity = opacityCtrl->GetValue() / 100.0; 5081 - wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_SIZE); 5082 - wxString value = sizeCtrl->GetValue(); 5083 - if (value.ToDouble(&size) != true) 5084 - { 5085 - if (check == true) 5086 - { 5087 - wxMessageBox(wxT 5088 - ("SIZE isn't a valid decimal number !!!"), 5089 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5090 - return false; 5091 - } 5092 - } 5093 - if (size < 0.0) 5094 - { 5095 - if (check == true) 5096 - { 5097 - wxMessageBox(wxT 5098 - ("SIZE must be a positive number !!!"), 5099 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5100 - return false; 5101 - } 5102 - } 5103 - wxTextCtrl *rotationCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_ROTATION); 5104 - value = rotationCtrl->GetValue(); 5105 - if (value.ToDouble(&rotation) != true) 5106 - { 5107 - if (check == true) 5108 - { 5109 - wxMessageBox(wxT 5110 - ("ROTATION isn't a valid decimal number !!!"), 5111 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5112 - return false; 5113 - } 5114 - } 5115 - wxTextCtrl *anchorXCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_ANCHOR_X); 5116 - value = anchorXCtrl->GetValue(); 5117 - if (value.ToDouble(&anchorPointX) != true) 5118 - { 5119 - if (check == true) 5120 - { 5121 - wxMessageBox(wxT 5122 - ("ANCHOR-POINT-X isn't a valid decimal number !!!"), 5123 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5124 - return false; 5125 - } 5126 - } 5127 - if (anchorPointX < 0.0 || anchorPointX > 1.0) 5128 - { 5129 - if (check == true) 5130 - { 5131 - wxMessageBox(wxT 5132 - ("ANCHOR-POINT-X must be between 0.0 and 1.0 !!!"), 5133 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5134 - return false; 5135 - } 5136 - } 5137 - wxTextCtrl *anchorYCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_ANCHOR_Y); 5138 - value = anchorYCtrl->GetValue(); 5139 - if (value.ToDouble(&anchorPointY) != true) 5140 - { 5141 - if (check == true) 5142 - { 5143 - wxMessageBox(wxT 5144 - ("ANCHOR-POINT-Y isn't a valid decimal number !!!"), 5145 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5146 - return false; 5147 - } 5148 - } 5149 - if (anchorPointY < 0.0 || anchorPointY > 1.0) 5150 - { 5151 - if (check == true) 5152 - { 5153 - wxMessageBox(wxT 5154 - ("ANCHOR-POINT-Y must be between 0.0 and 1.0 !!!"), 5155 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5156 - return false; 5157 - } 5158 - } 5159 - wxTextCtrl *displXCtrl = 5160 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_DISPLACEMENT_X); 5161 - value = displXCtrl->GetValue(); 5162 - if (value.ToDouble(&displacementX) != true) 5163 - { 5164 - if (check == true) 5165 - { 5166 - wxMessageBox(wxT 5167 - ("DISPLACEMENT-X isn't a valid decimal number !!!"), 5168 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5169 - return false; 5170 - } 5171 - } 5172 - wxTextCtrl *displYCtrl = 5173 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_DISPLACEMENT_Y); 5174 - value = displYCtrl->GetValue(); 5175 - if (value.ToDouble(&displacementY) != true) 5176 - { 5177 - if (check == true) 5178 - { 5179 - wxMessageBox(wxT 5180 - ("DISPLACEMENT-Y isn't a valid decimal number !!!"), 5181 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5182 - return false; 5183 - } 5184 - } 5185 - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL_COLOR); 5186 - wxString color = colorCtrl->GetValue(); 5187 - if (ColorMapEntry::IsValidColor(color) != true) 5188 - { 5189 - if (check == true) 5190 - { 5191 - wxMessageBox(wxT 5192 - ("FILL-COLOR isn't a valid HexRGB color !!!"), 5193 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5194 - return false; 5195 - } 5196 - } 5197 - strcpy(fillColor, color.ToUTF8()); 5198 - colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE_COLOR); 5199 - color = colorCtrl->GetValue(); 5200 - if (ColorMapEntry::IsValidColor(color) != true) 5201 - { 5202 - if (check == true) 5203 - { 5204 - wxMessageBox(wxT 5205 - ("STROKE-COLOR isn't a valid HexRGB color !!!"), 5206 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5207 - return false; 5208 - } 5209 - } 5210 - strcpy(strokeColor, color.ToUTF8()); 5211 - 5212 - Style->SetSymbolOpacity(opacity); 5213 - Style->SetSymbolSize(size); 5214 - Style->SetSymbolAnchorX(anchorPointX); 5215 - Style->SetSymbolAnchorY(anchorPointY); 5216 - Style->SetSymbolRotation(rotation); 5217 - Style->SetSymbolDisplacementX(displacementX); 5218 - Style->SetSymbolDisplacementY(displacementY); 5219 - Style->SetSymbolFillColor(fillColor); 5220 - Style->SetSymbolStrokeColor(strokeColor); 5221 - return true; 5222 -} 5223 - 5224 -void QuickStyleVectorDialog::UpdatePointPage() 5225 -{ 5226 -// 5227 -// updating the Point Symbolizer page 5228 -// 5229 - wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_OPACITY); 5230 - opacityCtrl->SetValue(Style->GetSymbolOpacity() * 100.0); 5231 - wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_SIZE); 5232 - char dummy[64]; 5233 - sprintf(dummy, "%1.2f", Style->GetSymbolSize()); 5234 - wxString str = wxString::FromUTF8(dummy); 5235 - sizeCtrl->SetValue(str); 5236 - wxTextCtrl *rotationCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_ROTATION); 5237 - sprintf(dummy, "%1.2f", Style->GetSymbolRotation()); 5238 - str = wxString::FromUTF8(dummy); 5239 - rotationCtrl->SetValue(str); 5240 - wxTextCtrl *anchorXCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_ANCHOR_X); 5241 - sprintf(dummy, "%1.2f", Style->GetSymbolAnchorX()); 5242 - str = wxString::FromUTF8(dummy); 5243 - anchorXCtrl->SetValue(str); 5244 - wxTextCtrl *anchorYCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_ANCHOR_Y); 5245 - sprintf(dummy, "%1.2f", Style->GetSymbolAnchorY()); 5246 - str = wxString::FromUTF8(dummy); 5247 - anchorYCtrl->SetValue(str); 5248 - wxTextCtrl *displXCtrl = 5249 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_DISPLACEMENT_X); 5250 - sprintf(dummy, "%1.2f", Style->GetSymbolDisplacementX()); 5251 - str = wxString::FromUTF8(dummy); 5252 - displXCtrl->SetValue(str); 5253 - wxTextCtrl *displYCtrl = 5254 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_DISPLACEMENT_Y); 5255 - sprintf(dummy, "%1.2f", Style->GetSymbolDisplacementY()); 5256 - str = wxString::FromUTF8(dummy); 5257 - displYCtrl->SetValue(str); 5258 - wxRadioBox *markCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MARK); 5259 - switch (Style->GetSymbolWellKnownMark()) 5260 - { 5261 - case RL2_GRAPHIC_MARK_CIRCLE: 5262 - markCtrl->SetSelection(1); 5263 - break; 5264 - case RL2_GRAPHIC_MARK_TRIANGLE: 5265 - markCtrl->SetSelection(2); 5266 - break; 5267 - case RL2_GRAPHIC_MARK_STAR: 5268 - markCtrl->SetSelection(3); 5269 - break; 5270 - case RL2_GRAPHIC_MARK_CROSS: 5271 - markCtrl->SetSelection(4); 5272 - break; 5273 - case RL2_GRAPHIC_MARK_X: 5274 - markCtrl->SetSelection(5); 5275 - break; 5276 - default: 5277 - markCtrl->SetSelection(0); 5278 - break; 5279 - }; 5280 - wxTextCtrl *colorFillCtrl = 5281 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL_COLOR); 5282 - wxString fillColor = wxString::FromUTF8(Style->GetSymbolFillColor()); 5283 - colorFillCtrl->SetValue(fillColor); 5284 - wxTextCtrl *colorStrokeCtrl = 5285 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE_COLOR); 5286 - wxString strokeColor = wxString::FromUTF8(Style->GetSymbolStrokeColor()); 5287 - colorStrokeCtrl->SetValue(strokeColor); 5288 -} 5289 - 5290 -bool QuickStyleVectorDialog::RetrieveLinePage(bool check) 5291 -{ 5292 -// 5293 -// retrieving params from the Line Symbolizer page 5294 -// 5295 - double opacity; 5296 - double perpendicularOffset; 5297 - char strokeColor[8]; 5298 - double strokeWidth; 5299 - wxSlider *opacityCtrl = 5300 - (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE1_OPACITY); 5301 - opacity = opacityCtrl->GetValue() / 100.0; 5302 - wxTextCtrl *perpCtrl = 5303 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_PERPENDICULAR); 5304 - wxString value = perpCtrl->GetValue(); 5305 - if (value.ToDouble(&perpendicularOffset) != true) 5306 - { 5307 - if (check == true) 5308 - { 5309 - wxMessageBox(wxT 5310 - ("PERPENDICULAR-OFFSET isn't a valid decimal number !!!"), 5311 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5312 - return false; 5313 - } 5314 - } 5315 - wxTextCtrl *colorCtrl = 5316 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); 5317 - wxString color = colorCtrl->GetValue(); 5318 - if (ColorMapEntry::IsValidColor(color) != true) 5319 - { 5320 - if (check == true) 5321 - { 5322 - wxMessageBox(wxT 5323 - ("STROKE-COLOR isn't a valid HexRGB color !!!"), 5324 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5325 - return false; 5326 - } 5327 - } 5328 - strcpy(strokeColor, color.ToUTF8()); 5329 - wxTextCtrl *widthCtrl = 5330 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_WIDTH); 5331 - value = widthCtrl->GetValue(); 5332 - if (value.ToDouble(&strokeWidth) != true) 5333 - { 5334 - if (check == true) 5335 - { 5336 - wxMessageBox(wxT 5337 - ("STROKE-WIDTH isn't a valid decimal number !!!"), 5338 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5339 - return false; 5340 - } 5341 - } 5342 - if (strokeWidth <= 0.0) 5343 - { 5344 - if (check == true) 5345 - { 5346 - wxMessageBox(wxT 5347 - ("STROKE-WIDTH must be a positive number !!!"), 5348 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5349 - return false; 5350 - } 5351 - } 5352 - wxRadioBox *dotCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_DASH_DOT); 5353 - switch (dotCtrl->GetSelection()) 5354 - { 5355 - case 1: 5356 - Style->SetLineDotStyle(QUICK_STYLE_DOT_LINE); 5357 - break; 5358 - case 2: 5359 - Style->SetLineDotStyle(QUICK_STYLE_DASH_LINE); 5360 - break; 5361 - case 3: 5362 - Style->SetLineDotStyle(QUICK_STYLE_DASH_DOT_LINE); 5363 - break; 5364 - default: 5365 - Style->SetLineDotStyle(QUICK_STYLE_SOLID_LINE); 5366 - break; 5367 - }; 5368 - Style->SetLineOpacity(opacity); 5369 - Style->SetLinePerpendicularOffset(perpendicularOffset); 5370 - Style->SetLineStrokeWidth(strokeWidth); 5371 - Style->SetLineStrokeColor(strokeColor); 5372 - return true; 5373 -} 5374 - 5375 -void QuickStyleVectorDialog::UpdateLinePage() 5376 -{ 5377 -// 5378 -// updating the Line Symbolizer page 5379 -// 5380 - wxSlider *opacityCtrl = 5381 - (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE1_OPACITY); 5382 - opacityCtrl->SetValue(Style->GetLineOpacity() * 100.0); 5383 - wxTextCtrl *perpCtrl = 5384 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_PERPENDICULAR); 5385 - char dummy[64]; 5386 - sprintf(dummy, "%1.2f", Style->GetLinePerpendicularOffset()); 5387 - wxString str = wxString::FromUTF8(dummy); 5388 - perpCtrl->SetValue(str); 5389 - wxTextCtrl *colorCtrl = 5390 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); 5391 - wxButton *pick = (wxButton *) FindWindow(ID_SYMBOLIZER_STROKE1_PICKER_BTN); 5392 - colorCtrl->Enable(true); 5393 - pick->Enable(true); 5394 - wxString strokeColor = wxString::FromUTF8(Style->GetLineStrokeColor()); 5395 - colorCtrl->SetValue(strokeColor); 5396 - wxTextCtrl *widthCtrl = 5397 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_WIDTH); 5398 - sprintf(dummy, "%1.2f", Style->GetLineStrokeWidth()); 5399 - str = wxString::FromUTF8(dummy); 5400 - wxRadioBox *dotCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_DASH_DOT); 5401 - switch (Style->GetLineDotStyle()) 5402 - { 5403 - case QUICK_STYLE_DOT_LINE: 5404 - dotCtrl->SetSelection(1); 5405 - break; 5406 - case QUICK_STYLE_DASH_LINE: 5407 - dotCtrl->SetSelection(2); 5408 - break; 5409 - case QUICK_STYLE_DASH_DOT_LINE: 5410 - dotCtrl->SetSelection(3); 5411 - break; 5412 - default: 5413 - dotCtrl->SetSelection(0); 5414 - break; 5415 - }; 5416 - widthCtrl->SetValue(str); 5417 -} 5418 - 5419 -bool QuickStyleVectorDialog::RetrievePolygonPage(bool check) 5420 -{ 5421 -// 5422 -// retrieving params from the Polygon Synbolizer page 5423 -// 5424 - double fillOpacity; 5425 - double displacementX; 5426 - double displacementY; 5427 - double perpendicularOffset; 5428 - char fillColor[8]; 5429 - double strokeOpacity; 5430 - char strokeColor[8]; 5431 - double strokeWidth; 5432 - wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_FILL2_OPACITY); 5433 - fillOpacity = opacityCtrl->GetValue() / 100.0; 5434 - wxTextCtrl *displXCtrl = 5435 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_X); 5436 - wxString value = displXCtrl->GetValue(); 5437 - if (Style->IsPolygonFill() != true && Style->IsPolygonStroke() != true) 5438 - { 5439 - if (check == true) 5440 - { 5441 - wxMessageBox(wxT 5442 - ("You can't disable both FILL and STROKE at the same time !!!"), 5443 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5444 - return false; 5445 - } 5446 - } 5447 - if (value.ToDouble(&displacementX) != true) 5448 - { 5449 - if (check == true) 5450 - { 5451 - wxMessageBox(wxT 5452 - ("DISPLACEMENT-X isn't a valid decimal number !!!"), 5453 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5454 - return false; 5455 - } 5456 - } 5457 - wxTextCtrl *displYCtrl = 5458 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_Y); 5459 - value = displYCtrl->GetValue(); 5460 - if (value.ToDouble(&displacementY) != true) 5461 - { 5462 - if (check == true) 5463 - { 5464 - wxMessageBox(wxT 5465 - ("DISPLACEMENT-Y isn't a valid decimal number !!!"), 5466 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5467 - return false; 5468 - } 5469 - } 5470 - wxTextCtrl *perpCtrl = 5471 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_PERPENDICULAR); 5472 - value = perpCtrl->GetValue(); 5473 - if (value.ToDouble(&perpendicularOffset) != true) 5474 - { 5475 - if (check == true) 5476 - { 5477 - wxMessageBox(wxT 5478 - ("PERPENDICULAR-OFFSET isn't a valid decimal number !!!"), 5479 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5480 - return false; 5481 - } 5482 - } 5483 - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); 5484 - wxString color = colorCtrl->GetValue(); 5485 - if (ColorMapEntry::IsValidColor(color) != true) 5486 - { 5487 - if (check == true) 5488 - { 5489 - wxMessageBox(wxT 5490 - ("FILL-COLOR isn't a valid HexRGB color !!!"), 5491 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5492 - return false; 5493 - } 5494 - } 5495 - strcpy(fillColor, color.ToUTF8()); 5496 - wxSlider *opacity2Ctrl = 5497 - (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE2_OPACITY); 5498 - strokeOpacity = opacity2Ctrl->GetValue() / 100.0; 5499 - wxTextCtrl *color2Ctrl = 5500 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); 5501 - color = color2Ctrl->GetValue(); 5502 - if (ColorMapEntry::IsValidColor(color) != true) 5503 - { 5504 - if (check == true) 5505 - { 5506 - wxMessageBox(wxT 5507 - ("STROKE-COLOR isn't a valid HexRGB color !!!"), 5508 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5509 - return false; 5510 - } 5511 - } 5512 - strcpy(strokeColor, color.ToUTF8()); 5513 - wxTextCtrl *widthCtrl = 5514 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_WIDTH); 5515 - value = widthCtrl->GetValue(); 5516 - if (value.ToDouble(&strokeWidth) != true) 5517 - { 5518 - if (check == true) 5519 - { 5520 - wxMessageBox(wxT 5521 - ("STROKE-WIDTH isn't a valid decimal number !!!"), 5522 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5523 - return false; 5524 - } 5525 - } 5526 - if (strokeWidth <= 0.0) 5527 - { 5528 - if (check == true) 5529 - { 5530 - wxMessageBox(wxT 5531 - ("STROKE-WIDTH must be a positive number !!!"), 5532 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5533 - return false; 5534 - } 5535 - } 5536 - 5537 - Style->SetPolygonFillOpacity(fillOpacity); 5538 - Style->SetPolygonDisplacementX(displacementX); 5539 - Style->SetPolygonDisplacementY(displacementY); 5540 - Style->SetPolygonPerpendicularOffset(perpendicularOffset); 5541 - Style->SetPolygonFillColor(fillColor); 5542 - Style->SetPolygonStrokeOpacity(strokeOpacity); 5543 - Style->SetPolygonStrokeColor(strokeColor); 5544 - Style->SetPolygonStrokeWidth(strokeWidth); 5545 - return true; 5546 -} 5547 - 5548 -void QuickStyleVectorDialog::UpdatePolygonPage() 5549 -{ 5550 -// 5551 -// updating the Polygon Symbolizer page 5552 -// 5553 - wxCheckBox *enableBox = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_FILL2_ENABLE); 5554 - enableBox->SetValue(Style->IsPolygonFill()); 5555 - wxTextCtrl *displXCtrl = 5556 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_X); 5557 - char dummy[64]; 5558 - sprintf(dummy, "%1.2f", Style->GetPolygonDisplacementX()); 5559 - wxString str = wxString::FromUTF8(dummy); 5560 - displXCtrl->SetValue(str); 5561 - wxTextCtrl *displYCtrl = 5562 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_Y); 5563 - sprintf(dummy, "%1.2f", Style->GetPolygonDisplacementY()); 5564 - str = wxString::FromUTF8(dummy); 5565 - displYCtrl->SetValue(str); 5566 - wxTextCtrl *perpCtrl = 5567 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_PERPENDICULAR); 5568 - sprintf(dummy, "%1.2f", Style->GetPolygonPerpendicularOffset()); 5569 - str = wxString::FromUTF8(dummy); 5570 - perpCtrl->SetValue(str); 5571 - wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_FILL2_OPACITY); 5572 - opacityCtrl->SetValue(Style->GetPolygonFillOpacity() * 100.0); 5573 - opacityCtrl->Enable(Style->IsPolygonFill()); 5574 - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); 5575 - wxButton *pick = (wxButton *) FindWindow(ID_SYMBOLIZER_FILL2_PICKER_BTN); 5576 - wxColour color = wxNullColour; 5577 - str = wxString::FromUTF8(Style->GetPolygonFillColor()); 5578 - ColorMapEntry::GetWxColor(str, color); 5579 - if (color.IsOk() == true) 5580 - { 5581 - char hex[16]; 5582 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 5583 - wxString str = wxString::FromUTF8(hex); 5584 - colorCtrl->SetValue(str); 5585 - } 5586 - colorCtrl->Enable(Style->IsPolygonFill()); 5587 - pick->Enable(Style->IsPolygonFill()); 5588 - wxCheckBox *enable2Box = 5589 - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_STROKE2_ENABLE); 5590 - enable2Box->SetValue(Style->IsPolygonStroke()); 5591 - wxSlider *opacity2Ctrl = 5592 - (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE2_OPACITY); 5593 - opacity2Ctrl->SetValue(Style->GetPolygonStrokeOpacity() * 100.0); 5594 - opacity2Ctrl->Enable(Style->IsPolygonStroke()); 5595 - wxTextCtrl *color2Ctrl = 5596 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); 5597 - wxButton *pick2 = (wxButton *) FindWindow(ID_SYMBOLIZER_STROKE2_PICKER_BTN); 5598 - color = wxNullColour; 5599 - str = wxString::FromUTF8(Style->GetPolygonStrokeColor()); 5600 - ColorMapEntry::GetWxColor(str, color); 5601 - if (color.IsOk() == true) 5602 - { 5603 - char hex[16]; 5604 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 5605 - wxString str = wxString::FromUTF8(hex); 5606 - color2Ctrl->SetValue(str); 5607 - } 5608 - color2Ctrl->Enable(Style->IsPolygonStroke()); 5609 - pick2->Enable(Style->IsPolygonStroke()); 5610 - wxTextCtrl *widthCtrl = 5611 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_WIDTH); 5612 - sprintf(dummy, "%1.2f", Style->GetPolygonStrokeWidth()); 5613 - str = wxString::FromUTF8(dummy); 5614 - widthCtrl->SetValue(str); 5615 - widthCtrl->Enable(Style->IsPolygonStroke()); 5616 -} 5617 - 5618 -bool QuickStyleVectorDialog::RetrieveTextPointPage(bool check) 5619 -{ 5620 -// 5621 -// retrieving params from the Text Symbolizer page - Point Placement 5622 -// 5623 - wxString column; 5624 - wxString font; 5625 - double fontSize; 5626 - int fontStyle; 5627 - int fontWeight; 5628 - double opacity; 5629 - char fontColor[8]; 5630 - double haloRadius; 5631 - double haloOpacity; 5632 - char haloColor[8]; 5633 - double rotation; 5634 - double anchorPointX; 5635 - double anchorPointY; 5636 - double displacementX; 5637 - double displacementY; 5638 - 5639 - if (Style->IsLabelPrint() == false) 5640 - return true; 5641 - 5642 - wxComboBox *columnCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_TEXT1_LABEL); 5643 - int idSel = columnCtrl->GetSelection(); 5644 - if (idSel == wxNOT_FOUND) 5645 - { 5646 - if (check == true) 5647 - { 5648 - wxMessageBox(wxT 5649 - ("You must select some Column !!!"), 5650 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5651 - return false; 5652 - } 5653 - } 5654 - column = columnCtrl->GetValue(); 5655 - wxComboBox *fontCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_FONT1_NAME); 5656 - idSel = fontCtrl->GetSelection(); 5657 - if (idSel == wxNOT_FOUND) 5658 - { 5659 - if (check == true) 5660 - { 5661 - wxMessageBox(wxT 5662 - ("You must select some Font !!!"), 5663 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5664 - return false; 5665 - } 5666 - } 5667 - font = fontCtrl->GetValue(); 5668 - wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT1_SIZE); 5669 - wxString value = sizeCtrl->GetValue(); 5670 - if (value.ToDouble(&fontSize) != true) 5671 - { 5672 - if (check == true) 5673 - { 5674 - wxMessageBox(wxT 5675 - ("FONT-SIZE isn't a valid decimal number !!!"), 5676 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5677 - return false; 5678 - } 5679 - } 5680 - if (fontSize <= 0.0) 5681 - { 5682 - if (check == true) 5683 - { 5684 - wxMessageBox(wxT 5685 - ("FONT-SIZE should be a positive numberr !!!"), 5686 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5687 - return false; 5688 - } 5689 - } 5690 - wxCheckBox *boldCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_BOLD); 5691 - wxCheckBox *italicCtrl = 5692 - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_ITALIC); 5693 - if (boldCtrl->GetValue() == true) 5694 - fontWeight = RL2_FONTWEIGHT_BOLD; 5695 - else 5696 - fontWeight = RL2_FONTWEIGHT_NORMAL; 5697 - if (italicCtrl->GetValue() == true) 5698 - fontStyle = RL2_FONTSTYLE_ITALIC; 5699 - else 5700 - fontStyle = RL2_FONTSTYLE_NORMAL; 5701 - wxSlider *opacityFontCtrl = 5702 - (wxSlider *) FindWindow(ID_SYMBOLIZER_FONT1_OPACITY); 5703 - opacity = opacityFontCtrl->GetValue() / 100.0; 5704 - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT1_COLOR); 5705 - wxString color = colorCtrl->GetValue(); 5706 - if (ColorMapEntry::IsValidColor(color) != true) 5707 - { 5708 - if (check == true) 5709 - { 5710 - wxMessageBox(wxT 5711 - ("FONT-COLOR isn't a valid HexRGB color !!!"), 5712 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5713 - return false; 5714 - } 5715 - } 5716 - strcpy(fontColor, color.ToUTF8()); 5717 -// Point Placement 5718 - wxTextCtrl *rotationCtrl = 5719 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_ROTATION); 5720 - value = rotationCtrl->GetValue(); 5721 - if (value.ToDouble(&rotation) != true) 5722 - { 5723 - if (check == true) 5724 - { 5725 - wxMessageBox(wxT 5726 - ("ROTATION isn't a valid decimal number !!!"), 5727 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5728 - return false; 5729 - } 5730 - } 5731 - wxTextCtrl *anchorXCtrl = 5732 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_ANCHOR_X); 5733 - value = anchorXCtrl->GetValue(); 5734 - if (value.ToDouble(&anchorPointX) != true) 5735 - { 5736 - if (check == true) 5737 - { 5738 - wxMessageBox(wxT 5739 - ("ANCHOR-POINT-X isn't a valid decimal number !!!"), 5740 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5741 - return false; 5742 - } 5743 - } 5744 - if (anchorPointX < 0.0 || anchorPointX > 1.0) 5745 - { 5746 - if (check == true) 5747 - { 5748 - wxMessageBox(wxT 5749 - ("ANCHOR-POINT-X must be between 0.0 and 1.0 !!!"), 5750 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5751 - return false; 5752 - } 5753 - } 5754 - wxTextCtrl *anchorYCtrl = 5755 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_ANCHOR_Y); 5756 - value = anchorYCtrl->GetValue(); 5757 - if (value.ToDouble(&anchorPointY) != true) 5758 - { 5759 - if (check == true) 5760 - { 5761 - wxMessageBox(wxT 5762 - ("ANCHOR-POINT-Y isn't a valid decimal number !!!"), 5763 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5764 - return false; 5765 - } 5766 - } 5767 - if (anchorPointY < 0.0 || anchorPointY > 1.0) 5768 - { 5769 - if (check == true) 5770 - { 5771 - wxMessageBox(wxT 5772 - ("ANCHOR-POINT-Y must be between 0.0 and 1.0 !!!"), 5773 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5774 - return false; 5775 - } 5776 - } 5777 - wxTextCtrl *displXCtrl = 5778 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_DISPLACEMENT_X); 5779 - value = displXCtrl->GetValue(); 5780 - if (value.ToDouble(&displacementX) != true) 5781 - { 5782 - if (check == true) 5783 - { 5784 - wxMessageBox(wxT 5785 - ("DISPLACEMENT-X isn't a valid decimal number !!!"), 5786 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5787 - return false; 5788 - } 5789 - } 5790 - wxTextCtrl *displYCtrl = 5791 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_DISPLACEMENT_Y); 5792 - value = displYCtrl->GetValue(); 5793 - if (value.ToDouble(&displacementY) != true) 5794 - { 5795 - if (check == true) 5796 - { 5797 - wxMessageBox(wxT 5798 - ("DISPLACEMENT-Y isn't a valid decimal number !!!"), 5799 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5800 - return false; 5801 - } 5802 - } 5803 - if (Style->IsHaloEnabled() == true) 5804 - { 5805 - wxSlider *opacityHaloCtrl = 5806 - (wxSlider *) FindWindow(ID_SYMBOLIZER_HALO1_OPACITY); 5807 - haloOpacity = opacityHaloCtrl->GetValue() / 100.0; 5808 - wxTextCtrl *radiusCtrl = 5809 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO1_RADIUS); 5810 - wxString value = radiusCtrl->GetValue(); 5811 - if (value.ToDouble(&haloRadius) != true) 5812 - { 5813 - if (check == true) 5814 - { 5815 - wxMessageBox(wxT 5816 - ("HALO-RADIUS isn't a valid decimal number !!!"), 5817 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5818 - return false; 5819 - } 5820 - } 5821 - if (haloRadius <= 0.0) 5822 - { 5823 - if (check == true) 5824 - { 5825 - wxMessageBox(wxT 5826 - ("HALO-RADIUS should be a positive number !!!"), 5827 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5828 - return false; 5829 - } 5830 - } 5831 - wxTextCtrl *colorHaloCtrl = 5832 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO1_COLOR); 5833 - wxString color = colorHaloCtrl->GetValue(); 5834 - if (ColorMapEntry::IsValidColor(color) != true) 5835 - { 5836 - if (check == true) 5837 - { 5838 - wxMessageBox(wxT 5839 - ("HALO-COLOR isn't a valid HexRGB color !!!"), 5840 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 5841 - return false; 5842 - } 5843 - } 5844 - strcpy(haloColor, color.ToUTF8()); 5845 - } 5846 - 5847 - Style->SetLabelColumn(column.ToUTF8()); 5848 - Style->SetFontFacename(font.ToUTF8()); 5849 - Style->SetFontOpacity(opacity); 5850 - Style->SetFontSize(fontSize); 5851 - Style->SetFontStyle(fontStyle); 5852 - Style->SetFontWeight(fontWeight); 5853 - Style->SetFontColor(fontColor); 5854 - Style->SetLabelRotation(rotation); 5855 - Style->SetLabelAnchorX(anchorPointX); 5856 - Style->SetLabelAnchorY(anchorPointY); 5857 - Style->SetLabelDisplacementX(displacementX); 5858 - Style->SetLabelDisplacementY(displacementY); 5859 - if (Style->IsHaloEnabled() == true) 5860 - { 5861 - Style->SetHaloRadius(haloRadius); 5862 - Style->SetHaloOpacity(haloOpacity); 5863 - Style->SetHaloColor(haloColor); 5864 - } 5865 - return true; 5866 -} 5867 - 5868 -void QuickStyleVectorDialog::UpdateTextPointPage() 5869 -{ 5870 -// 5871 -// updating the Text Symbolizer page - Point Placement 5872 -// 5873 - wxCheckBox *enableCtrl = 5874 - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_ENABLE); 5875 - enableCtrl->SetValue(Style->IsLabelPrint()); 5876 - wxComboBox *columnCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_TEXT1_LABEL); 5877 - wxString str = wxString::FromUTF8(Style->GetLabelColumn()); 5878 - int idSel = columnCtrl->FindString(str); 5879 - columnCtrl->SetSelection(idSel); 5880 - columnCtrl->Enable(Style->IsLabelPrint()); 5881 - wxComboBox *fontCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_FONT1_NAME); 5882 - str = wxString::FromUTF8(Style->GetFontFacename()); 5883 - idSel = fontCtrl->FindString(str); 5884 - fontCtrl->SetSelection(idSel); 5885 - fontCtrl->Enable(Style->IsLabelPrint()); 5886 - wxSlider *opacityFontCtrl = 5887 - (wxSlider *) FindWindow(ID_SYMBOLIZER_FONT1_OPACITY); 5888 - opacityFontCtrl->SetValue(Style->GetFontOpacity() * 100.0); 5889 - opacityFontCtrl->Enable(Style->IsLabelPrint()); 5890 - wxTextCtrl *colorFontCtrl = 5891 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT1_COLOR); 5892 - wxButton *pickFont = (wxButton *) FindWindow(ID_SYMBOLIZER_FONT1_PICKER_BTN); 5893 - wxColour color = wxNullColour; 5894 - str = wxString::FromUTF8(Style->GetFontColor()); 5895 - ColorMapEntry::GetWxColor(str, color); 5896 - if (color.IsOk() == true) 5897 - { 5898 - char hex[16]; 5899 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 5900 - wxString str = wxString::FromUTF8(hex); 5901 - colorFontCtrl->SetValue(str); 5902 - } 5903 - colorFontCtrl->Enable(Style->IsLabelPrint()); 5904 - pickFont->Enable(Style->IsLabelPrint()); 5905 - wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT1_SIZE); 5906 - char dummy[64]; 5907 - sprintf(dummy, "%1.2f", Style->GetFontSize()); 5908 - str = wxString::FromUTF8(dummy); 5909 - sizeCtrl->SetValue(str); 5910 - sizeCtrl->Enable(Style->IsLabelPrint()); 5911 - wxCheckBox *boldCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_BOLD); 5912 - wxCheckBox *italicCtrl = 5913 - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_ITALIC); 5914 - if (Style->GetFontWeight() == RL2_FONTWEIGHT_BOLD) 5915 - boldCtrl->SetValue(true); 5916 - else 5917 - boldCtrl->SetValue(false); 5918 - if (Style->GetFontStyle() == RL2_FONTSTYLE_ITALIC) 5919 - italicCtrl->SetValue(true); 5920 - else 5921 - italicCtrl->SetValue(false); 5922 - boldCtrl->Enable(false); 5923 - italicCtrl->Enable(false); 5924 - if (Style->GetFontFacename() != NULL) 5925 - { 5926 - if (strncmp(Style->GetFontFacename(), "ToyFont: ", 9) == 0) 5927 - { 5928 - boldCtrl->Enable(Style->IsLabelPrint()); 5929 - italicCtrl->Enable(Style->IsLabelPrint()); 5930 - } else 5931 - { 5932 - bool bold = false; 5933 - bool italic = false; 5934 - MainFrame->CheckTTFont(Style->GetFontFacename(), &bold, &italic); 5935 - boldCtrl->SetValue(bold); 5936 - italicCtrl->SetValue(italic); 5937 - boldCtrl->Enable(false); 5938 - italicCtrl->Enable(false); 5939 - } 5940 - } 5941 -// Point Placement 5942 - wxTextCtrl *rotationCtrl = 5943 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_ROTATION); 5944 - sprintf(dummy, "%1.2f", Style->GetLabelRotation()); 5945 - str = wxString::FromUTF8(dummy); 5946 - rotationCtrl->SetValue(str); 5947 - rotationCtrl->Enable(Style->IsLabelPrint()); 5948 - wxTextCtrl *anchorXCtrl = 5949 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_ANCHOR_X); 5950 - sprintf(dummy, "%1.2f", Style->GetLabelAnchorX()); 5951 - str = wxString::FromUTF8(dummy); 5952 - anchorXCtrl->SetValue(str); 5953 - anchorXCtrl->Enable(Style->IsLabelPrint()); 5954 - wxTextCtrl *anchorYCtrl = 5955 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_ANCHOR_Y); 5956 - sprintf(dummy, "%1.2f", Style->GetLabelAnchorY()); 5957 - str = wxString::FromUTF8(dummy); 5958 - anchorYCtrl->SetValue(str); 5959 - anchorYCtrl->Enable(Style->IsLabelPrint()); 5960 - wxTextCtrl *displXCtrl = 5961 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_DISPLACEMENT_X); 5962 - sprintf(dummy, "%1.2f", Style->GetLabelDisplacementX()); 5963 - str = wxString::FromUTF8(dummy); 5964 - displXCtrl->SetValue(str); 5965 - displXCtrl->Enable(Style->IsLabelPrint()); 5966 - wxTextCtrl *displYCtrl = 5967 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_DISPLACEMENT_Y); 5968 - sprintf(dummy, "%1.2f", Style->GetLabelDisplacementY()); 5969 - str = wxString::FromUTF8(dummy); 5970 - displYCtrl->SetValue(str); 5971 - displYCtrl->Enable(Style->IsLabelPrint()); 5972 - wxCheckBox *enableHaloBox = 5973 - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_HALO1_ENABLE); 5974 - if (Style->IsHaloEnabled() == true) 5975 - enableHaloBox->SetValue(true); 5976 - else 5977 - enableHaloBox->SetValue(false); 5978 - enableHaloBox->Enable(Style->IsLabelPrint()); 5979 - bool enable = false; 5980 - if (Style->IsLabelPrint() == true) 5981 - enable = Style->IsHaloEnabled(); 5982 - wxTextCtrl *radiusCtrl = 5983 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO1_RADIUS); 5984 - radiusCtrl->Enable(enable); 5985 - wxTextCtrl *colorHaloCtrl = 5986 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO1_COLOR); 5987 - colorHaloCtrl->Enable(enable); 5988 - wxButton *pickHalo = (wxButton *) FindWindow(ID_SYMBOLIZER_HALO1_PICKER_BTN); 5989 - pickHalo->Enable(enable); 5990 - wxSlider *opacityHaloCtrl = 5991 - (wxSlider *) FindWindow(ID_SYMBOLIZER_HALO1_OPACITY); 5992 - opacityHaloCtrl->Enable(enable); 5993 - opacityHaloCtrl->SetValue(Style->GetHaloOpacity() * 100.0); 5994 - sprintf(dummy, "%1.2f", Style->GetHaloRadius()); 5995 - str = wxString::FromUTF8(dummy); 5996 - radiusCtrl->SetValue(str); 5997 - color = wxNullColour; 5998 - str = wxString::FromUTF8(Style->GetHaloColor()); 5999 - ColorMapEntry::GetWxColor(str, color); 6000 - if (color.IsOk() == true) 6001 - { 6002 - char hex[16]; 6003 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 6004 - wxString str = wxString::FromUTF8(hex); 6005 - colorHaloCtrl->SetValue(str); 6006 - } 6007 - if (Style->IsHaloEnabled() == false) 6008 - { 6009 - opacityHaloCtrl->Enable(false); 6010 - pickHalo->Enable(false); 6011 - colorHaloCtrl->Enable(false); 6012 - radiusCtrl->Enable(false); 6013 - } else 6014 - { 6015 - opacityHaloCtrl->Enable(true); 6016 - pickHalo->Enable(true); 6017 - colorHaloCtrl->Enable(true); 6018 - radiusCtrl->Enable(true); 6019 - } 6020 -} 6021 - 6022 -bool QuickStyleVectorDialog::RetrieveTextLinePage(bool check) 6023 -{ 6024 -// 6025 -// retrieving params from the Text Symbolizer page - Line Placement 6026 -// 6027 - wxString column; 6028 - wxString font; 6029 - double fontSize; 6030 - int fontStyle; 6031 - int fontWeight; 6032 - double opacity; 6033 - char fontColor[8]; 6034 - double haloRadius; 6035 - double haloOpacity; 6036 - char haloColor[8]; 6037 - double perpendicularOffset; 6038 - double initialGap; 6039 - double gap; 6040 - 6041 - if (Style->IsLabelPrint() == false) 6042 - return true; 6043 - 6044 - wxComboBox *columnCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_TEXT2_LABEL); 6045 - int idSel = columnCtrl->GetSelection(); 6046 - if (idSel == wxNOT_FOUND) 6047 - { 6048 - if (check == true) 6049 - { 6050 - wxMessageBox(wxT 6051 - ("You must select some Column !!!"), 6052 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 6053 - return false; 6054 - } 6055 - } 6056 - column = columnCtrl->GetValue(); 6057 - wxComboBox *fontCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_FONT2_NAME); 6058 - idSel = fontCtrl->GetSelection(); 6059 - if (idSel == wxNOT_FOUND) 6060 - { 6061 - if (check == true) 6062 - { 6063 - wxMessageBox(wxT 6064 - ("You must select some Font !!!"), 6065 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 6066 - return false; 6067 - } 6068 - } 6069 - font = fontCtrl->GetValue(); 6070 - wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT2_SIZE); 6071 - wxString value = sizeCtrl->GetValue(); 6072 - if (value.ToDouble(&fontSize) != true) 6073 - { 6074 - if (check == true) 6075 - { 6076 - wxMessageBox(wxT 6077 - ("FONT-SIZE isn't a valid decimal number !!!"), 6078 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 6079 - return false; 6080 - } 6081 - } 6082 - if (fontSize <= 0.0) 6083 - { 6084 - if (check == true) 6085 - { 6086 - wxMessageBox(wxT 6087 - ("FONT-SIZE should be a positive numberr !!!"), 6088 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 6089 - return false; 6090 - } 6091 - } 6092 - wxCheckBox *boldCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_BOLD); 6093 - wxCheckBox *italicCtrl = 6094 - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_ITALIC); 6095 - if (boldCtrl->GetValue() == true) 6096 - fontWeight = RL2_FONTWEIGHT_BOLD; 6097 - else 6098 - fontWeight = RL2_FONTWEIGHT_NORMAL; 6099 - if (italicCtrl->GetValue() == true) 6100 - fontStyle = RL2_FONTSTYLE_ITALIC; 6101 - else 6102 - fontStyle = RL2_FONTSTYLE_NORMAL; 6103 - wxSlider *opacityFontCtrl = 6104 - (wxSlider *) FindWindow(ID_SYMBOLIZER_FONT2_OPACITY); 6105 - opacity = opacityFontCtrl->GetValue() / 100.0; 6106 - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT2_COLOR); 6107 - wxString color = colorCtrl->GetValue(); 6108 - if (ColorMapEntry::IsValidColor(color) != true) 6109 - { 6110 - if (check == true) 6111 - { 6112 - wxMessageBox(wxT 6113 - ("FONT-COLOR isn't a valid HexRGB color !!!"), 6114 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 6115 - return false; 6116 - } 6117 - } 6118 - strcpy(fontColor, color.ToUTF8()); 6119 -// Line Placement 6120 - wxTextCtrl *perpCtrl = 6121 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_PERPENDICULAR); 6122 - value = perpCtrl->GetValue(); 6123 - if (value.ToDouble(&perpendicularOffset) != true) 6124 - { 6125 - if (check == true) 6126 - { 6127 - wxMessageBox(wxT 6128 - ("PERPENDICULAR-OFFSET isn't a valid decimal number !!!"), 6129 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 6130 - return false; 6131 - } 6132 - } 6133 - wxTextCtrl *inigapCtrl = 6134 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_INITIAL_GAP); 6135 - value = inigapCtrl->GetValue(); 6136 - if (value.ToDouble(&initialGap) != true) 6137 - { 6138 - if (check == true) 6139 - { 6140 - wxMessageBox(wxT 6141 - ("INITIAL-GAP isn't a valid decimal number !!!"), 6142 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 6143 - return false; 6144 - } 6145 - } 6146 - if (initialGap < 0.0) 6147 - { 6148 - if (check == true) 6149 - { 6150 - wxMessageBox(wxT 6151 - ("INITIAL-GAP should be a positive number !!!"), 6152 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 6153 - return false; 6154 - } 6155 - } 6156 - wxTextCtrl *gapCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_GAP); 6157 - value = gapCtrl->GetValue(); 6158 - if (value.ToDouble(&gap) != true) 6159 - { 6160 - if (check == true) 6161 - { 6162 - wxMessageBox(wxT 6163 - ("GAP isn't a valid decimal number !!!"), 6164 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 6165 - return false; 6166 - } 6167 - } 6168 - if (gap < 0.0) 6169 - { 6170 - if (check == true) 6171 - { 6172 - wxMessageBox(wxT 6173 - ("GAP should be a positive number !!!"), 6174 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 6175 - return false; 6176 - } 6177 - } 6178 - if (Style->IsHaloEnabled() == true) 6179 - { 6180 - wxSlider *opacityHaloCtrl = 6181 - (wxSlider *) FindWindow(ID_SYMBOLIZER_HALO2_OPACITY); 6182 - haloOpacity = opacityHaloCtrl->GetValue() / 100.0; 6183 - wxTextCtrl *radiusCtrl = 6184 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO2_RADIUS); 6185 - wxString value = radiusCtrl->GetValue(); 6186 - if (value.ToDouble(&haloRadius) != true) 6187 - { 6188 - if (check == true) 6189 - { 6190 - wxMessageBox(wxT 6191 - ("HALO-RADIUS isn't a valid decimal number !!!"), 6192 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 6193 - return false; 6194 - } 6195 - } 6196 - if (haloRadius <= 0.0) 6197 - { 6198 - if (check == true) 6199 - { 6200 - wxMessageBox(wxT 6201 - ("HALO-RADIUS should be a positive number !!!"), 6202 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 6203 - return false; 6204 - } 6205 - } 6206 - wxTextCtrl *colorHaloCtrl = 6207 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO2_COLOR); 6208 - wxString color = colorHaloCtrl->GetValue(); 6209 - if (ColorMapEntry::IsValidColor(color) != true) 6210 - { 6211 - if (check == true) 6212 - { 6213 - wxMessageBox(wxT 6214 - ("HALO-COLOR isn't a valid HexRGB color !!!"), 6215 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 6216 - return false; 6217 - } 6218 - } 6219 - strcpy(haloColor, color.ToUTF8()); 6220 - } 6221 - Style->SetLabelColumn(column.ToUTF8()); 6222 - Style->SetFontFacename(font.ToUTF8()); 6223 - Style->SetFontOpacity(opacity); 6224 - Style->SetFontSize(fontSize); 6225 - Style->SetFontStyle(fontStyle); 6226 - Style->SetFontWeight(fontWeight); 6227 - Style->SetFontColor(fontColor); 6228 - Style->SetLabelPerpendicularOffset(perpendicularOffset); 6229 - Style->SetLabelInitialGap(initialGap); 6230 - Style->SetLabelGap(gap); 6231 - if (Style->IsHaloEnabled() == true) 6232 - { 6233 - Style->SetHaloRadius(haloRadius); 6234 - Style->SetHaloOpacity(haloOpacity); 6235 - Style->SetHaloColor(haloColor); 6236 - } 6237 - return true; 6238 -} 6239 - 6240 -void QuickStyleVectorDialog::UpdateTextLinePage() 6241 -{ 6242 -// 6243 -// updating the Text Symbolizer page - Line Placement 6244 -// 6245 - wxCheckBox *enableCtrl = 6246 - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_ENABLE); 6247 - enableCtrl->SetValue(Style->IsLabelPrint()); 6248 - wxComboBox *columnCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_TEXT2_LABEL); 6249 - wxString str = wxString::FromUTF8(Style->GetLabelColumn()); 6250 - int idSel = columnCtrl->FindString(str); 6251 - columnCtrl->SetSelection(idSel); 6252 - columnCtrl->Enable(Style->IsLabelPrint()); 6253 - wxComboBox *fontCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_FONT2_NAME); 6254 - str = wxString::FromUTF8(Style->GetFontFacename()); 6255 - idSel = fontCtrl->FindString(str); 6256 - fontCtrl->SetSelection(idSel); 6257 - fontCtrl->Enable(Style->IsLabelPrint()); 6258 - wxSlider *opacityFontCtrl = 6259 - (wxSlider *) FindWindow(ID_SYMBOLIZER_FONT2_OPACITY); 6260 - opacityFontCtrl->SetValue(Style->GetFontOpacity() * 100.0); 6261 - opacityFontCtrl->Enable(Style->IsLabelPrint()); 6262 - wxTextCtrl *colorFontCtrl = 6263 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT2_COLOR); 6264 - wxButton *pickFont = (wxButton *) FindWindow(ID_SYMBOLIZER_FONT2_PICKER_BTN); 6265 - wxColour color = wxNullColour; 6266 - str = wxString::FromUTF8(Style->GetFontColor()); 6267 - ColorMapEntry::GetWxColor(str, color); 6268 - if (color.IsOk() == true) 6269 - { 6270 - char hex[16]; 6271 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 6272 - wxString str = wxString::FromUTF8(hex); 6273 - colorFontCtrl->SetValue(str); 6274 - } 6275 - colorFontCtrl->Enable(Style->IsLabelPrint()); 6276 - pickFont->Enable(Style->IsLabelPrint()); 6277 - wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT2_SIZE); 6278 - char dummy[64]; 6279 - sprintf(dummy, "%1.2f", Style->GetFontSize()); 6280 - str = wxString::FromUTF8(dummy); 6281 - sizeCtrl->SetValue(str); 6282 - sizeCtrl->Enable(Style->IsLabelPrint()); 6283 - wxCheckBox *boldCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_BOLD); 6284 - wxCheckBox *italicCtrl = 6285 - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_ITALIC); 6286 - if (Style->GetFontWeight() == RL2_FONTWEIGHT_BOLD) 6287 - boldCtrl->SetValue(true); 6288 - else 6289 - boldCtrl->SetValue(false); 6290 - if (Style->GetFontStyle() == RL2_FONTSTYLE_ITALIC) 6291 - italicCtrl->SetValue(true); 6292 - else 6293 - italicCtrl->SetValue(false); 6294 - italicCtrl->Enable(Style->IsLabelPrint()); 6295 - boldCtrl->Enable(false); 6296 - italicCtrl->Enable(false); 6297 - if (Style->GetFontFacename() != NULL) 6298 - { 6299 - if (strncmp(Style->GetFontFacename(), "ToyFont: ", 9) == 0) 6300 - { 6301 - boldCtrl->Enable(Style->IsLabelPrint()); 6302 - italicCtrl->Enable(Style->IsLabelPrint()); 6303 - } else 6304 - { 6305 - bool bold = false; 6306 - bool italic = false; 6307 - MainFrame->CheckTTFont(Style->GetFontFacename(), &bold, &italic); 6308 - boldCtrl->SetValue(bold); 6309 - italicCtrl->SetValue(italic); 6310 - boldCtrl->Enable(false); 6311 - italicCtrl->Enable(false); 6312 - } 6313 - } 6314 -// Line Placement 6315 - wxTextCtrl *perpCtrl = 6316 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_PERPENDICULAR); 6317 - sprintf(dummy, "%1.2f", Style->GetLabelPerpendicularOffset()); 6318 - str = wxString::FromUTF8(dummy); 6319 - perpCtrl->SetValue(str); 6320 - perpCtrl->Enable(Style->IsLabelPrint()); 6321 - wxCheckBox *repeatBox = 6322 - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT_IS_REPEATED); 6323 - repeatBox->SetValue(Style->IsRepeatedLabel()); 6324 - repeatBox->Enable(Style->IsLabelPrint()); 6325 - wxTextCtrl *inigapCtrl = 6326 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_INITIAL_GAP); 6327 - sprintf(dummy, "%1.2f", Style->GetLabelInitialGap()); 6328 - str = wxString::FromUTF8(dummy); 6329 - inigapCtrl->SetValue(str); 6330 - wxTextCtrl *gapCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_GAP); 6331 - sprintf(dummy, "%1.2f", Style->GetLabelGap()); 6332 - str = wxString::FromUTF8(dummy); 6333 - gapCtrl->SetValue(str); 6334 - if (Style->IsLabelPrint() && Style->IsRepeatedLabel()) 6335 - { 6336 - inigapCtrl->Enable(true); 6337 - gapCtrl->Enable(true); 6338 - } else 6339 - { 6340 - inigapCtrl->Enable(false); 6341 - gapCtrl->Enable(false); 6342 - } 6343 - wxCheckBox *alignBox = 6344 - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT_IS_ALIGNED); 6345 - alignBox->SetValue(Style->IsLabelAligned()); 6346 - alignBox->Enable(Style->IsLabelPrint()); 6347 - wxCheckBox *generalizeBox = 6348 - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT_GENERALIZE); 6349 - generalizeBox->SetValue(Style->IsLabelGeneralizeLine()); 6350 - generalizeBox->Enable(Style->IsLabelPrint()); 6351 - wxCheckBox *enableHaloBox = 6352 - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_HALO2_ENABLE); 6353 - if (Style->IsHaloEnabled() == true) 6354 - enableHaloBox->SetValue(true); 6355 - else 6356 - enableHaloBox->SetValue(false); 6357 - enableHaloBox->Enable(Style->IsLabelPrint()); 6358 - bool enable = false; 6359 - if (Style->IsLabelPrint() == true) 6360 - enable = Style->IsHaloEnabled(); 6361 - wxTextCtrl *radiusCtrl = 6362 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO2_RADIUS); 6363 - radiusCtrl->Enable(enable); 6364 - wxTextCtrl *colorHaloCtrl = 6365 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO2_COLOR); 6366 - colorHaloCtrl->Enable(enable); 6367 - wxButton *pickHalo = (wxButton *) FindWindow(ID_SYMBOLIZER_HALO2_PICKER_BTN); 6368 - pickHalo->Enable(enable); 6369 - wxSlider *opacityHaloCtrl = 6370 - (wxSlider *) FindWindow(ID_SYMBOLIZER_HALO2_OPACITY); 6371 - opacityHaloCtrl->Enable(enable); 6372 - opacityHaloCtrl->SetValue(Style->GetHaloOpacity() * 100.0); 6373 - sprintf(dummy, "%1.2f", Style->GetHaloRadius()); 6374 - str = wxString::FromUTF8(dummy); 6375 - radiusCtrl->SetValue(str); 6376 - color = wxNullColour; 6377 - str = wxString::FromUTF8(Style->GetHaloColor()); 6378 - ColorMapEntry::GetWxColor(str, color); 6379 - if (color.IsOk() == true) 6380 - { 6381 - char hex[16]; 6382 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 6383 - wxString str = wxString::FromUTF8(hex); 6384 - colorHaloCtrl->SetValue(str); 6385 - } 6386 - if (Style->IsHaloEnabled() == false) 6387 - { 6388 - opacityHaloCtrl->Enable(false); 6389 - pickHalo->Enable(false); 6390 - colorHaloCtrl->Enable(false); 6391 - radiusCtrl->Enable(false); 6392 - } else 6393 - { 6394 - opacityHaloCtrl->Enable(true); 6395 - pickHalo->Enable(true); 6396 - colorHaloCtrl->Enable(true); 6397 - radiusCtrl->Enable(true); 6398 - } 6399 -} 6400 - 6401 -void QuickStyleVectorDialog::OnPageChanging(wxNotebookEvent & event) 6402 -{ 6403 -// 6404 -// TAB/PAGE selection changing 6405 -// 6406 - bool ret = false; 6407 - int idx = event.GetOldSelection(); 6408 - if (idx == 0) 6409 - ret = RetrieveMainPage(); 6410 - else 6411 - { 6412 - if (idx == PagePointIndex) 6413 - ret = RetrievePointPage(); 6414 - if (idx == PageLineIndex) 6415 - ret = RetrieveLinePage(); 6416 - if (idx == PagePolygonIndex) 6417 - ret = RetrievePolygonPage(); 6418 - if (idx == PageTextPointIndex) 6419 - ret = RetrieveTextPointPage(); 6420 - if (idx == PageTextLineIndex) 6421 - ret = RetrieveTextLinePage(); 6422 - } 6423 - if (ret != true) 6424 - event.Veto(); 6425 -} 6426 - 6427 -void QuickStyleVectorDialog::OnPageChanged(wxNotebookEvent & event) 6428 -{ 6429 -// 6430 -// TAB/PAGE selection changed 6431 -// 6432 - int idx = event.GetSelection(); 6433 - if (idx == 0) 6434 - UpdateMainPage(); 6435 - else 6436 - { 6437 - if (idx == PagePointIndex) 6438 - UpdatePointPage(); 6439 - if (idx == PageLineIndex) 6440 - UpdateLinePage(); 6441 - if (idx == PagePolygonIndex) 6442 - UpdatePolygonPage(); 6443 - if (idx == PageTextPointIndex) 6444 - UpdateTextPointPage(); 6445 - if (idx == PageTextLineIndex) 6446 - UpdateTextLinePage(); 6447 - } 6448 -} 6449 - 6450 -bool QuickStyleVectorDialog::UpdateStyle() 6451 -{ 6452 -// 6453 -// updating the QuickStyle 6454 -// 6455 - bool ret = false; 6456 - int idx = GetBookCtrl()->GetSelection(); 6457 - if (idx == 0) 6458 - ret = RetrieveMainPage(); 6459 - else 6460 - { 6461 - if (idx == PagePointIndex) 6462 - ret = RetrievePointPage(); 6463 - if (idx == PageLineIndex) 6464 - ret = RetrieveLinePage(); 6465 - if (idx == PagePolygonIndex) 6466 - ret = RetrievePolygonPage(); 6467 - if (idx == PageTextPointIndex) 6468 - ret = RetrieveTextPointPage(); 6469 - if (idx == PageTextLineIndex) 6470 - ret = RetrieveTextLinePage(); 6471 - } 6472 - if (ret == false) 6473 - return false; 6474 - 6475 - VectorLayerConfig *config = Layer->GetVectorConfig(); 6476 - bool setCurrentStyle = false; 6477 - if (config->GetStyle() == NULL) 6478 - setCurrentStyle = true; 6479 - else 6480 - { 6481 - if (strcmp(Style->GetUUID(), config->GetStyle()) != 0) 6482 - setCurrentStyle = true; 6483 - } 6484 - if (setCurrentStyle == true) 6485 - { 6486 - config->SetStyle(Style->GetUUID()); 6487 - IsConfigChanged = true; 6488 - } 6489 - IsConfigChanged = Layer->UpdateQuickStyle(Style); 6490 - return true; 6491 -} 6492 - 6493 -void QuickStyleVectorDialog::OnOk(wxCommandEvent & WXUNUSED(event)) 6494 -{ 6495 -// 6496 -// permanently saving the QuickStyle and quitting 6497 -// 6498 - if (UpdateStyle() == true) 6499 - wxDialog::EndModal(wxID_OK); 6500 -} 6501 - 6502 -void QuickStyleVectorDialog::OnApply(wxCommandEvent & WXUNUSED(event)) 6503 -{ 6504 -// 6505 -// applying the QuickStyle and continuing 6506 -// 6507 - if (UpdateStyle() == true) 6508 - { 6509 - if (IsConfigChanged == true) 6510 - MapPanel->RefreshMap(); 6511 - } 6512 -} 6513 - 6514 -void QuickStyleVectorDialog::OnExport(wxCommandEvent & WXUNUSED(event)) 6515 -{ 6516 -// 6517 -// exporting the Quick Style as an external file 6518 -// 6519 - bool xret = false; 6520 - int ret; 6521 - wxString path; 6522 - wxString lastDir; 6523 - int idx = GetBookCtrl()->GetSelection(); 6524 - if (idx == 0) 6525 - xret = RetrieveMainPage(); 6526 - else 6527 - { 6528 - if (idx == PagePointIndex) 6529 - xret = RetrievePointPage(); 6530 - if (idx == PageLineIndex) 6531 - xret = RetrieveLinePage(); 6532 - if (idx == PagePolygonIndex) 6533 - xret = RetrievePolygonPage(); 6534 - if (idx == PageTextPointIndex) 6535 - xret = RetrieveTextPointPage(); 6536 - if (idx == PageTextLineIndex) 6537 - xret = RetrieveTextLinePage(); 6538 - } 6539 - if (xret == false) 6540 - return; 6541 - 6542 - wxFileDialog fileDialog(this, 6543 - wxT("Exporting an SLD/SE QuickStyle to a file"), 6544 - wxT(""), wxT("style.xml"), 6545 - wxT("XML Document|*.xml|All files (*.*)|*.*"), 6546 - wxFD_SAVE | wxFD_OVERWRITE_PROMPT, wxDefaultPosition, 6547 - wxDefaultSize, wxT("filedlg")); 6548 - lastDir = MainFrame->GetLastDirectory(); 6549 - if (lastDir.Len() >= 1) 6550 - fileDialog.SetDirectory(lastDir); 6551 - ret = fileDialog.ShowModal(); 6552 - if (ret == wxID_OK) 6553 - { 6554 - wxFileName file(fileDialog.GetPath()); 6555 - path = file.GetPath(); 6556 - path += file.GetPathSeparator(); 6557 - path += file.GetName(); 6558 - lastDir = file.GetPath(); 6559 - path = fileDialog.GetPath(); 6560 - FILE *out = fopen(path.ToUTF8(), "wb"); 6561 - if (out == NULL) 6562 - wxMessageBox(wxT("ERROR: unable to create:\n\n\"") + path + wxT("\""), 6563 - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 6564 - else 6565 - { 6566 - char *xml = Style->CreateXmlStyle(); 6567 - fwrite(xml, 1, strlen(xml), out); 6568 - sqlite3_free(xml); 6569 - fclose(out); 6570 - wxMessageBox(wxT 6571 - ("SLD/SE QuickStyle successfully saved into:\n\n\"") 6572 - + path + wxT("\""), wxT("spatialite_gui"), 6573 - wxOK | wxICON_INFORMATION, this); 6574 - } 6575 - } 6576 -} 6577 - 6578 -void QuickStyleVectorDialog::OnCopy(wxCommandEvent & WXUNUSED(event)) 6579 -{ 6580 -// 6581 -// Copying the Quick Style into the Clipboard 6582 -// 6583 - bool ret = false; 6584 - int idx = GetBookCtrl()->GetSelection(); 6585 - if (idx == 0) 6586 - ret = RetrieveMainPage(); 6587 - else 6588 - { 6589 - if (idx == PagePointIndex) 6590 - ret = RetrievePointPage(); 6591 - if (idx == PageLineIndex) 6592 - ret = RetrieveLinePage(); 6593 - if (idx == PagePolygonIndex) 6594 - ret = RetrievePolygonPage(); 6595 - if (idx == PageTextPointIndex) 6596 - ret = RetrieveTextPointPage(); 6597 - if (idx == PageTextLineIndex) 6598 - ret = RetrieveTextLinePage(); 6599 - } 6600 - if (ret == false) 6601 - return; 6602 - 6603 - char *xml = Style->CreateXmlStyle(); 6604 - wxString XMLstring = wxString::FromUTF8(xml); 6605 - sqlite3_free(xml); 6606 - if (wxTheClipboard->Open()) 6607 - { 6608 - wxTheClipboard->SetData(new wxTextDataObject(XMLstring)); 6609 - wxTheClipboard->Close(); 6610 - } 6611 -} 6612 - 6613 -void QuickStyleVectorDialog::OnQuit(wxCommandEvent & WXUNUSED(event)) 6614 -{ 6615 -// 6616 -// all done: 6617 -// 6618 - wxDialog::EndModal(wxID_CANCEL); 6619 -} 6620 - 6621 -bool QuickStyleTopologyDialog::Create(MyMapPanel * parent, MapLayer * layer) 6622 -{ 6623 -// 6624 -// creating the dialog 6625 -// 6626 - MainFrame = parent->GetParent(); 6627 - MapPanel = parent; 6628 - Layer = layer; 6629 - Type = Layer->GetType(); 6630 - DbPrefix = layer->GetDbPrefix(); 6631 - LayerName = layer->GetName(); 6632 - IsConfigChanged = false; 6633 - 6634 - wxString title = wxT("QuickStyle (Topology) Edit"); 6635 - if (Type == MAP_LAYER_NETWORK) 6636 - title = wxT("QuickStyle (Network) Edit"); 6637 - if (wxPropertySheetDialog::Create(parent, wxID_ANY, title) == false) 6638 - return false; 6639 - if (Layer->GetQuickStyleTopology() != NULL) 6640 - Style = Layer->CloneQuickStyleTopology(); 6641 - else 6642 - Style = new QuickStyleTopologyObj(Type); 6643 - 6644 - wxBookCtrlBase *book = GetBookCtrl(); 6645 -// creates individual panels 6646 - wxPanel *mainPage = CreateMainPage(book); 6647 - book->AddPage(mainPage, wxT("General"), true); 6648 - if (Type == MAP_LAYER_NETWORK) 6649 - { 6650 - wxPanel *nodePage = CreateNodePage(book); 6651 - book->AddPage(nodePage, wxT("Nodes"), false); 6652 - wxPanel *edgeLinkPage = CreateEdgeLinkPage(book); 6653 - book->AddPage(edgeLinkPage, wxT("Links"), false); 6654 - wxPanel *edgeLinkSeedPage = CreateEdgeLinkSeedPage(book); 6655 - book->AddPage(edgeLinkSeedPage, wxT("Link Seeds"), false); 6656 - } else 6657 - { 6658 - wxPanel *nodePage = CreateNodePage(book); 6659 - book->AddPage(nodePage, wxT("Nodes"), false); 6660 - wxPanel *edgeLinkPage = CreateEdgeLinkPage(book); 6661 - book->AddPage(edgeLinkPage, wxT("Edges"), false); 6662 - wxPanel *facePage = CreateFacePage(book); 6663 - book->AddPage(facePage, wxT("Faces"), false); 6664 - wxPanel *edgeLinkSeedPage = CreateEdgeLinkSeedPage(book); 6665 - book->AddPage(edgeLinkSeedPage, wxT("Edge Seeds"), false); 6666 - wxPanel *faceSeedPage = CreateFaceSeedPage(book); 6667 - book->AddPage(faceSeedPage, wxT("Face Seeds"), false); 6668 - } 6669 - 6670 - CreateButtons(); 6671 - LayoutDialog(); 6672 -// appends event handler for TAB/PAGE changing 6673 - Connect(wxID_ANY, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, 6674 - (wxObjectEventFunction) & QuickStyleTopologyDialog::OnPageChanging); 6675 - Connect(wxID_ANY, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, 6676 - (wxObjectEventFunction) & QuickStyleTopologyDialog::OnPageChanged); 6677 -// appends event handler for buttons 6678 - Connect(wxID_CANCEL, wxEVT_COMMAND_BUTTON_CLICKED, 6679 - (wxObjectEventFunction) & QuickStyleTopologyDialog::OnQuit); 6680 - Connect(wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, 6681 - (wxObjectEventFunction) & QuickStyleTopologyDialog::OnOk); 6682 - Connect(ID_QUICK_STYLE_APPLY, wxEVT_COMMAND_BUTTON_CLICKED, 6683 - (wxObjectEventFunction) & QuickStyleTopologyDialog::OnApply); 6684 - Connect(ID_QUICK_STYLE_EXPORT, wxEVT_COMMAND_BUTTON_CLICKED, 6685 - (wxObjectEventFunction) & QuickStyleTopologyDialog::OnExport); 6686 - Connect(ID_QUICK_STYLE_COPY, wxEVT_COMMAND_BUTTON_CLICKED, 6687 - (wxObjectEventFunction) & QuickStyleTopologyDialog::OnCopy); 6688 -// centers the dialog window 6689 - Centre(); 6690 - UpdateMainPage(); 6691 - return true; 6692 -} 6693 - 6694 -void QuickStyleTopologyDialog::CreateButtons() 6695 -{ 6696 -// 6697 -// adding the common Buttons 6698 -// 6699 - wxBoxSizer *topSizer = (wxBoxSizer *) (this->GetSizer()); 6700 - wxBoxSizer *btnBox = new wxBoxSizer(wxHORIZONTAL); 6701 - topSizer->Add(btnBox, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 6702 - wxButton *save = new wxButton(this, ID_QUICK_STYLE_APPLY, wxT("&Apply")); 6703 - btnBox->Add(save, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6704 - wxButton *exp = 6705 - new wxButton(this, ID_QUICK_STYLE_EXPORT, wxT("&Export to file")); 6706 - btnBox->Add(exp, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6707 - wxButton *copy = new wxButton(this, ID_QUICK_STYLE_COPY, wxT("&Copy")); 6708 - btnBox->Add(copy, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6709 - btnBox->AddSpacer(100); 6710 - wxButton *ok = new wxButton(this, wxID_OK, wxT("&Ok")); 6711 - btnBox->Add(ok, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6712 - wxButton *cancel = new wxButton(this, wxID_CANCEL, wxT("&Cancel")); 6713 - btnBox->Add(cancel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6714 -} 6715 - 6716 -wxPanel *QuickStyleTopologyDialog::CreateMainPage(wxWindow * parent) 6717 -{ 6718 -// 6719 -// creating the MAIN page 6720 -// 6721 - wxPanel *panel = new wxPanel(parent, ID_PANE_MAIN); 6722 - wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 6723 - panel->SetSizer(topSizer); 6724 - wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 6725 - topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 6726 -// First row: Layer name 6727 - boxSizer->AddSpacer(50); 6728 - wxBoxSizer *lyrBoxSizer = new wxBoxSizer(wxVERTICAL); 6729 - boxSizer->Add(lyrBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6730 - wxBoxSizer *nameSizer = new wxBoxSizer(wxVERTICAL); 6731 - lyrBoxSizer->Add(nameSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6732 - wxStaticBox *nameBox = new wxStaticBox(panel, wxID_ANY, 6733 - wxT("Layer FullName"), 6734 - wxDefaultPosition, 6735 - wxDefaultSize); 6736 - wxBoxSizer *nameBoxSizer = new wxStaticBoxSizer(nameBox, wxHORIZONTAL); 6737 - nameSizer->Add(nameBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6738 - wxString fullName = DbPrefix + wxT(".") + LayerName; 6739 - wxTextCtrl *nameCtrl = new wxTextCtrl(panel, ID_VECTOR_LAYER, fullName, 6740 - wxDefaultPosition, wxSize(370, 22), 6741 - wxTE_READONLY); 6742 - nameBoxSizer->Add(nameCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6743 - wxStaticBox *typeBox = new wxStaticBox(panel, wxID_ANY, 6744 - wxT("Geometry Type"), 6745 - wxDefaultPosition, 6746 - wxDefaultSize); 6747 - wxBoxSizer *typeBoxSizer = new wxStaticBoxSizer(typeBox, wxHORIZONTAL); 6748 - nameSizer->Add(typeBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6749 - wxString typeName = wxT("UNKNOWN"); 6750 - if (Type == MAP_LAYER_NETWORK) 6751 - typeName = wxT("Network (ISO TopoNet)"); 6752 - if (Type == MAP_LAYER_TOPOLOGY) 6753 - typeName = wxT("Topology (ISO TopoGeo)"); 6754 - wxTextCtrl *typeCtrl = new wxTextCtrl(panel, ID_VECTOR_TYPE, typeName, 6755 - wxDefaultPosition, wxSize(370, 22), 6756 - wxTE_READONLY); 6757 - typeBoxSizer->Add(typeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6758 - wxStaticBox *uuidBox = new wxStaticBox(panel, wxID_ANY, 6759 - wxT("QuickStyle Name"), 6760 - wxDefaultPosition, 6761 - wxDefaultSize); 6762 - wxBoxSizer *uuidBoxSizer = new wxStaticBoxSizer(uuidBox, wxHORIZONTAL); 6763 - nameSizer->Add(uuidBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6764 - wxString uuid = wxString::FromUTF8(Style->GetUUID()); 6765 - wxTextCtrl *uuidCtrl = new wxTextCtrl(panel, ID_VECTOR_UUID, uuid, 6766 - wxDefaultPosition, wxSize(370, 22), 6767 - wxTE_READONLY); 6768 - uuidBoxSizer->Add(uuidCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6769 - boxSizer->AddSpacer(25); 6770 -// second row: Visibility Range 6771 - wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); 6772 - boxSizer->Add(miscSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 6773 - wxBoxSizer *visibilityBoxSizer = new wxBoxSizer(wxHORIZONTAL); 6774 - miscSizer->Add(visibilityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 6775 - wxStaticBox *visibilityBox = new wxStaticBox(panel, wxID_STATIC, 6776 - wxT("Visibility Range"), 6777 - wxDefaultPosition, 6778 - wxDefaultSize); 6779 - wxBoxSizer *visibilitySizer = 6780 - new wxStaticBoxSizer(visibilityBox, wxHORIZONTAL); 6781 - visibilityBoxSizer->Add(visibilitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 6782 - 5); 6783 - wxString range[4]; 6784 - range[0] = wxT("&None"); 6785 - range[1] = wxT("&Min"); 6786 - range[2] = wxT("&Max"); 6787 - range[3] = wxT("&Both"); 6788 - wxRadioBox *rangeBox = new wxRadioBox(panel, ID_SYMBOLIZER_MINMAX_SCALE, 6789 - wxT("&Range Type"), 6790 - wxDefaultPosition, 6791 - wxDefaultSize, 4, 6792 - range, 2, 6793 - wxRA_SPECIFY_COLS); 6794 - visibilitySizer->Add(rangeBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6795 - rangeBox->SetSelection(0); 6796 - visibilitySizer->AddSpacer(20); 6797 - wxBoxSizer *scaleBoxSizer = new wxBoxSizer(wxVERTICAL); 6798 - visibilitySizer->Add(scaleBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6799 - wxBoxSizer *scaleMinSizer = new wxBoxSizer(wxHORIZONTAL); 6800 - scaleBoxSizer->Add(scaleMinSizer, 0, wxALIGN_RIGHT | wxALL, 5); 6801 - wxStaticText *minScaleLabel = 6802 - new wxStaticText(panel, wxID_STATIC, wxT("&Min Scale:")); 6803 - scaleMinSizer->Add(minScaleLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6804 - wxTextCtrl *minScaleCtrl = 6805 - new wxTextCtrl(panel, ID_SYMBOLIZER_MIN_SCALE, wxT("0.0"), 6806 - wxDefaultPosition, wxSize(100, 22)); 6807 - minScaleCtrl->Enable(false); 6808 - scaleMinSizer->Add(minScaleCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6809 - wxBoxSizer *scaleMaxSizer = new wxBoxSizer(wxHORIZONTAL); 6810 - scaleBoxSizer->Add(scaleMaxSizer, 0, wxALIGN_RIGHT | wxALL, 0); 6811 - wxStaticText *maxScaleLabel = 6812 - new wxStaticText(panel, wxID_STATIC, wxT("&Max Scale:")); 6813 - scaleMaxSizer->Add(maxScaleLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6814 - wxTextCtrl *maxScaleCtrl = 6815 - new wxTextCtrl(panel, ID_SYMBOLIZER_MAX_SCALE, wxT("+Infinite"), 6816 - wxDefaultPosition, wxSize(100, 22)); 6817 - maxScaleCtrl->Enable(false); 6818 - scaleMaxSizer->Add(maxScaleCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6819 - panel->SetSizer(topSizer); 6820 - topSizer->Fit(panel); 6821 -// appends event handlers 6822 - Connect(ID_SYMBOLIZER_MINMAX_SCALE, wxEVT_COMMAND_RADIOBOX_SELECTED, 6823 - (wxObjectEventFunction) & 6824 - QuickStyleTopologyDialog::OnCmdScaleChanged); 6825 - return panel; 6826 -} 6827 - 6828 -void QuickStyleTopologyDialog:: 6829 -OnCmdScaleChanged(wxCommandEvent & WXUNUSED(event)) 6830 -{ 6831 -// 6832 -// Visibility Range selection changed 6833 -// 6834 - wxRadioBox *scaleModeCtrl = 6835 - (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MINMAX_SCALE); 6836 - wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); 6837 - wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); 6838 - switch (scaleModeCtrl->GetSelection()) 6839 - { 6840 - case 0: 6841 - Style->EnableMinScale(false); 6842 - Style->EnableMaxScale(false); 6843 - minCtrl->SetValue(wxT("0.0")); 6844 - minCtrl->Enable(false); 6845 - maxCtrl->SetValue(wxT("+Infinite")); 6846 - maxCtrl->Enable(false); 6847 - break; 6848 - case 1: 6849 - Style->EnableMinScale(true); 6850 - Style->EnableMaxScale(false); 6851 - minCtrl->SetValue(wxT("")); 6852 - minCtrl->Enable(true); 6853 - maxCtrl->SetValue(wxT("+Infinite")); 6854 - maxCtrl->Enable(false); 6855 - break; 6856 - case 2: 6857 - Style->EnableMinScale(false); 6858 - Style->EnableMaxScale(true); 6859 - minCtrl->SetValue(wxT("0.0")); 6860 - minCtrl->Enable(false); 6861 - maxCtrl->SetValue(wxT("")); 6862 - maxCtrl->Enable(true); 6863 - break; 6864 - case 3: 6865 - Style->EnableMinScale(true); 6866 - Style->EnableMaxScale(true); 6867 - minCtrl->SetValue(wxT("")); 6868 - minCtrl->Enable(true); 6869 - maxCtrl->SetValue(wxT("")); 6870 - maxCtrl->Enable(true); 6871 - break; 6872 - }; 6873 -} 6874 - 6875 -wxPanel *QuickStyleTopologyDialog::CreateNodePage(wxWindow * parent) 6876 -{ 6877 -// 6878 -// creating the Node Symbolizer page 6879 -// 6880 - wxString StrokeColor = wxT("#000000"); 6881 - wxString FillColor = wxT("#808080"); 6882 - wxPanel *panel = new wxPanel(parent, ID_PANE_POINT); 6883 - wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 6884 - panel->SetSizer(topSizer); 6885 - wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 6886 - topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 6887 -// first row A: Opacity 6888 - wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); 6889 - boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 6890 - wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, 6891 - wxT("Opacity"), 6892 - wxDefaultPosition, 6893 - wxDefaultSize); 6894 - wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); 6895 - opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 6896 - wxSlider *opacityCtrl = 6897 - new wxSlider(panel, ID_SYMBOLIZER_NODE_OPACITY, 100, 0, 100, 6898 - wxDefaultPosition, wxSize(600, 45), 6899 - wxSL_HORIZONTAL | wxSL_LABELS); 6900 - opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6901 -// Well Known Mark Name 6902 - wxBoxSizer *box1Sizer = new wxBoxSizer(wxHORIZONTAL); 6903 - boxSizer->Add(box1Sizer, 0, wxALIGN_CENTER | wxALL, 5); 6904 - wxBoxSizer *markSizer = new wxBoxSizer(wxHORIZONTAL); 6905 - box1Sizer->Add(markSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 6906 - wxString mark[6]; 6907 - mark[0] = wxT("&Square"); 6908 - mark[1] = wxT("&Circle"); 6909 - mark[2] = wxT("&Triangle"); 6910 - mark[3] = wxT("&Star"); 6911 - mark[4] = wxT("&Cross"); 6912 - mark[5] = wxT("&X"); 6913 - wxRadioBox *markBox = new wxRadioBox(panel, ID_SYMBOLIZER_NODE_MARK, 6914 - wxT("&Mark"), 6915 - wxDefaultPosition, 6916 - wxDefaultSize, 6, 6917 - mark, 1, 6918 - wxRA_SPECIFY_COLS); 6919 - markSizer->Add(markBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6920 - markBox->SetSelection(0); 6921 -// second row: Size and Rotation 6922 - wxBoxSizer *box2Sizer = new wxBoxSizer(wxVERTICAL); 6923 - box1Sizer->Add(box2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 6924 - wxBoxSizer *sizeBoxSizer = new wxBoxSizer(wxHORIZONTAL); 6925 - box2Sizer->Add(sizeBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 6926 -// second row A: Size 6927 - wxStaticBox *sizeBox = new wxStaticBox(panel, wxID_STATIC, 6928 - wxT("Size"), 6929 - wxDefaultPosition, 6930 - wxDefaultSize); 6931 - wxBoxSizer *sizeSizer = new wxStaticBoxSizer(sizeBox, wxVERTICAL); 6932 - sizeBoxSizer->Add(sizeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 6933 - wxBoxSizer *size1Sizer = new wxBoxSizer(wxHORIZONTAL); 6934 - sizeSizer->Add(size1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 6935 - wxTextCtrl *sizeCtrl = 6936 - new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_SIZE, wxT("16.0"), 6937 - wxDefaultPosition, wxSize(100, 22)); 6938 - size1Sizer->Add(sizeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6939 -// second row B: Rotation 6940 - wxStaticBox *rotBox = new wxStaticBox(panel, wxID_STATIC, 6941 - wxT("Rotation"), 6942 - wxDefaultPosition, 6943 - wxDefaultSize); 6944 - wxBoxSizer *rotSizer = new wxStaticBoxSizer(rotBox, wxVERTICAL); 6945 - sizeBoxSizer->Add(rotSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 6946 - wxBoxSizer *rot1Sizer = new wxBoxSizer(wxHORIZONTAL); 6947 - rotSizer->Add(rot1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 6948 - wxTextCtrl *rotCtrl = 6949 - new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_ROTATION, wxT("0.0"), 6950 - wxDefaultPosition, wxSize(100, 22)); 6951 - rot1Sizer->Add(rotCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6952 -// third row: AnchorNode and Displacement 6953 - wxBoxSizer *anchorBoxSizer = new wxBoxSizer(wxHORIZONTAL); 6954 - box2Sizer->Add(anchorBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 6955 -// third row A: Anchor Node 6956 - wxStaticBox *anchorBox = new wxStaticBox(panel, wxID_STATIC, 6957 - wxT("Anchor Node"), 6958 - wxDefaultPosition, 6959 - wxDefaultSize); 6960 - wxBoxSizer *anchorSizer = new wxStaticBoxSizer(anchorBox, wxVERTICAL); 6961 - anchorBoxSizer->Add(anchorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 6962 - wxBoxSizer *anchor1Sizer = new wxBoxSizer(wxHORIZONTAL); 6963 - anchorSizer->Add(anchor1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 6964 - wxStaticText *anchor1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); 6965 - anchor1Sizer->Add(anchor1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6966 - wxTextCtrl *anchorXCtrl = 6967 - new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_ANCHOR_X, wxT("0.5"), 6968 - wxDefaultPosition, wxSize(100, 22)); 6969 - anchor1Sizer->Add(anchorXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6970 - wxBoxSizer *anchor2Sizer = new wxBoxSizer(wxHORIZONTAL); 6971 - anchorSizer->Add(anchor2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 6972 - wxStaticText *anchor2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); 6973 - anchor2Sizer->Add(anchor2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6974 - wxTextCtrl *anchorYCtrl = 6975 - new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_ANCHOR_Y, wxT("0.5"), 6976 - wxDefaultPosition, wxSize(100, 22)); 6977 - anchor2Sizer->Add(anchorYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6978 -// third row B: Displacement 6979 - wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, 6980 - wxT("Displacement"), 6981 - wxDefaultPosition, 6982 - wxDefaultSize); 6983 - wxBoxSizer *displacementSizer = 6984 - new wxStaticBoxSizer(displacementBox, wxVERTICAL); 6985 - anchorBoxSizer->Add(displacementSizer, 0, 6986 - wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 6987 - wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); 6988 - displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 6989 - wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); 6990 - displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6991 - wxTextCtrl *displacementXCtrl = 6992 - new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_DISPLACEMENT_X, wxT("0.0"), 6993 - wxDefaultPosition, wxSize(100, 22)); 6994 - displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6995 - wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); 6996 - displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 6997 - wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); 6998 - displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 6999 - wxTextCtrl *displacementYCtrl = 7000 - new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_DISPLACEMENT_Y, wxT("0.0"), 7001 - wxDefaultPosition, wxSize(100, 22)); 7002 - displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7003 -// fourth row: colors 7004 - wxBoxSizer *box3Sizer = new wxBoxSizer(wxHORIZONTAL); 7005 - boxSizer->Add(box3Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7006 -// first row A: Fill Color 7007 - wxBoxSizer *fillBoxSizer = new wxBoxSizer(wxVERTICAL); 7008 - box3Sizer->Add(fillBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7009 - wxStaticBox *colorFillBox = new wxStaticBox(panel, wxID_STATIC, 7010 - wxT("Fill Color"), 7011 - wxDefaultPosition, 7012 - wxDefaultSize); 7013 - wxBoxSizer *colorFillSizer = new wxStaticBoxSizer(colorFillBox, wxVERTICAL); 7014 - box3Sizer->Add(colorFillSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 7015 - wxBoxSizer *fill1Sizer = new wxBoxSizer(wxHORIZONTAL); 7016 - colorFillSizer->Add(fill1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 7017 - wxTextCtrl *fillColorCtrl = 7018 - new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_FILL_COLOR, FillColor, 7019 - wxDefaultPosition, wxSize(80, 22)); 7020 - fill1Sizer->Add(fillColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7021 - wxBitmap bmp; 7022 - wxColour color(0, 0, 0); 7023 - ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 7024 - wxStaticBitmap *sampleFillCtrl = 7025 - new wxStaticBitmap(panel, ID_SYMBOLIZER_NODE_FILL_PICKER_HEX, bmp, 7026 - wxDefaultPosition, wxSize(32, 32)); 7027 - fill1Sizer->Add(sampleFillCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7028 - wxButton *pickFill = new wxButton(panel, ID_SYMBOLIZER_NODE_FILL_PICKER_BTN, 7029 - wxT("&Pick a color")); 7030 - fill1Sizer->Add(pickFill, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7031 -// second row B: Stroke Color 7032 - box3Sizer->AddSpacer(30); 7033 - wxStaticBox *colorStrokeBox = new wxStaticBox(panel, wxID_STATIC, 7034 - wxT("Stroke Color"), 7035 - wxDefaultPosition, 7036 - wxDefaultSize); 7037 - wxBoxSizer *colorStrokeSizer = 7038 - new wxStaticBoxSizer(colorStrokeBox, wxVERTICAL); 7039 - box3Sizer->Add(colorStrokeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 7040 - wxBoxSizer *stroke1Sizer = new wxBoxSizer(wxHORIZONTAL); 7041 - colorStrokeSizer->Add(stroke1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 7042 - wxTextCtrl *strokeColorCtrl = 7043 - new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_STROKE_COLOR, StrokeColor, 7044 - wxDefaultPosition, wxSize(80, 22)); 7045 - stroke1Sizer->Add(strokeColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7046 - wxStaticBitmap *sampleStrokeCtrl = 7047 - new wxStaticBitmap(panel, ID_SYMBOLIZER_NODE_STROKE_PICKER_HEX, bmp, 7048 - wxDefaultPosition, wxSize(32, 32)); 7049 - stroke1Sizer->Add(sampleStrokeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7050 - wxButton *pickStroke = 7051 - new wxButton(panel, ID_SYMBOLIZER_NODE_STROKE_PICKER_BTN, 7052 - wxT("&Pick a color")); 7053 - stroke1Sizer->Add(pickStroke, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7054 - panel->SetSizer(topSizer); 7055 - topSizer->Fit(panel); 7056 -// appends event handlers 7057 - Connect(ID_SYMBOLIZER_NODE_MARK, wxEVT_COMMAND_RADIOBOX_SELECTED, 7058 - (wxObjectEventFunction) & 7059 - QuickStyleTopologyDialog::OnCmdNodeMarkChanged); 7060 - Connect(ID_SYMBOLIZER_NODE_FILL_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 7061 - (wxObjectEventFunction) & 7062 - QuickStyleTopologyDialog::OnCmdNodeColorFillPicker); 7063 - Connect(ID_SYMBOLIZER_NODE_FILL_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 7064 - (wxObjectEventFunction) & 7065 - QuickStyleTopologyDialog::OnCmdNodeColorFillChanged); 7066 - Connect(ID_SYMBOLIZER_NODE_STROKE_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 7067 - (wxObjectEventFunction) & 7068 - QuickStyleTopologyDialog::OnCmdNodeColorStrokePicker); 7069 - Connect(ID_SYMBOLIZER_NODE_STROKE_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 7070 - (wxObjectEventFunction) & 7071 - QuickStyleTopologyDialog::OnCmdNodeColorStrokeChanged); 7072 - return panel; 7073 -} 7074 - 7075 -void QuickStyleTopologyDialog:: 7076 -OnCmdNodeMarkChanged(wxCommandEvent & WXUNUSED(event)) 7077 -{ 7078 -// 7079 -// Mark selection changed 7080 -// 7081 - wxRadioBox *markCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_NODE_MARK); 7082 - switch (markCtrl->GetSelection()) 7083 - { 7084 - case 1: 7085 - Style->SetNodeWellKnownMark(RL2_GRAPHIC_MARK_CIRCLE); 7086 - break; 7087 - case 2: 7088 - Style->SetNodeWellKnownMark(RL2_GRAPHIC_MARK_TRIANGLE); 7089 - break; 7090 - case 3: 7091 - Style->SetNodeWellKnownMark(RL2_GRAPHIC_MARK_STAR); 7092 - break; 7093 - case 4: 7094 - Style->SetNodeWellKnownMark(RL2_GRAPHIC_MARK_CROSS); 7095 - break; 7096 - case 5: 7097 - Style->SetNodeWellKnownMark(RL2_GRAPHIC_MARK_X); 7098 - break; 7099 - default: 7100 - Style->SetNodeWellKnownMark(RL2_GRAPHIC_MARK_SQUARE); 7101 - break; 7102 - }; 7103 -} 7104 - 7105 -void QuickStyleTopologyDialog:: 7106 -OnCmdNodeColorFillChanged(wxCommandEvent & WXUNUSED(event)) 7107 -{ 7108 -// 7109 -// Fill color changed: updating the visual sample 7110 -// 7111 - wxTextCtrl *colorCtrl = 7112 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_FILL_COLOR); 7113 - wxStaticBitmap *sampleCtrl = 7114 - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_NODE_FILL_PICKER_HEX); 7115 - wxColour back = wxColour(255, 255, 255); 7116 - wxString str = colorCtrl->GetValue(); 7117 - if (ColorMapEntry::IsValidColor(str) == true) 7118 - ColorMapEntry::GetWxColor(str, back); 7119 - wxBitmap bmp; 7120 - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 7121 - sampleCtrl->SetBitmap(bmp); 7122 - sampleCtrl->Refresh(); 7123 - sampleCtrl->Update(); 7124 -} 7125 - 7126 -void QuickStyleTopologyDialog:: 7127 -OnCmdNodeColorFillPicker(wxCommandEvent & WXUNUSED(event)) 7128 -{ 7129 -// 7130 -// color picker 7131 -// 7132 - wxTextCtrl *colorCtrl = 7133 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_FILL_COLOR); 7134 - wxColour clr = wxNullColour; 7135 - wxString str = colorCtrl->GetValue(); 7136 - if (ColorMapEntry::IsValidColor(str) == true) 7137 - ColorMapEntry::GetWxColor(str, clr); 7138 - wxColour color = wxGetColourFromUser(this, clr); 7139 - if (color.IsOk() == true) 7140 - { 7141 - char hex[16]; 7142 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 7143 - wxString str = wxString::FromUTF8(hex); 7144 - colorCtrl->SetValue(str); 7145 - } 7146 -} 7147 - 7148 -void QuickStyleTopologyDialog:: 7149 -OnCmdNodeColorStrokeChanged(wxCommandEvent & WXUNUSED(event)) 7150 -{ 7151 -// 7152 -// Stroke color changed: updating the visual sample 7153 -// 7154 - wxTextCtrl *colorCtrl = 7155 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_STROKE_COLOR); 7156 - wxStaticBitmap *sampleCtrl = 7157 - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_NODE_STROKE_PICKER_HEX); 7158 - wxColour back = wxColour(255, 255, 255); 7159 - wxString str = colorCtrl->GetValue(); 7160 - if (ColorMapEntry::IsValidColor(str) == true) 7161 - ColorMapEntry::GetWxColor(str, back); 7162 - wxBitmap bmp; 7163 - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 7164 - sampleCtrl->SetBitmap(bmp); 7165 - sampleCtrl->Refresh(); 7166 - sampleCtrl->Update(); 7167 -} 7168 - 7169 -void QuickStyleTopologyDialog:: 7170 -OnCmdNodeColorStrokePicker(wxCommandEvent & WXUNUSED(event)) 7171 -{ 7172 -// 7173 -// color picker 7174 -// 7175 - wxTextCtrl *colorCtrl = 7176 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_STROKE_COLOR); 7177 - wxColour clr = wxNullColour; 7178 - wxString str = colorCtrl->GetValue(); 7179 - if (ColorMapEntry::IsValidColor(str) == true) 7180 - ColorMapEntry::GetWxColor(str, clr); 7181 - wxColour color = wxGetColourFromUser(this, clr); 7182 - if (color.IsOk() == true) 7183 - { 7184 - char hex[16]; 7185 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 7186 - wxString str = wxString::FromUTF8(hex); 7187 - colorCtrl->SetValue(str); 7188 - } 7189 -} 7190 - 7191 -wxPanel *QuickStyleTopologyDialog::CreateEdgeLinkPage(wxWindow * parent) 7192 -{ 7193 -// 7194 -// creating the EdgeLink Symbolizer page 7195 -// 7196 - wxString StrokeColor = wxT("#000000"); 7197 - wxPanel *panel = new wxPanel(parent, ID_PANE_LINE); 7198 - wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 7199 - panel->SetSizer(topSizer); 7200 - wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 7201 - topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 7202 -// first row A: the Stroke #1 Opacity and Perpendicular Offset 7203 - boxSizer->AddSpacer(50); 7204 - wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxVERTICAL); 7205 - boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7206 - wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, 7207 - wxT("Opacity"), 7208 - wxDefaultPosition, 7209 - wxDefaultSize); 7210 - wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxHORIZONTAL); 7211 - opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7212 - wxSlider *opacityCtrl = 7213 - new wxSlider(panel, ID_SYMBOLIZER_STROKE1_OPACITY, 100, 0, 100, 7214 - wxDefaultPosition, wxSize(600, 45), 7215 - wxSL_HORIZONTAL | wxSL_LABELS); 7216 - opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7217 -// first row B: PerpendicularOffset 7218 - wxBoxSizer *perpendicularBoxSizer = new wxBoxSizer(wxHORIZONTAL); 7219 - opacityBoxSizer->Add(perpendicularBoxSizer, 0, 7220 - wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7221 - wxStaticBox *perpendicularBox = new wxStaticBox(panel, wxID_STATIC, 7222 - wxT("Perpendicular Offset"), 7223 - wxDefaultPosition, 7224 - wxDefaultSize); 7225 - wxBoxSizer *perpendicularSizer = 7226 - new wxStaticBoxSizer(perpendicularBox, wxVERTICAL); 7227 - perpendicularBoxSizer->Add(perpendicularSizer, 0, 7228 - wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 7229 - wxBoxSizer *perp1Sizer = new wxBoxSizer(wxHORIZONTAL); 7230 - perpendicularSizer->Add(perp1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7231 - wxTextCtrl *perpendicularCtrl = 7232 - new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE1_PERPENDICULAR, wxT("0.0"), 7233 - wxDefaultPosition, wxSize(100, 22)); 7234 - perp1Sizer->Add(perpendicularCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 7235 - wxStaticText *perp1Label = new wxStaticText(panel, wxID_STATIC, 7236 - wxT 7237 - ("Draw lines in parallel to the original geometry.")); 7238 - perp1Sizer->Add(perp1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 7239 - wxStaticText *perp2Label = new wxStaticText(panel, wxID_STATIC, 7240 - wxT 7241 - ("Positive to the left-hand side. Negative numbers mean right.")); 7242 - perpendicularSizer->Add(perp2Label, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7243 -// second row: Stroke color or Graphic 7244 - wxBoxSizer *strokeSizer = new wxBoxSizer(wxHORIZONTAL); 7245 - boxSizer->Add(strokeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7246 -// second row B: Stroke Color 7247 - wxBoxSizer *colorBoxSizer = new wxBoxSizer(wxHORIZONTAL); 7248 - strokeSizer->Add(colorBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 7249 - wxStaticBox *colorBox = new wxStaticBox(panel, wxID_STATIC, 7250 - wxT("Stroke Color"), 7251 - wxDefaultPosition, 7252 - wxDefaultSize); 7253 - wxBoxSizer *colorSizer = new wxStaticBoxSizer(colorBox, wxVERTICAL); 7254 - colorBoxSizer->Add(colorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7255 - wxBoxSizer *color1Sizer = new wxBoxSizer(wxHORIZONTAL); 7256 - colorSizer->Add(color1Sizer, 0, wxALIGN_RIGHT | wxALL, 0); 7257 - wxTextCtrl *colorCtrl = 7258 - new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE1_COLOR, StrokeColor, 7259 - wxDefaultPosition, wxSize(80, 22)); 7260 - color1Sizer->Add(colorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7261 - wxBitmap bmp; 7262 - wxColour color(0, 0, 0); 7263 - ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 7264 - wxStaticBitmap *sampleCtrl = 7265 - new wxStaticBitmap(panel, ID_SYMBOLIZER_STROKE1_PICKER_HEX, bmp, 7266 - wxDefaultPosition, wxSize(32, 32)); 7267 - color1Sizer->Add(sampleCtrl, 0, wxALIGN_RIGHT | wxALL, 5); 7268 - wxBoxSizer *pickerSizer = new wxBoxSizer(wxHORIZONTAL); 7269 - colorSizer->Add(pickerSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7270 - wxButton *pick = 7271 - new wxButton(panel, ID_SYMBOLIZER_STROKE1_PICKER_BTN, wxT("&Pick a color")); 7272 - pickerSizer->Add(pick, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 7273 -// third row: Stroke-Width 7274 - wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); 7275 - colorBoxSizer->Add(miscSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 7276 -// third row A: StrokeWidth 7277 - wxBoxSizer *widthBoxSizer = new wxBoxSizer(wxHORIZONTAL); 7278 - miscSizer->Add(widthBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 7279 - wxStaticBox *widthBox = new wxStaticBox(panel, wxID_STATIC, 7280 - wxT("Stroke Width"), 7281 - wxDefaultPosition, 7282 - wxDefaultSize); 7283 - wxBoxSizer *widthSizer = new wxStaticBoxSizer(widthBox, wxVERTICAL); 7284 - widthBoxSizer->Add(widthSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 7285 - wxTextCtrl *widthCtrl = 7286 - new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE1_WIDTH, wxT("1.0"), 7287 - wxDefaultPosition, wxSize(100, 22)); 7288 - widthSizer->Add(widthCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7289 -// third row D: DashArray and DashOffset 7290 - wxBoxSizer *dashBoxSizer = new wxBoxSizer(wxHORIZONTAL); 7291 - miscSizer->Add(dashBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 7292 - wxString dot[4]; 7293 - if (Type == MAP_LAYER_NETWORK) 7294 - { 7295 - dot[0] = wxT("&Solid Link"); 7296 - dot[1] = wxT("&Dotted Link"); 7297 - dot[2] = wxT("&Dashed Link"); 7298 - dot[3] = wxT("&Dashed/Dotted Link"); 7299 - } else 7300 - { 7301 - dot[0] = wxT("&Solid Edge"); 7302 - dot[1] = wxT("&Dotted Edge"); 7303 - dot[2] = wxT("&Dashed Edge"); 7304 - dot[3] = wxT("&Dashed/Dotted Edge"); 7305 - } 7306 - wxRadioBox *dotBox = new wxRadioBox(panel, ID_SYMBOLIZER_DASH_DOT, 7307 - wxT("&Dash/Dot Style"), 7308 - wxDefaultPosition, 7309 - wxDefaultSize, 4, 7310 - dot, 1, 7311 - wxRA_SPECIFY_COLS); 7312 - dotBox->SetSelection(0); 7313 - dashBoxSizer->Add(dotBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7314 - panel->SetSizer(topSizer); 7315 - topSizer->Fit(panel); 7316 -// appends event handlers 7317 - Connect(ID_SYMBOLIZER_STROKE1_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 7318 - (wxObjectEventFunction) & 7319 - QuickStyleTopologyDialog::OnCmdEdgeLinkColorChanged); 7320 - Connect(ID_SYMBOLIZER_STROKE1_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 7321 - (wxObjectEventFunction) & 7322 - QuickStyleTopologyDialog::OnCmdEdgeLinkColorPicker); 7323 - return panel; 7324 -} 7325 - 7326 -void QuickStyleTopologyDialog:: 7327 -OnCmdEdgeLinkColorChanged(wxCommandEvent & WXUNUSED(event)) 7328 -{ 7329 -// 7330 -// Stroke color changed: updating the visual sample 7331 -// 7332 - wxTextCtrl *colorCtrl = 7333 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); 7334 - wxStaticBitmap *sampleCtrl = 7335 - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_STROKE1_PICKER_HEX); 7336 - wxColour back = wxColour(255, 255, 255); 7337 - wxString str = colorCtrl->GetValue(); 7338 - if (ColorMapEntry::IsValidColor(str) == true) 7339 - ColorMapEntry::GetWxColor(str, back); 7340 - wxBitmap bmp; 7341 - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 7342 - sampleCtrl->SetBitmap(bmp); 7343 - sampleCtrl->Refresh(); 7344 - sampleCtrl->Update(); 7345 -} 7346 - 7347 -void QuickStyleTopologyDialog:: 7348 -OnCmdEdgeLinkColorPicker(wxCommandEvent & WXUNUSED(event)) 7349 -{ 7350 -// 7351 -// color picker 7352 -// 7353 - wxTextCtrl *colorCtrl = 7354 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); 7355 - wxColour clr = wxNullColour; 7356 - wxString str = colorCtrl->GetValue(); 7357 - if (ColorMapEntry::IsValidColor(str) == true) 7358 - ColorMapEntry::GetWxColor(str, clr); 7359 - wxColour color = wxGetColourFromUser(this, clr); 7360 - if (color.IsOk() == true) 7361 - { 7362 - char hex[16]; 7363 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 7364 - wxString str = wxString::FromUTF8(hex); 7365 - colorCtrl->SetValue(str); 7366 - } 7367 -} 7368 - 7369 -wxPanel *QuickStyleTopologyDialog::CreateFacePage(wxWindow * parent) 7370 -{ 7371 -// 7372 -// creating the Face Symbolizer page 7373 -// 7374 - wxString StrokeColor = wxT("#000000"); 7375 - wxString FillColor = wxT("#808080"); 7376 - wxPanel *panel = new wxPanel(parent, ID_PANE_FILL2); 7377 - wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 7378 - panel->SetSizer(topSizer); 7379 - wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 7380 - topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 7381 -// first row: the Face Displacement and Perpendicular Offset 7382 - wxBoxSizer *polygonBoxSizer = new wxBoxSizer(wxHORIZONTAL); 7383 - boxSizer->Add(polygonBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 7384 -// first row A: Displacement 7385 - wxBoxSizer *displacementBoxSizer = new wxBoxSizer(wxHORIZONTAL); 7386 - polygonBoxSizer->Add(displacementBoxSizer, 0, 7387 - wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7388 - wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, 7389 - wxT("Displacement"), 7390 - wxDefaultPosition, 7391 - wxDefaultSize); 7392 - wxBoxSizer *displacementSizer = 7393 - new wxStaticBoxSizer(displacementBox, wxVERTICAL); 7394 - displacementBoxSizer->Add(displacementSizer, 0, 7395 - wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 7396 - wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); 7397 - displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7398 - wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); 7399 - displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 7400 - wxTextCtrl *displacementXCtrl = 7401 - new wxTextCtrl(panel, ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_X, wxT("0.0"), 7402 - wxDefaultPosition, wxSize(100, 22)); 7403 - displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 7404 - wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); 7405 - displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7406 - wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); 7407 - displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 7408 - wxTextCtrl *displacementYCtrl = 7409 - new wxTextCtrl(panel, ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_Y, wxT("0.0"), 7410 - wxDefaultPosition, wxSize(100, 22)); 7411 - displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 7412 -// first row B: PerpendicularOffset 7413 - wxBoxSizer *perpendicularBoxSizer = new wxBoxSizer(wxHORIZONTAL); 7414 - polygonBoxSizer->Add(perpendicularBoxSizer, 0, 7415 - wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7416 - wxStaticBox *perpendicularBox = new wxStaticBox(panel, wxID_STATIC, 7417 - wxT("Perpendicular Offset"), 7418 - wxDefaultPosition, 7419 - wxDefaultSize); 7420 - wxBoxSizer *perpendicularSizer = 7421 - new wxStaticBoxSizer(perpendicularBox, wxVERTICAL); 7422 - perpendicularBoxSizer->Add(perpendicularSizer, 0, 7423 - wxALIGN_CENTER_VERTICAL | wxALL, 5); 7424 - wxBoxSizer *perp1Sizer = new wxBoxSizer(wxHORIZONTAL); 7425 - perpendicularSizer->Add(perp1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7426 - wxTextCtrl *perpendicularCtrl = 7427 - new wxTextCtrl(panel, ID_SYMBOLIZER_POLYGON1_PERPENDICULAR, wxT("0.0"), 7428 - wxDefaultPosition, wxSize(100, 22)); 7429 - perp1Sizer->Add(perpendicularCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 7430 - wxStaticText *perp1Label = new wxStaticText(panel, wxID_STATIC, 7431 - wxT 7432 - ("Positive: larger. / Negative: smaller.")); 7433 - perp1Sizer->Add(perp1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 7434 - wxStaticText *perp2Label = new wxStaticText(panel, wxID_STATIC, 7435 - wxT 7436 - ("Drawing polygons smaller or larger than their actual geometry (Buffer).")); 7437 - perpendicularSizer->Add(perp2Label, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7438 -// second row: Fill Opacity 7439 - wxBoxSizer *auxBoxSizer = new wxBoxSizer(wxHORIZONTAL); 7440 - boxSizer->Add(auxBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7441 - wxStaticBox *auxBox = new wxStaticBox(panel, wxID_STATIC, 7442 - wxT("Face Fill"), 7443 - wxDefaultPosition, 7444 - wxDefaultSize); 7445 - wxBoxSizer *auxSizer = new wxStaticBoxSizer(auxBox, wxHORIZONTAL); 7446 - auxBoxSizer->Add(auxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7447 - wxBoxSizer *enableSizer = new wxBoxSizer(wxHORIZONTAL); 7448 - auxSizer->Add(enableSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 7449 - wxCheckBox *enableCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_FILL2_ENABLE, 7450 - wxT("Enable"), 7451 - wxDefaultPosition, wxDefaultSize); 7452 - enableCtrl->SetValue(Style->IsFaceFill()); 7453 - enableSizer->Add(enableCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7454 - wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); 7455 - enableSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 7456 - wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, 7457 - wxT("Opacity"), 7458 - wxDefaultPosition, 7459 - wxDefaultSize); 7460 - wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); 7461 - opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7462 - wxSlider *opacityCtrl = 7463 - new wxSlider(panel, ID_SYMBOLIZER_FILL2_OPACITY, 100, 0, 100, 7464 - wxDefaultPosition, wxSize(400, 45), 7465 - wxSL_HORIZONTAL | wxSL_LABELS); 7466 - opacityCtrl->Enable(Style->IsFaceFill()); 7467 - opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7468 -// third row B: Fill Color 7469 - wxBoxSizer *colorBoxSizer = new wxBoxSizer(wxVERTICAL); 7470 - auxSizer->Add(colorBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7471 - wxStaticBox *colorBox = new wxStaticBox(panel, wxID_STATIC, 7472 - wxT("Fill Color"), 7473 - wxDefaultPosition, 7474 - wxDefaultSize); 7475 - wxBoxSizer *colorSizer = new wxStaticBoxSizer(colorBox, wxVERTICAL); 7476 - colorBoxSizer->Add(colorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7477 - wxBoxSizer *color1Sizer = new wxBoxSizer(wxHORIZONTAL); 7478 - colorSizer->Add(color1Sizer, 0, wxALIGN_RIGHT | wxALL, 0); 7479 - wxTextCtrl *colorCtrl = 7480 - new wxTextCtrl(panel, ID_SYMBOLIZER_FILL2_COLOR, FillColor, 7481 - wxDefaultPosition, wxSize(80, 22)); 7482 - color1Sizer->Add(colorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7483 - wxBitmap bmp; 7484 - wxColour color(0, 0, 0); 7485 - ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 7486 - wxStaticBitmap *sampleCtrl = 7487 - new wxStaticBitmap(panel, ID_SYMBOLIZER_FILL2_PICKER_HEX, bmp, 7488 - wxDefaultPosition, wxSize(32, 32)); 7489 - sampleCtrl->Enable(Style->IsFaceFill()); 7490 - color1Sizer->Add(sampleCtrl, 0, wxALIGN_RIGHT | wxALL, 5); 7491 - wxBoxSizer *pickerSizer = new wxBoxSizer(wxHORIZONTAL); 7492 - colorSizer->Add(pickerSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7493 - wxButton *pick = 7494 - new wxButton(panel, ID_SYMBOLIZER_FILL2_PICKER_BTN, wxT("&Pick a color")); 7495 - pick->Enable(Style->IsFaceFill()); 7496 - pickerSizer->Add(pick, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 7497 -// first row A: the Stroke #1 Opacity 7498 - wxBoxSizer *opacity2BoxSizer = new wxBoxSizer(wxHORIZONTAL); 7499 - boxSizer->Add(opacity2BoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 7500 - wxStaticBox *enableBox = new wxStaticBox(panel, wxID_STATIC, 7501 - wxT("Face Stroke"), 7502 - wxDefaultPosition, 7503 - wxDefaultSize); 7504 - wxBoxSizer *enable2Sizer = new wxStaticBoxSizer(enableBox, wxHORIZONTAL); 7505 - opacity2BoxSizer->Add(enable2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7506 - wxCheckBox *enable2Ctrl = new wxCheckBox(panel, ID_SYMBOLIZER_STROKE2_ENABLE, 7507 - wxT("Enable"), 7508 - wxDefaultPosition, wxDefaultSize); 7509 - enable2Ctrl->SetValue(Style->IsFaceStroke()); 7510 - enable2Sizer->Add(enable2Ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7511 - wxStaticBox *opacity2Box = new wxStaticBox(panel, wxID_STATIC, 7512 - wxT("Opacity"), 7513 - wxDefaultPosition, 7514 - wxDefaultSize); 7515 - wxBoxSizer *opacity2Sizer = new wxStaticBoxSizer(opacity2Box, wxVERTICAL); 7516 - enable2Sizer->Add(opacity2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7517 - wxSlider *opacity2Ctrl = 7518 - new wxSlider(panel, ID_SYMBOLIZER_STROKE2_OPACITY, 100, 0, 100, 7519 - wxDefaultPosition, wxSize(250, 45), 7520 - wxSL_HORIZONTAL | wxSL_LABELS); 7521 - opacity2Ctrl->Enable(Style->IsFaceStroke()); 7522 - opacity2Sizer->Add(opacity2Ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7523 -// second row B: Stroke Color 7524 - wxStaticBox *color2Box = new wxStaticBox(panel, wxID_STATIC, 7525 - wxT("Stroke Color"), 7526 - wxDefaultPosition, 7527 - wxDefaultSize); 7528 - wxBoxSizer *color2Sizer = new wxStaticBoxSizer(color2Box, wxVERTICAL); 7529 - enable2Sizer->Add(color2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 7530 - wxBoxSizer *color3Sizer = new wxBoxSizer(wxHORIZONTAL); 7531 - color2Sizer->Add(color3Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7532 - wxTextCtrl *color2Ctrl = 7533 - new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE2_COLOR, StrokeColor, 7534 - wxDefaultPosition, wxSize(80, 22)); 7535 - color2Ctrl->Enable(Style->IsFaceStroke()); 7536 - color3Sizer->Add(color2Ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7537 - wxStaticBitmap *sample2Ctrl = 7538 - new wxStaticBitmap(panel, ID_SYMBOLIZER_STROKE2_PICKER_HEX, bmp, 7539 - wxDefaultPosition, wxSize(32, 32)); 7540 - sample2Ctrl->Enable(Style->IsFaceStroke()); 7541 - color3Sizer->Add(sample2Ctrl, 0, wxALIGN_RIGHT | wxALL, 5); 7542 - wxBoxSizer *picker2Sizer = new wxBoxSizer(wxHORIZONTAL); 7543 - color2Sizer->Add(picker2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7544 - wxButton *pick2 = 7545 - new wxButton(panel, ID_SYMBOLIZER_STROKE2_PICKER_BTN, wxT("&Pick a color")); 7546 - pick2->Enable(Style->IsFaceStroke()); 7547 - picker2Sizer->Add(pick2, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 7548 -// third row: Stroke-Width, 7549 - wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); 7550 - enable2Sizer->Add(miscSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 7551 -// third row A: StrokeWidth 7552 - wxBoxSizer *widthBoxSizer = new wxBoxSizer(wxHORIZONTAL); 7553 - miscSizer->Add(widthBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 7554 - wxStaticBox *widthBox = new wxStaticBox(panel, wxID_STATIC, 7555 - wxT("Stroke Width"), 7556 - wxDefaultPosition, 7557 - wxDefaultSize); 7558 - wxBoxSizer *widthSizer = new wxStaticBoxSizer(widthBox, wxVERTICAL); 7559 - widthBoxSizer->Add(widthSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7560 - wxTextCtrl *widthCtrl = 7561 - new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE2_WIDTH, wxT("1.0"), 7562 - wxDefaultPosition, wxSize(100, 22)); 7563 - widthCtrl->Enable(false); 7564 - widthSizer->Add(widthCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7565 - 7566 - panel->SetSizer(topSizer); 7567 - topSizer->Fit(panel); 7568 -// appends event handlers 7569 - Connect(ID_SYMBOLIZER_STROKE2_ENABLE, wxEVT_COMMAND_CHECKBOX_CLICKED, 7570 - (wxObjectEventFunction) & 7571 - QuickStyleTopologyDialog::OnCmdFaceStrokeChanged); 7572 - Connect(ID_SYMBOLIZER_FILL2_ENABLE, wxEVT_COMMAND_CHECKBOX_CLICKED, 7573 - (wxObjectEventFunction) & 7574 - QuickStyleTopologyDialog::OnCmdFaceFillChanged); 7575 - Connect(ID_SYMBOLIZER_FILL2_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 7576 - (wxObjectEventFunction) & 7577 - QuickStyleTopologyDialog::OnCmdFaceColorFillChanged); 7578 - Connect(ID_SYMBOLIZER_FILL2_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 7579 - (wxObjectEventFunction) & 7580 - QuickStyleTopologyDialog::OnCmdFaceColorFillPicker); 7581 - Connect(ID_SYMBOLIZER_STROKE2_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 7582 - (wxObjectEventFunction) & 7583 - QuickStyleTopologyDialog::OnCmdFaceColorStrokeChanged); 7584 - Connect(ID_SYMBOLIZER_STROKE2_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 7585 - (wxObjectEventFunction) & 7586 - QuickStyleTopologyDialog::OnCmdFaceColorStrokePicker); 7587 - return panel; 7588 -} 7589 - 7590 -void QuickStyleTopologyDialog:: 7591 -OnCmdFaceStrokeChanged(wxCommandEvent & WXUNUSED(event)) 7592 -{ 7593 -// 7594 -// Stroke enable/disable 7595 -// 7596 - wxCheckBox *enableCtrl = 7597 - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_STROKE2_ENABLE); 7598 - if (enableCtrl->IsChecked() == true) 7599 - Style->SetFaceStroke(true); 7600 - else 7601 - Style->SetFaceStroke(false); 7602 - RetrieveFacePage(false); 7603 - UpdateFacePage(); 7604 -} 7605 - 7606 -void QuickStyleTopologyDialog:: 7607 -OnCmdFaceFillChanged(wxCommandEvent & WXUNUSED(event)) 7608 -{ 7609 -// 7610 -// Fill enable/disable 7611 -// 7612 - wxCheckBox *enableCtrl = 7613 - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_FILL2_ENABLE); 7614 - if (enableCtrl->IsChecked() == true) 7615 - Style->SetFaceFill(true); 7616 - else 7617 - Style->SetFaceFill(false); 7618 - RetrieveFacePage(false); 7619 - UpdateFacePage(); 7620 -} 7621 - 7622 -void QuickStyleTopologyDialog:: 7623 -OnCmdFaceColorFillChanged(wxCommandEvent & WXUNUSED(event)) 7624 -{ 7625 -// 7626 -// Fill color changed: updating the visual sample 7627 -// 7628 - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); 7629 - wxStaticBitmap *sampleCtrl = 7630 - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FILL2_PICKER_HEX); 7631 - wxColour back = wxColour(255, 255, 255); 7632 - wxString str = colorCtrl->GetValue(); 7633 - if (ColorMapEntry::IsValidColor(str) == true) 7634 - ColorMapEntry::GetWxColor(str, back); 7635 - wxBitmap bmp; 7636 - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 7637 - sampleCtrl->SetBitmap(bmp); 7638 - sampleCtrl->Refresh(); 7639 - sampleCtrl->Update(); 7640 -} 7641 - 7642 -void QuickStyleTopologyDialog:: 7643 -OnCmdFaceColorFillPicker(wxCommandEvent & WXUNUSED(event)) 7644 -{ 7645 -// 7646 -// color picker 7647 -// 7648 - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); 7649 - wxColour clr = wxNullColour; 7650 - wxString str = colorCtrl->GetValue(); 7651 - if (ColorMapEntry::IsValidColor(str) == true) 7652 - ColorMapEntry::GetWxColor(str, clr); 7653 - wxColour color = wxGetColourFromUser(this, clr); 7654 - if (color.IsOk() == true) 7655 - { 7656 - char hex[16]; 7657 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 7658 - wxString str = wxString::FromUTF8(hex); 7659 - colorCtrl->SetValue(str); 7660 - } 7661 -} 7662 - 7663 -void QuickStyleTopologyDialog:: 7664 -OnCmdFaceColorStrokeChanged(wxCommandEvent & WXUNUSED(event)) 7665 -{ 7666 -// 7667 -// Stroke color changed: updating the visual sample 7668 -// 7669 - wxTextCtrl *colorCtrl = 7670 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); 7671 - wxStaticBitmap *sampleCtrl = 7672 - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_STROKE2_PICKER_HEX); 7673 - wxColour back = wxColour(255, 255, 255); 7674 - wxString str = colorCtrl->GetValue(); 7675 - if (ColorMapEntry::IsValidColor(str) == true) 7676 - ColorMapEntry::GetWxColor(str, back); 7677 - wxBitmap bmp; 7678 - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 7679 - sampleCtrl->SetBitmap(bmp); 7680 - sampleCtrl->Refresh(); 7681 - sampleCtrl->Update(); 7682 -} 7683 - 7684 -void QuickStyleTopologyDialog:: 7685 -OnCmdFaceColorStrokePicker(wxCommandEvent & WXUNUSED(event)) 7686 -{ 7687 -// 7688 -// color picker 7689 -// 7690 - wxTextCtrl *colorCtrl = 7691 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); 7692 - wxColour clr = wxNullColour; 7693 - wxString str = colorCtrl->GetValue(); 7694 - if (ColorMapEntry::IsValidColor(str) == true) 7695 - ColorMapEntry::GetWxColor(str, clr); 7696 - wxColour color = wxGetColourFromUser(this, clr); 7697 - if (color.IsOk() == true) 7698 - { 7699 - char hex[16]; 7700 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 7701 - wxString str = wxString::FromUTF8(hex); 7702 - colorCtrl->SetValue(str); 7703 - } 7704 -} 7705 - 7706 -wxPanel *QuickStyleTopologyDialog::CreateEdgeLinkSeedPage(wxWindow * parent) 7707 -{ 7708 -// 7709 -// creating the EdgeLinkSeed Symbolizer page 7710 -// 7711 - wxString StrokeColor = wxT("#000000"); 7712 - wxString FillColor = wxT("#808080"); 7713 - wxPanel *panel = new wxPanel(parent, ID_PANE_POINT); 7714 - wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 7715 - panel->SetSizer(topSizer); 7716 - wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 7717 - topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 7718 -// first row A: Opacity 7719 - wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); 7720 - boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7721 - wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, 7722 - wxT("Opacity"), 7723 - wxDefaultPosition, 7724 - wxDefaultSize); 7725 - wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); 7726 - opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7727 - wxSlider *opacityCtrl = 7728 - new wxSlider(panel, ID_SYMBOLIZER_EDGELINK_SEED_OPACITY, 100, 0, 100, 7729 - wxDefaultPosition, wxSize(600, 45), 7730 - wxSL_HORIZONTAL | wxSL_LABELS); 7731 - opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7732 -// Well Known Mark Name 7733 - wxBoxSizer *box1Sizer = new wxBoxSizer(wxHORIZONTAL); 7734 - boxSizer->Add(box1Sizer, 0, wxALIGN_CENTER | wxALL, 5); 7735 - wxBoxSizer *markSizer = new wxBoxSizer(wxHORIZONTAL); 7736 - box1Sizer->Add(markSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 7737 - wxString mark[6]; 7738 - mark[0] = wxT("&Square"); 7739 - mark[1] = wxT("&Circle"); 7740 - mark[2] = wxT("&Triangle"); 7741 - mark[3] = wxT("&Star"); 7742 - mark[4] = wxT("&Cross"); 7743 - mark[5] = wxT("&X"); 7744 - wxRadioBox *markBox = new wxRadioBox(panel, ID_SYMBOLIZER_EDGELINK_SEED_MARK, 7745 - wxT("&Mark"), 7746 - wxDefaultPosition, 7747 - wxDefaultSize, 6, 7748 - mark, 1, 7749 - wxRA_SPECIFY_COLS); 7750 - markSizer->Add(markBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7751 - markBox->SetSelection(0); 7752 -// second row: Size and Rotation 7753 - wxBoxSizer *box2Sizer = new wxBoxSizer(wxVERTICAL); 7754 - box1Sizer->Add(box2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7755 - wxBoxSizer *sizeBoxSizer = new wxBoxSizer(wxHORIZONTAL); 7756 - box2Sizer->Add(sizeBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7757 -// second row A: Size 7758 - wxStaticBox *sizeBox = new wxStaticBox(panel, wxID_STATIC, 7759 - wxT("Size"), 7760 - wxDefaultPosition, 7761 - wxDefaultSize); 7762 - wxBoxSizer *sizeSizer = new wxStaticBoxSizer(sizeBox, wxVERTICAL); 7763 - sizeBoxSizer->Add(sizeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 7764 - wxBoxSizer *size1Sizer = new wxBoxSizer(wxHORIZONTAL); 7765 - sizeSizer->Add(size1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7766 - wxTextCtrl *sizeCtrl = 7767 - new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_SIZE, wxT("16.0"), 7768 - wxDefaultPosition, wxSize(100, 22)); 7769 - size1Sizer->Add(sizeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7770 -// second row B: Rotation 7771 - wxStaticBox *rotBox = new wxStaticBox(panel, wxID_STATIC, 7772 - wxT("Rotation"), 7773 - wxDefaultPosition, 7774 - wxDefaultSize); 7775 - wxBoxSizer *rotSizer = new wxStaticBoxSizer(rotBox, wxVERTICAL); 7776 - sizeBoxSizer->Add(rotSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 7777 - wxBoxSizer *rot1Sizer = new wxBoxSizer(wxHORIZONTAL); 7778 - rotSizer->Add(rot1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7779 - wxTextCtrl *rotCtrl = 7780 - new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_ROTATION, wxT("0.0"), 7781 - wxDefaultPosition, wxSize(100, 22)); 7782 - rot1Sizer->Add(rotCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7783 -// third row: AnchorEdgeLinkSeed and Displacement 7784 - wxBoxSizer *anchorBoxSizer = new wxBoxSizer(wxHORIZONTAL); 7785 - box2Sizer->Add(anchorBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7786 -// third row A: Anchor EdgeLinkSeed 7787 - wxStaticBox *anchorBox = new wxStaticBox(panel, wxID_STATIC, 7788 - wxT("Anchor EdgeLinkSeed"), 7789 - wxDefaultPosition, 7790 - wxDefaultSize); 7791 - wxBoxSizer *anchorSizer = new wxStaticBoxSizer(anchorBox, wxVERTICAL); 7792 - anchorBoxSizer->Add(anchorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 7793 - wxBoxSizer *anchor1Sizer = new wxBoxSizer(wxHORIZONTAL); 7794 - anchorSizer->Add(anchor1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7795 - wxStaticText *anchor1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); 7796 - anchor1Sizer->Add(anchor1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7797 - wxTextCtrl *anchorXCtrl = 7798 - new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_ANCHOR_X, wxT("0.5"), 7799 - wxDefaultPosition, wxSize(100, 22)); 7800 - anchor1Sizer->Add(anchorXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7801 - wxBoxSizer *anchor2Sizer = new wxBoxSizer(wxHORIZONTAL); 7802 - anchorSizer->Add(anchor2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7803 - wxStaticText *anchor2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); 7804 - anchor2Sizer->Add(anchor2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7805 - wxTextCtrl *anchorYCtrl = 7806 - new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_ANCHOR_Y, wxT("0.5"), 7807 - wxDefaultPosition, wxSize(100, 22)); 7808 - anchor2Sizer->Add(anchorYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7809 -// third row B: Displacement 7810 - wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, 7811 - wxT("Displacement"), 7812 - wxDefaultPosition, 7813 - wxDefaultSize); 7814 - wxBoxSizer *displacementSizer = 7815 - new wxStaticBoxSizer(displacementBox, wxVERTICAL); 7816 - anchorBoxSizer->Add(displacementSizer, 0, 7817 - wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 7818 - wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); 7819 - displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7820 - wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); 7821 - displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7822 - wxTextCtrl *displacementXCtrl = 7823 - new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_DISPLACEMENT_X, 7824 - wxT("0.0"), 7825 - wxDefaultPosition, wxSize(100, 22)); 7826 - displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7827 - wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); 7828 - displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7829 - wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); 7830 - displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7831 - wxTextCtrl *displacementYCtrl = 7832 - new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_DISPLACEMENT_Y, 7833 - wxT("0.0"), 7834 - wxDefaultPosition, wxSize(100, 22)); 7835 - displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7836 -// fourth row: colors 7837 - wxBoxSizer *box3Sizer = new wxBoxSizer(wxHORIZONTAL); 7838 - boxSizer->Add(box3Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 7839 -// first row A: Fill Color 7840 - wxBoxSizer *fillBoxSizer = new wxBoxSizer(wxVERTICAL); 7841 - box3Sizer->Add(fillBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7842 - wxStaticBox *colorFillBox = new wxStaticBox(panel, wxID_STATIC, 7843 - wxT("Fill Color"), 7844 - wxDefaultPosition, 7845 - wxDefaultSize); 7846 - wxBoxSizer *colorFillSizer = new wxStaticBoxSizer(colorFillBox, wxVERTICAL); 7847 - box3Sizer->Add(colorFillSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 7848 - wxBoxSizer *fill1Sizer = new wxBoxSizer(wxHORIZONTAL); 7849 - colorFillSizer->Add(fill1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 7850 - wxTextCtrl *fillColorCtrl = 7851 - new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_FILL_COLOR, FillColor, 7852 - wxDefaultPosition, wxSize(80, 22)); 7853 - fill1Sizer->Add(fillColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7854 - wxBitmap bmp; 7855 - wxColour color(0, 0, 0); 7856 - ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 7857 - wxStaticBitmap *sampleFillCtrl = 7858 - new wxStaticBitmap(panel, ID_SYMBOLIZER_EDGELINK_SEED_FILL_PICKER_HEX, bmp, 7859 - wxDefaultPosition, wxSize(32, 32)); 7860 - fill1Sizer->Add(sampleFillCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7861 - wxButton *pickFill = 7862 - new wxButton(panel, ID_SYMBOLIZER_EDGELINK_SEED_FILL_PICKER_BTN, 7863 - wxT("&Pick a color")); 7864 - fill1Sizer->Add(pickFill, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7865 -// second row B: Stroke Color 7866 - box3Sizer->AddSpacer(30); 7867 - wxStaticBox *colorStrokeBox = new wxStaticBox(panel, wxID_STATIC, 7868 - wxT("Stroke Color"), 7869 - wxDefaultPosition, 7870 - wxDefaultSize); 7871 - wxBoxSizer *colorStrokeSizer = 7872 - new wxStaticBoxSizer(colorStrokeBox, wxVERTICAL); 7873 - box3Sizer->Add(colorStrokeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 7874 - wxBoxSizer *stroke1Sizer = new wxBoxSizer(wxHORIZONTAL); 7875 - colorStrokeSizer->Add(stroke1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 7876 - wxTextCtrl *strokeColorCtrl = 7877 - new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_STROKE_COLOR, StrokeColor, 7878 - wxDefaultPosition, wxSize(80, 22)); 7879 - stroke1Sizer->Add(strokeColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7880 - wxStaticBitmap *sampleStrokeCtrl = 7881 - new wxStaticBitmap(panel, ID_SYMBOLIZER_EDGELINK_SEED_STROKE_PICKER_HEX, 7882 - bmp, 7883 - wxDefaultPosition, wxSize(32, 32)); 7884 - stroke1Sizer->Add(sampleStrokeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7885 - wxButton *pickStroke = 7886 - new wxButton(panel, ID_SYMBOLIZER_EDGELINK_SEED_STROKE_PICKER_BTN, 7887 - wxT("&Pick a color")); 7888 - stroke1Sizer->Add(pickStroke, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 7889 - panel->SetSizer(topSizer); 7890 - topSizer->Fit(panel); 7891 -// appends event handlers 7892 - Connect(ID_SYMBOLIZER_EDGELINK_SEED_MARK, wxEVT_COMMAND_RADIOBOX_SELECTED, 7893 - (wxObjectEventFunction) & 7894 - QuickStyleTopologyDialog::OnCmdEdgeLinkSeedMarkChanged); 7895 - Connect(ID_SYMBOLIZER_EDGELINK_SEED_FILL_PICKER_BTN, 7896 - wxEVT_COMMAND_BUTTON_CLICKED, 7897 - (wxObjectEventFunction) & 7898 - QuickStyleTopologyDialog::OnCmdEdgeLinkSeedColorFillPicker); 7899 - Connect(ID_SYMBOLIZER_EDGELINK_SEED_FILL_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 7900 - (wxObjectEventFunction) & 7901 - QuickStyleTopologyDialog::OnCmdEdgeLinkSeedColorFillChanged); 7902 - Connect(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_PICKER_BTN, 7903 - wxEVT_COMMAND_BUTTON_CLICKED, 7904 - (wxObjectEventFunction) & 7905 - QuickStyleTopologyDialog::OnCmdEdgeLinkSeedColorStrokePicker); 7906 - Connect(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 7907 - (wxObjectEventFunction) & 7908 - QuickStyleTopologyDialog::OnCmdEdgeLinkSeedColorStrokeChanged); 7909 - return panel; 7910 -} 7911 - 7912 -void QuickStyleTopologyDialog:: 7913 -OnCmdEdgeLinkSeedMarkChanged(wxCommandEvent & WXUNUSED(event)) 7914 -{ 7915 -// 7916 -// Mark selection changed 7917 -// 7918 - wxRadioBox *markCtrl = 7919 - (wxRadioBox *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_MARK); 7920 - switch (markCtrl->GetSelection()) 7921 - { 7922 - case 1: 7923 - Style->SetEdgeLinkSeedWellKnownMark(RL2_GRAPHIC_MARK_CIRCLE); 7924 - break; 7925 - case 2: 7926 - Style->SetEdgeLinkSeedWellKnownMark(RL2_GRAPHIC_MARK_TRIANGLE); 7927 - break; 7928 - case 3: 7929 - Style->SetEdgeLinkSeedWellKnownMark(RL2_GRAPHIC_MARK_STAR); 7930 - break; 7931 - case 4: 7932 - Style->SetEdgeLinkSeedWellKnownMark(RL2_GRAPHIC_MARK_CROSS); 7933 - break; 7934 - case 5: 7935 - Style->SetEdgeLinkSeedWellKnownMark(RL2_GRAPHIC_MARK_X); 7936 - break; 7937 - default: 7938 - Style->SetEdgeLinkSeedWellKnownMark(RL2_GRAPHIC_MARK_SQUARE); 7939 - break; 7940 - }; 7941 -} 7942 - 7943 -void QuickStyleTopologyDialog:: 7944 -OnCmdEdgeLinkSeedColorFillChanged(wxCommandEvent & WXUNUSED(event)) 7945 -{ 7946 -// 7947 -// Fill color changed: updating the visual sample 7948 -// 7949 - wxTextCtrl *colorCtrl = 7950 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_FILL_COLOR); 7951 - wxStaticBitmap *sampleCtrl = 7952 - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_FILL_PICKER_HEX); 7953 - wxColour back = wxColour(255, 255, 255); 7954 - wxString str = colorCtrl->GetValue(); 7955 - if (ColorMapEntry::IsValidColor(str) == true) 7956 - ColorMapEntry::GetWxColor(str, back); 7957 - wxBitmap bmp; 7958 - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 7959 - sampleCtrl->SetBitmap(bmp); 7960 - sampleCtrl->Refresh(); 7961 - sampleCtrl->Update(); 7962 -} 7963 - 7964 -void QuickStyleTopologyDialog:: 7965 -OnCmdEdgeLinkSeedColorFillPicker(wxCommandEvent & WXUNUSED(event)) 7966 -{ 7967 -// 7968 -// color picker 7969 -// 7970 - wxTextCtrl *colorCtrl = 7971 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_FILL_COLOR); 7972 - wxColour clr = wxNullColour; 7973 - wxString str = colorCtrl->GetValue(); 7974 - if (ColorMapEntry::IsValidColor(str) == true) 7975 - ColorMapEntry::GetWxColor(str, clr); 7976 - wxColour color = wxGetColourFromUser(this, clr); 7977 - if (color.IsOk() == true) 7978 - { 7979 - char hex[16]; 7980 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 7981 - wxString str = wxString::FromUTF8(hex); 7982 - colorCtrl->SetValue(str); 7983 - } 7984 -} 7985 - 7986 -void QuickStyleTopologyDialog:: 7987 -OnCmdEdgeLinkSeedColorStrokeChanged(wxCommandEvent & WXUNUSED(event)) 7988 -{ 7989 -// 7990 -// Stroke color changed: updating the visual sample 7991 -// 7992 - wxTextCtrl *colorCtrl = 7993 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_COLOR); 7994 - wxStaticBitmap *sampleCtrl = 7995 - (wxStaticBitmap *) 7996 - FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_PICKER_HEX); 7997 - wxColour back = wxColour(255, 255, 255); 7998 - wxString str = colorCtrl->GetValue(); 7999 - if (ColorMapEntry::IsValidColor(str) == true) 8000 - ColorMapEntry::GetWxColor(str, back); 8001 - wxBitmap bmp; 8002 - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 8003 - sampleCtrl->SetBitmap(bmp); 8004 - sampleCtrl->Refresh(); 8005 - sampleCtrl->Update(); 8006 -} 8007 - 8008 -void QuickStyleTopologyDialog:: 8009 -OnCmdEdgeLinkSeedColorStrokePicker(wxCommandEvent & WXUNUSED(event)) 8010 -{ 8011 -// 8012 -// color picker 8013 -// 8014 - wxTextCtrl *colorCtrl = 8015 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_COLOR); 8016 - wxColour clr = wxNullColour; 8017 - wxString str = colorCtrl->GetValue(); 8018 - if (ColorMapEntry::IsValidColor(str) == true) 8019 - ColorMapEntry::GetWxColor(str, clr); 8020 - wxColour color = wxGetColourFromUser(this, clr); 8021 - if (color.IsOk() == true) 8022 - { 8023 - char hex[16]; 8024 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 8025 - wxString str = wxString::FromUTF8(hex); 8026 - colorCtrl->SetValue(str); 8027 - } 8028 -} 8029 - 8030 -wxPanel *QuickStyleTopologyDialog::CreateFaceSeedPage(wxWindow * parent) 8031 -{ 8032 -// 8033 -// creating the FaceSeed Symbolizer page 8034 -// 8035 - wxString StrokeColor = wxT("#000000"); 8036 - wxString FillColor = wxT("#808080"); 8037 - wxPanel *panel = new wxPanel(parent, ID_PANE_POINT); 8038 - wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 8039 - panel->SetSizer(topSizer); 8040 - wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 8041 - topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 8042 -// first row A: Opacity 8043 - wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); 8044 - boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 8045 - wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, 8046 - wxT("Opacity"), 8047 - wxDefaultPosition, 8048 - wxDefaultSize); 8049 - wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); 8050 - opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 8051 - wxSlider *opacityCtrl = 8052 - new wxSlider(panel, ID_SYMBOLIZER_FACE_SEED_OPACITY, 100, 0, 100, 8053 - wxDefaultPosition, wxSize(600, 45), 8054 - wxSL_HORIZONTAL | wxSL_LABELS); 8055 - opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 8056 -// Well Known Mark Name 8057 - wxBoxSizer *box1Sizer = new wxBoxSizer(wxHORIZONTAL); 8058 - boxSizer->Add(box1Sizer, 0, wxALIGN_CENTER | wxALL, 5); 8059 - wxBoxSizer *markSizer = new wxBoxSizer(wxHORIZONTAL); 8060 - box1Sizer->Add(markSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 8061 - wxString mark[6]; 8062 - mark[0] = wxT("&Square"); 8063 - mark[1] = wxT("&Circle"); 8064 - mark[2] = wxT("&Triangle"); 8065 - mark[3] = wxT("&Star"); 8066 - mark[4] = wxT("&Cross"); 8067 - mark[5] = wxT("&X"); 8068 - wxRadioBox *markBox = new wxRadioBox(panel, ID_SYMBOLIZER_FACE_SEED_MARK, 8069 - wxT("&Mark"), 8070 - wxDefaultPosition, 8071 - wxDefaultSize, 6, 8072 - mark, 1, 8073 - wxRA_SPECIFY_COLS); 8074 - markSizer->Add(markBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 8075 - markBox->SetSelection(0); 8076 -// second row: Size and Rotation 8077 - wxBoxSizer *box2Sizer = new wxBoxSizer(wxVERTICAL); 8078 - box1Sizer->Add(box2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 8079 - wxBoxSizer *sizeBoxSizer = new wxBoxSizer(wxHORIZONTAL); 8080 - box2Sizer->Add(sizeBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 8081 -// second row A: Size 8082 - wxStaticBox *sizeBox = new wxStaticBox(panel, wxID_STATIC, 8083 - wxT("Size"), 8084 - wxDefaultPosition, 8085 - wxDefaultSize); 8086 - wxBoxSizer *sizeSizer = new wxStaticBoxSizer(sizeBox, wxVERTICAL); 8087 - sizeBoxSizer->Add(sizeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 8088 - wxBoxSizer *size1Sizer = new wxBoxSizer(wxHORIZONTAL); 8089 - sizeSizer->Add(size1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 8090 - wxTextCtrl *sizeCtrl = 8091 - new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_SIZE, wxT("16.0"), 8092 - wxDefaultPosition, wxSize(100, 22)); 8093 - size1Sizer->Add(sizeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 8094 -// second row B: Rotation 8095 - wxStaticBox *rotBox = new wxStaticBox(panel, wxID_STATIC, 8096 - wxT("Rotation"), 8097 - wxDefaultPosition, 8098 - wxDefaultSize); 8099 - wxBoxSizer *rotSizer = new wxStaticBoxSizer(rotBox, wxVERTICAL); 8100 - sizeBoxSizer->Add(rotSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 8101 - wxBoxSizer *rot1Sizer = new wxBoxSizer(wxHORIZONTAL); 8102 - rotSizer->Add(rot1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 8103 - wxTextCtrl *rotCtrl = 8104 - new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_ROTATION, wxT("0.0"), 8105 - wxDefaultPosition, wxSize(100, 22)); 8106 - rot1Sizer->Add(rotCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 8107 -// third row: AnchorFaceSeed and Displacement 8108 - wxBoxSizer *anchorBoxSizer = new wxBoxSizer(wxHORIZONTAL); 8109 - box2Sizer->Add(anchorBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 8110 -// third row A: Anchor FaceSeed 8111 - wxStaticBox *anchorBox = new wxStaticBox(panel, wxID_STATIC, 8112 - wxT("Anchor FaceSeed"), 8113 - wxDefaultPosition, 8114 - wxDefaultSize); 8115 - wxBoxSizer *anchorSizer = new wxStaticBoxSizer(anchorBox, wxVERTICAL); 8116 - anchorBoxSizer->Add(anchorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 8117 - wxBoxSizer *anchor1Sizer = new wxBoxSizer(wxHORIZONTAL); 8118 - anchorSizer->Add(anchor1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 8119 - wxStaticText *anchor1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); 8120 - anchor1Sizer->Add(anchor1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 8121 - wxTextCtrl *anchorXCtrl = 8122 - new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_ANCHOR_X, wxT("0.5"), 8123 - wxDefaultPosition, wxSize(100, 22)); 8124 - anchor1Sizer->Add(anchorXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 8125 - wxBoxSizer *anchor2Sizer = new wxBoxSizer(wxHORIZONTAL); 8126 - anchorSizer->Add(anchor2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 8127 - wxStaticText *anchor2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); 8128 - anchor2Sizer->Add(anchor2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 8129 - wxTextCtrl *anchorYCtrl = 8130 - new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_ANCHOR_Y, wxT("0.5"), 8131 - wxDefaultPosition, wxSize(100, 22)); 8132 - anchor2Sizer->Add(anchorYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 8133 -// third row B: Displacement 8134 - wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, 8135 - wxT("Displacement"), 8136 - wxDefaultPosition, 8137 - wxDefaultSize); 8138 - wxBoxSizer *displacementSizer = 8139 - new wxStaticBoxSizer(displacementBox, wxVERTICAL); 8140 - anchorBoxSizer->Add(displacementSizer, 0, 8141 - wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 8142 - wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); 8143 - displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 8144 - wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); 8145 - displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 8146 - wxTextCtrl *displacementXCtrl = 8147 - new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_DISPLACEMENT_X, wxT("0.0"), 8148 - wxDefaultPosition, wxSize(100, 22)); 8149 - displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 8150 - wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); 8151 - displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 8152 - wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); 8153 - displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 8154 - wxTextCtrl *displacementYCtrl = 8155 - new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_DISPLACEMENT_Y, wxT("0.0"), 8156 - wxDefaultPosition, wxSize(100, 22)); 8157 - displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 8158 -// fourth row: colors 8159 - wxBoxSizer *box3Sizer = new wxBoxSizer(wxHORIZONTAL); 8160 - boxSizer->Add(box3Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 8161 -// first row A: Fill Color 8162 - wxBoxSizer *fillBoxSizer = new wxBoxSizer(wxVERTICAL); 8163 - box3Sizer->Add(fillBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 8164 - wxStaticBox *colorFillBox = new wxStaticBox(panel, wxID_STATIC, 8165 - wxT("Fill Color"), 8166 - wxDefaultPosition, 8167 - wxDefaultSize); 8168 - wxBoxSizer *colorFillSizer = new wxStaticBoxSizer(colorFillBox, wxVERTICAL); 8169 - box3Sizer->Add(colorFillSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 8170 - wxBoxSizer *fill1Sizer = new wxBoxSizer(wxHORIZONTAL); 8171 - colorFillSizer->Add(fill1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 8172 - wxTextCtrl *fillColorCtrl = 8173 - new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_FILL_COLOR, FillColor, 8174 - wxDefaultPosition, wxSize(80, 22)); 8175 - fill1Sizer->Add(fillColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 8176 - wxBitmap bmp; 8177 - wxColour color(0, 0, 0); 8178 - ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 8179 - wxStaticBitmap *sampleFillCtrl = 8180 - new wxStaticBitmap(panel, ID_SYMBOLIZER_FACE_SEED_FILL_PICKER_HEX, bmp, 8181 - wxDefaultPosition, wxSize(32, 32)); 8182 - fill1Sizer->Add(sampleFillCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 8183 - wxButton *pickFill = 8184 - new wxButton(panel, ID_SYMBOLIZER_FACE_SEED_FILL_PICKER_BTN, 8185 - wxT("&Pick a color")); 8186 - fill1Sizer->Add(pickFill, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 8187 -// second row B: Stroke Color 8188 - box3Sizer->AddSpacer(30); 8189 - wxStaticBox *colorStrokeBox = new wxStaticBox(panel, wxID_STATIC, 8190 - wxT("Stroke Color"), 8191 - wxDefaultPosition, 8192 - wxDefaultSize); 8193 - wxBoxSizer *colorStrokeSizer = 8194 - new wxStaticBoxSizer(colorStrokeBox, wxVERTICAL); 8195 - box3Sizer->Add(colorStrokeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 8196 - wxBoxSizer *stroke1Sizer = new wxBoxSizer(wxHORIZONTAL); 8197 - colorStrokeSizer->Add(stroke1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 8198 - wxTextCtrl *strokeColorCtrl = 8199 - new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR, StrokeColor, 8200 - wxDefaultPosition, wxSize(80, 22)); 8201 - stroke1Sizer->Add(strokeColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 8202 - wxStaticBitmap *sampleStrokeCtrl = 8203 - new wxStaticBitmap(panel, ID_SYMBOLIZER_FACE_SEED_STROKE_PICKER_HEX, bmp, 8204 - wxDefaultPosition, wxSize(32, 32)); 8205 - stroke1Sizer->Add(sampleStrokeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 8206 - wxButton *pickStroke = 8207 - new wxButton(panel, ID_SYMBOLIZER_FACE_SEED_STROKE_PICKER_BTN, 8208 - wxT("&Pick a color")); 8209 - stroke1Sizer->Add(pickStroke, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 8210 - panel->SetSizer(topSizer); 8211 - topSizer->Fit(panel); 8212 -// appends event handlers 8213 - Connect(ID_SYMBOLIZER_FACE_SEED_MARK, wxEVT_COMMAND_RADIOBOX_SELECTED, 8214 - (wxObjectEventFunction) & 8215 - QuickStyleTopologyDialog::OnCmdFaceSeedMarkChanged); 8216 - Connect(ID_SYMBOLIZER_FACE_SEED_FILL_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 8217 - (wxObjectEventFunction) & 8218 - QuickStyleTopologyDialog::OnCmdFaceSeedColorFillPicker); 8219 - Connect(ID_SYMBOLIZER_FACE_SEED_FILL_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 8220 - (wxObjectEventFunction) & 8221 - QuickStyleTopologyDialog::OnCmdFaceSeedColorFillChanged); 8222 - Connect(ID_SYMBOLIZER_FACE_SEED_STROKE_PICKER_BTN, 8223 - wxEVT_COMMAND_BUTTON_CLICKED, 8224 - (wxObjectEventFunction) & 8225 - QuickStyleTopologyDialog::OnCmdFaceSeedColorStrokePicker); 8226 - Connect(ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 8227 - (wxObjectEventFunction) & 8228 - QuickStyleTopologyDialog::OnCmdFaceSeedColorStrokeChanged); 8229 - return panel; 8230 -} 8231 - 8232 -void QuickStyleTopologyDialog:: 8233 -OnCmdFaceSeedMarkChanged(wxCommandEvent & WXUNUSED(event)) 8234 -{ 8235 -// 8236 -// Mark selection changed 8237 -// 8238 - wxRadioBox *markCtrl = 8239 - (wxRadioBox *) FindWindow(ID_SYMBOLIZER_FACE_SEED_MARK); 8240 - switch (markCtrl->GetSelection()) 8241 - { 8242 - case 1: 8243 - Style->SetFaceSeedWellKnownMark(RL2_GRAPHIC_MARK_CIRCLE); 8244 - break; 8245 - case 2: 8246 - Style->SetFaceSeedWellKnownMark(RL2_GRAPHIC_MARK_TRIANGLE); 8247 - break; 8248 - case 3: 8249 - Style->SetFaceSeedWellKnownMark(RL2_GRAPHIC_MARK_STAR); 8250 - break; 8251 - case 4: 8252 - Style->SetFaceSeedWellKnownMark(RL2_GRAPHIC_MARK_CROSS); 8253 - break; 8254 - case 5: 8255 - Style->SetFaceSeedWellKnownMark(RL2_GRAPHIC_MARK_X); 8256 - break; 8257 - default: 8258 - Style->SetFaceSeedWellKnownMark(RL2_GRAPHIC_MARK_SQUARE); 8259 - break; 8260 - }; 8261 -} 8262 - 8263 -void QuickStyleTopologyDialog:: 8264 -OnCmdFaceSeedColorFillChanged(wxCommandEvent & WXUNUSED(event)) 8265 -{ 8266 -// 8267 -// Fill color changed: updating the visual sample 8268 -// 8269 - wxTextCtrl *colorCtrl = 8270 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_FILL_COLOR); 8271 - wxStaticBitmap *sampleCtrl = 8272 - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FACE_SEED_FILL_PICKER_HEX); 8273 - wxColour back = wxColour(255, 255, 255); 8274 - wxString str = colorCtrl->GetValue(); 8275 - if (ColorMapEntry::IsValidColor(str) == true) 8276 - ColorMapEntry::GetWxColor(str, back); 8277 - wxBitmap bmp; 8278 - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 8279 - sampleCtrl->SetBitmap(bmp); 8280 - sampleCtrl->Refresh(); 8281 - sampleCtrl->Update(); 8282 -} 8283 - 8284 -void QuickStyleTopologyDialog:: 8285 -OnCmdFaceSeedColorFillPicker(wxCommandEvent & WXUNUSED(event)) 8286 -{ 8287 -// 8288 -// color picker 8289 -// 8290 - wxTextCtrl *colorCtrl = 8291 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_FILL_COLOR); 8292 - wxColour clr = wxNullColour; 8293 - wxString str = colorCtrl->GetValue(); 8294 - if (ColorMapEntry::IsValidColor(str) == true) 8295 - ColorMapEntry::GetWxColor(str, clr); 8296 - wxColour color = wxGetColourFromUser(this, clr); 8297 - if (color.IsOk() == true) 8298 - { 8299 - char hex[16]; 8300 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 8301 - wxString str = wxString::FromUTF8(hex); 8302 - colorCtrl->SetValue(str); 8303 - } 8304 -} 8305 - 8306 -void QuickStyleTopologyDialog:: 8307 -OnCmdFaceSeedColorStrokeChanged(wxCommandEvent & WXUNUSED(event)) 8308 -{ 8309 -// 8310 -// Stroke color changed: updating the visual sample 8311 -// 8312 - wxTextCtrl *colorCtrl = 8313 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR); 8314 - wxStaticBitmap *sampleCtrl = 8315 - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FACE_SEED_STROKE_PICKER_HEX); 8316 - wxColour back = wxColour(255, 255, 255); 8317 - wxString str = colorCtrl->GetValue(); 8318 - if (ColorMapEntry::IsValidColor(str) == true) 8319 - ColorMapEntry::GetWxColor(str, back); 8320 - wxBitmap bmp; 8321 - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 8322 - sampleCtrl->SetBitmap(bmp); 8323 - sampleCtrl->Refresh(); 8324 - sampleCtrl->Update(); 8325 -} 8326 - 8327 -void QuickStyleTopologyDialog:: 8328 -OnCmdFaceSeedColorStrokePicker(wxCommandEvent & WXUNUSED(event)) 8329 -{ 8330 -// 8331 -// color picker 8332 -// 8333 - wxTextCtrl *colorCtrl = 8334 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR); 8335 - wxColour clr = wxNullColour; 8336 - wxString str = colorCtrl->GetValue(); 8337 - if (ColorMapEntry::IsValidColor(str) == true) 8338 - ColorMapEntry::GetWxColor(str, clr); 8339 - wxColour color = wxGetColourFromUser(this, clr); 8340 - if (color.IsOk() == true) 8341 - { 8342 - char hex[16]; 8343 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 8344 - wxString str = wxString::FromUTF8(hex); 8345 - colorCtrl->SetValue(str); 8346 - } 8347 -} 8348 - 8349 - 8350 - 8351 - 8352 - 8353 -bool QuickStyleTopologyDialog::RetrieveMainPage() 8354 -{ 8355 -// 8356 -// retrieving params from the MAIN page 8357 -// 8358 - double min = Style->GetScaleMin(); 8359 - double max = Style->GetScaleMax(); 8360 - if (Style->IsMinScaleEnabled() == true) 8361 - { 8362 - wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); 8363 - wxString value = minCtrl->GetValue(); 8364 - if (value.ToDouble(&min) != true) 8365 - { 8366 - wxMessageBox(wxT 8367 - ("MIN_SCALE isn't a valid decimal number !!!"), 8368 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8369 - return false; 8370 - } 8371 - if (min < 0.0) 8372 - { 8373 - wxMessageBox(wxT 8374 - ("MIN_SCALE must be a positive number !!!"), 8375 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8376 - return false; 8377 - } 8378 - } 8379 - if (Style->IsMaxScaleEnabled() == true) 8380 - { 8381 - wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); 8382 - wxString value = maxCtrl->GetValue(); 8383 - if (value.ToDouble(&max) != true) 8384 - { 8385 - wxMessageBox(wxT 8386 - ("MAX_SCALE isn't a valid decimal number !!!"), 8387 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8388 - return false; 8389 - } 8390 - if (max < 0.0) 8391 - { 8392 - wxMessageBox(wxT 8393 - ("MAX_SCALE must be a positive number !!!"), 8394 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8395 - return false; 8396 - } 8397 - } 8398 - if (Style->IsMinScaleEnabled() == true && Style->IsMaxScaleEnabled() == true) 8399 - { 8400 - if (min >= max) 8401 - { 8402 - wxMessageBox(wxT 8403 - ("MAX_SCALE is always expected to be greater than MIN_SCALE !!!"), 8404 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8405 - return false; 8406 - } 8407 - } 8408 - Style->SetScaleMin(min); 8409 - Style->SetScaleMax(max); 8410 - return true; 8411 -} 8412 - 8413 -void QuickStyleTopologyDialog::UpdateMainPage() 8414 -{ 8415 -// 8416 -// updating the MAIN page 8417 -// 8418 - wxRadioBox *rangeBox = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MINMAX_SCALE); 8419 - if (Style->IsMinScaleEnabled() != true && Style->IsMaxScaleEnabled() != true) 8420 - rangeBox->SetSelection(0); 8421 - else if (Style->IsMinScaleEnabled() == true 8422 - && Style->IsMaxScaleEnabled() != true) 8423 - rangeBox->SetSelection(1); 8424 - else if (Style->IsMinScaleEnabled() != true 8425 - && Style->IsMaxScaleEnabled() == true) 8426 - rangeBox->SetSelection(2); 8427 - else 8428 - rangeBox->SetSelection(3); 8429 - wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); 8430 - char dummy[64]; 8431 - wxString str; 8432 - if (Style->IsMinScaleEnabled() == true) 8433 - { 8434 - sprintf(dummy, "%1.2f", Style->GetScaleMin()); 8435 - str = wxString::FromUTF8(dummy); 8436 - minCtrl->SetValue(str); 8437 - minCtrl->Enable(true); 8438 - } else 8439 - { 8440 - str = wxT("0.0"); 8441 - minCtrl->SetValue(str); 8442 - minCtrl->Enable(false); 8443 - } 8444 - wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); 8445 - if (Style->IsMaxScaleEnabled() == true) 8446 - { 8447 - sprintf(dummy, "%1.2f", Style->GetScaleMax()); 8448 - str = wxString::FromUTF8(dummy); 8449 - maxCtrl->SetValue(str); 8450 - maxCtrl->Enable(true); 8451 - } else 8452 - { 8453 - str = wxT("+Infinite"); 8454 - maxCtrl->SetValue(str); 8455 - maxCtrl->Enable(false); 8456 - } 8457 -} 8458 - 8459 -bool QuickStyleTopologyDialog::RetrieveNodePage(bool check) 8460 -{ 8461 -// 8462 -// retrieving params from the Node Nodeizer page 8463 -// 8464 - double opacity; 8465 - double size; 8466 - double rotation; 8467 - double anchorNodeX; 8468 - double anchorNodeY; 8469 - double displacementX; 8470 - double displacementY; 8471 - char fillColor[8]; 8472 - char strokeColor[8]; 8473 - wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_NODE_OPACITY); 8474 - opacity = opacityCtrl->GetValue() / 100.0; 8475 - wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_SIZE); 8476 - wxString value = sizeCtrl->GetValue(); 8477 - if (value.ToDouble(&size) != true) 8478 - { 8479 - if (check == true) 8480 - { 8481 - wxMessageBox(wxT 8482 - ("SIZE isn't a valid decimal number !!!"), 8483 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8484 - return false; 8485 - } 8486 - } 8487 - if (size < 0.0) 8488 - { 8489 - if (check == true) 8490 - { 8491 - wxMessageBox(wxT 8492 - ("SIZE must be a positive number !!!"), 8493 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8494 - return false; 8495 - } 8496 - } 8497 - wxTextCtrl *rotationCtrl = 8498 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_ROTATION); 8499 - value = rotationCtrl->GetValue(); 8500 - if (value.ToDouble(&rotation) != true) 8501 - { 8502 - if (check == true) 8503 - { 8504 - wxMessageBox(wxT 8505 - ("ROTATION isn't a valid decimal number !!!"), 8506 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8507 - return false; 8508 - } 8509 - } 8510 - wxTextCtrl *anchorXCtrl = 8511 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_ANCHOR_X); 8512 - value = anchorXCtrl->GetValue(); 8513 - if (value.ToDouble(&anchorNodeX) != true) 8514 - { 8515 - if (check == true) 8516 - { 8517 - wxMessageBox(wxT 8518 - ("ANCHOR-POINT-X isn't a valid decimal number !!!"), 8519 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8520 - return false; 8521 - } 8522 - } 8523 - if (anchorNodeX < 0.0 || anchorNodeX > 1.0) 8524 - { 8525 - if (check == true) 8526 - { 8527 - wxMessageBox(wxT 8528 - ("ANCHOR-POINT-X must be between 0.0 and 1.0 !!!"), 8529 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8530 - return false; 8531 - } 8532 - } 8533 - wxTextCtrl *anchorYCtrl = 8534 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_ANCHOR_Y); 8535 - value = anchorYCtrl->GetValue(); 8536 - if (value.ToDouble(&anchorNodeY) != true) 8537 - { 8538 - if (check == true) 8539 - { 8540 - wxMessageBox(wxT 8541 - ("ANCHOR-POINT-Y isn't a valid decimal number !!!"), 8542 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8543 - return false; 8544 - } 8545 - } 8546 - if (anchorNodeY < 0.0 || anchorNodeY > 1.0) 8547 - { 8548 - if (check == true) 8549 - { 8550 - wxMessageBox(wxT 8551 - ("ANCHOR-POINT-Y must be between 0.0 and 1.0 !!!"), 8552 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8553 - return false; 8554 - } 8555 - } 8556 - wxTextCtrl *displXCtrl = 8557 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_DISPLACEMENT_X); 8558 - value = displXCtrl->GetValue(); 8559 - if (value.ToDouble(&displacementX) != true) 8560 - { 8561 - if (check == true) 8562 - { 8563 - wxMessageBox(wxT 8564 - ("DISPLACEMENT-X isn't a valid decimal number !!!"), 8565 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8566 - return false; 8567 - } 8568 - } 8569 - wxTextCtrl *displYCtrl = 8570 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_DISPLACEMENT_Y); 8571 - value = displYCtrl->GetValue(); 8572 - if (value.ToDouble(&displacementY) != true) 8573 - { 8574 - if (check == true) 8575 - { 8576 - wxMessageBox(wxT 8577 - ("DISPLACEMENT-Y isn't a valid decimal number !!!"), 8578 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8579 - return false; 8580 - } 8581 - } 8582 - wxTextCtrl *colorCtrl = 8583 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_FILL_COLOR); 8584 - wxString color = colorCtrl->GetValue(); 8585 - if (ColorMapEntry::IsValidColor(color) != true) 8586 - { 8587 - if (check == true) 8588 - { 8589 - wxMessageBox(wxT 8590 - ("FILL-COLOR isn't a valid HexRGB color !!!"), 8591 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8592 - return false; 8593 - } 8594 - } 8595 - strcpy(fillColor, color.ToUTF8()); 8596 - colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_STROKE_COLOR); 8597 - color = colorCtrl->GetValue(); 8598 - if (ColorMapEntry::IsValidColor(color) != true) 8599 - { 8600 - if (check == true) 8601 - { 8602 - wxMessageBox(wxT 8603 - ("STROKE-COLOR isn't a valid HexRGB color !!!"), 8604 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8605 - return false; 8606 - } 8607 - } 8608 - strcpy(strokeColor, color.ToUTF8()); 8609 - Style->SetNodeOpacity(opacity); 8610 - Style->SetNodeSize(size); 8611 - Style->SetNodeRotation(rotation); 8612 - Style->SetNodeAnchorX(anchorNodeX); 8613 - Style->SetNodeAnchorY(anchorNodeY); 8614 - Style->SetNodeDisplacementX(displacementX); 8615 - Style->SetNodeDisplacementY(displacementY); 8616 - Style->SetNodeFillColor(fillColor); 8617 - Style->SetNodeStrokeColor(strokeColor); 8618 - return true; 8619 -} 8620 - 8621 -void QuickStyleTopologyDialog::UpdateNodePage() 8622 -{ 8623 -// 8624 -// updating the Node Nodeizer page 8625 -// 8626 - wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_NODE_OPACITY); 8627 - opacityCtrl->SetValue(Style->GetNodeOpacity() * 100.0); 8628 - wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_SIZE); 8629 - char dummy[64]; 8630 - sprintf(dummy, "%1.2f", Style->GetNodeSize()); 8631 - wxString str = wxString::FromUTF8(dummy); 8632 - sizeCtrl->SetValue(str); 8633 - wxTextCtrl *rotationCtrl = 8634 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_ROTATION); 8635 - sprintf(dummy, "%1.2f", Style->GetNodeRotation()); 8636 - str = wxString::FromUTF8(dummy); 8637 - rotationCtrl->SetValue(str); 8638 - wxTextCtrl *anchorXCtrl = 8639 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_ANCHOR_X); 8640 - sprintf(dummy, "%1.2f", Style->GetNodeAnchorX()); 8641 - str = wxString::FromUTF8(dummy); 8642 - anchorXCtrl->SetValue(str); 8643 - wxTextCtrl *anchorYCtrl = 8644 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_ANCHOR_Y); 8645 - sprintf(dummy, "%1.2f", Style->GetNodeAnchorY()); 8646 - str = wxString::FromUTF8(dummy); 8647 - anchorYCtrl->SetValue(str); 8648 - wxTextCtrl *displXCtrl = 8649 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_DISPLACEMENT_X); 8650 - sprintf(dummy, "%1.2f", Style->GetNodeDisplacementX()); 8651 - str = wxString::FromUTF8(dummy); 8652 - displXCtrl->SetValue(str); 8653 - wxTextCtrl *displYCtrl = 8654 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_DISPLACEMENT_Y); 8655 - sprintf(dummy, "%1.2f", Style->GetNodeDisplacementY()); 8656 - str = wxString::FromUTF8(dummy); 8657 - displYCtrl->SetValue(str); 8658 - wxRadioBox *markCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_NODE_MARK); 8659 - switch (Style->GetNodeWellKnownMark()) 8660 - { 8661 - case RL2_GRAPHIC_MARK_CIRCLE: 8662 - markCtrl->SetSelection(1); 8663 - break; 8664 - case RL2_GRAPHIC_MARK_TRIANGLE: 8665 - markCtrl->SetSelection(2); 8666 - break; 8667 - case RL2_GRAPHIC_MARK_STAR: 8668 - markCtrl->SetSelection(3); 8669 - break; 8670 - case RL2_GRAPHIC_MARK_CROSS: 8671 - markCtrl->SetSelection(4); 8672 - break; 8673 - case RL2_GRAPHIC_MARK_X: 8674 - markCtrl->SetSelection(5); 8675 - break; 8676 - default: 8677 - markCtrl->SetSelection(0); 8678 - break; 8679 - }; 8680 - wxTextCtrl *colorFillCtrl = 8681 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_FILL_COLOR); 8682 - wxString fillColor = wxString::FromUTF8(Style->GetNodeFillColor()); 8683 - colorFillCtrl->SetValue(fillColor); 8684 - wxTextCtrl *colorStrokeCtrl = 8685 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_STROKE_COLOR); 8686 - wxString strokeColor = wxString::FromUTF8(Style->GetNodeStrokeColor()); 8687 - colorStrokeCtrl->SetValue(strokeColor); 8688 -} 8689 - 8690 -bool QuickStyleTopologyDialog::RetrieveEdgeLinkPage(bool check) 8691 -{ 8692 -// 8693 -// retrieving params from the EdgeLink Symbolizer page 8694 -// 8695 - double opacity; 8696 - double perpendicularOffset; 8697 - char strokeColor[8]; 8698 - double strokeWidth; 8699 - wxSlider *opacityCtrl = 8700 - (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE1_OPACITY); 8701 - opacity = opacityCtrl->GetValue() / 100.0; 8702 - wxTextCtrl *perpCtrl = 8703 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_PERPENDICULAR); 8704 - wxString value = perpCtrl->GetValue(); 8705 - if (value.ToDouble(&perpendicularOffset) != true) 8706 - { 8707 - if (check == true) 8708 - { 8709 - wxMessageBox(wxT 8710 - ("PERPENDICULAR-OFFSET isn't a valid decimal number !!!"), 8711 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8712 - return false; 8713 - } 8714 - } 8715 - wxTextCtrl *colorCtrl = 8716 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); 8717 - wxString color = colorCtrl->GetValue(); 8718 - if (ColorMapEntry::IsValidColor(color) != true) 8719 - { 8720 - if (check == true) 8721 - { 8722 - wxMessageBox(wxT 8723 - ("STROKE-COLOR isn't a valid HexRGB color !!!"), 8724 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8725 - return false; 8726 - } 8727 - } 8728 - strcpy(strokeColor, color.ToUTF8()); 8729 - wxTextCtrl *widthCtrl = 8730 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_WIDTH); 8731 - value = widthCtrl->GetValue(); 8732 - if (value.ToDouble(&strokeWidth) != true) 8733 - { 8734 - if (check == true) 8735 - { 8736 - wxMessageBox(wxT 8737 - ("STROKE-WIDTH isn't a valid decimal number !!!"), 8738 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8739 - return false; 8740 - } 8741 - } 8742 - if (strokeWidth <= 0.0) 8743 - { 8744 - if (check == true) 8745 - { 8746 - wxMessageBox(wxT 8747 - ("STROKE-WIDTH must be a positive number !!!"), 8748 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8749 - return false; 8750 - } 8751 - } 8752 - wxRadioBox *dotCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_DASH_DOT); 8753 - switch (dotCtrl->GetSelection()) 8754 - { 8755 - case 1: 8756 - Style->SetEdgeLinkDotStyle(QUICK_STYLE_DOT_LINE); 8757 - break; 8758 - case 2: 8759 - Style->SetEdgeLinkDotStyle(QUICK_STYLE_DASH_LINE); 8760 - break; 8761 - case 3: 8762 - Style->SetEdgeLinkDotStyle(QUICK_STYLE_DASH_DOT_LINE); 8763 - break; 8764 - default: 8765 - Style->SetEdgeLinkDotStyle(QUICK_STYLE_SOLID_LINE); 8766 - break; 8767 - }; 8768 - Style->SetEdgeLinkOpacity(opacity); 8769 - Style->SetEdgeLinkPerpendicularOffset(perpendicularOffset); 8770 - Style->SetEdgeLinkStrokeWidth(strokeWidth); 8771 - Style->SetEdgeLinkStrokeColor(strokeColor); 8772 - return true; 8773 -} 8774 - 8775 -void QuickStyleTopologyDialog::UpdateEdgeLinkPage() 8776 -{ 8777 -// 8778 -// updating the EdgeLink Symbolizer page 8779 -// 8780 - wxSlider *opacityCtrl = 8781 - (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE1_OPACITY); 8782 - opacityCtrl->SetValue(Style->GetEdgeLinkOpacity() * 100.0); 8783 - wxTextCtrl *perpCtrl = 8784 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_PERPENDICULAR); 8785 - char dummy[64]; 8786 - sprintf(dummy, "%1.2f", Style->GetEdgeLinkPerpendicularOffset()); 8787 - wxString str = wxString::FromUTF8(dummy); 8788 - perpCtrl->SetValue(str); 8789 - wxTextCtrl *colorCtrl = 8790 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); 8791 - wxButton *pick = (wxButton *) FindWindow(ID_SYMBOLIZER_STROKE1_PICKER_BTN); 8792 - colorCtrl->Enable(true); 8793 - pick->Enable(true); 8794 - wxString strokeColor = wxString::FromUTF8(Style->GetEdgeLinkStrokeColor()); 8795 - colorCtrl->SetValue(strokeColor); 8796 - wxTextCtrl *widthCtrl = 8797 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_WIDTH); 8798 - sprintf(dummy, "%1.2f", Style->GetEdgeLinkStrokeWidth()); 8799 - str = wxString::FromUTF8(dummy); 8800 - wxRadioBox *dotCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_DASH_DOT); 8801 - switch (Style->GetEdgeLinkDotStyle()) 8802 - { 8803 - case QUICK_STYLE_DOT_LINE: 8804 - dotCtrl->SetSelection(1); 8805 - break; 8806 - case QUICK_STYLE_DASH_LINE: 8807 - dotCtrl->SetSelection(2); 8808 - break; 8809 - case QUICK_STYLE_DASH_DOT_LINE: 8810 - dotCtrl->SetSelection(3); 8811 - break; 8812 - default: 8813 - dotCtrl->SetSelection(0); 8814 - break; 8815 - }; 8816 - widthCtrl->SetValue(str); 8817 -} 8818 - 8819 -bool QuickStyleTopologyDialog::RetrieveFacePage(bool check) 8820 -{ 8821 -// 8822 -// retrieving params from the Face Synbolizer page 8823 -// 8824 - double fillOpacity; 8825 - double displacementX; 8826 - double displacementY; 8827 - double perpendicularOffset; 8828 - char fillColor[8]; 8829 - wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_FILL2_OPACITY); 8830 - fillOpacity = opacityCtrl->GetValue() / 100.0; 8831 - wxTextCtrl *displXCtrl = 8832 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_X); 8833 - wxString value = displXCtrl->GetValue(); 8834 - if (Style->IsFaceFill() != true && Style->IsFaceStroke() != true) 8835 - { 8836 - if (check == true) 8837 - { 8838 - wxMessageBox(wxT 8839 - ("You can't disable both FILL and STROKE at the same time !!!"), 8840 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8841 - return false; 8842 - } 8843 - } 8844 - if (value.ToDouble(&displacementX) != true) 8845 - { 8846 - if (check == true) 8847 - { 8848 - wxMessageBox(wxT 8849 - ("DISPLACEMENT-X isn't a valid decimal number !!!"), 8850 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8851 - return false; 8852 - } 8853 - } 8854 - wxTextCtrl *displYCtrl = 8855 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_Y); 8856 - value = displYCtrl->GetValue(); 8857 - if (value.ToDouble(&displacementY) != true) 8858 - { 8859 - if (check == true) 8860 - { 8861 - wxMessageBox(wxT 8862 - ("DISPLACEMENT-Y isn't a valid decimal number !!!"), 8863 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8864 - return false; 8865 - } 8866 - } 8867 - wxTextCtrl *perpCtrl = 8868 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_PERPENDICULAR); 8869 - value = perpCtrl->GetValue(); 8870 - if (value.ToDouble(&perpendicularOffset) != true) 8871 - { 8872 - if (check == true) 8873 - { 8874 - wxMessageBox(wxT 8875 - ("PERPENDICULAR-OFFSET isn't a valid decimal number !!!"), 8876 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8877 - return false; 8878 - } 8879 - } 8880 - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); 8881 - wxString color = colorCtrl->GetValue(); 8882 - if (ColorMapEntry::IsValidColor(color) != true) 8883 - { 8884 - if (check == true) 8885 - { 8886 - wxMessageBox(wxT 8887 - ("FILL-COLOR isn't a valid HexRGB color !!!"), 8888 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8889 - return false; 8890 - } 8891 - } 8892 - strcpy(fillColor, color.ToUTF8()); 8893 - Style->SetFaceFillOpacity(fillOpacity); 8894 - Style->SetFaceDisplacementX(displacementX); 8895 - Style->SetFaceDisplacementY(displacementY); 8896 - Style->SetFacePerpendicularOffset(perpendicularOffset); 8897 - Style->SetFaceFillColor(fillColor); 8898 - return true; 8899 -} 8900 - 8901 -void QuickStyleTopologyDialog::UpdateFacePage() 8902 -{ 8903 -// 8904 -// updating the Face Symbolizer page 8905 -// 8906 - wxCheckBox *enableBox = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_FILL2_ENABLE); 8907 - enableBox->SetValue(Style->IsFaceFill()); 8908 - wxTextCtrl *displXCtrl = 8909 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_X); 8910 - char dummy[64]; 8911 - sprintf(dummy, "%1.2f", Style->GetFaceDisplacementX()); 8912 - wxString str = wxString::FromUTF8(dummy); 8913 - displXCtrl->SetValue(str); 8914 - wxTextCtrl *displYCtrl = 8915 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_Y); 8916 - sprintf(dummy, "%1.2f", Style->GetFaceDisplacementY()); 8917 - str = wxString::FromUTF8(dummy); 8918 - displYCtrl->SetValue(str); 8919 - wxTextCtrl *perpCtrl = 8920 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_PERPENDICULAR); 8921 - sprintf(dummy, "%1.2f", Style->GetFacePerpendicularOffset()); 8922 - str = wxString::FromUTF8(dummy); 8923 - perpCtrl->SetValue(str); 8924 - wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_FILL2_OPACITY); 8925 - opacityCtrl->SetValue(Style->GetFaceFillOpacity() * 100.0); 8926 - opacityCtrl->Enable(Style->IsFaceFill()); 8927 - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); 8928 - wxButton *pick = (wxButton *) FindWindow(ID_SYMBOLIZER_FILL2_PICKER_BTN); 8929 - wxColour color = wxNullColour; 8930 - str = wxString::FromUTF8(Style->GetFaceFillColor()); 8931 - ColorMapEntry::GetWxColor(str, color); 8932 - if (color.IsOk() == true) 8933 - { 8934 - char hex[16]; 8935 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 8936 - wxString str = wxString::FromUTF8(hex); 8937 - colorCtrl->SetValue(str); 8938 - } 8939 - colorCtrl->Enable(Style->IsFaceFill()); 8940 - pick->Enable(Style->IsFaceFill()); 8941 - wxSlider *opacity2Ctrl = 8942 - (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE2_OPACITY); 8943 - opacity2Ctrl->SetValue(Style->GetFaceStrokeOpacity() * 100.0); 8944 - opacity2Ctrl->Enable(Style->IsFaceStroke()); 8945 - wxTextCtrl *color2Ctrl = 8946 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); 8947 - wxButton *pick2 = (wxButton *) FindWindow(ID_SYMBOLIZER_STROKE2_PICKER_BTN); 8948 - color = wxNullColour; 8949 - str = wxString::FromUTF8(Style->GetFaceStrokeColor()); 8950 - ColorMapEntry::GetWxColor(str, color); 8951 - if (color.IsOk() == true) 8952 - { 8953 - char hex[16]; 8954 - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 8955 - wxString str = wxString::FromUTF8(hex); 8956 - color2Ctrl->SetValue(str); 8957 - } 8958 - color2Ctrl->Enable(Style->IsFaceStroke()); 8959 - pick2->Enable(Style->IsFaceStroke()); 8960 - wxTextCtrl *widthCtrl = 8961 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_WIDTH); 8962 - sprintf(dummy, "%1.2f", Style->GetFaceStrokeWidth()); 8963 - str = wxString::FromUTF8(dummy); 8964 - widthCtrl->SetValue(str); 8965 - widthCtrl->Enable(Style->IsFaceStroke()); 8966 -} 8967 - 8968 -bool QuickStyleTopologyDialog::RetrieveEdgeLinkSeedPage(bool check) 8969 -{ 8970 -// 8971 -// retrieving params from the EdgeLinkSeed EdgeLinkSeedizer page 8972 -// 8973 - double opacity; 8974 - double size; 8975 - double rotation; 8976 - double anchorEdgeLinkSeedX; 8977 - double anchorEdgeLinkSeedY; 8978 - double displacementX; 8979 - double displacementY; 8980 - char fillColor[8]; 8981 - char strokeColor[8]; 8982 - wxSlider *opacityCtrl = 8983 - (wxSlider *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_OPACITY); 8984 - opacity = opacityCtrl->GetValue() / 100.0; 8985 - wxTextCtrl *sizeCtrl = 8986 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_SIZE); 8987 - wxString value = sizeCtrl->GetValue(); 8988 - if (value.ToDouble(&size) != true) 8989 - { 8990 - if (check == true) 8991 - { 8992 - wxMessageBox(wxT 8993 - ("SIZE isn't a valid decimal number !!!"), 8994 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 8995 - return false; 8996 - } 8997 - } 8998 - if (size < 0.0) 8999 - { 9000 - if (check == true) 9001 - { 9002 - wxMessageBox(wxT 9003 - ("SIZE must be a positive number !!!"), 9004 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 9005 - return false; 9006 - } 9007 - } 9008 - wxTextCtrl *rotationCtrl = 9009 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_ROTATION); 9010 - value = rotationCtrl->GetValue(); 9011 - if (value.ToDouble(&rotation) != true) 9012 - { 9013 - if (check == true) 9014 - { 9015 - wxMessageBox(wxT 9016 - ("ROTATION isn't a valid decimal number !!!"), 9017 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 9018 - return false; 9019 - } 9020 - } 9021 - wxTextCtrl *anchorXCtrl = 9022 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_ANCHOR_X); 9023 - value = anchorXCtrl->GetValue(); 9024 - if (value.ToDouble(&anchorEdgeLinkSeedX) != true) 9025 - { 9026 - if (check == true) 9027 - { 9028 - wxMessageBox(wxT 9029 - ("ANCHOR-POINT-X isn't a valid decimal number !!!"), 9030 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 9031 - return false; 9032 - } 9033 - } 9034 - if (anchorEdgeLinkSeedX < 0.0 || anchorEdgeLinkSeedX > 1.0) 9035 - { 9036 - if (check == true) 9037 - { 9038 - wxMessageBox(wxT 9039 - ("ANCHOR-POINT-X must be between 0.0 and 1.0 !!!"), 9040 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 9041 - return false; 9042 - } 9043 - } 9044 - wxTextCtrl *anchorYCtrl = 9045 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_ANCHOR_Y); 9046 - value = anchorYCtrl->GetValue(); 9047 - if (value.ToDouble(&anchorEdgeLinkSeedY) != true) 9048 - { 9049 - if (check == true) 9050 - { 9051 - wxMessageBox(wxT 9052 - ("ANCHOR-POINT-Y isn't a valid decimal number !!!"), 9053 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 9054 - return false; 9055 - } 9056 - } 9057 - if (anchorEdgeLinkSeedY < 0.0 || anchorEdgeLinkSeedY > 1.0) 9058 - { 9059 - if (check == true) 9060 - { 9061 - wxMessageBox(wxT 9062 - ("ANCHOR-POINT-Y must be between 0.0 and 1.0 !!!"), 9063 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 9064 - return false; 9065 - } 9066 - } 9067 - wxTextCtrl *displXCtrl = 9068 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_DISPLACEMENT_X); 9069 - value = displXCtrl->GetValue(); 9070 - if (value.ToDouble(&displacementX) != true) 9071 - { 9072 - if (check == true) 9073 - { 9074 - wxMessageBox(wxT 9075 - ("DISPLACEMENT-X isn't a valid decimal number !!!"), 9076 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 9077 - return false; 9078 - } 9079 - } 9080 - wxTextCtrl *displYCtrl = 9081 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_DISPLACEMENT_Y); 9082 - value = displYCtrl->GetValue(); 9083 - if (value.ToDouble(&displacementY) != true) 9084 - { 9085 - if (check == true) 9086 - { 9087 - wxMessageBox(wxT 9088 - ("DISPLACEMENT-Y isn't a valid decimal number !!!"), 9089 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 9090 - return false; 9091 - } 9092 - } 9093 - wxTextCtrl *colorCtrl = 9094 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_FILL_COLOR); 9095 - wxString color = colorCtrl->GetValue(); 9096 - if (ColorMapEntry::IsValidColor(color) != true) 9097 - { 9098 - if (check == true) 9099 - { 9100 - wxMessageBox(wxT 9101 - ("FILL-COLOR isn't a valid HexRGB color !!!"), 9102 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 9103 - return false; 9104 - } 9105 - } 9106 - strcpy(fillColor, color.ToUTF8()); 9107 - colorCtrl = 9108 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_COLOR); 9109 - color = colorCtrl->GetValue(); 9110 - if (ColorMapEntry::IsValidColor(color) != true) 9111 - { 9112 - if (check == true) 9113 - { 9114 - wxMessageBox(wxT 9115 - ("STROKE-COLOR isn't a valid HexRGB color !!!"), 9116 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 9117 - return false; 9118 - } 9119 - } 9120 - strcpy(strokeColor, color.ToUTF8()); 9121 - Style->SetEdgeLinkSeedOpacity(opacity); 9122 - Style->SetEdgeLinkSeedSize(size); 9123 - Style->SetEdgeLinkSeedRotation(rotation); 9124 - Style->SetEdgeLinkSeedAnchorX(anchorEdgeLinkSeedX); 9125 - Style->SetEdgeLinkSeedAnchorY(anchorEdgeLinkSeedY); 9126 - Style->SetEdgeLinkSeedDisplacementX(displacementX); 9127 - Style->SetEdgeLinkSeedDisplacementY(displacementY); 9128 - Style->SetEdgeLinkSeedFillColor(fillColor); 9129 - Style->SetEdgeLinkSeedStrokeColor(strokeColor); 9130 - return true; 9131 -} 9132 - 9133 -void QuickStyleTopologyDialog::UpdateEdgeLinkSeedPage() 9134 -{ 9135 -// 9136 -// updating the EdgeLinkSeed EdgeLinkSeedizer page 9137 -// 9138 - wxSlider *opacityCtrl = 9139 - (wxSlider *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_OPACITY); 9140 - opacityCtrl->SetValue(Style->GetEdgeLinkSeedOpacity() * 100.0); 9141 - wxTextCtrl *sizeCtrl = 9142 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_SIZE); 9143 - char dummy[64]; 9144 - sprintf(dummy, "%1.2f", Style->GetEdgeLinkSeedSize()); 9145 - wxString str = wxString::FromUTF8(dummy); 9146 - sizeCtrl->SetValue(str); 9147 - wxTextCtrl *rotationCtrl = 9148 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_ROTATION); 9149 - sprintf(dummy, "%1.2f", Style->GetEdgeLinkSeedRotation()); 9150 - str = wxString::FromUTF8(dummy); 9151 - rotationCtrl->SetValue(str); 9152 - wxTextCtrl *anchorXCtrl = 9153 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_ANCHOR_X); 9154 - sprintf(dummy, "%1.2f", Style->GetEdgeLinkSeedAnchorX()); 9155 - str = wxString::FromUTF8(dummy); 9156 - anchorXCtrl->SetValue(str); 9157 - wxTextCtrl *anchorYCtrl = 9158 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_ANCHOR_Y); 9159 - sprintf(dummy, "%1.2f", Style->GetEdgeLinkSeedAnchorY()); 9160 - str = wxString::FromUTF8(dummy); 9161 - anchorYCtrl->SetValue(str); 9162 - wxTextCtrl *displXCtrl = 9163 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_DISPLACEMENT_X); 9164 - sprintf(dummy, "%1.2f", Style->GetEdgeLinkSeedDisplacementX()); 9165 - str = wxString::FromUTF8(dummy); 9166 - displXCtrl->SetValue(str); 9167 - wxTextCtrl *displYCtrl = 9168 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_DISPLACEMENT_Y); 9169 - sprintf(dummy, "%1.2f", Style->GetEdgeLinkSeedDisplacementY()); 9170 - str = wxString::FromUTF8(dummy); 9171 - displYCtrl->SetValue(str); 9172 - wxRadioBox *markCtrl = 9173 - (wxRadioBox *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_MARK); 9174 - switch (Style->GetEdgeLinkSeedWellKnownMark()) 9175 - { 9176 - case RL2_GRAPHIC_MARK_CIRCLE: 9177 - markCtrl->SetSelection(1); 9178 - break; 9179 - case RL2_GRAPHIC_MARK_TRIANGLE: 9180 - markCtrl->SetSelection(2); 9181 - break; 9182 - case RL2_GRAPHIC_MARK_STAR: 9183 - markCtrl->SetSelection(3); 9184 - break; 9185 - case RL2_GRAPHIC_MARK_CROSS: 9186 - markCtrl->SetSelection(4); 9187 - break; 9188 - case RL2_GRAPHIC_MARK_X: 9189 - markCtrl->SetSelection(5); 9190 - break; 9191 - default: 9192 - markCtrl->SetSelection(0); 9193 - break; 9194 - }; 9195 - wxTextCtrl *colorFillCtrl = 9196 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_FILL_COLOR); 9197 - wxString fillColor = wxString::FromUTF8(Style->GetEdgeLinkSeedFillColor()); 9198 - colorFillCtrl->SetValue(fillColor); 9199 - wxTextCtrl *colorStrokeCtrl = 9200 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_COLOR); 9201 - wxString strokeColor = 9202 - wxString::FromUTF8(Style->GetEdgeLinkSeedStrokeColor()); 9203 - colorStrokeCtrl->SetValue(strokeColor); 9204 -} 9205 - 9206 -bool QuickStyleTopologyDialog::RetrieveFaceSeedPage(bool check) 9207 -{ 9208 -// 9209 -// retrieving params from the FaceSeed FaceSeedizer page 9210 -// 9211 - double opacity; 9212 - double size; 9213 - double rotation; 9214 - double anchorFaceSeedX; 9215 - double anchorFaceSeedY; 9216 - double displacementX; 9217 - double displacementY; 9218 - char fillColor[8]; 9219 - char strokeColor[8]; 9220 - wxSlider *opacityCtrl = 9221 - (wxSlider *) FindWindow(ID_SYMBOLIZER_FACE_SEED_OPACITY); 9222 - opacity = opacityCtrl->GetValue() / 100.0; 9223 - wxTextCtrl *sizeCtrl = 9224 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_SIZE); 9225 - wxString value = sizeCtrl->GetValue(); 9226 - if (value.ToDouble(&size) != true) 9227 - { 9228 - if (check == true) 9229 - { 9230 - wxMessageBox(wxT 9231 - ("SIZE isn't a valid decimal number !!!"), 9232 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 9233 - return false; 9234 - } 9235 - } 9236 - if (size < 0.0) 9237 - { 9238 - if (check == true) 9239 - { 9240 - wxMessageBox(wxT 9241 - ("SIZE must be a positive number !!!"), 9242 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 9243 - return false; 9244 - } 9245 - } 9246 - wxTextCtrl *rotationCtrl = 9247 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_ROTATION); 9248 - value = rotationCtrl->GetValue(); 9249 - if (value.ToDouble(&rotation) != true) 9250 - { 9251 - if (check == true) 9252 - { 9253 - wxMessageBox(wxT 9254 - ("ROTATION isn't a valid decimal number !!!"), 9255 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 9256 - return false; 9257 - } 9258 - } 9259 - wxTextCtrl *anchorXCtrl = 9260 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_ANCHOR_X); 9261 - value = anchorXCtrl->GetValue(); 9262 - if (value.ToDouble(&anchorFaceSeedX) != true) 9263 - { 9264 - if (check == true) 9265 - { 9266 - wxMessageBox(wxT 9267 - ("ANCHOR-POINT-X isn't a valid decimal number !!!"), 9268 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 9269 - return false; 9270 - } 9271 - } 9272 - if (anchorFaceSeedX < 0.0 || anchorFaceSeedX > 1.0) 9273 - { 9274 - if (check == true) 9275 - { 9276 - wxMessageBox(wxT 9277 - ("ANCHOR-POINT-X must be between 0.0 and 1.0 !!!"), 9278 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 9279 - return false; 9280 - } 9281 - } 9282 - wxTextCtrl *anchorYCtrl = 9283 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_ANCHOR_Y); 9284 - value = anchorYCtrl->GetValue(); 9285 - if (value.ToDouble(&anchorFaceSeedY) != true) 9286 - { 9287 - if (check == true) 9288 - { 9289 - wxMessageBox(wxT 9290 - ("ANCHOR-POINT-Y isn't a valid decimal number !!!"), 9291 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 9292 - return false; 9293 - } 9294 - } 9295 - if (anchorFaceSeedY < 0.0 || anchorFaceSeedY > 1.0) 9296 - { 9297 - if (check == true) 9298 - { 9299 - wxMessageBox(wxT 9300 - ("ANCHOR-POINT-Y must be between 0.0 and 1.0 !!!"), 9301 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 9302 - return false; 9303 - } 9304 - } 9305 - wxTextCtrl *displXCtrl = 9306 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_DISPLACEMENT_X); 9307 - value = displXCtrl->GetValue(); 9308 - if (value.ToDouble(&displacementX) != true) 9309 - { 9310 - if (check == true) 9311 - { 9312 - wxMessageBox(wxT 9313 - ("DISPLACEMENT-X isn't a valid decimal number !!!"), 9314 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 9315 - return false; 9316 - } 9317 - } 9318 - wxTextCtrl *displYCtrl = 9319 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_DISPLACEMENT_Y); 9320 - value = displYCtrl->GetValue(); 9321 - if (value.ToDouble(&displacementY) != true) 9322 - { 9323 - if (check == true) 9324 - { 9325 - wxMessageBox(wxT 9326 - ("DISPLACEMENT-Y isn't a valid decimal number !!!"), 9327 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 9328 - return false; 9329 - } 9330 - } 9331 - wxTextCtrl *colorCtrl = 9332 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_FILL_COLOR); 9333 - wxString color = colorCtrl->GetValue(); 9334 - if (ColorMapEntry::IsValidColor(color) != true) 9335 - { 9336 - if (check == true) 9337 - { 9338 - wxMessageBox(wxT 9339 - ("FILL-COLOR isn't a valid HexRGB color !!!"), 9340 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 9341 - return false; 9342 - } 9343 - } 9344 - strcpy(fillColor, color.ToUTF8()); 9345 - colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR); 9346 - color = colorCtrl->GetValue(); 9347 - if (ColorMapEntry::IsValidColor(color) != true) 9348 - { 9349 - if (check == true) 9350 - { 9351 - wxMessageBox(wxT 9352 - ("STROKE-COLOR isn't a valid HexRGB color !!!"), 9353 - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 9354 - return false; 9355 - } 9356 - } 9357 - strcpy(strokeColor, color.ToUTF8()); 9358 - Style->SetFaceSeedOpacity(opacity); 9359 - Style->SetFaceSeedSize(size); 9360 - Style->SetFaceSeedRotation(rotation); 9361 - Style->SetFaceSeedAnchorX(anchorFaceSeedX); 9362 - Style->SetFaceSeedAnchorY(anchorFaceSeedY); 9363 - Style->SetFaceSeedDisplacementX(displacementX); 9364 - Style->SetFaceSeedDisplacementY(displacementY); 9365 - Style->SetFaceSeedFillColor(fillColor); 9366 - Style->SetFaceSeedStrokeColor(strokeColor); 9367 - return true; 9368 -} 9369 - 9370 -void QuickStyleTopologyDialog::UpdateFaceSeedPage() 9371 -{ 9372 -// 9373 -// updating the FaceSeed FaceSeedizer page 9374 -// 9375 - wxSlider *opacityCtrl = 9376 - (wxSlider *) FindWindow(ID_SYMBOLIZER_FACE_SEED_OPACITY); 9377 - opacityCtrl->SetValue(Style->GetFaceSeedOpacity() * 100.0); 9378 - wxTextCtrl *sizeCtrl = 9379 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_SIZE); 9380 - char dummy[64]; 9381 - sprintf(dummy, "%1.2f", Style->GetFaceSeedSize()); 9382 - wxString str = wxString::FromUTF8(dummy); 9383 - sizeCtrl->SetValue(str); 9384 - wxTextCtrl *rotationCtrl = 9385 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_ROTATION); 9386 - sprintf(dummy, "%1.2f", Style->GetFaceSeedRotation()); 9387 - str = wxString::FromUTF8(dummy); 9388 - rotationCtrl->SetValue(str); 9389 - wxTextCtrl *anchorXCtrl = 9390 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_ANCHOR_X); 9391 - sprintf(dummy, "%1.2f", Style->GetFaceSeedAnchorX()); 9392 - str = wxString::FromUTF8(dummy); 9393 - anchorXCtrl->SetValue(str); 9394 - wxTextCtrl *anchorYCtrl = 9395 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_ANCHOR_Y); 9396 - sprintf(dummy, "%1.2f", Style->GetFaceSeedAnchorY()); 9397 - str = wxString::FromUTF8(dummy); 9398 - anchorYCtrl->SetValue(str); 9399 - wxTextCtrl *displXCtrl = 9400 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_DISPLACEMENT_X); 9401 - sprintf(dummy, "%1.2f", Style->GetFaceSeedDisplacementX()); 9402 - str = wxString::FromUTF8(dummy); 9403 - displXCtrl->SetValue(str); 9404 - wxTextCtrl *displYCtrl = 9405 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_DISPLACEMENT_Y); 9406 - sprintf(dummy, "%1.2f", Style->GetFaceSeedDisplacementY()); 9407 - str = wxString::FromUTF8(dummy); 9408 - displYCtrl->SetValue(str); 9409 - wxRadioBox *markCtrl = 9410 - (wxRadioBox *) FindWindow(ID_SYMBOLIZER_FACE_SEED_MARK); 9411 - switch (Style->GetFaceSeedWellKnownMark()) 9412 - { 9413 - case RL2_GRAPHIC_MARK_CIRCLE: 9414 - markCtrl->SetSelection(1); 9415 - break; 9416 - case RL2_GRAPHIC_MARK_TRIANGLE: 9417 - markCtrl->SetSelection(2); 9418 - break; 9419 - case RL2_GRAPHIC_MARK_STAR: 9420 - markCtrl->SetSelection(3); 9421 - break; 9422 - case RL2_GRAPHIC_MARK_CROSS: 9423 - markCtrl->SetSelection(4); 9424 - break; 9425 - case RL2_GRAPHIC_MARK_X: 9426 - markCtrl->SetSelection(5); 9427 - break; 9428 - default: 9429 - markCtrl->SetSelection(0); 9430 - break; 9431 - }; 9432 - wxTextCtrl *colorFillCtrl = 9433 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_FILL_COLOR); 9434 - wxString fillColor = wxString::FromUTF8(Style->GetFaceSeedFillColor()); 9435 - colorFillCtrl->SetValue(fillColor); 9436 - wxTextCtrl *colorStrokeCtrl = 9437 - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR); 9438 - wxString strokeColor = wxString::FromUTF8(Style->GetFaceSeedStrokeColor()); 9439 - colorStrokeCtrl->SetValue(strokeColor); 9440 -} 9441 - 9442 -void QuickStyleTopologyDialog::OnPageChanging(wxNotebookEvent & event) 9443 -{ 9444 -// 9445 -// TAB/PAGE selection changing 9446 -// 9447 - bool ret = false; 9448 - int idx = event.GetOldSelection(); 9449 - if (idx == 0) 9450 - ret = RetrieveMainPage(); 9451 - else if (idx == 1) 9452 - ret = RetrieveNodePage(); 9453 - else if (idx == 2) 9454 - ret = RetrieveEdgeLinkPage(); 9455 - else 9456 - { 9457 - if (Type == MAP_LAYER_NETWORK) 9458 - { 9459 - if (idx == 3) 9460 - ret = RetrieveEdgeLinkSeedPage(); 9461 - } else 9462 - { 9463 - if (idx == 3) 9464 - ret = RetrieveFacePage(); 9465 - if (idx == 4) 9466 - ret = RetrieveEdgeLinkSeedPage(); 9467 - if (idx == 5) 9468 - ret = RetrieveFaceSeedPage(); 9469 - } 9470 - } 9471 - if (ret != true) 9472 - event.Veto(); 9473 -} 9474 - 9475 -void QuickStyleTopologyDialog::OnPageChanged(wxNotebookEvent & event) 9476 -{ 9477 -// 9478 -// TAB/PAGE selection changed 9479 -// 9480 - int idx = event.GetSelection(); 9481 - if (idx == 0) 9482 - UpdateMainPage(); 9483 - else if (idx == 1) 9484 - UpdateNodePage(); 9485 - else if (idx == 2) 9486 - UpdateEdgeLinkPage(); 9487 - else 9488 - { 9489 - if (Type == MAP_LAYER_NETWORK) 9490 - { 9491 - if (idx == 3) 9492 - UpdateEdgeLinkSeedPage(); 9493 - } else 9494 - { 9495 - if (idx == 3) 9496 - UpdateFacePage(); 9497 - if (idx == 4) 9498 - UpdateEdgeLinkSeedPage(); 9499 - if (idx == 5) 9500 - UpdateFaceSeedPage(); 9501 - } 9502 - } 9503 -} 9504 - 9505 -bool QuickStyleTopologyDialog::UpdateStyle() 9506 -{ 9507 -// 9508 -// updating the QuickStyle 9509 -// 9510 - bool ret = false; 9511 - int idx = GetBookCtrl()->GetSelection(); 9512 - if (idx == 0) 9513 - ret = RetrieveMainPage(); 9514 - else if (idx == 1) 9515 - ret = RetrieveNodePage(); 9516 - else if (idx == 2) 9517 - ret = RetrieveEdgeLinkPage(); 9518 - else 9519 - { 9520 - if (Type == MAP_LAYER_NETWORK) 9521 - { 9522 - if (idx == 3) 9523 - ret = RetrieveEdgeLinkSeedPage(); 9524 - } else 9525 - { 9526 - if (idx == 3) 9527 - ret = RetrieveFacePage(); 9528 - if (idx == 4) 9529 - ret = RetrieveEdgeLinkSeedPage(); 9530 - if (idx == 5) 9531 - ret = RetrieveFaceSeedPage(); 9532 - } 9533 - } 9534 - if (ret == false) 9535 - return false; 9536 - 9537 - VectorLayerConfig *config = Layer->GetVectorConfig(); 9538 - bool setCurrentStyle = false; 9539 - if (config->GetStyle() == NULL) 9540 - setCurrentStyle = true; 9541 - else 9542 - { 9543 - if (strcmp(Style->GetUUID(), config->GetStyle()) != 0) 9544 - setCurrentStyle = true; 9545 - } 9546 - if (setCurrentStyle == true) 9547 - { 9548 - config->SetStyle(Style->GetUUID()); 9549 - IsConfigChanged = true; 9550 - } 9551 - IsConfigChanged = Layer->UpdateQuickStyle(Style); 9552 - return true; 9553 -} 9554 - 9555 -void QuickStyleTopologyDialog::OnOk(wxCommandEvent & WXUNUSED(event)) 9556 -{ 9557 -// 9558 -// permanently saving the QuickStyle and quitting 9559 -// 9560 - if (UpdateStyle() == true) 9561 - wxDialog::EndModal(wxID_OK); 9562 -} 9563 - 9564 -void QuickStyleTopologyDialog::OnApply(wxCommandEvent & WXUNUSED(event)) 9565 -{ 9566 -// 9567 -// applying the QuickStyle and continuing 9568 -// 9569 - if (UpdateStyle() == true) 9570 - { 9571 - if (IsConfigChanged == true) 9572 - MapPanel->RefreshMap(); 9573 - } 9574 -} 9575 - 9576 -void QuickStyleTopologyDialog::OnExport(wxCommandEvent & WXUNUSED(event)) 9577 -{ 9578 -// 9579 -// exporting the Quick Style as an external file 9580 -// 9581 - bool xret = false; 9582 - int ret; 9583 - wxString path; 9584 - wxString lastDir; 9585 - int idx = GetBookCtrl()->GetSelection(); 9586 - if (idx == 0) 9587 - xret = RetrieveMainPage(); 9588 - else if (idx == 1) 9589 - xret = RetrieveNodePage(); 9590 - else if (idx == 2) 9591 - xret = RetrieveEdgeLinkPage(); 9592 - else 9593 - { 9594 - if (Type == MAP_LAYER_NETWORK) 9595 - { 9596 - if (idx == 3) 9597 - xret = RetrieveEdgeLinkSeedPage(); 9598 - } else 9599 - { 9600 - if (idx == 3) 9601 - xret = RetrieveFacePage(); 9602 - if (idx == 4) 9603 - xret = RetrieveEdgeLinkSeedPage(); 9604 - if (idx == 5) 9605 - xret = RetrieveFaceSeedPage(); 9606 - } 9607 - } 9608 - if (xret == false) 9609 - return; 9610 - 9611 - wxFileDialog fileDialog(this, 9612 - wxT("Exporting an SLD/SE QuickStyle to a file"), 9613 - wxT(""), wxT("style.xml"), 9614 - wxT("XML Document|*.xml|All files (*.*)|*.*"), 9615 - wxFD_SAVE | wxFD_OVERWRITE_PROMPT, wxDefaultPosition, 9616 - wxDefaultSize, wxT("filedlg")); 9617 - lastDir = MainFrame->GetLastDirectory(); 9618 - if (lastDir.Len() >= 1) 9619 - fileDialog.SetDirectory(lastDir); 9620 - ret = fileDialog.ShowModal(); 9621 - if (ret == wxID_OK) 9622 - { 9623 - wxFileName file(fileDialog.GetPath()); 9624 - path = file.GetPath(); 9625 - path += file.GetPathSeparator(); 9626 - path += file.GetName(); 9627 - lastDir = file.GetPath(); 9628 - path = fileDialog.GetPath(); 9629 - FILE *out = fopen(path.ToUTF8(), "wb"); 9630 - if (out == NULL) 9631 - wxMessageBox(wxT("ERROR: unable to create:\n\n\"") + path + wxT("\""), 9632 - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 9633 - else 9634 - { 9635 - char *xml = Style->CreateXmlStyle(); 9636 - fwrite(xml, 1, strlen(xml), out); 9637 - sqlite3_free(xml); 9638 - fclose(out); 9639 - wxMessageBox(wxT 9640 - ("SLD/SE QuickStyle successfully saved into:\n\n\"") 9641 - + path + wxT("\""), wxT("spatialite_gui"), 9642 - wxOK | wxICON_INFORMATION, this); 9643 - } 9644 - } 9645 -} 9646 - 9647 -void QuickStyleTopologyDialog::OnCopy(wxCommandEvent & WXUNUSED(event)) 9648 -{ 9649 -// 9650 -// Copying the Quick Style into the Clipboard 9651 -// 9652 - bool ret = false; 9653 - int idx = GetBookCtrl()->GetSelection(); 9654 - if (idx == 0) 9655 - ret = RetrieveMainPage(); 9656 - else if (idx == 1) 9657 - ret = RetrieveNodePage(); 9658 - else if (idx == 2) 9659 - ret = RetrieveEdgeLinkPage(); 9660 - else 9661 - { 9662 - if (Type == MAP_LAYER_NETWORK) 9663 - { 9664 - if (idx == 3) 9665 - ret = RetrieveEdgeLinkSeedPage(); 9666 - } else 9667 - { 9668 - if (idx == 3) 9669 - ret = RetrieveFacePage(); 9670 - if (idx == 4) 9671 - ret = RetrieveEdgeLinkSeedPage(); 9672 - if (idx == 5) 9673 - ret = RetrieveFaceSeedPage(); 9674 - } 9675 - } 9676 - if (ret == false) 9677 - return; 9678 - 9679 - char *xml = Style->CreateXmlStyle(); 9680 - wxString XMLstring = wxString::FromUTF8(xml); 9681 - sqlite3_free(xml); 9682 - if (wxTheClipboard->Open()) 9683 - { 9684 - wxTheClipboard->SetData(new wxTextDataObject(XMLstring)); 9685 - wxTheClipboard->Close(); 9686 - } 9687 -} 9688 - 9689 -void QuickStyleTopologyDialog::OnQuit(wxCommandEvent & WXUNUSED(event)) 9690 -{ 9691 -// 9692 -// all done: 9693 -// 9694 - wxDialog::EndModal(wxID_CANCEL); 9695 -}
Added QuickStylesRaster.cpp.
1 +/* 2 +/ QuickStylesRaster.cpp 3 +/ Quick Styles wizards (Raster layers) 4 +/ 5 +/ version 2.0, 2018 June 7 6 +/ 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 +/ 9 +/ Copyright (C) 2017 Alessandro Furieri 10 +/ 11 +/ This program is free software: you can redistribute it and/or modify 12 +/ it under the terms of the GNU General Public License as published by 13 +/ the Free Software Foundation, either version 3 of the License, or 14 +/ (at your option) any later version. 15 +/ 16 +/ This program is distributed in the hope that it will be useful, 17 +/ but WITHOUT ANY WARRANTY; without even the implied warranty of 18 +/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 +/ GNU General Public License for more details. 20 +/ 21 +/ You should have received a copy of the GNU General Public License 22 +/ along with this program. If not, see <http://www.gnu.org/licenses/>. 23 +/ 24 +*/ 25 + 26 +#include "Classdef.h" 27 + 28 +#include "wx/spinctrl.h" 29 +#include "wx/imaglist.h" 30 +#include "wx/colordlg.h" 31 +#include "wx/filename.h" 32 +#include "wx/clipbrd.h" 33 + 34 +QuickStyleRasterObj::QuickStyleRasterObj() 35 +{ 36 +// ctor 37 + QuickStyleObj::DoGetUUID(UUID); 38 + MinScaleEnabled = false; 39 + MaxScaleEnabled = false; 40 + ScaleMin = 0.0; 41 + ScaleMax = 0.0; 42 + Opacity = 1.0; 43 + Normalize = false; 44 + Histogram = false; 45 + Gamma = false; 46 + GammaValue = 1.0; 47 + TripleBand = false; 48 + SingleBand = false; 49 + RedBand = 0; 50 + GreenBand = 0; 51 + BlueBand = 0; 52 + GrayBand = 0; 53 + SrtmColorMap = false; 54 + TerrainColorMap = false; 55 + NdviColorMap = false; 56 + ColorRamp = false; 57 + MinValue = 0.0; 58 + ShadedRelief = false; 59 + ShadedReliefFactor = 0.0; 60 + QuickStyleObj::RandomColor(MinValueColor); 61 + MaxValue = 0.0; 62 + QuickStyleObj::RandomColor(MaxValueColor); 63 + XmlStyle = NULL; 64 +} 65 + 66 +QuickStyleRasterObj *QuickStyleRasterObj::Clone() 67 +{ 68 +// 69 +// cloning a Quick Style - Raster 70 +// 71 + QuickStyleRasterObj *Style = new QuickStyleRasterObj(); 72 + strcpy(Style->UUID, this->UUID); 73 + Style->MinScaleEnabled = this->MinScaleEnabled; 74 + Style->MaxScaleEnabled = this->MaxScaleEnabled; 75 + Style->ScaleMin = this->ScaleMin; 76 + Style->ScaleMax = this->ScaleMax; 77 + Style->Opacity = this->Opacity; 78 + Style->Normalize = this->Normalize; 79 + Style->Histogram = this->Histogram; 80 + Style->Gamma = this->Gamma; 81 + Style->GammaValue = this->GammaValue; 82 + Style->TripleBand = this->TripleBand; 83 + Style->SingleBand = this->SingleBand; 84 + Style->RedBand = this->RedBand; 85 + Style->GreenBand = this->GreenBand; 86 + Style->BlueBand = this->BlueBand; 87 + Style->GrayBand = this->GrayBand; 88 + Style->SrtmColorMap = this->SrtmColorMap; 89 + Style->TerrainColorMap = this->TerrainColorMap; 90 + Style->NdviColorMap = this->NdviColorMap; 91 + Style->ColorRamp = this->ColorRamp; 92 + Style->MinValue = this->MinValue; 93 + strcpy(Style->MinValueColor, this->MinValueColor); 94 + Style->MaxValue = this->MaxValue; 95 + strcpy(Style->MaxValueColor, this->MaxValueColor); 96 + Style->ShadedRelief = this->ShadedRelief; 97 + Style->ShadedReliefFactor = this->ShadedReliefFactor; 98 + Style->XmlStyle = NULL; 99 + return Style; 100 +} 101 + 102 +bool QuickStyleRasterObj::Compare(QuickStyleRasterObj * Style) 103 +{ 104 +// 105 +// comparing two Quick Style objects - Raster 106 +// 107 + if (Style == NULL) 108 + return false; 109 + if (strcmp(Style->UUID, this->UUID) != 0) 110 + return false; 111 + if (Style->MinScaleEnabled != this->MinScaleEnabled) 112 + return false; 113 + if (Style->MaxScaleEnabled != this->MaxScaleEnabled) 114 + return false; 115 + if (Style->ScaleMin != this->ScaleMin) 116 + return false; 117 + if (Style->ScaleMax != this->ScaleMax) 118 + return false; 119 + if (Style->Opacity != this->Opacity) 120 + return false; 121 + if (Style->Normalize != this->Normalize) 122 + return false; 123 + if (Style->Histogram != this->Histogram) 124 + return false; 125 + if (Style->Gamma != this->Gamma) 126 + return false; 127 + if (Style->GammaValue != this->GammaValue) 128 + return false; 129 + if (Style->TripleBand != this->TripleBand) 130 + return false; 131 + if (Style->SingleBand != this->SingleBand) 132 + return false; 133 + if (Style->RedBand != this->RedBand) 134 + return false; 135 + if (Style->GreenBand != this->GreenBand) 136 + return false; 137 + if (Style->BlueBand != this->BlueBand) 138 + return false; 139 + if (Style->GrayBand != this->GrayBand) 140 + return false; 141 + if (Style->SrtmColorMap != this->SrtmColorMap) 142 + return false; 143 + if (Style->TerrainColorMap != this->TerrainColorMap) 144 + return false; 145 + if (Style->NdviColorMap != this->NdviColorMap) 146 + return false; 147 + if (Style->ColorRamp != this->ColorRamp) 148 + return false; 149 + if (Style->MinValue != this->MinValue) 150 + return false; 151 + if (strcmp(Style->MinValueColor, this->MinValueColor) != 0) 152 + return false; 153 + if (Style->MaxValue != this->MaxValue) 154 + return false; 155 + if (strcmp(Style->MaxValueColor, this->MaxValueColor) != 0) 156 + return false; 157 + if (Style->ShadedRelief != this->ShadedRelief) 158 + return false; 159 + if (Style->ShadedReliefFactor != this->ShadedReliefFactor) 160 + return false; 161 + return true; 162 +} 163 + 164 +char *QuickStyleRasterObj::DoCreatePredefinedSrtmStyle(char *base_xml) 165 +{ 166 +// 167 +// creating the predefined SRTM Style 168 +// 169 + char *prev = base_xml; 170 + char *xml = sqlite3_mprintf("%s\t\t\t<ColorMap>\r\n", prev); 171 + sqlite3_free(prev); 172 + prev = xml; 173 + xml = 174 + sqlite3_mprintf("%s\t\t\t\t<Interpolate fallbackValue=\"#ffffff\">\r\n", 175 + prev); 176 + sqlite3_free(prev); 177 + prev = xml; 178 + xml = 179 + sqlite3_mprintf("%s\t\t\t\t\t<LookupValue>Rasterdata</LookupValue>\r\n", 180 + prev); 181 + sqlite3_free(prev); 182 + prev = xml; 183 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 184 + sqlite3_free(prev); 185 + prev = xml; 186 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>-11000.00000000</Data>\r\n", prev); 187 + sqlite3_free(prev); 188 + prev = xml; 189 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#000000</Value>\r\n", prev); 190 + sqlite3_free(prev); 191 + prev = xml; 192 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 193 + sqlite3_free(prev); 194 + prev = xml; 195 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 196 + sqlite3_free(prev); 197 + prev = xml; 198 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>-8000.00000000</Data>\r\n", prev); 199 + sqlite3_free(prev); 200 + prev = xml; 201 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#000032</Value>\r\n", prev); 202 + sqlite3_free(prev); 203 + prev = xml; 204 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 205 + sqlite3_free(prev); 206 + prev = xml; 207 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 208 + sqlite3_free(prev); 209 + prev = xml; 210 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>-5000.00000000</Data>\r\n", prev); 211 + sqlite3_free(prev); 212 + prev = xml; 213 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#0a0a64</Value>\r\n", prev); 214 + sqlite3_free(prev); 215 + prev = xml; 216 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 217 + sqlite3_free(prev); 218 + prev = xml; 219 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 220 + sqlite3_free(prev); 221 + prev = xml; 222 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>-3000.00000000</Data>\r\n", prev); 223 + sqlite3_free(prev); 224 + prev = xml; 225 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#1e1e96</Value>\r\n", prev); 226 + sqlite3_free(prev); 227 + prev = xml; 228 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 229 + sqlite3_free(prev); 230 + prev = xml; 231 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 232 + sqlite3_free(prev); 233 + prev = xml; 234 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>-1000.00000000</Data>\r\n", prev); 235 + sqlite3_free(prev); 236 + prev = xml; 237 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#4646c8</Value>\r\n", prev); 238 + sqlite3_free(prev); 239 + prev = xml; 240 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 241 + sqlite3_free(prev); 242 + prev = xml; 243 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 244 + sqlite3_free(prev); 245 + prev = xml; 246 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>-100.00000000</Data>\r\n", prev); 247 + sqlite3_free(prev); 248 + prev = xml; 249 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#6464e1</Value>\r\n", prev); 250 + sqlite3_free(prev); 251 + prev = xml; 252 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 253 + sqlite3_free(prev); 254 + prev = xml; 255 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 256 + sqlite3_free(prev); 257 + prev = xml; 258 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>0.00000000</Data>\r\n", prev); 259 + sqlite3_free(prev); 260 + prev = xml; 261 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#aaaaff</Value>\r\n", prev); 262 + sqlite3_free(prev); 263 + prev = xml; 264 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 265 + sqlite3_free(prev); 266 + prev = xml; 267 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 268 + sqlite3_free(prev); 269 + prev = xml; 270 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>0.10000000</Data>\r\n", prev); 271 + sqlite3_free(prev); 272 + prev = xml; 273 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#399769</Value>\r\n", prev); 274 + sqlite3_free(prev); 275 + prev = xml; 276 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 277 + sqlite3_free(prev); 278 + prev = xml; 279 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 280 + sqlite3_free(prev); 281 + prev = xml; 282 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>100.00000000</Data>\r\n", prev); 283 + sqlite3_free(prev); 284 + prev = xml; 285 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#75c25d</Value>\r\n", prev); 286 + sqlite3_free(prev); 287 + prev = xml; 288 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 289 + sqlite3_free(prev); 290 + prev = xml; 291 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 292 + sqlite3_free(prev); 293 + prev = xml; 294 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>500.00000000</Data>\r\n", prev); 295 + sqlite3_free(prev); 296 + prev = xml; 297 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#e6e680</Value>\r\n", prev); 298 + sqlite3_free(prev); 299 + prev = xml; 300 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 301 + sqlite3_free(prev); 302 + prev = xml; 303 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 304 + sqlite3_free(prev); 305 + prev = xml; 306 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>1000.00000000</Data>\r\n", prev); 307 + sqlite3_free(prev); 308 + prev = xml; 309 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#ca9e4b</Value>\r\n", prev); 310 + sqlite3_free(prev); 311 + prev = xml; 312 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 313 + sqlite3_free(prev); 314 + prev = xml; 315 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 316 + sqlite3_free(prev); 317 + prev = xml; 318 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>2000.00000000</Data>\r\n", prev); 319 + sqlite3_free(prev); 320 + prev = xml; 321 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#b99a64</Value>\r\n", prev); 322 + sqlite3_free(prev); 323 + prev = xml; 324 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 325 + sqlite3_free(prev); 326 + prev = xml; 327 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 328 + sqlite3_free(prev); 329 + prev = xml; 330 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>3000.00000000</Data>\r\n", prev); 331 + sqlite3_free(prev); 332 + prev = xml; 333 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#dcdcdc</Value>\r\n", prev); 334 + sqlite3_free(prev); 335 + prev = xml; 336 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 337 + sqlite3_free(prev); 338 + prev = xml; 339 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 340 + sqlite3_free(prev); 341 + prev = xml; 342 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>5000.00000000</Data>\r\n", prev); 343 + sqlite3_free(prev); 344 + prev = xml; 345 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#ffffff</Value>\r\n", prev); 346 + sqlite3_free(prev); 347 + prev = xml; 348 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 349 + sqlite3_free(prev); 350 + prev = xml; 351 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 352 + sqlite3_free(prev); 353 + prev = xml; 354 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>8850.00000000</Data>\r\n", prev); 355 + sqlite3_free(prev); 356 + prev = xml; 357 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#6464c8</Value>\r\n", prev); 358 + sqlite3_free(prev); 359 + prev = xml; 360 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 361 + sqlite3_free(prev); 362 + prev = xml; 363 + xml = sqlite3_mprintf("%s\t\t\t\t</Interpolate>\r\n", prev); 364 + sqlite3_free(prev); 365 + prev = xml; 366 + xml = sqlite3_mprintf("%s\t\t\t</ColorMap>\r\n", prev); 367 + sqlite3_free(prev); 368 + return xml; 369 +} 370 + 371 +char *QuickStyleRasterObj::DoCreatePredefinedTerrainStyle(char *base_xml) 372 +{ 373 +// 374 +// creating the predefined Terrain Style 375 +// 376 + char *prev = base_xml; 377 + char *xml = sqlite3_mprintf("%s\t\t\t<ColorMap>\r\n", prev); 378 + sqlite3_free(prev); 379 + prev = xml; 380 + xml = 381 + sqlite3_mprintf("%s\t\t\t\t<Interpolate fallbackValue=\"#ffffff\">\r\n", 382 + prev); 383 + sqlite3_free(prev); 384 + prev = xml; 385 + xml = 386 + sqlite3_mprintf("%s\t\t\t\t\t<LookupValue>Rasterdata</LookupValue>\r\n", 387 + prev); 388 + sqlite3_free(prev); 389 + prev = xml; 390 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 391 + sqlite3_free(prev); 392 + prev = xml; 393 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>-11000.00000000</Data>\r\n", prev); 394 + sqlite3_free(prev); 395 + prev = xml; 396 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#000000</Value>\r\n", prev); 397 + sqlite3_free(prev); 398 + prev = xml; 399 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 400 + sqlite3_free(prev); 401 + prev = xml; 402 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 403 + sqlite3_free(prev); 404 + prev = xml; 405 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>-500.00000000</Data>\r\n", prev); 406 + sqlite3_free(prev); 407 + prev = xml; 408 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#00001e</Value>\r\n", prev); 409 + sqlite3_free(prev); 410 + prev = xml; 411 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 412 + sqlite3_free(prev); 413 + prev = xml; 414 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 415 + sqlite3_free(prev); 416 + prev = xml; 417 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>-100.00000000</Data>\r\n", prev); 418 + sqlite3_free(prev); 419 + prev = xml; 420 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#0000c8</Value>\r\n", prev); 421 + sqlite3_free(prev); 422 + prev = xml; 423 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 424 + sqlite3_free(prev); 425 + prev = xml; 426 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 427 + sqlite3_free(prev); 428 + prev = xml; 429 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>-1.00000000</Data>\r\n", prev); 430 + sqlite3_free(prev); 431 + prev = xml; 432 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#9696ff</Value>\r\n", prev); 433 + sqlite3_free(prev); 434 + prev = xml; 435 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 436 + sqlite3_free(prev); 437 + prev = xml; 438 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 439 + sqlite3_free(prev); 440 + prev = xml; 441 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>0.00000000</Data>\r\n", prev); 442 + sqlite3_free(prev); 443 + prev = xml; 444 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#007800</Value>\r\n", prev); 445 + sqlite3_free(prev); 446 + prev = xml; 447 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 448 + sqlite3_free(prev); 449 + prev = xml; 450 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 451 + sqlite3_free(prev); 452 + prev = xml; 453 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>100.00000000</Data>\r\n", prev); 454 + sqlite3_free(prev); 455 + prev = xml; 456 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#009600</Value>\r\n", prev); 457 + sqlite3_free(prev); 458 + prev = xml; 459 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 460 + sqlite3_free(prev); 461 + prev = xml; 462 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 463 + sqlite3_free(prev); 464 + prev = xml; 465 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>270.00000000</Data>\r\n", prev); 466 + sqlite3_free(prev); 467 + prev = xml; 468 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#5aa55a</Value>\r\n", prev); 469 + sqlite3_free(prev); 470 + prev = xml; 471 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 472 + sqlite3_free(prev); 473 + prev = xml; 474 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 475 + sqlite3_free(prev); 476 + prev = xml; 477 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>300.00000000</Data>\r\n", prev); 478 + sqlite3_free(prev); 479 + prev = xml; 480 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#5aaf5a</Value>\r\n", prev); 481 + sqlite3_free(prev); 482 + prev = xml; 483 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 484 + sqlite3_free(prev); 485 + prev = xml; 486 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 487 + sqlite3_free(prev); 488 + prev = xml; 489 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>500.00000000</Data>\r\n", prev); 490 + sqlite3_free(prev); 491 + prev = xml; 492 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#32b432</Value>\r\n", prev); 493 + sqlite3_free(prev); 494 + prev = xml; 495 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 496 + sqlite3_free(prev); 497 + prev = xml; 498 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 499 + sqlite3_free(prev); 500 + prev = xml; 501 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>500.00000000</Data>\r\n", prev); 502 + sqlite3_free(prev); 503 + prev = xml; 504 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#46aa46</Value>\r\n", prev); 505 + sqlite3_free(prev); 506 + prev = xml; 507 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 508 + sqlite3_free(prev); 509 + prev = xml; 510 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 511 + sqlite3_free(prev); 512 + prev = xml; 513 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>1000.00000000</Data>\r\n", prev); 514 + sqlite3_free(prev); 515 + prev = xml; 516 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#46914b</Value>\r\n", prev); 517 + sqlite3_free(prev); 518 + prev = xml; 519 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 520 + sqlite3_free(prev); 521 + prev = xml; 522 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 523 + sqlite3_free(prev); 524 + prev = xml; 525 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>1000.00000000</Data>\r\n", prev); 526 + sqlite3_free(prev); 527 + prev = xml; 528 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#469b4b</Value>\r\n", prev); 529 + sqlite3_free(prev); 530 + prev = xml; 531 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 532 + sqlite3_free(prev); 533 + prev = xml; 534 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 535 + sqlite3_free(prev); 536 + prev = xml; 537 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>2000.00000000</Data>\r\n", prev); 538 + sqlite3_free(prev); 539 + prev = xml; 540 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#969c64</Value>\r\n", prev); 541 + sqlite3_free(prev); 542 + prev = xml; 543 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 544 + sqlite3_free(prev); 545 + prev = xml; 546 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 547 + sqlite3_free(prev); 548 + prev = xml; 549 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>2800.00000000</Data>\r\n", prev); 550 + sqlite3_free(prev); 551 + prev = xml; 552 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#dcdcdc</Value>\r\n", prev); 553 + sqlite3_free(prev); 554 + prev = xml; 555 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 556 + sqlite3_free(prev); 557 + prev = xml; 558 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 559 + sqlite3_free(prev); 560 + prev = xml; 561 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>3000.00000000</Data>\r\n", prev); 562 + sqlite3_free(prev); 563 + prev = xml; 564 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#ffffff</Value>\r\n", prev); 565 + sqlite3_free(prev); 566 + prev = xml; 567 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 568 + sqlite3_free(prev); 569 + prev = xml; 570 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 571 + sqlite3_free(prev); 572 + prev = xml; 573 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>8850.00000000</Data>\r\n", prev); 574 + sqlite3_free(prev); 575 + prev = xml; 576 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#ffffff</Value>\r\n", prev); 577 + sqlite3_free(prev); 578 + prev = xml; 579 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 580 + sqlite3_free(prev); 581 + prev = xml; 582 + xml = sqlite3_mprintf("%s\t\t\t\t</Interpolate>\r\n", prev); 583 + sqlite3_free(prev); 584 + prev = xml; 585 + xml = sqlite3_mprintf("%s\t\t\t</ColorMap>\r\n", prev); 586 + sqlite3_free(prev); 587 + return xml; 588 +} 589 + 590 +char *QuickStyleRasterObj::DoCreatePredefinedNdviStyle(char *base_xml) 591 +{ 592 +// 593 +// creating the predefined NDVI Style 594 +// 595 + char *prev = base_xml; 596 + char *xml = sqlite3_mprintf("%s\t\t\t<ColorMap>\r\n", prev); 597 + sqlite3_free(prev); 598 + prev = xml; 599 + xml = 600 + sqlite3_mprintf("%s\t\t\t\t<Interpolate fallbackValue=\"#ffffff\">\r\n", 601 + prev); 602 + sqlite3_free(prev); 603 + prev = xml; 604 + xml = 605 + sqlite3_mprintf("%s\t\t\t\t\t<LookupValue>Rasterdata</LookupValue>\r\n", 606 + prev); 607 + sqlite3_free(prev); 608 + prev = xml; 609 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 610 + sqlite3_free(prev); 611 + prev = xml; 612 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>-1.00000000</Data>\r\n", prev); 613 + sqlite3_free(prev); 614 + prev = xml; 615 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#051852</Value>\r\n", prev); 616 + sqlite3_free(prev); 617 + prev = xml; 618 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 619 + sqlite3_free(prev); 620 + prev = xml; 621 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 622 + sqlite3_free(prev); 623 + prev = xml; 624 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>-0.30000000</Data>\r\n", prev); 625 + sqlite3_free(prev); 626 + prev = xml; 627 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#051852</Value>\r\n", prev); 628 + sqlite3_free(prev); 629 + prev = xml; 630 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 631 + sqlite3_free(prev); 632 + prev = xml; 633 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 634 + sqlite3_free(prev); 635 + prev = xml; 636 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>-0.18000000</Data>\r\n", prev); 637 + sqlite3_free(prev); 638 + prev = xml; 639 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#ffffff</Value>\r\n", prev); 640 + sqlite3_free(prev); 641 + prev = xml; 642 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 643 + sqlite3_free(prev); 644 + prev = xml; 645 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 646 + sqlite3_free(prev); 647 + prev = xml; 648 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>0.00000000</Data>\r\n", prev); 649 + sqlite3_free(prev); 650 + prev = xml; 651 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#ffffff</Value>\r\n", prev); 652 + sqlite3_free(prev); 653 + prev = xml; 654 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 655 + sqlite3_free(prev); 656 + prev = xml; 657 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 658 + sqlite3_free(prev); 659 + prev = xml; 660 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>0.02500000</Data>\r\n", prev); 661 + sqlite3_free(prev); 662 + prev = xml; 663 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#cec5b4</Value>\r\n", prev); 664 + sqlite3_free(prev); 665 + prev = xml; 666 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 667 + sqlite3_free(prev); 668 + prev = xml; 669 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 670 + sqlite3_free(prev); 671 + prev = xml; 672 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>0.07500000</Data>\r\n", prev); 673 + sqlite3_free(prev); 674 + prev = xml; 675 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#bfa37c</Value>\r\n", prev); 676 + sqlite3_free(prev); 677 + prev = xml; 678 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 679 + sqlite3_free(prev); 680 + prev = xml; 681 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 682 + sqlite3_free(prev); 683 + prev = xml; 684 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>0.12500000</Data>\r\n", prev); 685 + sqlite3_free(prev); 686 + prev = xml; 687 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#b3ae60</Value>\r\n", prev); 688 + sqlite3_free(prev); 689 + prev = xml; 690 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 691 + sqlite3_free(prev); 692 + prev = xml; 693 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 694 + sqlite3_free(prev); 695 + prev = xml; 696 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>0.15000000</Data>\r\n", prev); 697 + sqlite3_free(prev); 698 + prev = xml; 699 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#a3b550</Value>\r\n", prev); 700 + sqlite3_free(prev); 701 + prev = xml; 702 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 703 + sqlite3_free(prev); 704 + prev = xml; 705 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 706 + sqlite3_free(prev); 707 + prev = xml; 708 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>0.17500000</Data>\r\n", prev); 709 + sqlite3_free(prev); 710 + prev = xml; 711 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#90aa3c</Value>\r\n", prev); 712 + sqlite3_free(prev); 713 + prev = xml; 714 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 715 + sqlite3_free(prev); 716 + prev = xml; 717 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 718 + sqlite3_free(prev); 719 + prev = xml; 720 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>0.23300000</Data>\r\n", prev); 721 + sqlite3_free(prev); 722 + prev = xml; 723 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#a6c31d</Value>\r\n", prev); 724 + sqlite3_free(prev); 725 + prev = xml; 726 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 727 + sqlite3_free(prev); 728 + prev = xml; 729 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 730 + sqlite3_free(prev); 731 + prev = xml; 732 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>0.26600000</Data>\r\n", prev); 733 + sqlite3_free(prev); 734 + prev = xml; 735 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#87b703</Value>\r\n", prev); 736 + sqlite3_free(prev); 737 + prev = xml; 738 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 739 + sqlite3_free(prev); 740 + prev = xml; 741 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 742 + sqlite3_free(prev); 743 + prev = xml; 744 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>0.33300000</Data>\r\n", prev); 745 + sqlite3_free(prev); 746 + prev = xml; 747 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#79af01</Value>\r\n", prev); 748 + sqlite3_free(prev); 749 + prev = xml; 750 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 751 + sqlite3_free(prev); 752 + prev = xml; 753 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 754 + sqlite3_free(prev); 755 + prev = xml; 756 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>0.36600000</Data>\r\n", prev); 757 + sqlite3_free(prev); 758 + prev = xml; 759 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#65a300</Value>\r\n", prev); 760 + sqlite3_free(prev); 761 + prev = xml; 762 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 763 + sqlite3_free(prev); 764 + prev = xml; 765 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 766 + sqlite3_free(prev); 767 + prev = xml; 768 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>0.43300000</Data>\r\n", prev); 769 + sqlite3_free(prev); 770 + prev = xml; 771 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#4e9700</Value>\r\n", prev); 772 + sqlite3_free(prev); 773 + prev = xml; 774 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 775 + sqlite3_free(prev); 776 + prev = xml; 777 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 778 + sqlite3_free(prev); 779 + prev = xml; 780 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>0.46600000</Data>\r\n", prev); 781 + sqlite3_free(prev); 782 + prev = xml; 783 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#2b8404</Value>\r\n", prev); 784 + sqlite3_free(prev); 785 + prev = xml; 786 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 787 + sqlite3_free(prev); 788 + prev = xml; 789 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 790 + sqlite3_free(prev); 791 + prev = xml; 792 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>0.55000000</Data>\r\n", prev); 793 + sqlite3_free(prev); 794 + prev = xml; 795 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#007200</Value>\r\n", prev); 796 + sqlite3_free(prev); 797 + prev = xml; 798 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 799 + sqlite3_free(prev); 800 + prev = xml; 801 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 802 + sqlite3_free(prev); 803 + prev = xml; 804 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>0.65000000</Data>\r\n", prev); 805 + sqlite3_free(prev); 806 + prev = xml; 807 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#005a01</Value>\r\n", prev); 808 + sqlite3_free(prev); 809 + prev = xml; 810 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 811 + sqlite3_free(prev); 812 + prev = xml; 813 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 814 + sqlite3_free(prev); 815 + prev = xml; 816 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>0.75000000</Data>\r\n", prev); 817 + sqlite3_free(prev); 818 + prev = xml; 819 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#004900</Value>\r\n", prev); 820 + sqlite3_free(prev); 821 + prev = xml; 822 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 823 + sqlite3_free(prev); 824 + prev = xml; 825 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 826 + sqlite3_free(prev); 827 + prev = xml; 828 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>0.85000000</Data>\r\n", prev); 829 + sqlite3_free(prev); 830 + prev = xml; 831 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#003800</Value>\r\n", prev); 832 + sqlite3_free(prev); 833 + prev = xml; 834 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 835 + sqlite3_free(prev); 836 + prev = xml; 837 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 838 + sqlite3_free(prev); 839 + prev = xml; 840 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>0.95000000</Data>\r\n", prev); 841 + sqlite3_free(prev); 842 + prev = xml; 843 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#001f00</Value>\r\n", prev); 844 + sqlite3_free(prev); 845 + prev = xml; 846 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 847 + sqlite3_free(prev); 848 + prev = xml; 849 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 850 + sqlite3_free(prev); 851 + prev = xml; 852 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Data>1.00000000</Data>\r\n", prev); 853 + sqlite3_free(prev); 854 + prev = xml; 855 + xml = sqlite3_mprintf("%s\t\t\t\t\t\t<Value>#000000</Value>\r\n", prev); 856 + sqlite3_free(prev); 857 + prev = xml; 858 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 859 + sqlite3_free(prev); 860 + prev = xml; 861 + xml = sqlite3_mprintf("%s\t\t\t\t</Interpolate>\r\n", prev); 862 + sqlite3_free(prev); 863 + prev = xml; 864 + xml = sqlite3_mprintf("%s\t\t\t</ColorMap>\r\n", prev); 865 + sqlite3_free(prev); 866 + return xml; 867 +} 868 + 869 +char *QuickStyleRasterObj::CreateXmlStyle() 870 +{ 871 +// 872 +// creating the XML Style 873 +// 874 + if (MinScaleEnabled == false && MaxScaleEnabled == false && Opacity == 1.0 875 + && Normalize == false && Histogram == false && Gamma == false 876 + && TripleBand == false && SingleBand == false && SrtmColorMap == false 877 + && TerrainColorMap == false && NdviColorMap == false && ColorRamp == false 878 + && ShadedRelief == false) 879 + return NULL; // NULL Raster Style - no option is set 880 + 881 + char *prev; 882 + char *xml = sqlite3_mprintf("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"); 883 + prev = xml; 884 + xml = sqlite3_mprintf("%s<CoverageStyle version=\"1.1.0\" ", prev); 885 + sqlite3_free(prev); 886 + prev = xml; 887 + xml = 888 + sqlite3_mprintf 889 + ("%sxsi:schemaLocation=\"http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/FeatureStyle.xsd\" ", 890 + prev); 891 + sqlite3_free(prev); 892 + prev = xml; 893 + xml = sqlite3_mprintf 894 + ("%sxmlns=\"http://www.opengis.net/se\" xmlns:ogc=\"http://www.opengis.net/ogc\" ", 895 + prev); 896 + sqlite3_free(prev); 897 + prev = xml; 898 + xml = 899 + sqlite3_mprintf("%sxmlns:xlink=\"http://www.w3.org/1999/xlink\" ", prev); 900 + sqlite3_free(prev); 901 + prev = xml; 902 + xml = 903 + sqlite3_mprintf 904 + ("%sxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n", prev); 905 + sqlite3_free(prev); 906 + prev = xml; 907 + xml = sqlite3_mprintf("%s\t<Name>%s</Name>\r\n", prev, UUID); 908 + sqlite3_free(prev); 909 + prev = xml; 910 + xml = sqlite3_mprintf("%s\t<Description>\r\n", prev); 911 + sqlite3_free(prev); 912 + prev = xml; 913 + xml = sqlite3_mprintf("%s\t\t<Title>%s</Title>\r\n", prev, "Quick Style"); 914 + sqlite3_free(prev); 915 + prev = xml; 916 + xml = 917 + sqlite3_mprintf("%s\t\t<Abstract>%s</Abstract>\r\n", prev, 918 + "Created by SpatialiteGUI"); 919 + sqlite3_free(prev); 920 + prev = xml; 921 + xml = sqlite3_mprintf("%s\t</Description>\r\n", prev); 922 + sqlite3_free(prev); 923 + prev = xml; 924 + xml = sqlite3_mprintf("%s\t<Rule>\r\n", prev); 925 + sqlite3_free(prev); 926 + prev = xml; 927 + if (MinScaleEnabled == true) 928 + { 929 + xml = 930 + sqlite3_mprintf 931 + ("%s\t\t<MinScaleDenominator>%1.2f</MinScaleDenominator>\r\n", prev, 932 + ScaleMin); 933 + sqlite3_free(prev); 934 + prev = xml; 935 + } 936 + if (MaxScaleEnabled == true) 937 + { 938 + xml = 939 + sqlite3_mprintf 940 + ("%s\t\t<MaxScaleDenominator>%1.2f</MaxScaleDenominator>\r\n", prev, 941 + ScaleMax); 942 + sqlite3_free(prev); 943 + prev = xml; 944 + } 945 + xml = sqlite3_mprintf("%s\t\t<RasterSymbolizer>\r\n", prev); 946 + sqlite3_free(prev); 947 + prev = xml; 948 + xml = sqlite3_mprintf("%s\t\t\t<Opacity>%1.2f</Opacity>\r\n", prev, Opacity); 949 + sqlite3_free(prev); 950 + prev = xml; 951 + if (SrtmColorMap == true) 952 + { 953 + // special case: predefined SRTM style 954 + xml = DoCreatePredefinedSrtmStyle(prev); 955 + prev = xml; 956 + goto shaded_relief; 957 + } 958 + if (TerrainColorMap == true) 959 + { 960 + // special case: predefined Terrain style 961 + xml = DoCreatePredefinedTerrainStyle(prev); 962 + prev = xml; 963 + goto shaded_relief; 964 + } 965 + if (NdviColorMap == true) 966 + { 967 + // special case: predefined NDVI style 968 + xml = DoCreatePredefinedNdviStyle(prev); 969 + prev = xml; 970 + goto foot; 971 + } 972 + if (TripleBand == true || SingleBand == true) 973 + { 974 + xml = sqlite3_mprintf("%s\t\t\t<ChannelSelection>\r\n", prev); 975 + sqlite3_free(prev); 976 + prev = xml; 977 + if (TripleBand == true) 978 + { 979 + xml = 980 + sqlite3_mprintf 981 + ("%s\t\t\t\t<RedChannel>\r\n\t\t\t\t\t<SourceChannelName>%d", prev, 982 + RedBand + 1); 983 + sqlite3_free(prev); 984 + prev = xml; 985 + xml = 986 + sqlite3_mprintf 987 + ("%s</SourceChannelName>\r\n\t\t\t\t</RedChannel>\r\n", prev); 988 + sqlite3_free(prev); 989 + prev = xml; 990 + xml = 991 + sqlite3_mprintf 992 + ("%s\t\t\t\t<GreenChannel>\r\n\t\t\t\t\t<SourceChannelName>%d", 993 + prev, GreenBand + 1); 994 + sqlite3_free(prev); 995 + prev = xml; 996 + xml = 997 + sqlite3_mprintf 998 + ("%s</SourceChannelName>\r\n\t\t\t\t</GreenChannel>\r\n", prev); 999 + sqlite3_free(prev); 1000 + prev = xml; 1001 + xml = 1002 + sqlite3_mprintf 1003 + ("%s\t\t\t\t<BlueChannel>\r\n\t\t\t\t\t<SourceChannelName>%d", prev, 1004 + BlueBand + 1); 1005 + sqlite3_free(prev); 1006 + prev = xml; 1007 + xml = 1008 + sqlite3_mprintf 1009 + ("%s</SourceChannelName>\r\n\t\t\t\t</BlueChannel>\r\n", prev); 1010 + sqlite3_free(prev); 1011 + prev = xml; 1012 + } 1013 + if (SingleBand == true) 1014 + { 1015 + xml = 1016 + sqlite3_mprintf 1017 + ("%s\t\t\t\t<GrayChannel>\r\n\t\t\t\t\t<SourceChannelName>%d", prev, 1018 + GrayBand + 1); 1019 + sqlite3_free(prev); 1020 + prev = xml; 1021 + xml = 1022 + sqlite3_mprintf 1023 + ("%s</SourceChannelName>\r\n\t\t\t\t</GrayChannel>\r\n", prev); 1024 + sqlite3_free(prev); 1025 + prev = xml; 1026 + } 1027 + xml = sqlite3_mprintf("%s\t\t\t</ChannelSelection>\r\n", prev); 1028 + sqlite3_free(prev); 1029 + prev = xml; 1030 + } 1031 + if (Normalize == true || Histogram == true || Gamma == true) 1032 + { 1033 + xml = sqlite3_mprintf("%s\t\t\t<ContrastEnhancement>\r\n", prev); 1034 + sqlite3_free(prev); 1035 + prev = xml; 1036 + if (Histogram == true) 1037 + { 1038 + xml = sqlite3_mprintf("%s\t\t\t\t<Histogram/>\r\n", prev); 1039 + sqlite3_free(prev); 1040 + prev = xml; 1041 + } else if (Gamma == true) 1042 + { 1043 + xml = 1044 + sqlite3_mprintf("%s\t\t\t\t<GammaValue>%1.2f</GammaValue>\r\n", 1045 + prev, GammaValue); 1046 + sqlite3_free(prev); 1047 + prev = xml; 1048 + } else 1049 + { 1050 + xml = sqlite3_mprintf("%s\t\t\t\t<Normalize/>\r\n", prev); 1051 + sqlite3_free(prev); 1052 + prev = xml; 1053 + } 1054 + xml = sqlite3_mprintf("%s\t\t\t</ContrastEnhancement>\r\n", prev); 1055 + sqlite3_free(prev); 1056 + prev = xml; 1057 + } 1058 + if (ColorRamp == true) 1059 + { 1060 + xml = sqlite3_mprintf("%s\t\t\t<ColorMap>\r\n", prev); 1061 + sqlite3_free(prev); 1062 + prev = xml; 1063 + xml = 1064 + sqlite3_mprintf("%s\t\t\t\t<Interpolate fallbackValue=\"%s\">\r\n", 1065 + prev, MinValueColor); 1066 + sqlite3_free(prev); 1067 + prev = xml; 1068 + xml = 1069 + sqlite3_mprintf("%s\t\t\t\t\t<LookupValue>Rasterdata</LookupValue>\r\n", 1070 + prev); 1071 + sqlite3_free(prev); 1072 + prev = xml; 1073 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 1074 + sqlite3_free(prev); 1075 + prev = xml; 1076 + xml = 1077 + sqlite3_mprintf("%s\t\t\t\t\t\t<Data>%1.8f</Data>\r\n", prev, MinValue); 1078 + sqlite3_free(prev); 1079 + prev = xml; 1080 + xml = 1081 + sqlite3_mprintf("%s\t\t\t\t\t\t<Value>%s</Value>\r\n", prev, 1082 + MinValueColor); 1083 + sqlite3_free(prev); 1084 + prev = xml; 1085 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 1086 + sqlite3_free(prev); 1087 + prev = xml; 1088 + xml = sqlite3_mprintf("%s\t\t\t\t\t<InterpolationPoint>\r\n", prev); 1089 + sqlite3_free(prev); 1090 + prev = xml; 1091 + xml = 1092 + sqlite3_mprintf("%s\t\t\t\t\t\t<Data>%1.8f</Data>\r\n", prev, MaxValue); 1093 + sqlite3_free(prev); 1094 + prev = xml; 1095 + xml = 1096 + sqlite3_mprintf("%s\t\t\t\t\t\t<Value>%s</Value>\r\n", prev, 1097 + MaxValueColor); 1098 + sqlite3_free(prev); 1099 + prev = xml; 1100 + xml = sqlite3_mprintf("%s\t\t\t\t\t</InterpolationPoint>\r\n", prev); 1101 + sqlite3_free(prev); 1102 + prev = xml; 1103 + xml = sqlite3_mprintf("%s\t\t\t\t</Interpolate>\r\n", prev); 1104 + sqlite3_free(prev); 1105 + prev = xml; 1106 + xml = sqlite3_mprintf("%s\t\t\t</ColorMap>\r\n", prev); 1107 + sqlite3_free(prev); 1108 + prev = xml; 1109 + } 1110 +shaded_relief: 1111 + if (ShadedRelief == true) 1112 + { 1113 + xml = sqlite3_mprintf("%s\t\t\t<ShadedRelief>\r\n", prev); 1114 + sqlite3_free(prev); 1115 + prev = xml; 1116 + xml = 1117 + sqlite3_mprintf("%s\t\t\t\t<ReliefFactor>%1.2f</ReliefFactor>\r\n", 1118 + prev, ShadedReliefFactor); 1119 + sqlite3_free(prev); 1120 + prev = xml; 1121 + xml = sqlite3_mprintf("%s\t\t\t</ShadedRelief>\r\n", prev); 1122 + sqlite3_free(prev); 1123 + prev = xml; 1124 + } 1125 +foot: 1126 + xml = sqlite3_mprintf("%s\t\t</RasterSymbolizer>\r\n", prev); 1127 + sqlite3_free(prev); 1128 + prev = xml; 1129 + xml = sqlite3_mprintf("%s\t</Rule>\r\n</CoverageStyle>\r\n", prev); 1130 + sqlite3_free(prev); 1131 + return xml; 1132 +} 1133 + 1134 +unsigned char *QuickStyleRasterObj::CloneXmlStyle() 1135 +{ 1136 +// 1137 +// cloning the XML Style definition 1138 +// 1139 + if (XmlStyle == NULL) 1140 + XmlStyle = CreateXmlStyle(); 1141 + if (XmlStyle == NULL) 1142 + return NULL; 1143 + int len = strlen(XmlStyle); 1144 + char *cloned = (char *) malloc(len + 1); 1145 + strcpy(cloned, XmlStyle); 1146 + return (unsigned char *) cloned; 1147 +} 1148 + 1149 +void QuickStyleRasterObj::UpdateXmlStyle() 1150 +{ 1151 +// 1152 +// updating the XML Style 1153 +// 1154 + if (XmlStyle != NULL) 1155 + sqlite3_free(XmlStyle); 1156 + XmlStyle = CreateXmlStyle(); 1157 +} 1158 + 1159 +bool QuickStyleRasterDialog::Create(MyMapPanel * parent, MapLayer * layer) 1160 +{ 1161 +// 1162 +// creating the dialog 1163 +// 1164 + MainFrame = parent->GetParent(); 1165 + MapPanel = parent; 1166 + Layer = layer; 1167 + DbPrefix = layer->GetDbPrefix(); 1168 + LayerName = layer->GetName(); 1169 + CanApplyContrastEnhancement = true; 1170 + IsMultiband = false; 1171 + CanApplyColorMap = false; 1172 + CanApplyShadedRelief = false; 1173 + RedBand = 0; 1174 + GreenBand = 0; 1175 + BlueBand = 0; 1176 + GrayBand = 0; 1177 + MinPixelValue = 0.0; 1178 + MaxPixelValue = 0.0; 1179 + GetCoverageInfos(); 1180 + IsConfigChanged = false; 1181 + 1182 + if (wxPropertySheetDialog::Create 1183 + (parent, wxID_ANY, wxT("QuickStyle (Raster) Edit")) == false) 1184 + return false; 1185 + if (Layer->GetQuickStyleRaster() != NULL) 1186 + Style = Layer->CloneQuickStyleRaster(); 1187 + else 1188 + Style = new QuickStyleRasterObj(); 1189 + Style->SetRedBand(RedBand); 1190 + Style->SetGreenBand(GreenBand); 1191 + Style->SetBlueBand(BlueBand); 1192 + Style->SetGrayBand(GrayBand); 1193 + Style->SetMinValue(MinPixelValue); 1194 + Style->SetMaxValue(MaxPixelValue); 1195 + 1196 + wxBookCtrlBase *book = GetBookCtrl(); 1197 +// creates individual panels 1198 + int next = 1; 1199 + PageContrastEnhancementIndex = 0; 1200 + PageChannelSelectionIndex = 0; 1201 + PageColorMapIndex = 0; 1202 + wxPanel *mainPage = CreateMainPage(book); 1203 + book->AddPage(mainPage, wxT("General"), true); 1204 + wxPanel *contrastEnhancementPage = CreateContrastEnhancementPage(book); 1205 + book->AddPage(contrastEnhancementPage, wxT("ContrastEnhancement"), false); 1206 + PageContrastEnhancementIndex = next++; 1207 + wxPanel *channelSelectionPage = CreateChannelSelectionPage(book); 1208 + book->AddPage(channelSelectionPage, wxT("ChannelSelection"), false); 1209 + PageChannelSelectionIndex = next++; 1210 + wxPanel *colorMapPage = CreateColorMapPage(book); 1211 + book->AddPage(colorMapPage, wxT("ColorMap"), false); 1212 + PageColorMapIndex = next++; 1213 + 1214 + CreateButtons(); 1215 + LayoutDialog(); 1216 +// appends event handler for TAB/PAGE changing 1217 + Connect(wxID_ANY, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, 1218 + (wxObjectEventFunction) & QuickStyleRasterDialog::OnPageChanging); 1219 + Connect(wxID_ANY, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, 1220 + (wxObjectEventFunction) & QuickStyleRasterDialog::OnPageChanged); 1221 +// appends event handler for buttons 1222 + Connect(wxID_CANCEL, wxEVT_COMMAND_BUTTON_CLICKED, 1223 + (wxObjectEventFunction) & QuickStyleRasterDialog::OnQuit); 1224 + Connect(wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, 1225 + (wxObjectEventFunction) & QuickStyleRasterDialog::OnOk); 1226 + Connect(ID_QUICK_STYLE_APPLY, wxEVT_COMMAND_BUTTON_CLICKED, 1227 + (wxObjectEventFunction) & QuickStyleRasterDialog::OnApply); 1228 + Connect(ID_QUICK_STYLE_EXPORT, wxEVT_COMMAND_BUTTON_CLICKED, 1229 + (wxObjectEventFunction) & QuickStyleRasterDialog::OnExport); 1230 + Connect(ID_QUICK_STYLE_COPY, wxEVT_COMMAND_BUTTON_CLICKED, 1231 + (wxObjectEventFunction) & QuickStyleRasterDialog::OnCopy); 1232 +// centers the dialog window 1233 + Centre(); 1234 + UpdateMainPage(); 1235 + return true; 1236 +} 1237 + 1238 +void QuickStyleRasterDialog::CreateButtons() 1239 +{ 1240 +// 1241 +// adding the common Buttons 1242 +// 1243 + wxBoxSizer *topSizer = (wxBoxSizer *) (this->GetSizer()); 1244 + wxBoxSizer *btnBox = new wxBoxSizer(wxHORIZONTAL); 1245 + topSizer->Add(btnBox, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1246 + wxButton *save = new wxButton(this, ID_QUICK_STYLE_APPLY, wxT("&Apply")); 1247 + btnBox->Add(save, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1248 + wxButton *exp = 1249 + new wxButton(this, ID_QUICK_STYLE_EXPORT, wxT("&Export to file")); 1250 + btnBox->Add(exp, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1251 + wxButton *copy = new wxButton(this, ID_QUICK_STYLE_COPY, wxT("&Copy")); 1252 + btnBox->Add(copy, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1253 + btnBox->AddSpacer(100); 1254 + wxButton *ok = new wxButton(this, wxID_OK, wxT("&Ok")); 1255 + btnBox->Add(ok, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1256 + wxButton *cancel = new wxButton(this, wxID_CANCEL, wxT("&Cancel")); 1257 + btnBox->Add(cancel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1258 +} 1259 + 1260 +wxPanel *QuickStyleRasterDialog::CreateMainPage(wxWindow * parent) 1261 +{ 1262 +// 1263 +// creating the MAIN page 1264 +// 1265 + wxPanel *panel = new wxPanel(parent, ID_PANE_MAIN); 1266 + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 1267 + panel->SetSizer(topSizer); 1268 + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 1269 + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 1270 +// First row: Layer name 1271 + wxBoxSizer *lyrBoxSizer = new wxBoxSizer(wxVERTICAL); 1272 + boxSizer->Add(lyrBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1273 + wxBoxSizer *nameSizer = new wxBoxSizer(wxVERTICAL); 1274 + lyrBoxSizer->Add(nameSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1275 + wxStaticBox *nameBox = new wxStaticBox(panel, wxID_ANY, 1276 + wxT("Layer FullName"), 1277 + wxDefaultPosition, 1278 + wxDefaultSize); 1279 + wxBoxSizer *nameBoxSizer = new wxStaticBoxSizer(nameBox, wxHORIZONTAL); 1280 + nameSizer->Add(nameBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1281 + wxString fullName = DbPrefix + wxT(".") + LayerName; 1282 + wxTextCtrl *nameCtrl = new wxTextCtrl(panel, ID_VECTOR_LAYER, fullName, 1283 + wxDefaultPosition, wxSize(370, 22), 1284 + wxTE_READONLY); 1285 + nameBoxSizer->Add(nameCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1286 + wxStaticBox *uuidBox = new wxStaticBox(panel, wxID_ANY, 1287 + wxT("QuickStyle Name"), 1288 + wxDefaultPosition, 1289 + wxDefaultSize); 1290 + wxBoxSizer *uuidBoxSizer = new wxStaticBoxSizer(uuidBox, wxHORIZONTAL); 1291 + nameSizer->Add(uuidBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1292 + wxString uuid = wxString::FromUTF8(Style->GetUUID()); 1293 + wxTextCtrl *uuidCtrl = new wxTextCtrl(panel, ID_VECTOR_UUID, uuid, 1294 + wxDefaultPosition, wxSize(370, 22), 1295 + wxTE_READONLY); 1296 + uuidBoxSizer->Add(uuidCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1297 +// second row: Visibility Range 1298 + wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); 1299 + boxSizer->Add(miscSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 1300 + wxBoxSizer *visibilityBoxSizer = new wxBoxSizer(wxHORIZONTAL); 1301 + miscSizer->Add(visibilityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 1302 + wxStaticBox *visibilityBox = new wxStaticBox(panel, wxID_STATIC, 1303 + wxT("Visibility Range"), 1304 + wxDefaultPosition, 1305 + wxDefaultSize); 1306 + wxBoxSizer *visibilitySizer = 1307 + new wxStaticBoxSizer(visibilityBox, wxHORIZONTAL); 1308 + visibilityBoxSizer->Add(visibilitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 1309 + 5); 1310 + wxString range[4]; 1311 + range[0] = wxT("&None"); 1312 + range[1] = wxT("&Min"); 1313 + range[2] = wxT("&Max"); 1314 + range[3] = wxT("&Both"); 1315 + wxRadioBox *rangeBox = new wxRadioBox(panel, ID_SYMBOLIZER_MINMAX_SCALE, 1316 + wxT("&Range Type"), 1317 + wxDefaultPosition, 1318 + wxDefaultSize, 4, 1319 + range, 2, 1320 + wxRA_SPECIFY_COLS); 1321 + visibilitySizer->Add(rangeBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1322 + rangeBox->SetSelection(0); 1323 + wxBoxSizer *scaleBoxSizer = new wxBoxSizer(wxVERTICAL); 1324 + visibilitySizer->Add(scaleBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1325 + wxBoxSizer *scaleMinSizer = new wxBoxSizer(wxHORIZONTAL); 1326 + scaleBoxSizer->Add(scaleMinSizer, 0, wxALIGN_RIGHT | wxALL, 5); 1327 + wxStaticText *minScaleLabel = 1328 + new wxStaticText(panel, wxID_STATIC, wxT("&Min Scale:")); 1329 + scaleMinSizer->Add(minScaleLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1330 + wxTextCtrl *minScaleCtrl = 1331 + new wxTextCtrl(panel, ID_SYMBOLIZER_MIN_SCALE, wxT("0.0"), 1332 + wxDefaultPosition, wxSize(100, 22)); 1333 + minScaleCtrl->Enable(false); 1334 + scaleMinSizer->Add(minScaleCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1335 + wxBoxSizer *scaleMaxSizer = new wxBoxSizer(wxHORIZONTAL); 1336 + scaleBoxSizer->Add(scaleMaxSizer, 0, wxALIGN_RIGHT | wxALL, 0); 1337 + wxStaticText *maxScaleLabel = 1338 + new wxStaticText(panel, wxID_STATIC, wxT("&Max Scale:")); 1339 + scaleMaxSizer->Add(maxScaleLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1340 + wxTextCtrl *maxScaleCtrl = 1341 + new wxTextCtrl(panel, ID_SYMBOLIZER_MAX_SCALE, wxT("+Infinite"), 1342 + wxDefaultPosition, wxSize(100, 22)); 1343 + maxScaleCtrl->Enable(false); 1344 + scaleMaxSizer->Add(maxScaleCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1345 +// third row: Opacity 1346 + wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); 1347 + boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1348 + wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, 1349 + wxT("Opacity"), 1350 + wxDefaultPosition, 1351 + wxDefaultSize); 1352 + wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); 1353 + opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1354 + wxSlider *opacityCtrl = 1355 + new wxSlider(panel, ID_SYMBOLIZER_OPACITY, 100, 0, 100, 1356 + wxDefaultPosition, wxSize(400, 45), 1357 + wxSL_HORIZONTAL | wxSL_LABELS); 1358 + opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1359 + panel->SetSizer(topSizer); 1360 + topSizer->Fit(panel); 1361 +// appends event handlers 1362 + Connect(ID_SYMBOLIZER_MINMAX_SCALE, wxEVT_COMMAND_RADIOBOX_SELECTED, 1363 + (wxObjectEventFunction) & QuickStyleRasterDialog::OnCmdScaleChanged); 1364 + return panel; 1365 +} 1366 + 1367 +void QuickStyleRasterDialog:: 1368 +OnCmdScaleChanged(wxCommandEvent & WXUNUSED(event)) 1369 +{ 1370 +// 1371 +// Visibility Range selection changed 1372 +// 1373 + wxRadioBox *scaleModeCtrl = 1374 + (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MINMAX_SCALE); 1375 + wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); 1376 + wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); 1377 + switch (scaleModeCtrl->GetSelection()) 1378 + { 1379 + case 0: 1380 + Style->EnableMinScale(false); 1381 + Style->EnableMaxScale(false); 1382 + minCtrl->SetValue(wxT("0.0")); 1383 + minCtrl->Enable(false); 1384 + maxCtrl->SetValue(wxT("+Infinite")); 1385 + maxCtrl->Enable(false); 1386 + break; 1387 + case 1: 1388 + Style->EnableMinScale(true); 1389 + Style->EnableMaxScale(false); 1390 + minCtrl->SetValue(wxT("")); 1391 + minCtrl->Enable(true); 1392 + maxCtrl->SetValue(wxT("+Infinite")); 1393 + maxCtrl->Enable(false); 1394 + break; 1395 + case 2: 1396 + Style->EnableMinScale(false); 1397 + Style->EnableMaxScale(true); 1398 + minCtrl->SetValue(wxT("0.0")); 1399 + minCtrl->Enable(false); 1400 + maxCtrl->SetValue(wxT("")); 1401 + maxCtrl->Enable(true); 1402 + break; 1403 + case 3: 1404 + Style->EnableMinScale(true); 1405 + Style->EnableMaxScale(true); 1406 + minCtrl->SetValue(wxT("")); 1407 + minCtrl->Enable(true); 1408 + maxCtrl->SetValue(wxT("")); 1409 + maxCtrl->Enable(true); 1410 + break; 1411 + }; 1412 +} 1413 + 1414 +wxPanel *QuickStyleRasterDialog::CreateContrastEnhancementPage(wxWindow * 1415 + parent) 1416 +{ 1417 +// 1418 +// creating the Contrast Enhancement page 1419 +// 1420 + wxPanel *panel = new wxPanel(parent, ID_PANE_CONTRAST_ENHANCEMENT); 1421 + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 1422 + panel->SetSizer(topSizer); 1423 + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 1424 + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 1425 +// first row: Contrast Enhancement 1426 + boxSizer->AddSpacer(100); 1427 + wxBoxSizer *contrastSizer = new wxBoxSizer(wxHORIZONTAL); 1428 + boxSizer->Add(contrastSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1429 + wxString contrast[4]; 1430 + contrast[0] = wxT("&None"); 1431 + contrast[1] = wxT("Normalize/&Stretch"); 1432 + contrast[2] = wxT("&Histogram"); 1433 + contrast[3] = wxT("&GammaValue"); 1434 + wxRadioBox *contrastBox = new wxRadioBox(panel, ID_SYMBOLIZER_CONTRAST, 1435 + wxT("&Contrast Enhancement Method"), 1436 + wxDefaultPosition, 1437 + wxDefaultSize, 4, 1438 + contrast, 1, 1439 + wxRA_SPECIFY_COLS); 1440 + contrastSizer->Add(contrastBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1441 + contrastBox->SetSelection(0); 1442 + if (CanApplyContrastEnhancement == false) 1443 + contrastBox->Enable(false); 1444 + wxBoxSizer *gammaSizer = new wxBoxSizer(wxHORIZONTAL); 1445 + contrastSizer->Add(gammaSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 1446 + wxStaticText *gammaLabel = 1447 + new wxStaticText(panel, wxID_STATIC, wxT("&GammaValue [x100]:")); 1448 + gammaSizer->Add(gammaLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1449 + wxSpinCtrl *gammaCtrl = new wxSpinCtrl(panel, ID_SYMBOLIZER_GAMMA, wxT("100"), 1450 + wxDefaultPosition, wxSize(80, 22), 1451 + wxSP_ARROW_KEYS, 1452 + 100, 500, 100); 1453 + gammaCtrl->Enable(false); 1454 + gammaSizer->Add(gammaCtrl, 0, wxALIGN_RIGHT | wxALL, 5); 1455 + panel->SetSizer(topSizer); 1456 + topSizer->Fit(panel); 1457 +// appends event handler for OK button 1458 + Connect(ID_SYMBOLIZER_CONTRAST, wxEVT_COMMAND_RADIOBOX_SELECTED, 1459 + (wxObjectEventFunction) & 1460 + QuickStyleRasterDialog::OnCmdContrastChanged); 1461 + return panel; 1462 +} 1463 + 1464 +void QuickStyleRasterDialog:: 1465 +OnCmdContrastChanged(wxCommandEvent & WXUNUSED(event)) 1466 +{ 1467 +// 1468 +// Contrast Enhancement Method selection changed 1469 +// 1470 + wxRadioBox *contrastCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_CONTRAST); 1471 + wxSpinCtrl *gammaCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_GAMMA); 1472 + switch (contrastCtrl->GetSelection()) 1473 + { 1474 + case 1: 1475 + Style->SetNormalize(true); 1476 + Style->SetHistogram(false); 1477 + Style->SetGamma(false); 1478 + gammaCtrl->Enable(false); 1479 + break; 1480 + case 2: 1481 + Style->SetNormalize(false); 1482 + Style->SetHistogram(true); 1483 + Style->SetGamma(false); 1484 + gammaCtrl->Enable(false); 1485 + break; 1486 + case 3: 1487 + Style->SetNormalize(false); 1488 + Style->SetHistogram(false); 1489 + Style->SetGamma(true); 1490 + gammaCtrl->Enable(true); 1491 + break; 1492 + default: 1493 + Style->SetNormalize(false); 1494 + Style->SetHistogram(false); 1495 + Style->SetGamma(false); 1496 + gammaCtrl->Enable(false); 1497 + break; 1498 + }; 1499 +} 1500 + 1501 +wxPanel *QuickStyleRasterDialog::CreateChannelSelectionPage(wxWindow * parent) 1502 +{ 1503 +// 1504 +// creating the Channel Selection page 1505 +// 1506 + wxPanel *panel = new wxPanel(parent, ID_PANE_CHANNEL_SELECTION); 1507 + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 1508 + panel->SetSizer(topSizer); 1509 + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 1510 + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 1511 + panel->SetSizer(topSizer); 1512 +// Left panel: mode selector 1513 + boxSizer->AddSpacer(50); 1514 + wxBoxSizer *pageSizer = new wxBoxSizer(wxHORIZONTAL); 1515 + boxSizer->Add(pageSizer, 0, wxALIGN_CENTER_VERTICAL); 1516 + wxBoxSizer *leftSizer = new wxBoxSizer(wxVERTICAL); 1517 + pageSizer->Add(leftSizer, 0, wxALIGN_CENTER_VERTICAL); 1518 + wxString mode[3]; 1519 + mode[0] = wxT("&None"); 1520 + mode[1] = wxT("&Triple Band (RGB Image)"); 1521 + mode[2] = wxT("&Single Band (Grayscale Image)"); 1522 + wxRadioBox *bandModeBox = new wxRadioBox(panel, ID_SYMBOLIZER_BAND_MODE, 1523 + wxT("&Channel Selection Method"), 1524 + wxDefaultPosition, 1525 + wxDefaultSize, 3, 1526 + mode, 1, 1527 + wxRA_SPECIFY_COLS); 1528 + leftSizer->Add(bandModeBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1529 + bandModeBox->SetSelection(0); 1530 + if (IsMultiband == false) 1531 + bandModeBox->Enable(false); 1532 +// First row: ChannelSelection RGB 1533 + wxBoxSizer *rightSizer = new wxBoxSizer(wxVERTICAL); 1534 + pageSizer->Add(rightSizer, 0, wxALIGN_CENTER_HORIZONTAL); 1535 + wxBoxSizer *channelBoxSizer = new wxBoxSizer(wxVERTICAL); 1536 + rightSizer->Add(channelBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1537 + wxStaticBox *channelBox = new wxStaticBox(panel, wxID_STATIC, 1538 + wxT 1539 + ("Channel Selection (first Band is #1)"), 1540 + wxDefaultPosition, 1541 + wxDefaultSize); 1542 + wxBoxSizer *channelSizer = new wxStaticBoxSizer(channelBox, wxVERTICAL); 1543 + channelBoxSizer->Add(channelSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 1544 + wxBoxSizer *bandSizer = new wxBoxSizer(wxVERTICAL); 1545 + channelSizer->Add(bandSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1546 + wxBoxSizer *redSizer = new wxBoxSizer(wxHORIZONTAL); 1547 + bandSizer->Add(redSizer, 0, wxALIGN_RIGHT | wxALL, 3); 1548 + wxStaticText *redLabel = 1549 + new wxStaticText(panel, wxID_STATIC, wxT("&Red Channel is Band #")); 1550 + redSizer->Add(redLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1551 + wxSpinCtrl *redCtrl = new wxSpinCtrl(panel, ID_SYMBOLIZER_RED, wxT("1"), 1552 + wxDefaultPosition, wxSize(80, 22), 1553 + wxSP_ARROW_KEYS, 1554 + 1, 256, 1); 1555 + redSizer->Add(redCtrl, 0, wxALIGN_RIGHT | wxALL, 0); 1556 + redCtrl->Enable(false); 1557 + wxBoxSizer *greenSizer = new wxBoxSizer(wxHORIZONTAL); 1558 + bandSizer->Add(greenSizer, 0, wxALIGN_RIGHT | wxALL, 3); 1559 + wxStaticText *greenLabel = 1560 + new wxStaticText(panel, wxID_STATIC, wxT("&Green Channel is Band #")); 1561 + greenSizer->Add(greenLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1562 + wxSpinCtrl *greenCtrl = new wxSpinCtrl(panel, ID_SYMBOLIZER_GREEN, wxT("2"), 1563 + wxDefaultPosition, wxSize(80, 22), 1564 + wxSP_ARROW_KEYS, 1565 + 1, 256, 2); 1566 + greenSizer->Add(greenCtrl, 0, wxALIGN_RIGHT | wxALL, 0); 1567 + greenCtrl->Enable(false); 1568 + wxBoxSizer *blueSizer = new wxBoxSizer(wxHORIZONTAL); 1569 + bandSizer->Add(blueSizer, 0, wxALIGN_RIGHT | wxALL, 3); 1570 + wxStaticText *blueLabel = 1571 + new wxStaticText(panel, wxID_STATIC, wxT("&Blue Channel is Band #")); 1572 + blueSizer->Add(blueLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1573 + wxSpinCtrl *blueCtrl = new wxSpinCtrl(panel, ID_SYMBOLIZER_BLUE, wxT("3"), 1574 + wxDefaultPosition, wxSize(80, 22), 1575 + wxSP_ARROW_KEYS, 1576 + 1, 256, 3); 1577 + blueSizer->Add(blueCtrl, 0, wxALIGN_RIGHT | wxALL, 0); 1578 + blueCtrl->Enable(false); 1579 +// Second row: ChannelSelection Grayscale 1580 + rightSizer->AddSpacer(25); 1581 + wxBoxSizer *channel2BoxSizer = new wxBoxSizer(wxVERTICAL); 1582 + rightSizer->Add(channel2BoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1583 + wxStaticBox *channel2Box = new wxStaticBox(panel, wxID_STATIC, 1584 + wxT 1585 + ("Channel Selection (first Band is #1)"), 1586 + wxDefaultPosition, 1587 + wxDefaultSize); 1588 + wxBoxSizer *channel2Sizer = new wxStaticBoxSizer(channel2Box, wxVERTICAL); 1589 + channel2BoxSizer->Add(channel2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 1590 + wxBoxSizer *band2Sizer = new wxBoxSizer(wxVERTICAL); 1591 + channel2Sizer->Add(band2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1592 + wxBoxSizer *graySizer = new wxBoxSizer(wxHORIZONTAL); 1593 + band2Sizer->Add(graySizer, 0, wxALIGN_RIGHT | wxALL, 3); 1594 + wxStaticText *grayLabel = 1595 + new wxStaticText(panel, wxID_STATIC, wxT("&Gray Channel is Band #")); 1596 + graySizer->Add(grayLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1597 + wxSpinCtrl *grayCtrl = new wxSpinCtrl(panel, ID_SYMBOLIZER_GRAY, wxT("1"), 1598 + wxDefaultPosition, wxSize(80, 22), 1599 + wxSP_ARROW_KEYS, 1600 + 1, 256, 1); 1601 + graySizer->Add(grayCtrl, 0, wxALIGN_RIGHT | wxALL, 0); 1602 + grayCtrl->Enable(false); 1603 + topSizer->Fit(panel); 1604 +// appends event handlers 1605 + Connect(ID_SYMBOLIZER_BAND_MODE, wxEVT_COMMAND_RADIOBOX_SELECTED, 1606 + (wxObjectEventFunction) & 1607 + QuickStyleRasterDialog::OnCmdBandModeChanged); 1608 + return panel; 1609 +} 1610 + 1611 +void QuickStyleRasterDialog:: 1612 +OnCmdBandModeChanged(wxCommandEvent & WXUNUSED(event)) 1613 +{ 1614 +// 1615 +// Channel Selection Method selection changed 1616 +// 1617 + wxRadioBox *bandModeCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_BAND_MODE); 1618 + wxSpinCtrl *redCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_RED); 1619 + wxSpinCtrl *greenCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_GREEN); 1620 + wxSpinCtrl *blueCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_BLUE); 1621 + wxSpinCtrl *grayCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_GRAY); 1622 + switch (bandModeCtrl->GetSelection()) 1623 + { 1624 + case 1: 1625 + Style->SetTripleBand(true); 1626 + Style->SetSingleBand(false); 1627 + redCtrl->Enable(true); 1628 + greenCtrl->Enable(true); 1629 + blueCtrl->Enable(true); 1630 + grayCtrl->Enable(false); 1631 + break; 1632 + case 2: 1633 + Style->SetTripleBand(false); 1634 + Style->SetSingleBand(true); 1635 + redCtrl->Enable(false); 1636 + greenCtrl->Enable(false); 1637 + blueCtrl->Enable(false); 1638 + grayCtrl->Enable(true); 1639 + break; 1640 + default: 1641 + Style->SetTripleBand(false); 1642 + Style->SetSingleBand(false); 1643 + redCtrl->Enable(false); 1644 + greenCtrl->Enable(false); 1645 + blueCtrl->Enable(false); 1646 + grayCtrl->Enable(false); 1647 + break; 1648 + }; 1649 +} 1650 + 1651 +wxPanel *QuickStyleRasterDialog::CreateColorMapPage(wxWindow * parent) 1652 +{ 1653 +// 1654 +// creating the ColorMap page 1655 +// 1656 + wxPanel *panel = new wxPanel(parent, ID_PANE_COLOR_MAP); 1657 + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 1658 + panel->SetSizer(topSizer); 1659 + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 1660 + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 1661 + boxSizer->AddSpacer(50); 1662 + wxBoxSizer *mainSizer = new wxBoxSizer(wxHORIZONTAL); 1663 + boxSizer->Add(mainSizer, 0, wxALIGN_CENTER | wxALL, 5); 1664 +// left box: mode selector 1665 + wxBoxSizer *modeSizer = new wxBoxSizer(wxVERTICAL); 1666 + mainSizer->Add(modeSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 1667 + int max = 4; 1668 + if (CanApplyNDVI == true) 1669 + max = 2; 1670 + wxString mode[max]; 1671 + mode[0] = wxT("&None"); 1672 + if (CanApplyNDVI == true) 1673 + mode[1] = wxT("&NDVI (predefined style)"); 1674 + else 1675 + { 1676 + mode[1] = wxT("&SRTM (predefined style)"); 1677 + mode[2] = wxT("&Terrain (predefined style)"); 1678 + mode[3] = wxT("&Color Ramp"); 1679 + } 1680 + wxRadioBox *modeBox = new wxRadioBox(panel, ID_SYMBOLIZER_COLOR_MAP_MODE, 1681 + wxT("&Color Map Type"), 1682 + wxDefaultPosition, 1683 + wxDefaultSize, max, 1684 + mode, 1, 1685 + wxRA_SPECIFY_COLS); 1686 + modeSizer->Add(modeBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1687 + modeBox->SetSelection(0); 1688 + if (CanApplyColorMap == false && CanApplyNDVI == false) 1689 + modeBox->Enable(false); 1690 +// right box: Color Ramp 1691 + wxBoxSizer *rampSizer = new wxBoxSizer(wxVERTICAL); 1692 + mainSizer->Add(rampSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 1693 + wxStaticBox *rampBox = new wxStaticBox(panel, wxID_STATIC, 1694 + wxT("Color Ramp"), 1695 + wxDefaultPosition, 1696 + wxDefaultSize); 1697 + wxBoxSizer *ramp2Sizer = new wxStaticBoxSizer(rampBox, wxVERTICAL); 1698 + rampSizer->Add(ramp2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 1699 + wxBoxSizer *minSizer = new wxBoxSizer(wxHORIZONTAL); 1700 + ramp2Sizer->Add(minSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 3); 1701 +// Min Color 1702 + wxStaticBox *minBox = new wxStaticBox(panel, wxID_STATIC, 1703 + wxT("Min Value"), 1704 + wxDefaultPosition, 1705 + wxDefaultSize); 1706 + wxBoxSizer *min2Sizer = new wxStaticBoxSizer(minBox, wxHORIZONTAL); 1707 + minSizer->Add(min2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1708 + wxString minColor = wxT("#000000"); 1709 + wxTextCtrl *colorMinCtrl = 1710 + new wxTextCtrl(panel, ID_SYMBOLIZER_MIN_COLOR, minColor, 1711 + wxDefaultPosition, wxSize(80, 22)); 1712 + min2Sizer->Add(colorMinCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1713 + colorMinCtrl->Enable(false); 1714 + wxBitmap bmp; 1715 + wxColour color(0, 0, 0); 1716 + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 1717 + wxStaticBitmap *sampleMinCtrl = 1718 + new wxStaticBitmap(panel, ID_SYMBOLIZER_MIN_PICKER_HEX, bmp, 1719 + wxDefaultPosition, wxSize(32, 32)); 1720 + min2Sizer->Add(sampleMinCtrl, 0, wxALIGN_RIGHT | wxALL, 5); 1721 + wxButton *minPick = 1722 + new wxButton(panel, ID_SYMBOLIZER_MIN_PICKER_BTN, wxT("&Pick a color")); 1723 + min2Sizer->Add(minPick, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 1724 + minPick->Enable(false); 1725 +// Max Color 1726 + wxBoxSizer *maxSizer = new wxBoxSizer(wxHORIZONTAL); 1727 + ramp2Sizer->Add(maxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 3); 1728 + wxStaticBox *maxBox = new wxStaticBox(panel, wxID_STATIC, 1729 + wxT("Max Value"), 1730 + wxDefaultPosition, 1731 + wxDefaultSize); 1732 + wxBoxSizer *max2Sizer = new wxStaticBoxSizer(maxBox, wxHORIZONTAL); 1733 + maxSizer->Add(max2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1734 + wxString maxColor = wxT("#ffffff"); 1735 + wxTextCtrl *colorMaxCtrl = 1736 + new wxTextCtrl(panel, ID_SYMBOLIZER_MAX_COLOR, maxColor, 1737 + wxDefaultPosition, wxSize(80, 22)); 1738 + max2Sizer->Add(colorMaxCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1739 + colorMaxCtrl->Enable(false); 1740 + wxBitmap bmp2; 1741 + wxColour color2(255, 255, 255); 1742 + ColorMapEntry::DoPaintColorSample(32, 32, color2, bmp2); 1743 + wxStaticBitmap *sampleMaxCtrl = 1744 + new wxStaticBitmap(panel, ID_SYMBOLIZER_MAX_PICKER_HEX, bmp2, 1745 + wxDefaultPosition, wxSize(32, 32)); 1746 + max2Sizer->Add(sampleMaxCtrl, 0, wxALIGN_RIGHT | wxALL, 5); 1747 + wxButton *maxPick = 1748 + new wxButton(panel, ID_SYMBOLIZER_MAX_PICKER_BTN, wxT("&Pick a color")); 1749 + max2Sizer->Add(maxPick, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 1750 + maxPick->Enable(false); 1751 +// bottom box: shaded relief 1752 + wxBoxSizer *shadedSizer = new wxBoxSizer(wxHORIZONTAL); 1753 + boxSizer->Add(shadedSizer, 0, wxALIGN_CENTER_HORIZONTAL); 1754 + wxStaticBox *shadedBox = new wxStaticBox(panel, wxID_STATIC, 1755 + wxT("Shaded Relief"), 1756 + wxDefaultPosition, 1757 + wxDefaultSize); 1758 + wxBoxSizer *shaded2Sizer = new wxStaticBoxSizer(shadedBox, wxHORIZONTAL); 1759 + shadedSizer->Add(shaded2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 1760 + wxBoxSizer *reliefSizer = new wxBoxSizer(wxHORIZONTAL); 1761 + shaded2Sizer->Add(reliefSizer, 0, wxALIGN_RIGHT | wxALL, 0); 1762 + wxCheckBox *shadedCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_SHADED, 1763 + wxT("Enable"), 1764 + wxDefaultPosition, wxDefaultSize); 1765 + reliefSizer->Add(shadedCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1766 + if (CanApplyShadedRelief == false) 1767 + shadedCtrl->Enable(false); 1768 + reliefSizer->AddSpacer(25); 1769 + wxBoxSizer *relief2Sizer = new wxBoxSizer(wxHORIZONTAL); 1770 + reliefSizer->Add(relief2Sizer, 0, wxALIGN_RIGHT | wxALL, 0); 1771 + wxStaticText *reliefLabel = 1772 + new wxStaticText(panel, wxID_STATIC, wxT("&Relief Factor:")); 1773 + relief2Sizer->Add(reliefLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1774 + wxSpinCtrl *reliefCtrl = new wxSpinCtrl(panel, ID_SYMBOLIZER_RELIEF, wxT(""), 1775 + wxDefaultPosition, wxSize(80, 22), 1776 + wxSP_ARROW_KEYS, 1777 + 0, 0, 0); 1778 + reliefCtrl->Enable(false); 1779 + relief2Sizer->Add(reliefCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1780 + panel->SetSizer(topSizer); 1781 + topSizer->Fit(panel); 1782 +// appends event handlers 1783 + Connect(ID_SYMBOLIZER_COLOR_MAP_MODE, wxEVT_COMMAND_RADIOBOX_SELECTED, 1784 + (wxObjectEventFunction) & 1785 + QuickStyleRasterDialog::OnCmdColorMapModeChanged); 1786 + Connect(ID_SYMBOLIZER_MIN_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 1787 + (wxObjectEventFunction) & 1788 + QuickStyleRasterDialog::OnCmdColorMinChanged); 1789 + Connect(ID_SYMBOLIZER_MIN_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 1790 + (wxObjectEventFunction) & 1791 + QuickStyleRasterDialog::OnCmdMinColorPicker); 1792 + Connect(ID_SYMBOLIZER_MAX_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 1793 + (wxObjectEventFunction) & 1794 + QuickStyleRasterDialog::OnCmdColorMaxChanged); 1795 + Connect(ID_SYMBOLIZER_MAX_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 1796 + (wxObjectEventFunction) & 1797 + QuickStyleRasterDialog::OnCmdMaxColorPicker); 1798 + Connect(ID_SYMBOLIZER_SHADED, wxEVT_COMMAND_CHECKBOX_CLICKED, 1799 + (wxObjectEventFunction) & QuickStyleRasterDialog::OnShadedChanged); 1800 + return panel; 1801 +} 1802 + 1803 +void QuickStyleRasterDialog:: 1804 +OnCmdColorMapModeChanged(wxCommandEvent & WXUNUSED(event)) 1805 +{ 1806 +// 1807 +// Color Map Mode selection changed 1808 +// 1809 + wxRadioBox *colorMapModeCtrl = 1810 + (wxRadioBox *) FindWindow(ID_SYMBOLIZER_COLOR_MAP_MODE); 1811 + wxTextCtrl *colorMinCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_COLOR); 1812 + wxButton *minPick = (wxButton *) FindWindow(ID_SYMBOLIZER_MIN_PICKER_BTN); 1813 + wxTextCtrl *colorMaxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_COLOR); 1814 + wxButton *maxPick = (wxButton *) FindWindow(ID_SYMBOLIZER_MAX_PICKER_BTN); 1815 + wxStaticBitmap *sampleMinCtrl = 1816 + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_MIN_PICKER_HEX); 1817 + wxStaticBitmap *sampleMaxCtrl = 1818 + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_MIN_PICKER_HEX); 1819 + if (CanApplyNDVI == true) 1820 + { 1821 + // special case: NDVI 1822 + Style->SetSrtmColorMap(false); 1823 + Style->SetTerrainColorMap(false); 1824 + Style->SetColorRamp(false); 1825 + colorMinCtrl->Enable(false); 1826 + minPick->Enable(false); 1827 + colorMaxCtrl->Enable(false); 1828 + maxPick->Enable(false); 1829 + colorMinCtrl->SetValue(wxT("#000000")); 1830 + colorMaxCtrl->SetValue(wxT("#ffffff")); 1831 + switch (colorMapModeCtrl->GetSelection()) 1832 + { 1833 + case 1: 1834 + Style->SetNdviColorMap(true); 1835 + break; 1836 + default: 1837 + Style->SetNdviColorMap(false); 1838 + break; 1839 + }; 1840 + } else 1841 + { 1842 + // ordinary Color Map 1843 + Style->SetNdviColorMap(false); 1844 + switch (colorMapModeCtrl->GetSelection()) 1845 + { 1846 + case 1: 1847 + Style->SetSrtmColorMap(true); 1848 + Style->SetTerrainColorMap(false); 1849 + Style->SetColorRamp(false); 1850 + colorMinCtrl->Enable(false); 1851 + minPick->Enable(false); 1852 + colorMaxCtrl->Enable(false); 1853 + maxPick->Enable(false); 1854 + colorMinCtrl->SetValue(wxT("#000000")); 1855 + colorMaxCtrl->SetValue(wxT("#ffffff")); 1856 + break; 1857 + case 2: 1858 + Style->SetSrtmColorMap(false); 1859 + Style->SetTerrainColorMap(true); 1860 + Style->SetColorRamp(false); 1861 + colorMinCtrl->Enable(false); 1862 + minPick->Enable(false); 1863 + colorMaxCtrl->Enable(false); 1864 + maxPick->Enable(false); 1865 + colorMinCtrl->SetValue(wxT("#000000")); 1866 + colorMaxCtrl->SetValue(wxT("#ffffff")); 1867 + break; 1868 + case 3: 1869 + Style->SetSrtmColorMap(false); 1870 + Style->SetTerrainColorMap(false); 1871 + Style->SetColorRamp(true); 1872 + colorMinCtrl->Enable(true); 1873 + minPick->Enable(true); 1874 + colorMaxCtrl->Enable(true); 1875 + maxPick->Enable(true); 1876 + colorMinCtrl-> 1877 + SetValue(wxString::FromUTF8(Style->GetMinValueColor())); 1878 + colorMaxCtrl-> 1879 + SetValue(wxString::FromUTF8(Style->GetMaxValueColor())); 1880 + break; 1881 + default: 1882 + Style->SetSrtmColorMap(false); 1883 + Style->SetTerrainColorMap(false); 1884 + Style->SetColorRamp(false); 1885 + colorMinCtrl->Enable(false); 1886 + minPick->Enable(false); 1887 + colorMaxCtrl->Enable(false); 1888 + maxPick->Enable(false); 1889 + colorMinCtrl->SetValue(wxT("#000000")); 1890 + colorMaxCtrl->SetValue(wxT("#ffffff")); 1891 + break; 1892 + }; 1893 + } 1894 +} 1895 + 1896 +void QuickStyleRasterDialog:: 1897 +OnCmdColorMinChanged(wxCommandEvent & WXUNUSED(event)) 1898 +{ 1899 +// 1900 +// Min Value color changed: updating the visual sample 1901 +// 1902 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_COLOR); 1903 + wxStaticBitmap *sampleCtrl = 1904 + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_MIN_PICKER_HEX); 1905 + wxColour back = wxColour(255, 255, 255); 1906 + wxString str = colorCtrl->GetValue(); 1907 + if (ColorMapEntry::IsValidColor(str) == true) 1908 + ColorMapEntry::GetWxColor(str, back); 1909 + wxBitmap bmp; 1910 + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 1911 + sampleCtrl->SetBitmap(bmp); 1912 + sampleCtrl->Refresh(); 1913 + sampleCtrl->Update(); 1914 +} 1915 + 1916 +void QuickStyleRasterDialog:: 1917 +OnCmdMinColorPicker(wxCommandEvent & WXUNUSED(event)) 1918 +{ 1919 +// 1920 +// Min Value color picker 1921 +// 1922 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_COLOR); 1923 + wxColour clr = wxNullColour; 1924 + wxString str = colorCtrl->GetValue(); 1925 + if (ColorMapEntry::IsValidColor(str) == true) 1926 + ColorMapEntry::GetWxColor(str, clr); 1927 + wxColour color = wxGetColourFromUser(this, clr); 1928 + if (color.IsOk() == true) 1929 + { 1930 + char hex[16]; 1931 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 1932 + wxString str = wxString::FromUTF8(hex); 1933 + colorCtrl->SetValue(str); 1934 + } 1935 +} 1936 + 1937 +void QuickStyleRasterDialog:: 1938 +OnCmdColorMaxChanged(wxCommandEvent & WXUNUSED(event)) 1939 +{ 1940 +// 1941 +// Max Value color changed: updating the visual sample 1942 +// 1943 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_COLOR); 1944 + wxStaticBitmap *sampleCtrl = 1945 + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_MAX_PICKER_HEX); 1946 + wxColour back = wxColour(255, 255, 255); 1947 + wxString str = colorCtrl->GetValue(); 1948 + if (ColorMapEntry::IsValidColor(str) == true) 1949 + ColorMapEntry::GetWxColor(str, back); 1950 + wxBitmap bmp; 1951 + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 1952 + sampleCtrl->SetBitmap(bmp); 1953 + sampleCtrl->Refresh(); 1954 + sampleCtrl->Update(); 1955 +} 1956 + 1957 +void QuickStyleRasterDialog:: 1958 +OnCmdMaxColorPicker(wxCommandEvent & WXUNUSED(event)) 1959 +{ 1960 +// 1961 +// Max Value color picker 1962 +// 1963 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_COLOR); 1964 + wxColour clr = wxNullColour; 1965 + wxString str = colorCtrl->GetValue(); 1966 + if (ColorMapEntry::IsValidColor(str) == true) 1967 + ColorMapEntry::GetWxColor(str, clr); 1968 + wxColour color = wxGetColourFromUser(this, clr); 1969 + if (color.IsOk() == true) 1970 + { 1971 + char hex[16]; 1972 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 1973 + wxString str = wxString::FromUTF8(hex); 1974 + colorCtrl->SetValue(str); 1975 + } 1976 +} 1977 + 1978 +void QuickStyleRasterDialog::OnShadedChanged(wxCommandEvent & WXUNUSED(event)) 1979 +{ 1980 +// 1981 +// changed Shaded Relief (on/off): 1982 +// 1983 + wxCheckBox *shadedCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_SHADED); 1984 + wxSpinCtrl *reliefCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_RELIEF); 1985 + if (shadedCtrl->IsChecked() == true) 1986 + { 1987 + reliefCtrl->SetRange(1, 200); 1988 + reliefCtrl->SetValue(25); 1989 + reliefCtrl->Enable(true); 1990 + Style->SetShadedRelief(true); 1991 + } else 1992 + { 1993 + reliefCtrl->SetRange(0, 0); 1994 + reliefCtrl->SetValue(0); 1995 + reliefCtrl->Enable(false); 1996 + Style->SetShadedRelief(false); 1997 + } 1998 +} 1999 + 2000 +bool QuickStyleRasterDialog::UpdateStyle() 2001 +{ 2002 +// 2003 +// updating the QuickStyle 2004 +// 2005 + bool ret = false; 2006 + int idx = GetBookCtrl()->GetSelection(); 2007 + if (idx == 0) 2008 + ret = RetrieveMainPage(); 2009 + else 2010 + { 2011 + if (idx == PageContrastEnhancementIndex) 2012 + ret = RetrieveContrastEnhancementPage(); 2013 + if (idx == PageChannelSelectionIndex) 2014 + ret = RetrieveChannelSelectionPage(); 2015 + if (idx == PageColorMapIndex) 2016 + ret = RetrieveColorMapPage(); 2017 + } 2018 + if (ret == false) 2019 + return false; 2020 + 2021 + RasterLayerConfig *config = Layer->GetRasterConfig(); 2022 + bool setCurrentStyle = false; 2023 + if (config->GetStyle() == NULL) 2024 + setCurrentStyle = true; 2025 + else 2026 + { 2027 + if (strcmp(Style->GetUUID(), config->GetStyle()) != 0) 2028 + setCurrentStyle = true; 2029 + } 2030 + if (setCurrentStyle == true) 2031 + { 2032 + config->SetStyle(Style->GetUUID()); 2033 + IsConfigChanged = true; 2034 + } 2035 + IsConfigChanged = Layer->UpdateQuickStyle(Style); 2036 + return true; 2037 +} 2038 + 2039 +bool QuickStyleRasterDialog::RetrieveMainPage() 2040 +{ 2041 +// 2042 +// retrieving params from the MAIN page 2043 +// 2044 + double min = Style->GetScaleMin(); 2045 + double max = Style->GetScaleMax(); 2046 + double opacity = Style->GetOpacity(); 2047 + if (Style->IsMinScaleEnabled() == true) 2048 + { 2049 + wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); 2050 + wxString value = minCtrl->GetValue(); 2051 + if (value.ToDouble(&min) != true) 2052 + { 2053 + wxMessageBox(wxT 2054 + ("MIN_SCALE isn't a valid decimal number !!!"), 2055 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 2056 + return false; 2057 + } 2058 + if (min < 0.0) 2059 + { 2060 + wxMessageBox(wxT 2061 + ("MIN_SCALE must be a positive number !!!"), 2062 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 2063 + return false; 2064 + } 2065 + } 2066 + if (Style->IsMaxScaleEnabled() == true) 2067 + { 2068 + wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); 2069 + wxString value = maxCtrl->GetValue(); 2070 + if (value.ToDouble(&max) != true) 2071 + { 2072 + wxMessageBox(wxT 2073 + ("MAX_SCALE isn't a valid decimal number !!!"), 2074 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 2075 + return false; 2076 + } 2077 + if (max < 0.0) 2078 + { 2079 + wxMessageBox(wxT 2080 + ("MAX_SCALE must be a positive number !!!"), 2081 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 2082 + return false; 2083 + } 2084 + } 2085 + if (Style->IsMinScaleEnabled() == true && Style->IsMaxScaleEnabled() == true) 2086 + { 2087 + if (min >= max) 2088 + { 2089 + wxMessageBox(wxT 2090 + ("MAX_SCALE is always expected to be greater than MIN_SCALE !!!"), 2091 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 2092 + return false; 2093 + } 2094 + } 2095 + wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_OPACITY); 2096 + opacity = opacityCtrl->GetValue() / 100.0; 2097 + Style->SetScaleMin(min); 2098 + Style->SetScaleMax(max); 2099 + Style->SetOpacity(opacity); 2100 + return true; 2101 +} 2102 + 2103 +void QuickStyleRasterDialog::UpdateMainPage() 2104 +{ 2105 +// 2106 +// updating the MAIN page 2107 +// 2108 + wxRadioBox *rangeBox = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MINMAX_SCALE); 2109 + if (Style->IsMinScaleEnabled() != true && Style->IsMaxScaleEnabled() != true) 2110 + rangeBox->SetSelection(0); 2111 + else if (Style->IsMinScaleEnabled() == true 2112 + && Style->IsMaxScaleEnabled() != true) 2113 + rangeBox->SetSelection(1); 2114 + else if (Style->IsMinScaleEnabled() != true 2115 + && Style->IsMaxScaleEnabled() == true) 2116 + rangeBox->SetSelection(2); 2117 + else 2118 + rangeBox->SetSelection(3); 2119 + wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); 2120 + char dummy[64]; 2121 + wxString str; 2122 + if (Style->IsMinScaleEnabled() == true) 2123 + { 2124 + sprintf(dummy, "%1.2f", Style->GetScaleMin()); 2125 + str = wxString::FromUTF8(dummy); 2126 + minCtrl->SetValue(str); 2127 + minCtrl->Enable(true); 2128 + } else 2129 + { 2130 + str = wxT("0.0"); 2131 + minCtrl->SetValue(str); 2132 + minCtrl->Enable(false); 2133 + } 2134 + wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); 2135 + if (Style->IsMaxScaleEnabled() == true) 2136 + { 2137 + sprintf(dummy, "%1.2f", Style->GetScaleMax()); 2138 + str = wxString::FromUTF8(dummy); 2139 + maxCtrl->SetValue(str); 2140 + maxCtrl->Enable(true); 2141 + } else 2142 + { 2143 + str = wxT("+Infinite"); 2144 + maxCtrl->SetValue(str); 2145 + maxCtrl->Enable(false); 2146 + } 2147 + wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_OPACITY); 2148 + opacityCtrl->SetValue(Style->GetOpacity() * 100.0); 2149 +} 2150 + 2151 +bool QuickStyleRasterDialog::RetrieveContrastEnhancementPage(bool check) 2152 +{ 2153 +// 2154 +// retrieving params from the CONTRAST ENHANCEMENT page 2155 +// 2156 + if (Style->IsGamma() == true) 2157 + { 2158 + wxSpinCtrl *gammaCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_GAMMA); 2159 + Style->SetGammaValue(gammaCtrl->GetValue() / 100.0); 2160 + } else 2161 + Style->SetGammaValue(1.0); 2162 + return true; 2163 +} 2164 + 2165 +void QuickStyleRasterDialog::UpdateContrastEnhancementPage() 2166 +{ 2167 +// 2168 +// updating the CONTRAST ENHANCEMENT page 2169 +// 2170 + wxRadioBox *contrastCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_CONTRAST); 2171 + wxSpinCtrl *gammaCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_GAMMA); 2172 + if (Style->IsNormalize() == true) 2173 + { 2174 + contrastCtrl->SetSelection(1); 2175 + gammaCtrl->Enable(false); 2176 + } else if (Style->IsHistogram() == true) 2177 + { 2178 + contrastCtrl->SetSelection(2); 2179 + gammaCtrl->Enable(false); 2180 + } else if (Style->IsGamma() == true) 2181 + { 2182 + contrastCtrl->SetSelection(3); 2183 + gammaCtrl->Enable(true); 2184 + } else 2185 + { 2186 + contrastCtrl->SetSelection(0); 2187 + gammaCtrl->Enable(false); 2188 + } 2189 + gammaCtrl->SetValue(Style->GetGammaValue() * 100.0); 2190 + if (CanApplyContrastEnhancement == true) 2191 + contrastCtrl->Enable(true); 2192 + else 2193 + contrastCtrl->Enable(false); 2194 +} 2195 + 2196 +bool QuickStyleRasterDialog::RetrieveChannelSelectionPage(bool check) 2197 +{ 2198 +// 2199 +// retrieving params from the CHANNEL SELECTION page 2200 +// 2201 + if (Style->IsTripleBand() == true) 2202 + { 2203 + wxSpinCtrl *redCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_RED); 2204 + Style->SetRedBand(redCtrl->GetValue() - 1); 2205 + wxSpinCtrl *greenCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_GREEN); 2206 + Style->SetGreenBand(greenCtrl->GetValue() - 1); 2207 + wxSpinCtrl *blueCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_BLUE); 2208 + Style->SetBlueBand(blueCtrl->GetValue() - 1); 2209 + Style->SetGrayBand(0); 2210 + } else if (Style->IsSingleBand() == true) 2211 + { 2212 + wxSpinCtrl *grayCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_GRAY); 2213 + Style->SetGrayBand(grayCtrl->GetValue() - 1); 2214 + Style->SetRedBand(0); 2215 + Style->SetGreenBand(0); 2216 + Style->SetBlueBand(0); 2217 + } else 2218 + { 2219 + Style->SetRedBand(0); 2220 + Style->SetGreenBand(0); 2221 + Style->SetBlueBand(0); 2222 + Style->SetGrayBand(0); 2223 + } 2224 + return true; 2225 +} 2226 + 2227 +void QuickStyleRasterDialog::UpdateChannelSelectionPage() 2228 +{ 2229 +// 2230 +// updating the CHANNEL SELECTION page 2231 +// 2232 + wxRadioBox *bandModeCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_BAND_MODE); 2233 + wxSpinCtrl *redCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_RED); 2234 + wxSpinCtrl *greenCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_GREEN); 2235 + wxSpinCtrl *blueCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_BLUE); 2236 + wxSpinCtrl *grayCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_GRAY); 2237 + if (IsMultiband == false) 2238 + { 2239 + bandModeCtrl->SetSelection(0); 2240 + redCtrl->Enable(false); 2241 + greenCtrl->Enable(false); 2242 + blueCtrl->Enable(false); 2243 + grayCtrl->Enable(false); 2244 + redCtrl->SetValue(1); 2245 + greenCtrl->SetValue(1); 2246 + blueCtrl->SetValue(1); 2247 + grayCtrl->SetValue(1); 2248 + bandModeCtrl->Enable(false); 2249 + return; 2250 + } 2251 + if (Style->IsTripleBand() == true) 2252 + { 2253 + bandModeCtrl->SetSelection(1); 2254 + redCtrl->Enable(true); 2255 + greenCtrl->Enable(true); 2256 + blueCtrl->Enable(true); 2257 + grayCtrl->Enable(false); 2258 + } else if (Style->IsSingleBand() == true) 2259 + { 2260 + bandModeCtrl->SetSelection(2); 2261 + redCtrl->Enable(false); 2262 + greenCtrl->Enable(false); 2263 + blueCtrl->Enable(false); 2264 + grayCtrl->Enable(true); 2265 + } else 2266 + { 2267 + bandModeCtrl->SetSelection(0); 2268 + redCtrl->Enable(false); 2269 + greenCtrl->Enable(false); 2270 + blueCtrl->Enable(false); 2271 + grayCtrl->Enable(false); 2272 + } 2273 + redCtrl->SetRange(1, NumBands); 2274 + greenCtrl->SetRange(1, NumBands); 2275 + blueCtrl->SetRange(1, NumBands); 2276 + grayCtrl->SetRange(1, NumBands); 2277 + redCtrl->SetValue(Style->GetRedBand() + 1); 2278 + greenCtrl->SetValue(Style->GetGreenBand() + 1); 2279 + blueCtrl->SetValue(Style->GetBlueBand() + 1); 2280 + grayCtrl->SetValue(Style->GetGrayBand() + 1); 2281 + if (IsMultiband == true) 2282 + bandModeCtrl->Enable(true); 2283 + else 2284 + bandModeCtrl->Enable(false); 2285 +} 2286 + 2287 +bool QuickStyleRasterDialog::RetrieveColorMapPage(bool check) 2288 +{ 2289 +// 2290 +// retrieving params from the COLOR MAP page 2291 +// 2292 + if (Style->IsShadedRelief() == true) 2293 + { 2294 + wxSpinCtrl *shadedCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_RELIEF); 2295 + Style->SetShadedReliefFactor(shadedCtrl->GetValue()); 2296 + } else 2297 + Style->SetShadedReliefFactor(0.0); 2298 + wxTextCtrl *colorMinCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_COLOR); 2299 + wxTextCtrl *colorMaxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_COLOR); 2300 + char dummy[64]; 2301 + strcpy(dummy, colorMinCtrl->GetValue().ToUTF8()); 2302 + Style->SetMinValueColor(dummy); 2303 + strcpy(dummy, colorMaxCtrl->GetValue().ToUTF8()); 2304 + Style->SetMaxValueColor(dummy); 2305 + return true; 2306 +} 2307 + 2308 +void QuickStyleRasterDialog::UpdateColorMapPage() 2309 +{ 2310 +// 2311 +// updating the COLOR MAP page 2312 +// 2313 + wxRadioBox *modeBox = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_COLOR_MAP_MODE); 2314 + wxTextCtrl *colorMinCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_COLOR); 2315 + wxStaticBitmap *sampleMinCtrl = 2316 + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_MIN_PICKER_HEX); 2317 + wxButton *minPick = (wxButton *) FindWindow(ID_SYMBOLIZER_MIN_PICKER_BTN); 2318 + wxTextCtrl *colorMaxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_COLOR); 2319 + wxStaticBitmap *sampleMaxCtrl = 2320 + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_MAX_PICKER_HEX); 2321 + wxButton *maxPick = (wxButton *) FindWindow(ID_SYMBOLIZER_MAX_PICKER_BTN); 2322 + wxCheckBox *shadedCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_SHADED); 2323 + wxSpinCtrl *reliefCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_RELIEF); 2324 + if (CanApplyNDVI == true) 2325 + { 2326 + // special case: NDVI 2327 + if (Style->IsNdviColorMap() == true) 2328 + modeBox->SetSelection(1); 2329 + else 2330 + modeBox->SetSelection(0); 2331 + } else 2332 + { 2333 + // ordinary Color Map 2334 + if (Style->IsSrtmColorMap() == true) 2335 + modeBox->SetSelection(1); 2336 + else if (Style->IsTerrainColorMap() == true) 2337 + modeBox->SetSelection(2); 2338 + else if (Style->IsColorRamp() == true) 2339 + modeBox->SetSelection(3); 2340 + else 2341 + modeBox->SetSelection(0); 2342 + } 2343 + if (Style->IsColorRamp() == true) 2344 + { 2345 + colorMinCtrl->Enable(true); 2346 + minPick->Enable(true); 2347 + colorMaxCtrl->Enable(true); 2348 + maxPick->Enable(true); 2349 + colorMinCtrl->SetValue(wxString::FromUTF8(Style->GetMinValueColor())); 2350 + colorMaxCtrl->SetValue(wxString::FromUTF8(Style->GetMaxValueColor())); 2351 + } else 2352 + { 2353 + colorMinCtrl->Enable(false); 2354 + minPick->Enable(false); 2355 + colorMaxCtrl->Enable(false); 2356 + maxPick->Enable(false); 2357 + colorMinCtrl->SetValue(wxT("#000000")); 2358 + colorMaxCtrl->SetValue(wxT("#ffffff")); 2359 + } 2360 + if (Style->IsShadedRelief() == true) 2361 + { 2362 + reliefCtrl->SetRange(1, 200); 2363 + reliefCtrl->SetValue(Style->GetShadedReliefFactor()); 2364 + reliefCtrl->Enable(true); 2365 + } else 2366 + { 2367 + reliefCtrl->SetRange(0, 0); 2368 + reliefCtrl->SetValue(0); 2369 + reliefCtrl->Enable(false); 2370 + } 2371 + if (CanApplyColorMap == true || CanApplyNDVI == true) 2372 + modeBox->Enable(true); 2373 + else 2374 + modeBox->Enable(false); 2375 + if (CanApplyShadedRelief == true) 2376 + shadedCtrl->Enable(true); 2377 + else 2378 + shadedCtrl->Enable(false); 2379 +} 2380 + 2381 + 2382 +void QuickStyleRasterDialog::OnPageChanging(wxNotebookEvent & event) 2383 +{ 2384 +// 2385 +// TAB/PAGE selection changing 2386 +// 2387 + bool ret = false; 2388 + int idx = event.GetOldSelection(); 2389 + if (idx == 0) 2390 + ret = RetrieveMainPage(); 2391 + else 2392 + { 2393 + if (idx == PageContrastEnhancementIndex) 2394 + ret = RetrieveContrastEnhancementPage(); 2395 + if (idx == PageChannelSelectionIndex) 2396 + ret = RetrieveChannelSelectionPage(); 2397 + if (idx == PageColorMapIndex) 2398 + ret = RetrieveColorMapPage(); 2399 + } 2400 + if (ret != true) 2401 + event.Veto(); 2402 +} 2403 + 2404 +void QuickStyleRasterDialog::OnPageChanged(wxNotebookEvent & event) 2405 +{ 2406 +// 2407 +// TAB/PAGE selection changed 2408 +// 2409 + int idx = event.GetSelection(); 2410 + if (idx == 0) 2411 + UpdateMainPage(); 2412 + else 2413 + { 2414 + if (idx == PageContrastEnhancementIndex) 2415 + UpdateContrastEnhancementPage(); 2416 + if (idx == PageChannelSelectionIndex) 2417 + UpdateChannelSelectionPage(); 2418 + if (idx == PageColorMapIndex) 2419 + UpdateColorMapPage(); 2420 + } 2421 +} 2422 + 2423 +void QuickStyleRasterDialog::OnOk(wxCommandEvent & WXUNUSED(event)) 2424 +{ 2425 +// 2426 +// permanently saving the QuickStyle and quitting 2427 +// 2428 + if (UpdateStyle() == true) 2429 + wxDialog::EndModal(wxID_OK); 2430 +} 2431 + 2432 +void QuickStyleRasterDialog::OnApply(wxCommandEvent & WXUNUSED(event)) 2433 +{ 2434 +// 2435 +// applying the QuickStyle and continuing 2436 +// 2437 + if (UpdateStyle() == true) 2438 + { 2439 + if (IsConfigChanged == true) 2440 + MapPanel->RefreshMap(); 2441 + } 2442 +} 2443 + 2444 +void QuickStyleRasterDialog::OnExport(wxCommandEvent & WXUNUSED(event)) 2445 +{ 2446 +// 2447 +// exporting the Quick Style as an external file 2448 +// 2449 + bool xret = false; 2450 + int ret; 2451 + wxString path; 2452 + wxString lastDir; 2453 + int idx = GetBookCtrl()->GetSelection(); 2454 + if (idx == 0) 2455 + xret = RetrieveMainPage(); 2456 + else 2457 + { 2458 + if (idx == PageContrastEnhancementIndex) 2459 + xret = RetrieveContrastEnhancementPage(); 2460 + if (idx == PageChannelSelectionIndex) 2461 + xret = RetrieveChannelSelectionPage(); 2462 + if (idx == PageColorMapIndex) 2463 + xret = RetrieveColorMapPage(); 2464 + } 2465 + if (xret == false) 2466 + return; 2467 + 2468 + wxFileDialog fileDialog(this, 2469 + wxT("Exporting an SLD/SE QuickStyle to a file"), 2470 + wxT(""), wxT("style.xml"), 2471 + wxT("XML Document|*.xml|All files (*.*)|*.*"), 2472 + wxFD_SAVE | wxFD_OVERWRITE_PROMPT, wxDefaultPosition, 2473 + wxDefaultSize, wxT("filedlg")); 2474 + lastDir = MainFrame->GetLastDirectory(); 2475 + if (lastDir.Len() >= 1) 2476 + fileDialog.SetDirectory(lastDir); 2477 + ret = fileDialog.ShowModal(); 2478 + if (ret == wxID_OK) 2479 + { 2480 + wxFileName file(fileDialog.GetPath()); 2481 + path = file.GetPath(); 2482 + path += file.GetPathSeparator(); 2483 + path += file.GetName(); 2484 + lastDir = file.GetPath(); 2485 + path = fileDialog.GetPath(); 2486 + FILE *out = fopen(path.ToUTF8(), "wb"); 2487 + if (out == NULL) 2488 + wxMessageBox(wxT("ERROR: unable to create:\n\n\"") + path + wxT("\""), 2489 + wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 2490 + else 2491 + { 2492 + char *xml = Style->CreateXmlStyle(); 2493 + fwrite(xml, 1, strlen(xml), out); 2494 + sqlite3_free(xml); 2495 + fclose(out); 2496 + wxMessageBox(wxT 2497 + ("SLD/SE QuickStyle successfully saved into:\n\n\"") 2498 + + path + wxT("\""), wxT("spatialite_gui"), 2499 + wxOK | wxICON_INFORMATION, this); 2500 + } 2501 + } 2502 +} 2503 + 2504 +void QuickStyleRasterDialog::OnCopy(wxCommandEvent & WXUNUSED(event)) 2505 +{ 2506 +// 2507 +// Copying the Quick Style into the Clipboard 2508 +// 2509 + bool ret = false; 2510 + int idx = GetBookCtrl()->GetSelection(); 2511 + if (idx == 0) 2512 + ret = RetrieveMainPage(); 2513 + else 2514 + { 2515 + if (idx == PageContrastEnhancementIndex) 2516 + ret = RetrieveContrastEnhancementPage(); 2517 + if (idx == PageChannelSelectionIndex) 2518 + ret = RetrieveChannelSelectionPage(); 2519 + if (idx == PageColorMapIndex) 2520 + ret = RetrieveColorMapPage(); 2521 + } 2522 + if (ret == false) 2523 + return; 2524 + 2525 + char *xml = Style->CreateXmlStyle(); 2526 + wxString XMLstring = wxString::FromUTF8(xml); 2527 + sqlite3_free(xml); 2528 + if (wxTheClipboard->Open()) 2529 + { 2530 + wxTheClipboard->SetData(new wxTextDataObject(XMLstring)); 2531 + wxTheClipboard->Close(); 2532 + } 2533 +} 2534 + 2535 +void QuickStyleRasterDialog::OnQuit(wxCommandEvent & WXUNUSED(event)) 2536 +{ 2537 +// 2538 +// all done: 2539 +// 2540 + wxDialog::EndModal(wxID_CANCEL); 2541 +} 2542 + 2543 +void QuickStyleRasterDialog::GetCoverageInfos() 2544 +{ 2545 +// 2546 +// attempting to get the basic Coverage Infos 2547 +// 2548 + char *prefix; 2549 + char *xprefix; 2550 + char *name; 2551 + char *sql; 2552 + int ret; 2553 + char **results; 2554 + int rows; 2555 + int columns; 2556 + wxString pixelType; 2557 + wxString sampleType; 2558 + int numBands; 2559 + bool ok_min = false; 2560 + bool ok_max = false; 2561 + double min = 0.0; 2562 + double max = 0.0; 2563 + 2564 + if (DbPrefix.Len() == 0) 2565 + { 2566 + prefix = (char *) malloc(5); 2567 + strcpy(prefix, "MAIN"); 2568 + } else 2569 + { 2570 + prefix = (char *) malloc(DbPrefix.Len() * 4); 2571 + strcpy(prefix, DbPrefix.ToUTF8()); 2572 + } 2573 + xprefix = gaiaDoubleQuotedSql(prefix); 2574 + free(prefix); 2575 + name = (char *) malloc(LayerName.Len() * 4); 2576 + strcpy(name, LayerName.ToUTF8()); 2577 + sql = 2578 + sqlite3_mprintf 2579 + ("SELECT pixel_type, sample_type, num_bands, enable_auto_ndvi, " 2580 + "RL2_GetBandStatistics_Min(statistics, 0), RL2_GetBandStatistics_Max(statistics, 0) " 2581 + "FROM \"%s\".raster_coverages WHERE Upper(coverage_name) = Upper(%Q)", 2582 + xprefix, name); 2583 + free(xprefix); 2584 + free(name); 2585 + ret = 2586 + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, 2587 + NULL); 2588 + sqlite3_free(sql); 2589 + if (ret != SQLITE_OK) 2590 + return; 2591 + 2592 + for (int i = 1; i <= rows; i++) 2593 + { 2594 + // retrieving the basic Coverage Infos 2595 + pixelType = wxString::FromUTF8(results[(i * columns) + 0]); 2596 + sampleType = wxString::FromUTF8(results[(i * columns) + 1]); 2597 + numBands = atoi(results[(i * columns) + 2]); 2598 + if (results[(i * columns) + 3] == NULL) 2599 + CanApplyNDVI = false; 2600 + else 2601 + { 2602 + if (atoi(results[(i * columns) + 3]) == 0) 2603 + CanApplyNDVI = false; 2604 + else 2605 + CanApplyNDVI = true; 2606 + } 2607 + if (results[(i * columns) + 4] == NULL) 2608 + ok_min = false; 2609 + else 2610 + { 2611 + ok_min = true; 2612 + min = atof(results[(i * columns) + 4]); 2613 + } 2614 + if (results[(i * columns) + 5] == NULL) 2615 + ok_max = false; 2616 + else 2617 + { 2618 + ok_max = true; 2619 + max = atof(results[(i * columns) + 5]); 2620 + } 2621 + 2622 + } 2623 + sqlite3_free_table(results); 2624 + 2625 + if (pixelType.Cmp(wxT("RGB")) == 0 || pixelType.Cmp(wxT("GRAYSCALE")) == 0 2626 + || pixelType.Cmp(wxT("MULTIBAND")) == 0 2627 + || (pixelType.Cmp(wxT("DATAGRID")) == 0 2628 + && sampleType.Cmp(wxT("UINT16")) == 0)) 2629 + CanApplyContrastEnhancement = true; 2630 + else 2631 + CanApplyContrastEnhancement = false; 2632 + if (pixelType.Cmp(wxT("MULTIBAND")) == 0) 2633 + { 2634 + IsMultiband = true; 2635 + NumBands = numBands; 2636 + RedBand = 0; 2637 + GreenBand = 1; 2638 + BlueBand = 2; 2639 + } else 2640 + IsMultiband = false; 2641 + if (ok_min == true && ok_max == true) 2642 + { 2643 + CanApplyColorMap = true; 2644 + MinPixelValue = min; 2645 + MaxPixelValue = max; 2646 + } else 2647 + CanApplyColorMap = false; 2648 + if (pixelType.Cmp(wxT("DATAGRID")) == 0 2649 + || pixelType.Cmp(wxT("MONOCHROME")) == 0) 2650 + ; 2651 + else 2652 + CanApplyColorMap = false; 2653 + if (pixelType.Cmp(wxT("DATAGRID")) == 0) 2654 + CanApplyShadedRelief = true; 2655 + else 2656 + CanApplyShadedRelief = false; 2657 +}
Added QuickStylesTopology.cpp.
1 +/* 2 +/ QuickStylesTopology.cpp 3 +/ Quick Styles wizards (Topology layers) 4 +/ 5 +/ version 2.0, 2017 May 26 6 +/ 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 +/ 9 +/ Copyright (C) 2017 Alessandro Furieri 10 +/ 11 +/ This program is free software: you can redistribute it and/or modify 12 +/ it under the terms of the GNU General Public License as published by 13 +/ the Free Software Foundation, either version 3 of the License, or 14 +/ (at your option) any later version. 15 +/ 16 +/ This program is distributed in the hope that it will be useful, 17 +/ but WITHOUT ANY WARRANTY; without even the implied warranty of 18 +/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 +/ GNU General Public License for more details. 20 +/ 21 +/ You should have received a copy of the GNU General Public License 22 +/ along with this program. If not, see <http://www.gnu.org/licenses/>. 23 +/ 24 +*/ 25 + 26 +#include "Classdef.h" 27 + 28 +#include "wx/spinctrl.h" 29 +#include "wx/imaglist.h" 30 +#include "wx/colordlg.h" 31 +#include "wx/filename.h" 32 +#include "wx/clipbrd.h" 33 + 34 +QuickStyleTopologyObj::QuickStyleTopologyObj(int type) 35 +{ 36 +// ctor 37 + QuickStyleObj::DoGetUUID(UUID); 38 + Type = type; 39 + MinScaleEnabled = false; 40 + MaxScaleEnabled = false; 41 + ScaleMin = 0.0; 42 + ScaleMax = 0.0; 43 + NodeOpacity = 1.0; 44 + NodeSize = 16; 45 + NodeRotation = 0.0; 46 + NodeAnchorX = 0.5; 47 + NodeAnchorY = 0.5; 48 + NodeDisplacementX = 0.0; 49 + NodeDisplacementY = 0.0; 50 + NodeWellKnownMark = QuickStyleObj::RandomWellKnownMark(); 51 + QuickStyleObj::RandomColor(NodeFillColor); 52 + QuickStyleObj::RandomColor(NodeStrokeColor); 53 + EdgeLinkOpacity = 1.0; 54 + EdgeLinkPerpendicularOffset = 0.0; 55 + EdgeLinkStrokeWidth = 1.0; 56 + QuickStyleObj::RandomColor(EdgeLinkStrokeColor); 57 + EdgeLinkDotStyle = QUICK_STYLE_SOLID_LINE; 58 + FaceFill = true; 59 + FaceStroke = true; 60 + FaceDisplacementX = 0.0; 61 + FaceDisplacementY = 0.0; 62 + FacePerpendicularOffset = 0.0; 63 + FaceFillOpacity = 1.0; 64 + QuickStyleObj::RandomColor(FaceFillColor); 65 + FaceStrokeOpacity = 1.0; 66 + FaceStrokeWidth = 1.0; 67 + QuickStyleObj::RandomColor(FaceStrokeColor); 68 + EdgeLinkSeedOpacity = 1.0; 69 + EdgeLinkSeedSize = 16; 70 + EdgeLinkSeedRotation = 0.0; 71 + EdgeLinkSeedAnchorX = 0.5; 72 + EdgeLinkSeedAnchorY = 0.5; 73 + EdgeLinkSeedDisplacementX = 0.0; 74 + EdgeLinkSeedDisplacementY = 0.0; 75 + EdgeLinkSeedWellKnownMark = QuickStyleObj::RandomWellKnownMark(); 76 + QuickStyleObj::RandomColor(EdgeLinkSeedFillColor); 77 + QuickStyleObj::RandomColor(EdgeLinkSeedStrokeColor); 78 + FaceSeedOpacity = 1.0; 79 + FaceSeedSize = 16; 80 + FaceSeedRotation = 0.0; 81 + FaceSeedAnchorX = 0.5; 82 + FaceSeedAnchorY = 0.5; 83 + FaceSeedDisplacementX = 0.0; 84 + FaceSeedDisplacementY = 0.0; 85 + FaceSeedWellKnownMark = QuickStyleObj::RandomWellKnownMark(); 86 + QuickStyleObj::RandomColor(FaceSeedFillColor); 87 + QuickStyleObj::RandomColor(FaceSeedStrokeColor); 88 + XmlStyle = NULL; 89 +} 90 + 91 +QuickStyleTopologyObj *QuickStyleTopologyObj::Clone() 92 +{ 93 +// 94 +// cloning a Quick Style Topology 95 +// 96 + QuickStyleTopologyObj *Style = new QuickStyleTopologyObj(this->Type); 97 + strcpy(Style->UUID, this->UUID); 98 + Style->MinScaleEnabled = this->MinScaleEnabled; 99 + Style->MaxScaleEnabled = this->MaxScaleEnabled; 100 + Style->ScaleMin = this->ScaleMin; 101 + Style->ScaleMax = this->ScaleMax; 102 + Style->NodeOpacity = this->NodeOpacity; 103 + Style->NodeSize = this->NodeSize; 104 + Style->NodeRotation = this->NodeRotation; 105 + Style->NodeAnchorX = this->NodeAnchorX; 106 + Style->NodeAnchorY = this->NodeAnchorY; 107 + Style->NodeDisplacementX = this->NodeDisplacementX; 108 + Style->NodeDisplacementY = this->NodeDisplacementY; 109 + Style->NodeWellKnownMark = this->NodeWellKnownMark; 110 + strcpy(Style->NodeFillColor, this->NodeFillColor); 111 + strcpy(Style->NodeStrokeColor, this->NodeStrokeColor); 112 + Style->EdgeLinkOpacity = this->EdgeLinkOpacity; 113 + Style->EdgeLinkPerpendicularOffset = this->EdgeLinkPerpendicularOffset; 114 + Style->EdgeLinkStrokeWidth = this->EdgeLinkStrokeWidth; 115 + strcpy(Style->EdgeLinkStrokeColor, this->EdgeLinkStrokeColor); 116 + Style->EdgeLinkDotStyle = this->EdgeLinkDotStyle; 117 + Style->FaceFill = this->FaceFill; 118 + Style->FaceStroke = this->FaceStroke; 119 + Style->FaceDisplacementX = this->FaceDisplacementX; 120 + Style->FaceDisplacementY = this->FaceDisplacementY; 121 + Style->FacePerpendicularOffset = this->FacePerpendicularOffset; 122 + Style->FaceFillOpacity = this->FaceFillOpacity; 123 + strcpy(Style->FaceFillColor, this->FaceFillColor); 124 + Style->FaceStrokeOpacity = this->FaceStrokeOpacity; 125 + Style->FaceStrokeWidth = this->FaceStrokeWidth; 126 + strcpy(Style->FaceStrokeColor, this->FaceStrokeColor); 127 + Style->EdgeLinkSeedOpacity = this->EdgeLinkSeedOpacity; 128 + Style->EdgeLinkSeedSize = this->EdgeLinkSeedSize; 129 + Style->EdgeLinkSeedRotation = this->EdgeLinkSeedRotation; 130 + Style->EdgeLinkSeedAnchorX = this->EdgeLinkSeedAnchorX; 131 + Style->EdgeLinkSeedAnchorY = this->EdgeLinkSeedAnchorY; 132 + Style->EdgeLinkSeedDisplacementX = this->EdgeLinkSeedDisplacementX; 133 + Style->EdgeLinkSeedDisplacementY = this->EdgeLinkSeedDisplacementY; 134 + Style->EdgeLinkSeedWellKnownMark = this->EdgeLinkSeedWellKnownMark; 135 + strcpy(Style->EdgeLinkSeedFillColor, this->EdgeLinkSeedFillColor); 136 + strcpy(Style->EdgeLinkSeedStrokeColor, this->EdgeLinkSeedStrokeColor); 137 + Style->FaceSeedOpacity = this->FaceSeedOpacity; 138 + Style->FaceSeedSize = this->FaceSeedSize; 139 + Style->FaceSeedRotation = this->FaceSeedRotation; 140 + Style->FaceSeedAnchorX = this->FaceSeedAnchorX; 141 + Style->FaceSeedAnchorY = this->FaceSeedAnchorY; 142 + Style->FaceSeedDisplacementX = this->FaceSeedDisplacementX; 143 + Style->FaceSeedDisplacementY = this->FaceSeedDisplacementY; 144 + Style->FaceSeedWellKnownMark = this->FaceSeedWellKnownMark; 145 + strcpy(Style->FaceSeedFillColor, this->FaceSeedFillColor); 146 + strcpy(Style->FaceSeedStrokeColor, this->FaceSeedStrokeColor); 147 + Style->XmlStyle = NULL; 148 + return Style; 149 +} 150 + 151 +bool QuickStyleTopologyObj::Compare(QuickStyleTopologyObj * Style) 152 +{ 153 +// 154 +// comparing two Quick Style objects (Topology) 155 +// 156 + if (strcmp(Style->UUID, this->UUID) != 0) 157 + return false; 158 + if (Style->MinScaleEnabled != this->MinScaleEnabled) 159 + return false; 160 + if (Style->MaxScaleEnabled != this->MaxScaleEnabled) 161 + return false; 162 + if (Style->ScaleMin != this->ScaleMin) 163 + return false; 164 + if (Style->ScaleMax != this->ScaleMax) 165 + return false; 166 + if (Style->NodeOpacity != this->NodeOpacity) 167 + return false; 168 + if (Style->NodeSize != this->NodeSize) 169 + return false; 170 + if (Style->NodeRotation != this->NodeRotation) 171 + return false; 172 + if (Style->NodeAnchorX != this->NodeAnchorX) 173 + return false; 174 + if (Style->NodeAnchorY != this->NodeAnchorY) 175 + return false; 176 + if (Style->NodeDisplacementX != this->NodeDisplacementX) 177 + return false; 178 + if (Style->NodeDisplacementY != this->NodeDisplacementY) 179 + return false; 180 + if (Style->NodeWellKnownMark != this->NodeWellKnownMark) 181 + return false; 182 + if (strcmp(Style->NodeFillColor, this->NodeFillColor) != 0) 183 + return false; 184 + if (strcmp(Style->NodeStrokeColor, this->NodeStrokeColor) != 0) 185 + return false; 186 + if (Style->EdgeLinkOpacity != this->EdgeLinkOpacity) 187 + return false; 188 + if (Style->EdgeLinkPerpendicularOffset != this->EdgeLinkPerpendicularOffset) 189 + return false; 190 + if (Style->EdgeLinkStrokeWidth != this->EdgeLinkStrokeWidth) 191 + return false; 192 + if (strcmp(Style->EdgeLinkStrokeColor, this->EdgeLinkStrokeColor) != 0) 193 + return false; 194 + if (Style->EdgeLinkDotStyle != this->EdgeLinkDotStyle) 195 + return false; 196 + if (Style->FaceFill != this->FaceFill) 197 + return false; 198 + if (Style->FaceStroke != this->FaceStroke) 199 + return false; 200 + if (Style->FaceDisplacementX != this->FaceDisplacementX) 201 + return false; 202 + if (Style->FaceDisplacementY != this->FaceDisplacementY) 203 + return false; 204 + if (Style->FacePerpendicularOffset != this->FacePerpendicularOffset) 205 + return false; 206 + if (Style->FaceFillOpacity != this->FaceFillOpacity) 207 + return false; 208 + if (strcmp(Style->FaceFillColor, this->FaceFillColor) != 0) 209 + return false; 210 + if (Style->FaceStrokeOpacity != this->FaceStrokeOpacity) 211 + return false; 212 + if (Style->FaceStrokeWidth != this->FaceStrokeWidth) 213 + return false; 214 + if (strcmp(Style->FaceStrokeColor, this->FaceStrokeColor) != 0) 215 + return false; 216 + if (Style->EdgeLinkSeedOpacity != this->EdgeLinkSeedOpacity) 217 + return false; 218 + if (Style->EdgeLinkSeedSize != this->EdgeLinkSeedSize) 219 + return false; 220 + if (Style->EdgeLinkSeedRotation != this->EdgeLinkSeedRotation) 221 + return false; 222 + if (Style->EdgeLinkSeedAnchorX != this->EdgeLinkSeedAnchorX) 223 + return false; 224 + if (Style->EdgeLinkSeedAnchorY != this->EdgeLinkSeedAnchorY) 225 + return false; 226 + if (Style->EdgeLinkSeedDisplacementX != this->EdgeLinkSeedDisplacementX) 227 + return false; 228 + if (Style->EdgeLinkSeedDisplacementY != this->EdgeLinkSeedDisplacementY) 229 + return false; 230 + if (Style->EdgeLinkSeedWellKnownMark != this->EdgeLinkSeedWellKnownMark) 231 + return false; 232 + if (strcmp(Style->EdgeLinkSeedFillColor, this->EdgeLinkSeedFillColor) != 0) 233 + return false; 234 + if (strcmp(Style->EdgeLinkSeedStrokeColor, this->EdgeLinkSeedStrokeColor) != 235 + 0) 236 + return false; 237 + if (Style->FaceSeedOpacity != this->FaceSeedOpacity) 238 + return false; 239 + if (Style->FaceSeedSize != this->FaceSeedSize) 240 + return false; 241 + if (Style->FaceSeedRotation != this->FaceSeedRotation) 242 + return false; 243 + if (Style->FaceSeedAnchorX != this->FaceSeedAnchorX) 244 + return false; 245 + if (Style->FaceSeedAnchorY != this->FaceSeedAnchorY) 246 + return false; 247 + if (Style->FaceSeedDisplacementX != this->FaceSeedDisplacementX) 248 + return false; 249 + if (Style->FaceSeedDisplacementY != this->FaceSeedDisplacementY) 250 + return false; 251 + if (Style->FaceSeedWellKnownMark != this->FaceSeedWellKnownMark) 252 + return false; 253 + if (strcmp(Style->FaceSeedFillColor, this->FaceSeedFillColor) != 0) 254 + return false; 255 + if (strcmp(Style->FaceSeedStrokeColor, this->FaceSeedStrokeColor) != 0) 256 + return false; 257 + return true; 258 +} 259 + 260 +void QuickStyleTopologyObj::UpdateXmlStyle() 261 +{ 262 +// 263 +// updating the XML Style 264 +// 265 + if (XmlStyle != NULL) 266 + sqlite3_free(XmlStyle); 267 + XmlStyle = CreateXmlStyle(); 268 +} 269 + 270 +char *QuickStyleTopologyObj::CreateXmlStyle() 271 +{ 272 +// 273 +// creating the XML Style 274 +// 275 + char *prev; 276 + char *xml2; 277 + char *xml = sqlite3_mprintf("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"); 278 + prev = xml; 279 + xml = sqlite3_mprintf("%s<FeatureTypeStyle version=\"1.1.0\" ", prev); 280 + sqlite3_free(prev); 281 + prev = xml; 282 + xml = 283 + sqlite3_mprintf 284 + ("%sxsi:schemaLocation=\"http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/FeatureStyle.xsd\" ", 285 + prev); 286 + sqlite3_free(prev); 287 + prev = xml; 288 + xml = sqlite3_mprintf 289 + ("%sxmlns=\"http://www.opengis.net/se\" xmlns:ogc=\"http://www.opengis.net/ogc\" ", 290 + prev); 291 + sqlite3_free(prev); 292 + prev = xml; 293 + xml = 294 + sqlite3_mprintf("%sxmlns:xlink=\"http://www.w3.org/1999/xlink\" ", prev); 295 + sqlite3_free(prev); 296 + prev = xml; 297 + xml = 298 + sqlite3_mprintf 299 + ("%sxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n", prev); 300 + sqlite3_free(prev); 301 + prev = xml; 302 + xml = sqlite3_mprintf("%s\t<Name>%s</Name>\r\n", prev, UUID); 303 + sqlite3_free(prev); 304 + prev = xml; 305 + xml = sqlite3_mprintf("%s\t<Description>\r\n", prev); 306 + sqlite3_free(prev); 307 + prev = xml; 308 + xml = 309 + sqlite3_mprintf("%s\t\t<Title>%s</Title>\r\n", prev, 310 + "Quick Style - Topology"); 311 + sqlite3_free(prev); 312 + prev = xml; 313 + xml = 314 + sqlite3_mprintf("%s\t\t<Abstract>%s</Abstract>\r\n", prev, 315 + "Created by SpatialiteGUI"); 316 + sqlite3_free(prev); 317 + prev = xml; 318 + xml = sqlite3_mprintf("%s\t</Description>\r\n", prev); 319 + sqlite3_free(prev); 320 + prev = xml; 321 + if (Type == MAP_LAYER_NETWORK) 322 + { 323 + // Links 324 + xml2 = DoCreateEdgeLinkXML(); 325 + if (xml2 != NULL) 326 + { 327 + xml = sqlite3_mprintf("%s%s", prev, xml2); 328 + sqlite3_free(prev); 329 + sqlite3_free(xml2); 330 + prev = xml; 331 + } 332 + // Nodes 333 + xml2 = DoCreateNodeXML(); 334 + if (xml2 != NULL) 335 + { 336 + xml = sqlite3_mprintf("%s%s", prev, xml2); 337 + sqlite3_free(prev); 338 + sqlite3_free(xml2); 339 + prev = xml; 340 + } 341 + // LinkSeeds 342 + xml2 = DoCreateEdgeLinkSeedXML(); 343 + if (xml2 != NULL) 344 + { 345 + xml = sqlite3_mprintf("%s%s", prev, xml2); 346 + sqlite3_free(prev); 347 + sqlite3_free(xml2); 348 + prev = xml; 349 + } 350 + } else 351 + { 352 + // Faces 353 + xml2 = DoCreateFaceXML(); 354 + if (xml2 != NULL) 355 + { 356 + xml = sqlite3_mprintf("%s%s", prev, xml2); 357 + sqlite3_free(prev); 358 + sqlite3_free(xml2); 359 + prev = xml; 360 + } 361 + // Edges 362 + xml2 = DoCreateEdgeLinkXML(); 363 + if (xml2 != NULL) 364 + { 365 + xml = sqlite3_mprintf("%s%s", prev, xml2); 366 + sqlite3_free(prev); 367 + sqlite3_free(xml2); 368 + prev = xml; 369 + } 370 + // Nodes 371 + xml2 = DoCreateNodeXML(); 372 + if (xml2 != NULL) 373 + { 374 + xml = sqlite3_mprintf("%s%s", prev, xml2); 375 + sqlite3_free(prev); 376 + sqlite3_free(xml2); 377 + prev = xml; 378 + } 379 + // EdgeSeeds 380 + xml2 = DoCreateEdgeLinkSeedXML(); 381 + if (xml2 != NULL) 382 + { 383 + xml = sqlite3_mprintf("%s%s", prev, xml2); 384 + sqlite3_free(prev); 385 + sqlite3_free(xml2); 386 + prev = xml; 387 + } 388 + // EdgeSeeds 389 + xml2 = DoCreateFaceSeedXML(); 390 + if (xml2 != NULL) 391 + { 392 + xml = sqlite3_mprintf("%s%s", prev, xml2); 393 + sqlite3_free(prev); 394 + sqlite3_free(xml2); 395 + prev = xml; 396 + } 397 + } 398 + xml = sqlite3_mprintf("%s</FeatureTypeStyle>\r\n", prev); 399 + sqlite3_free(prev); 400 + return xml; 401 +} 402 + 403 +char *QuickStyleTopologyObj::DoCreateFaceXML() 404 +{ 405 +// 406 +// creating the XML Style - Face 407 +// 408 + char *prev; 409 + char *xml = sqlite3_mprintf("\t<Rule>\r\n"); 410 + prev = xml; 411 + if (MinScaleEnabled == true) 412 + { 413 + xml = 414 + sqlite3_mprintf 415 + ("%s\t\t<MinScaleDenominator>%1.2f</MinScaleDenominator>\r\n", prev, 416 + ScaleMin); 417 + sqlite3_free(prev); 418 + prev = xml; 419 + } 420 + if (MaxScaleEnabled == true) 421 + { 422 + xml = 423 + sqlite3_mprintf 424 + ("%s\t\t<MaxScaleDenominator>%1.2f</MaxScaleDenominator>\r\n", prev, 425 + ScaleMax); 426 + sqlite3_free(prev); 427 + prev = xml; 428 + } 429 + xml = sqlite3_mprintf("%s\t\t<Name>Face</Name>\r\n", prev); 430 + sqlite3_free(prev); 431 + prev = xml; 432 + xml = 433 + sqlite3_mprintf("%s\t\t<ogc:Filter>\r\n\t\t\t<ogc:PropertyIsEqualTo>\r\n", 434 + prev); 435 + sqlite3_free(prev); 436 + prev = xml; 437 + xml = 438 + sqlite3_mprintf 439 + ("%s\t\t\t\t<ogc:PropertyName>topoclass</ogc:PropertyName>\r\n", prev); 440 + sqlite3_free(prev); 441 + prev = xml; 442 + xml = sqlite3_mprintf("%s\t\t\t\t<ogc:Literal>face</ogc:Literal>\r\n", prev); 443 + sqlite3_free(prev); 444 + prev = xml; 445 + xml = 446 + sqlite3_mprintf("%s\t\t\t</ogc:PropertyIsEqualTo>\r\n\t\t</ogc:Filter>\r\n", 447 + prev); 448 + sqlite3_free(prev); 449 + prev = xml; 450 + 451 + const char *extra = "\t\t"; 452 + xml = sqlite3_mprintf("%s%s<PolygonSymbolizer>\r\n", prev, extra); 453 + prev = xml; 454 + if (FaceFill == true) 455 + { 456 + // Polygon Fill 457 + xml = sqlite3_mprintf("%s%s\t<Fill>\r\n", prev, extra); 458 + sqlite3_free(prev); 459 + prev = xml; 460 + // using a Solid Color 461 + xml = 462 + sqlite3_mprintf 463 + ("%s%s\t\t<SvgParameter name=\"fill\">%s</SvgParameter>\r\n", prev, 464 + extra, FaceFillColor); 465 + sqlite3_free(prev); 466 + prev = xml; 467 + xml = 468 + sqlite3_mprintf 469 + ("%s%s\t\t<SvgParameter name=\"fill-opacity\">%1.2f</SvgParameter>\r\n", 470 + prev, extra, FaceFillOpacity); 471 + sqlite3_free(prev); 472 + prev = xml; 473 + xml = sqlite3_mprintf("%s%s\t</Fill>\r\n", prev, extra); 474 + sqlite3_free(prev); 475 + prev = xml; 476 + } 477 + if (FaceStroke == true) 478 + { 479 + // Polygon Stroke 480 + xml = sqlite3_mprintf("%s%s\t<Stroke>\r\n", prev, extra); 481 + sqlite3_free(prev); 482 + prev = xml; 483 + // using a Solid Color 484 + xml = 485 + sqlite3_mprintf 486 + ("%s%s\t\t<SvgParameter name=\"stroke\">%s</SvgParameter>\r\n", prev, 487 + extra, FaceStrokeColor); 488 + sqlite3_free(prev); 489 + prev = xml; 490 + xml = 491 + sqlite3_mprintf 492 + ("%s%s\t\t<SvgParameter name=\"stroke-opacity\">%1.2f</SvgParameter>\r\n", 493 + prev, extra, FaceStrokeOpacity); 494 + sqlite3_free(prev); 495 + prev = xml; 496 + xml = 497 + sqlite3_mprintf 498 + ("%s%s\t\t<SvgParameter name=\"stroke-width\">%1.2f</SvgParameter>\r\n", 499 + prev, extra, FaceStrokeWidth); 500 + sqlite3_free(prev); 501 + prev = xml; 502 + xml = 503 + sqlite3_mprintf 504 + ("%s%s\t\t<SvgParameter name=\"stroke-linejoin\">round</SvgParameter>\r\n", 505 + prev, extra); 506 + sqlite3_free(prev); 507 + prev = xml; 508 + xml = 509 + sqlite3_mprintf 510 + ("%s%s\t\t<SvgParameter name=\"stroke-linecap\">round</SvgParameter>\r\n", 511 + prev, extra); 512 + sqlite3_free(prev); 513 + prev = xml; 514 + xml = sqlite3_mprintf("%s%s\t</Stroke>\r\n", prev, extra); 515 + sqlite3_free(prev); 516 + prev = xml; 517 + } 518 + if (FaceDisplacementX != 0.0 || FaceDisplacementY != 0.0) 519 + { 520 + xml = sqlite3_mprintf("%s%s\t<Displacement>\r\n", prev, extra); 521 + sqlite3_free(prev); 522 + prev = xml; 523 + xml = 524 + sqlite3_mprintf("%s%s\t\t<DisplacementX>%1.4f</DisplacementX>\r\n", 525 + prev, extra, FaceDisplacementX); 526 + sqlite3_free(prev); 527 + prev = xml; 528 + xml = 529 + sqlite3_mprintf("%s%s\t\t<DisplacementY>%1.4f</DisplacementY>\r\n", 530 + prev, extra, FaceDisplacementY); 531 + sqlite3_free(prev); 532 + prev = xml; 533 + xml = sqlite3_mprintf("%s%s\t</Displacement>\r\n", prev, extra); 534 + sqlite3_free(prev); 535 + prev = xml; 536 + } 537 + if (FacePerpendicularOffset != 0.0) 538 + { 539 + xml = 540 + sqlite3_mprintf 541 + ("%s%s\t<PerpendicularOffset>%1.4f</PerpendicularOffset>\r\n", prev, 542 + extra, FacePerpendicularOffset); 543 + sqlite3_free(prev); 544 + prev = xml; 545 + } 546 + xml = sqlite3_mprintf("%s%s</PolygonSymbolizer>\r\n", prev, extra); 547 + sqlite3_free(prev); 548 + prev = xml; 549 + xml = sqlite3_mprintf("%s\t</Rule>\r\n", prev); 550 + sqlite3_free(prev); 551 + return xml; 552 +} 553 + 554 +char *QuickStyleTopologyObj::DoCreateEdgeLinkXML() 555 +{ 556 +// 557 +// creating the XML Style - Edge or Link 558 +// 559 + char *prev; 560 + char *xml = sqlite3_mprintf("\t<Rule>\r\n"); 561 + prev = xml; 562 + if (MinScaleEnabled == true) 563 + { 564 + xml = 565 + sqlite3_mprintf 566 + ("%s\t\t<MinScaleDenominator>%1.2f</MinScaleDenominator>\r\n", prev, 567 + ScaleMin); 568 + sqlite3_free(prev); 569 + prev = xml; 570 + } 571 + if (MaxScaleEnabled == true) 572 + { 573 + xml = 574 + sqlite3_mprintf 575 + ("%s\t\t<MaxScaleDenominator>%1.2f</MaxScaleDenominator>\r\n", prev, 576 + ScaleMax); 577 + sqlite3_free(prev); 578 + prev = xml; 579 + } 580 + if (Type == MAP_LAYER_NETWORK) 581 + xml = sqlite3_mprintf("%s\t\t<Name>Link</Name>\r\n", prev); 582 + else 583 + xml = sqlite3_mprintf("%s\t\t<Name>Edge</Name>\r\n", prev); 584 + sqlite3_free(prev); 585 + prev = xml; 586 + xml = 587 + sqlite3_mprintf("%s\t\t<ogc:Filter>\r\n\t\t\t<ogc:PropertyIsEqualTo>\r\n", 588 + prev); 589 + sqlite3_free(prev); 590 + prev = xml; 591 + xml = 592 + sqlite3_mprintf 593 + ("%s\t\t\t\t<ogc:PropertyName>topoclass</ogc:PropertyName>\r\n", prev); 594 + sqlite3_free(prev); 595 + prev = xml; 596 + if (Type == MAP_LAYER_NETWORK) 597 + xml = 598 + sqlite3_mprintf("%s\t\t\t\t<ogc:Literal>link</ogc:Literal>\r\n", prev); 599 + else 600 + xml = 601 + sqlite3_mprintf("%s\t\t\t\t<ogc:Literal>edge</ogc:Literal>\r\n", prev); 602 + sqlite3_free(prev); 603 + prev = xml; 604 + xml = 605 + sqlite3_mprintf("%s\t\t\t</ogc:PropertyIsEqualTo>\r\n\t\t</ogc:Filter>\r\n", 606 + prev); 607 + sqlite3_free(prev); 608 + prev = xml; 609 + 610 + const char *extra = "\t\t"; 611 + xml = sqlite3_mprintf("%s%s<LineSymbolizer>\r\n", prev, extra); 612 + prev = xml; 613 + xml = sqlite3_mprintf("%s%s\t<Stroke>\r\n", prev, extra); 614 + sqlite3_free(prev); 615 + prev = xml; 616 +// using a Solid Color 617 + xml = 618 + sqlite3_mprintf 619 + ("%s%s\t\t<SvgParameter name=\"stroke\">%s</SvgParameter>\r\n", prev, extra, 620 + EdgeLinkStrokeColor); 621 + sqlite3_free(prev); 622 + prev = xml; 623 + xml = 624 + sqlite3_mprintf 625 + ("%s%s\t\t<SvgParameter name=\"stroke-opacity\">%1.2f</SvgParameter>\r\n", 626 + prev, extra, EdgeLinkOpacity); 627 + sqlite3_free(prev); 628 + prev = xml; 629 + xml = 630 + sqlite3_mprintf 631 + ("%s%s\t\t<SvgParameter name=\"stroke-width\">%1.2f</SvgParameter>\r\n", 632 + prev, extra, EdgeLinkStrokeWidth); 633 + sqlite3_free(prev); 634 + prev = xml; 635 + xml = 636 + sqlite3_mprintf 637 + ("%s%s\t\t<SvgParameter name=\"stroke-linejoin\">round</SvgParameter>\r\n", 638 + prev, extra); 639 + sqlite3_free(prev); 640 + prev = xml; 641 + xml = 642 + sqlite3_mprintf 643 + ("%s%s\t\t<SvgParameter name=\"stroke-linecap\">round</SvgParameter>\r\n", 644 + prev, extra); 645 + sqlite3_free(prev); 646 + prev = xml; 647 + const char *dashArray; 648 + switch (EdgeLinkDotStyle) 649 + { 650 + case QUICK_STYLE_DOT_LINE: 651 + dashArray = "5.0, 10.0"; 652 + break; 653 + case QUICK_STYLE_DASH_LINE: 654 + dashArray = "20.0, 20.0"; 655 + break; 656 + case QUICK_STYLE_DASH_DOT_LINE: 657 + dashArray = "20.0, 10.0, 5.0, 10.0"; 658 + break; 659 + default: 660 + dashArray = NULL; 661 + break; 662 + }; 663 + if (dashArray != NULL) 664 + { 665 + xml = 666 + sqlite3_mprintf 667 + ("%s%s\t\t<SvgParameter name=\"stroke-dasharray\">%s</SvgParameter>\r\n", 668 + prev, extra, dashArray); 669 + sqlite3_free(prev); 670 + prev = xml; 671 + } 672 + xml = sqlite3_mprintf("%s%s\t</Stroke>\r\n", prev, extra); 673 + sqlite3_free(prev); 674 + prev = xml; 675 + if (EdgeLinkPerpendicularOffset != 0.0) 676 + { 677 + xml = 678 + sqlite3_mprintf 679 + ("%s%s\t<PerpendicularOffset>%1.2f</PerpendicularOffset>\r\n", prev, 680 + extra, EdgeLinkPerpendicularOffset); 681 + sqlite3_free(prev); 682 + prev = xml; 683 + } 684 + xml = sqlite3_mprintf("%s%s</LineSymbolizer>\r\n", prev, extra); 685 + sqlite3_free(prev); 686 + prev = xml; 687 + xml = sqlite3_mprintf("%s\t</Rule>\r\n", prev); 688 + sqlite3_free(prev); 689 + return xml; 690 +} 691 + 692 +char *QuickStyleTopologyObj::DoCreateNodeXML() 693 +{ 694 +// 695 +// creating the XML Style - Node 696 +// 697 + const char *cstr; 698 + char *prev; 699 + char *xml = sqlite3_mprintf("\t<Rule>\r\n"); 700 + prev = xml; 701 + if (MinScaleEnabled == true) 702 + { 703 + xml = 704 + sqlite3_mprintf 705 + ("%s\t\t<MinScaleDenominator>%1.2f</MinScaleDenominator>\r\n", prev, 706 + ScaleMin); 707 + sqlite3_free(prev); 708 + prev = xml; 709 + } 710 + if (MaxScaleEnabled == true) 711 + { 712 + xml = 713 + sqlite3_mprintf 714 + ("%s\t\t<MaxScaleDenominator>%1.2f</MaxScaleDenominator>\r\n", prev, 715 + ScaleMax); 716 + sqlite3_free(prev); 717 + prev = xml; 718 + } 719 + xml = sqlite3_mprintf("%s\t\t<Name>Node</Name>\r\n", prev); 720 + sqlite3_free(prev); 721 + prev = xml; 722 + xml = 723 + sqlite3_mprintf("%s\t\t<ogc:Filter>\r\n\t\t\t<ogc:PropertyIsEqualTo>\r\n", 724 + prev); 725 + sqlite3_free(prev); 726 + prev = xml; 727 + xml = 728 + sqlite3_mprintf 729 + ("%s\t\t\t\t<ogc:PropertyName>topoclass</ogc:PropertyName>\r\n", prev); 730 + sqlite3_free(prev); 731 + prev = xml; 732 + xml = sqlite3_mprintf("%s\t\t\t\t<ogc:Literal>node</ogc:Literal>\r\n", prev); 733 + sqlite3_free(prev); 734 + prev = xml; 735 + xml = 736 + sqlite3_mprintf("%s\t\t\t</ogc:PropertyIsEqualTo>\r\n\t\t</ogc:Filter>\r\n", 737 + prev); 738 + sqlite3_free(prev); 739 + prev = xml; 740 + 741 + const char *extra = "\t\t"; 742 + xml = sqlite3_mprintf("%s%s<PointSymbolizer>\r\n", prev, extra); 743 + prev = xml; 744 + xml = sqlite3_mprintf("%s%s\t<Graphic>\r\n", prev, extra); 745 + sqlite3_free(prev); 746 + prev = xml; 747 +// mark symbol 748 + xml = sqlite3_mprintf("%s%s\t\t<Mark>\r\n", prev, extra); 749 + sqlite3_free(prev); 750 + prev = xml; 751 + switch (NodeWellKnownMark) 752 + { 753 + case RL2_GRAPHIC_MARK_CIRCLE: 754 + cstr = "circle"; 755 + break; 756 + case RL2_GRAPHIC_MARK_TRIANGLE: 757 + cstr = "triangle"; 758 + break; 759 + case RL2_GRAPHIC_MARK_STAR: 760 + cstr = "star"; 761 + break; 762 + case RL2_GRAPHIC_MARK_CROSS: 763 + cstr = "cross"; 764 + break; 765 + case RL2_GRAPHIC_MARK_X: 766 + cstr = "x"; 767 + break; 768 + default: 769 + cstr = "square"; 770 + break; 771 + }; 772 + xml = 773 + sqlite3_mprintf("%s%s\t\t\t<WellKnownName>%s</WellKnownName>\r\n", prev, 774 + extra, cstr); 775 + sqlite3_free(prev); 776 + prev = xml; 777 +// Mark Fill 778 + xml = sqlite3_mprintf("%s%s\t\t\t<Fill>\r\n", prev, extra); 779 + sqlite3_free(prev); 780 + prev = xml; 781 + xml = 782 + sqlite3_mprintf 783 + ("%s%s\t\t\t\t<SvgParameter name=\"fill\">%s</SvgParameter>\r\n", 784 + prev, extra, NodeFillColor); 785 + sqlite3_free(prev); 786 + prev = xml; 787 + xml = sqlite3_mprintf("%s%s\t\t\t</Fill>\r\n", prev, extra); 788 + sqlite3_free(prev); 789 + prev = xml; 790 +// Mark Stroke 791 + xml = sqlite3_mprintf("%s%s\t\t\t<Stroke>\r\n", prev, extra); 792 + sqlite3_free(prev); 793 + prev = xml; 794 + xml = 795 + sqlite3_mprintf 796 + ("%s%s\t\t\t\t<SvgParameter name=\"stroke\">%s</SvgParameter>\r\n", 797 + prev, extra, NodeStrokeColor); 798 + sqlite3_free(prev); 799 + prev = xml; 800 + xml = 801 + sqlite3_mprintf 802 + ("%s%s\t\t\t\t<SvgParameter name=\"stroke-width\">%1.2f</SvgParameter>\r\n", 803 + prev, extra, 1.0); 804 + sqlite3_free(prev); 805 + prev = xml; 806 + xml = 807 + sqlite3_mprintf 808 + ("%s%s\t\t\t\t<SvgParameter name=\"stroke-linejoin\">round</SvgParameter>\r\n", 809 + prev, extra); 810 + sqlite3_free(prev); 811 + prev = xml; 812 + xml = 813 + sqlite3_mprintf 814 + ("%s%s\t\t\t\t<SvgParameter name=\"stroke-linecap\">round</SvgParameter>\r\n", 815 + prev, extra); 816 + sqlite3_free(prev); 817 + prev = xml; 818 + xml = sqlite3_mprintf("%s%s\t\t\t</Stroke>\r\n", prev, extra); 819 + sqlite3_free(prev); 820 + prev = xml; 821 + xml = sqlite3_mprintf("%s%s\t\t</Mark>\r\n", prev, extra); 822 + sqlite3_free(prev); 823 + prev = xml; 824 + if (NodeOpacity != 1.0) 825 + { 826 + xml = 827 + sqlite3_mprintf("%s%s\t\t<Opacity>%1.2f</Opacity>\r\n", prev, extra, 828 + NodeOpacity); 829 + sqlite3_free(prev); 830 + prev = xml; 831 + } 832 + xml = 833 + sqlite3_mprintf("%s%s\t\t<Size>%1.2f</Size>\r\n", prev, extra, NodeSize); 834 + sqlite3_free(prev); 835 + prev = xml; 836 + if (NodeRotation != 0.0) 837 + { 838 + xml = 839 + sqlite3_mprintf("%s%s\t\t<Rotation>%1.2f</Rotation>\r\n", prev, extra, 840 + NodeRotation); 841 + sqlite3_free(prev); 842 + prev = xml; 843 + } 844 + if (NodeAnchorX != 0.5 || NodeAnchorY != 0.5) 845 + { 846 + xml = sqlite3_mprintf("%s%s\t\t<AnchorPoint>\r\n", prev, extra); 847 + sqlite3_free(prev); 848 + prev = xml; 849 + xml = 850 + sqlite3_mprintf("%s%s\t\t\t<AnchorPointX>%1.4f</AnchorPointX>\r\n", 851 + prev, extra, NodeAnchorX); 852 + sqlite3_free(prev); 853 + prev = xml; 854 + xml = 855 + sqlite3_mprintf("%s%s\t\t\t<AnchorPointY>%1.4f</AnchorPointY>\r\n", 856 + prev, extra, NodeAnchorY); 857 + sqlite3_free(prev); 858 + prev = xml; 859 + xml = sqlite3_mprintf("%s%s\t\t</AnchorPoint>\r\n", prev, extra); 860 + sqlite3_free(prev); 861 + prev = xml; 862 + } 863 + if (NodeDisplacementX != 0.0 || NodeDisplacementY != 0.0) 864 + { 865 + xml = sqlite3_mprintf("%s%s\t\t<Displacement>\r\n", prev, extra); 866 + sqlite3_free(prev); 867 + prev = xml; 868 + xml = 869 + sqlite3_mprintf("%s%s\t\t\t<DisplacementX>%1.4f</DisplacementX>\r\n", 870 + prev, extra, NodeDisplacementX); 871 + sqlite3_free(prev); 872 + prev = xml; 873 + xml = 874 + sqlite3_mprintf("%s%s\t\t\t<DisplacementY>%1.4f</DisplacementY>\r\n", 875 + prev, extra, NodeDisplacementY); 876 + sqlite3_free(prev); 877 + prev = xml; 878 + xml = sqlite3_mprintf("%s%s\t\t</Displacement>\r\n", prev, extra); 879 + sqlite3_free(prev); 880 + prev = xml; 881 + } 882 + xml = sqlite3_mprintf("%s%s\t</Graphic>\r\n", prev, extra); 883 + sqlite3_free(prev); 884 + prev = xml; 885 + xml = sqlite3_mprintf("%s%s</PointSymbolizer>\r\n", prev, extra); 886 + sqlite3_free(prev); 887 + prev = xml; 888 + xml = sqlite3_mprintf("%s\t</Rule>\r\n", prev); 889 + sqlite3_free(prev); 890 + return xml; 891 +} 892 + 893 +char *QuickStyleTopologyObj::DoCreateEdgeLinkSeedXML() 894 +{ 895 +// 896 +// creating the XML Style - Edge or Link Seed 897 +// 898 + const char *cstr; 899 + char *prev; 900 + char *xml = sqlite3_mprintf("\t<Rule>\r\n"); 901 + prev = xml; 902 + if (MinScaleEnabled == true) 903 + { 904 + xml = 905 + sqlite3_mprintf 906 + ("%s\t\t<MinScaleDenominator>%1.2f</MinScaleDenominator>\r\n", prev, 907 + ScaleMin); 908 + sqlite3_free(prev); 909 + prev = xml; 910 + } 911 + if (MaxScaleEnabled == true) 912 + { 913 + xml = 914 + sqlite3_mprintf 915 + ("%s\t\t<MaxScaleDenominator>%1.2f</MaxScaleDenominator>\r\n", prev, 916 + ScaleMax); 917 + sqlite3_free(prev); 918 + prev = xml; 919 + } 920 + if (Type == MAP_LAYER_NETWORK) 921 + xml = sqlite3_mprintf("%s\t\t<Name>LinkSeed</Name>\r\n", prev); 922 + else 923 + xml = sqlite3_mprintf("%s\t\t<Name>EdgeSeed</Name>\r\n", prev); 924 + sqlite3_free(prev); 925 + prev = xml; 926 + xml = 927 + sqlite3_mprintf("%s\t\t<ogc:Filter>\r\n\t\t\t<ogc:PropertyIsEqualTo>\r\n", 928 + prev); 929 + sqlite3_free(prev); 930 + prev = xml; 931 + xml = 932 + sqlite3_mprintf 933 + ("%s\t\t\t\t<ogc:PropertyName>topoclass</ogc:PropertyName>\r\n", prev); 934 + sqlite3_free(prev); 935 + prev = xml; 936 + if (Type == MAP_LAYER_NETWORK) 937 + xml = 938 + sqlite3_mprintf("%s\t\t\t\t<ogc:Literal>link_seed</ogc:Literal>\r\n", 939 + prev); 940 + else 941 + xml = 942 + sqlite3_mprintf("%s\t\t\t\t<ogc:Literal>edge_seed</ogc:Literal>\r\n", 943 + prev); 944 + sqlite3_free(prev); 945 + prev = xml; 946 + xml = 947 + sqlite3_mprintf("%s\t\t\t</ogc:PropertyIsEqualTo>\r\n\t\t</ogc:Filter>\r\n", 948 + prev); 949 + sqlite3_free(prev); 950 + prev = xml; 951 + 952 + const char *extra = "\t\t"; 953 + xml = sqlite3_mprintf("%s%s<PointSymbolizer>\r\n", prev, extra); 954 + prev = xml; 955 + xml = sqlite3_mprintf("%s%s\t<Graphic>\r\n", prev, extra); 956 + sqlite3_free(prev); 957 + prev = xml; 958 +// mark symbol 959 + xml = sqlite3_mprintf("%s%s\t\t<Mark>\r\n", prev, extra); 960 + sqlite3_free(prev); 961 + prev = xml; 962 + switch (EdgeLinkSeedWellKnownMark) 963 + { 964 + case RL2_GRAPHIC_MARK_CIRCLE: 965 + cstr = "circle"; 966 + break; 967 + case RL2_GRAPHIC_MARK_TRIANGLE: 968 + cstr = "triangle"; 969 + break; 970 + case RL2_GRAPHIC_MARK_STAR: 971 + cstr = "star"; 972 + break; 973 + case RL2_GRAPHIC_MARK_CROSS: 974 + cstr = "cross"; 975 + break; 976 + case RL2_GRAPHIC_MARK_X: 977 + cstr = "x"; 978 + break; 979 + default: 980 + cstr = "square"; 981 + break; 982 + }; 983 + xml = 984 + sqlite3_mprintf("%s%s\t\t\t<WellKnownName>%s</WellKnownName>\r\n", prev, 985 + extra, cstr); 986 + sqlite3_free(prev); 987 + prev = xml; 988 +// Mark Fill 989 + xml = sqlite3_mprintf("%s%s\t\t\t<Fill>\r\n", prev, extra); 990 + sqlite3_free(prev); 991 + prev = xml; 992 + xml = 993 + sqlite3_mprintf 994 + ("%s%s\t\t\t\t<SvgParameter name=\"fill\">%s</SvgParameter>\r\n", 995 + prev, extra, EdgeLinkSeedFillColor); 996 + sqlite3_free(prev); 997 + prev = xml; 998 + xml = sqlite3_mprintf("%s%s\t\t\t</Fill>\r\n", prev, extra); 999 + sqlite3_free(prev); 1000 + prev = xml; 1001 +// Mark Stroke 1002 + xml = sqlite3_mprintf("%s%s\t\t\t<Stroke>\r\n", prev, extra); 1003 + sqlite3_free(prev); 1004 + prev = xml; 1005 + xml = 1006 + sqlite3_mprintf 1007 + ("%s%s\t\t\t\t<SvgParameter name=\"stroke\">%s</SvgParameter>\r\n", 1008 + prev, extra, EdgeLinkSeedStrokeColor); 1009 + sqlite3_free(prev); 1010 + prev = xml; 1011 + xml = 1012 + sqlite3_mprintf 1013 + ("%s%s\t\t\t\t<SvgParameter name=\"stroke-width\">%1.2f</SvgParameter>\r\n", 1014 + prev, extra, 1.0); 1015 + sqlite3_free(prev); 1016 + prev = xml; 1017 + xml = 1018 + sqlite3_mprintf 1019 + ("%s%s\t\t\t\t<SvgParameter name=\"stroke-linejoin\">round</SvgParameter>\r\n", 1020 + prev, extra); 1021 + sqlite3_free(prev); 1022 + prev = xml; 1023 + xml = 1024 + sqlite3_mprintf 1025 + ("%s%s\t\t\t\t<SvgParameter name=\"stroke-linecap\">round</SvgParameter>\r\n", 1026 + prev, extra); 1027 + sqlite3_free(prev); 1028 + prev = xml; 1029 + xml = sqlite3_mprintf("%s%s\t\t\t</Stroke>\r\n", prev, extra); 1030 + sqlite3_free(prev); 1031 + prev = xml; 1032 + xml = sqlite3_mprintf("%s%s\t\t</Mark>\r\n", prev, extra); 1033 + sqlite3_free(prev); 1034 + prev = xml; 1035 + if (EdgeLinkSeedOpacity != 1.0) 1036 + { 1037 + xml = 1038 + sqlite3_mprintf("%s%s\t\t<Opacity>%1.2f</Opacity>\r\n", prev, extra, 1039 + EdgeLinkSeedOpacity); 1040 + sqlite3_free(prev); 1041 + prev = xml; 1042 + } 1043 + xml = 1044 + sqlite3_mprintf("%s%s\t\t<Size>%1.2f</Size>\r\n", prev, extra, 1045 + EdgeLinkSeedSize); 1046 + sqlite3_free(prev); 1047 + prev = xml; 1048 + if (EdgeLinkSeedRotation != 0.0) 1049 + { 1050 + xml = 1051 + sqlite3_mprintf("%s%s\t\t<Rotation>%1.2f</Rotation>\r\n", prev, extra, 1052 + EdgeLinkSeedRotation); 1053 + sqlite3_free(prev); 1054 + prev = xml; 1055 + } 1056 + if (EdgeLinkSeedAnchorX != 0.5 || EdgeLinkSeedAnchorY != 0.5) 1057 + { 1058 + xml = sqlite3_mprintf("%s%s\t\t<AnchorPoint>\r\n", prev, extra); 1059 + sqlite3_free(prev); 1060 + prev = xml; 1061 + xml = 1062 + sqlite3_mprintf("%s%s\t\t\t<AnchorPointX>%1.4f</AnchorPointX>\r\n", 1063 + prev, extra, EdgeLinkSeedAnchorX); 1064 + sqlite3_free(prev); 1065 + prev = xml; 1066 + xml = 1067 + sqlite3_mprintf("%s%s\t\t\t<AnchorPointY>%1.4f</AnchorPointY>\r\n", 1068 + prev, extra, EdgeLinkSeedAnchorY); 1069 + sqlite3_free(prev); 1070 + prev = xml; 1071 + xml = sqlite3_mprintf("%s%s\t\t</AnchorPoint>\r\n", prev, extra); 1072 + sqlite3_free(prev); 1073 + prev = xml; 1074 + } 1075 + if (EdgeLinkSeedDisplacementX != 0.0 || EdgeLinkSeedDisplacementY != 0.0) 1076 + { 1077 + xml = sqlite3_mprintf("%s%s\t\t<Displacement>\r\n", prev, extra); 1078 + sqlite3_free(prev); 1079 + prev = xml; 1080 + xml = 1081 + sqlite3_mprintf("%s%s\t\t\t<DisplacementX>%1.4f</DisplacementX>\r\n", 1082 + prev, extra, EdgeLinkSeedDisplacementX); 1083 + sqlite3_free(prev); 1084 + prev = xml; 1085 + xml = 1086 + sqlite3_mprintf("%s%s\t\t\t<DisplacementY>%1.4f</DisplacementY>\r\n", 1087 + prev, extra, EdgeLinkSeedDisplacementY); 1088 + sqlite3_free(prev); 1089 + prev = xml; 1090 + xml = sqlite3_mprintf("%s%s\t\t</Displacement>\r\n", prev, extra); 1091 + sqlite3_free(prev); 1092 + prev = xml; 1093 + } 1094 + xml = sqlite3_mprintf("%s%s\t</Graphic>\r\n", prev, extra); 1095 + sqlite3_free(prev); 1096 + prev = xml; 1097 + xml = sqlite3_mprintf("%s%s</PointSymbolizer>\r\n", prev, extra); 1098 + sqlite3_free(prev); 1099 + prev = xml; 1100 + xml = sqlite3_mprintf("%s\t</Rule>\r\n", prev); 1101 + sqlite3_free(prev); 1102 + return xml; 1103 +} 1104 + 1105 +char *QuickStyleTopologyObj::DoCreateFaceSeedXML() 1106 +{ 1107 +// 1108 +// creating the XML Style - FaceSeed 1109 +// 1110 + const char *cstr; 1111 + char *prev; 1112 + char *xml = sqlite3_mprintf("\t<Rule>\r\n"); 1113 + prev = xml; 1114 + if (MinScaleEnabled == true) 1115 + { 1116 + xml = 1117 + sqlite3_mprintf 1118 + ("%s\t\t<MinScaleDenominator>%1.2f</MinScaleDenominator>\r\n", prev, 1119 + ScaleMin); 1120 + sqlite3_free(prev); 1121 + prev = xml; 1122 + } 1123 + if (MaxScaleEnabled == true) 1124 + { 1125 + xml = 1126 + sqlite3_mprintf 1127 + ("%s\t\t<MaxScaleDenominator>%1.2f</MaxScaleDenominator>\r\n", prev, 1128 + ScaleMax); 1129 + sqlite3_free(prev); 1130 + prev = xml; 1131 + } 1132 + xml = sqlite3_mprintf("%s\t\t<Name>FaceSeed</Name>\r\n", prev); 1133 + sqlite3_free(prev); 1134 + prev = xml; 1135 + xml = 1136 + sqlite3_mprintf("%s\t\t<ogc:Filter>\r\n\t\t\t<ogc:PropertyIsEqualTo>\r\n", 1137 + prev); 1138 + sqlite3_free(prev); 1139 + prev = xml; 1140 + xml = 1141 + sqlite3_mprintf 1142 + ("%s\t\t\t\t<ogc:PropertyName>topoclass</ogc:PropertyName>\r\n", prev); 1143 + sqlite3_free(prev); 1144 + prev = xml; 1145 + xml = 1146 + sqlite3_mprintf("%s\t\t\t\t<ogc:Literal>face_seed</ogc:Literal>\r\n", prev); 1147 + sqlite3_free(prev); 1148 + prev = xml; 1149 + xml = 1150 + sqlite3_mprintf("%s\t\t\t</ogc:PropertyIsEqualTo>\r\n\t\t</ogc:Filter>\r\n", 1151 + prev); 1152 + sqlite3_free(prev); 1153 + prev = xml; 1154 + 1155 + const char *extra = "\t\t"; 1156 + xml = sqlite3_mprintf("%s%s<PointSymbolizer>\r\n", prev, extra); 1157 + prev = xml; 1158 + xml = sqlite3_mprintf("%s%s\t<Graphic>\r\n", prev, extra); 1159 + sqlite3_free(prev); 1160 + prev = xml; 1161 +// mark symbol 1162 + xml = sqlite3_mprintf("%s%s\t\t<Mark>\r\n", prev, extra); 1163 + sqlite3_free(prev); 1164 + prev = xml; 1165 + switch (FaceSeedWellKnownMark) 1166 + { 1167 + case RL2_GRAPHIC_MARK_CIRCLE: 1168 + cstr = "circle"; 1169 + break; 1170 + case RL2_GRAPHIC_MARK_TRIANGLE: 1171 + cstr = "triangle"; 1172 + break; 1173 + case RL2_GRAPHIC_MARK_STAR: 1174 + cstr = "star"; 1175 + break; 1176 + case RL2_GRAPHIC_MARK_CROSS: 1177 + cstr = "cross"; 1178 + break; 1179 + case RL2_GRAPHIC_MARK_X: 1180 + cstr = "x"; 1181 + break; 1182 + default: 1183 + cstr = "square"; 1184 + break; 1185 + }; 1186 + xml = 1187 + sqlite3_mprintf("%s%s\t\t\t<WellKnownName>%s</WellKnownName>\r\n", prev, 1188 + extra, cstr); 1189 + sqlite3_free(prev); 1190 + prev = xml; 1191 +// Mark Fill 1192 + xml = sqlite3_mprintf("%s%s\t\t\t<Fill>\r\n", prev, extra); 1193 + sqlite3_free(prev); 1194 + prev = xml; 1195 + xml = 1196 + sqlite3_mprintf 1197 + ("%s%s\t\t\t\t<SvgParameter name=\"fill\">%s</SvgParameter>\r\n", 1198 + prev, extra, FaceSeedFillColor); 1199 + sqlite3_free(prev); 1200 + prev = xml; 1201 + xml = sqlite3_mprintf("%s%s\t\t\t</Fill>\r\n", prev, extra); 1202 + sqlite3_free(prev); 1203 + prev = xml; 1204 +// Mark Stroke 1205 + xml = sqlite3_mprintf("%s%s\t\t\t<Stroke>\r\n", prev, extra); 1206 + sqlite3_free(prev); 1207 + prev = xml; 1208 + xml = 1209 + sqlite3_mprintf 1210 + ("%s%s\t\t\t\t<SvgParameter name=\"stroke\">%s</SvgParameter>\r\n", 1211 + prev, extra, FaceSeedStrokeColor); 1212 + sqlite3_free(prev); 1213 + prev = xml; 1214 + xml = 1215 + sqlite3_mprintf 1216 + ("%s%s\t\t\t\t<SvgParameter name=\"stroke-width\">%1.2f</SvgParameter>\r\n", 1217 + prev, extra, 1.0); 1218 + sqlite3_free(prev); 1219 + prev = xml; 1220 + xml = 1221 + sqlite3_mprintf 1222 + ("%s%s\t\t\t\t<SvgParameter name=\"stroke-linejoin\">round</SvgParameter>\r\n", 1223 + prev, extra); 1224 + sqlite3_free(prev); 1225 + prev = xml; 1226 + xml = 1227 + sqlite3_mprintf 1228 + ("%s%s\t\t\t\t<SvgParameter name=\"stroke-linecap\">round</SvgParameter>\r\n", 1229 + prev, extra); 1230 + sqlite3_free(prev); 1231 + prev = xml; 1232 + xml = sqlite3_mprintf("%s%s\t\t\t</Stroke>\r\n", prev, extra); 1233 + sqlite3_free(prev); 1234 + prev = xml; 1235 + xml = sqlite3_mprintf("%s%s\t\t</Mark>\r\n", prev, extra); 1236 + sqlite3_free(prev); 1237 + prev = xml; 1238 + if (FaceSeedOpacity != 1.0) 1239 + { 1240 + xml = 1241 + sqlite3_mprintf("%s%s\t\t<Opacity>%1.2f</Opacity>\r\n", prev, extra, 1242 + FaceSeedOpacity); 1243 + sqlite3_free(prev); 1244 + prev = xml; 1245 + } 1246 + xml = 1247 + sqlite3_mprintf("%s%s\t\t<Size>%1.2f</Size>\r\n", prev, extra, 1248 + FaceSeedSize); 1249 + sqlite3_free(prev); 1250 + prev = xml; 1251 + if (FaceSeedRotation != 0.0) 1252 + { 1253 + xml = 1254 + sqlite3_mprintf("%s%s\t\t<Rotation>%1.2f</Rotation>\r\n", prev, extra, 1255 + FaceSeedRotation); 1256 + sqlite3_free(prev); 1257 + prev = xml; 1258 + } 1259 + if (FaceSeedAnchorX != 0.5 || FaceSeedAnchorY != 0.5) 1260 + { 1261 + xml = sqlite3_mprintf("%s%s\t\t<AnchorPoint>\r\n", prev, extra); 1262 + sqlite3_free(prev); 1263 + prev = xml; 1264 + xml = 1265 + sqlite3_mprintf("%s%s\t\t\t<AnchorPointX>%1.4f</AnchorPointX>\r\n", 1266 + prev, extra, FaceSeedAnchorX); 1267 + sqlite3_free(prev); 1268 + prev = xml; 1269 + xml = 1270 + sqlite3_mprintf("%s%s\t\t\t<AnchorPointY>%1.4f</AnchorPointY>\r\n", 1271 + prev, extra, FaceSeedAnchorY); 1272 + sqlite3_free(prev); 1273 + prev = xml; 1274 + xml = sqlite3_mprintf("%s%s\t\t</AnchorPoint>\r\n", prev, extra); 1275 + sqlite3_free(prev); 1276 + prev = xml; 1277 + } 1278 + if (FaceSeedDisplacementX != 0.0 || FaceSeedDisplacementY != 0.0) 1279 + { 1280 + xml = sqlite3_mprintf("%s%s\t\t<Displacement>\r\n", prev, extra); 1281 + sqlite3_free(prev); 1282 + prev = xml; 1283 + xml = 1284 + sqlite3_mprintf("%s%s\t\t\t<DisplacementX>%1.4f</DisplacementX>\r\n", 1285 + prev, extra, FaceSeedDisplacementX); 1286 + sqlite3_free(prev); 1287 + prev = xml; 1288 + xml = 1289 + sqlite3_mprintf("%s%s\t\t\t<DisplacementY>%1.4f</DisplacementY>\r\n", 1290 + prev, extra, FaceSeedDisplacementY); 1291 + sqlite3_free(prev); 1292 + prev = xml; 1293 + xml = sqlite3_mprintf("%s%s\t\t</Displacement>\r\n", prev, extra); 1294 + sqlite3_free(prev); 1295 + prev = xml; 1296 + } 1297 + xml = sqlite3_mprintf("%s%s\t</Graphic>\r\n", prev, extra); 1298 + sqlite3_free(prev); 1299 + prev = xml; 1300 + xml = sqlite3_mprintf("%s%s</PointSymbolizer>\r\n", prev, extra); 1301 + sqlite3_free(prev); 1302 + prev = xml; 1303 + xml = sqlite3_mprintf("%s\t</Rule>\r\n", prev); 1304 + sqlite3_free(prev); 1305 + return xml; 1306 +} 1307 + 1308 +const unsigned char *QuickStyleTopologyObj::CloneXmlStyle() 1309 +{ 1310 +// 1311 +// cloning the XML Style definition 1312 +// 1313 + if (XmlStyle == NULL) 1314 + XmlStyle = CreateXmlStyle(); 1315 + if (XmlStyle == NULL) 1316 + return NULL; 1317 + int len = strlen(XmlStyle); 1318 + char *cloned = (char *) malloc(len + 1); 1319 + strcpy(cloned, XmlStyle); 1320 + return (const unsigned char *) cloned; 1321 +} 1322 + 1323 +bool QuickStyleTopologyDialog::Create(MyMapPanel * parent, MapLayer * layer) 1324 +{ 1325 +// 1326 +// creating the dialog 1327 +// 1328 + MainFrame = parent->GetParent(); 1329 + MapPanel = parent; 1330 + Layer = layer; 1331 + Type = Layer->GetType(); 1332 + DbPrefix = layer->GetDbPrefix(); 1333 + LayerName = layer->GetName(); 1334 + IsConfigChanged = false; 1335 + 1336 + wxString title = wxT("QuickStyle (Topology) Edit"); 1337 + if (Type == MAP_LAYER_NETWORK) 1338 + title = wxT("QuickStyle (Network) Edit"); 1339 + if (wxPropertySheetDialog::Create(parent, wxID_ANY, title) == false) 1340 + return false; 1341 + if (Layer->GetQuickStyleTopology() != NULL) 1342 + Style = Layer->CloneQuickStyleTopology(); 1343 + else 1344 + Style = new QuickStyleTopologyObj(Type); 1345 + 1346 + wxBookCtrlBase *book = GetBookCtrl(); 1347 +// creates individual panels 1348 + wxPanel *mainPage = CreateMainPage(book); 1349 + book->AddPage(mainPage, wxT("General"), true); 1350 + if (Type == MAP_LAYER_NETWORK) 1351 + { 1352 + wxPanel *nodePage = CreateNodePage(book); 1353 + book->AddPage(nodePage, wxT("Nodes"), false); 1354 + wxPanel *edgeLinkPage = CreateEdgeLinkPage(book); 1355 + book->AddPage(edgeLinkPage, wxT("Links"), false); 1356 + wxPanel *edgeLinkSeedPage = CreateEdgeLinkSeedPage(book); 1357 + book->AddPage(edgeLinkSeedPage, wxT("Link Seeds"), false); 1358 + } else 1359 + { 1360 + wxPanel *nodePage = CreateNodePage(book); 1361 + book->AddPage(nodePage, wxT("Nodes"), false); 1362 + wxPanel *edgeLinkPage = CreateEdgeLinkPage(book); 1363 + book->AddPage(edgeLinkPage, wxT("Edges"), false); 1364 + wxPanel *facePage = CreateFacePage(book); 1365 + book->AddPage(facePage, wxT("Faces"), false); 1366 + wxPanel *edgeLinkSeedPage = CreateEdgeLinkSeedPage(book); 1367 + book->AddPage(edgeLinkSeedPage, wxT("Edge Seeds"), false); 1368 + wxPanel *faceSeedPage = CreateFaceSeedPage(book); 1369 + book->AddPage(faceSeedPage, wxT("Face Seeds"), false); 1370 + } 1371 + 1372 + CreateButtons(); 1373 + LayoutDialog(); 1374 +// appends event handler for TAB/PAGE changing 1375 + Connect(wxID_ANY, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, 1376 + (wxObjectEventFunction) & QuickStyleTopologyDialog::OnPageChanging); 1377 + Connect(wxID_ANY, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, 1378 + (wxObjectEventFunction) & QuickStyleTopologyDialog::OnPageChanged); 1379 +// appends event handler for buttons 1380 + Connect(wxID_CANCEL, wxEVT_COMMAND_BUTTON_CLICKED, 1381 + (wxObjectEventFunction) & QuickStyleTopologyDialog::OnQuit); 1382 + Connect(wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, 1383 + (wxObjectEventFunction) & QuickStyleTopologyDialog::OnOk); 1384 + Connect(ID_QUICK_STYLE_APPLY, wxEVT_COMMAND_BUTTON_CLICKED, 1385 + (wxObjectEventFunction) & QuickStyleTopologyDialog::OnApply); 1386 + Connect(ID_QUICK_STYLE_EXPORT, wxEVT_COMMAND_BUTTON_CLICKED, 1387 + (wxObjectEventFunction) & QuickStyleTopologyDialog::OnExport); 1388 + Connect(ID_QUICK_STYLE_COPY, wxEVT_COMMAND_BUTTON_CLICKED, 1389 + (wxObjectEventFunction) & QuickStyleTopologyDialog::OnCopy); 1390 +// centers the dialog window 1391 + Centre(); 1392 + UpdateMainPage(); 1393 + return true; 1394 +} 1395 + 1396 +void QuickStyleTopologyDialog::CreateButtons() 1397 +{ 1398 +// 1399 +// adding the common Buttons 1400 +// 1401 + wxBoxSizer *topSizer = (wxBoxSizer *) (this->GetSizer()); 1402 + wxBoxSizer *btnBox = new wxBoxSizer(wxHORIZONTAL); 1403 + topSizer->Add(btnBox, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1404 + wxButton *save = new wxButton(this, ID_QUICK_STYLE_APPLY, wxT("&Apply")); 1405 + btnBox->Add(save, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1406 + wxButton *exp = 1407 + new wxButton(this, ID_QUICK_STYLE_EXPORT, wxT("&Export to file")); 1408 + btnBox->Add(exp, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1409 + wxButton *copy = new wxButton(this, ID_QUICK_STYLE_COPY, wxT("&Copy")); 1410 + btnBox->Add(copy, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1411 + btnBox->AddSpacer(100); 1412 + wxButton *ok = new wxButton(this, wxID_OK, wxT("&Ok")); 1413 + btnBox->Add(ok, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1414 + wxButton *cancel = new wxButton(this, wxID_CANCEL, wxT("&Cancel")); 1415 + btnBox->Add(cancel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1416 +} 1417 + 1418 +wxPanel *QuickStyleTopologyDialog::CreateMainPage(wxWindow * parent) 1419 +{ 1420 +// 1421 +// creating the MAIN page 1422 +// 1423 + wxPanel *panel = new wxPanel(parent, ID_PANE_MAIN); 1424 + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 1425 + panel->SetSizer(topSizer); 1426 + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 1427 + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 1428 +// First row: Layer name 1429 + boxSizer->AddSpacer(50); 1430 + wxBoxSizer *lyrBoxSizer = new wxBoxSizer(wxVERTICAL); 1431 + boxSizer->Add(lyrBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1432 + wxBoxSizer *nameSizer = new wxBoxSizer(wxVERTICAL); 1433 + lyrBoxSizer->Add(nameSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1434 + wxStaticBox *nameBox = new wxStaticBox(panel, wxID_ANY, 1435 + wxT("Layer FullName"), 1436 + wxDefaultPosition, 1437 + wxDefaultSize); 1438 + wxBoxSizer *nameBoxSizer = new wxStaticBoxSizer(nameBox, wxHORIZONTAL); 1439 + nameSizer->Add(nameBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1440 + wxString fullName = DbPrefix + wxT(".") + LayerName; 1441 + wxTextCtrl *nameCtrl = new wxTextCtrl(panel, ID_VECTOR_LAYER, fullName, 1442 + wxDefaultPosition, wxSize(370, 22), 1443 + wxTE_READONLY); 1444 + nameBoxSizer->Add(nameCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1445 + wxStaticBox *typeBox = new wxStaticBox(panel, wxID_ANY, 1446 + wxT("Geometry Type"), 1447 + wxDefaultPosition, 1448 + wxDefaultSize); 1449 + wxBoxSizer *typeBoxSizer = new wxStaticBoxSizer(typeBox, wxHORIZONTAL); 1450 + nameSizer->Add(typeBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1451 + wxString typeName = wxT("UNKNOWN"); 1452 + if (Type == MAP_LAYER_NETWORK) 1453 + typeName = wxT("Network (ISO TopoNet)"); 1454 + if (Type == MAP_LAYER_TOPOLOGY) 1455 + typeName = wxT("Topology (ISO TopoGeo)"); 1456 + wxTextCtrl *typeCtrl = new wxTextCtrl(panel, ID_VECTOR_TYPE, typeName, 1457 + wxDefaultPosition, wxSize(370, 22), 1458 + wxTE_READONLY); 1459 + typeBoxSizer->Add(typeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1460 + wxStaticBox *uuidBox = new wxStaticBox(panel, wxID_ANY, 1461 + wxT("QuickStyle Name"), 1462 + wxDefaultPosition, 1463 + wxDefaultSize); 1464 + wxBoxSizer *uuidBoxSizer = new wxStaticBoxSizer(uuidBox, wxHORIZONTAL); 1465 + nameSizer->Add(uuidBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1466 + wxString uuid = wxString::FromUTF8(Style->GetUUID()); 1467 + wxTextCtrl *uuidCtrl = new wxTextCtrl(panel, ID_VECTOR_UUID, uuid, 1468 + wxDefaultPosition, wxSize(370, 22), 1469 + wxTE_READONLY); 1470 + uuidBoxSizer->Add(uuidCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1471 + boxSizer->AddSpacer(25); 1472 +// second row: Visibility Range 1473 + wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); 1474 + boxSizer->Add(miscSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 1475 + wxBoxSizer *visibilityBoxSizer = new wxBoxSizer(wxHORIZONTAL); 1476 + miscSizer->Add(visibilityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 1477 + wxStaticBox *visibilityBox = new wxStaticBox(panel, wxID_STATIC, 1478 + wxT("Visibility Range"), 1479 + wxDefaultPosition, 1480 + wxDefaultSize); 1481 + wxBoxSizer *visibilitySizer = 1482 + new wxStaticBoxSizer(visibilityBox, wxHORIZONTAL); 1483 + visibilityBoxSizer->Add(visibilitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 1484 + 5); 1485 + wxString range[4]; 1486 + range[0] = wxT("&None"); 1487 + range[1] = wxT("&Min"); 1488 + range[2] = wxT("&Max"); 1489 + range[3] = wxT("&Both"); 1490 + wxRadioBox *rangeBox = new wxRadioBox(panel, ID_SYMBOLIZER_MINMAX_SCALE, 1491 + wxT("&Range Type"), 1492 + wxDefaultPosition, 1493 + wxDefaultSize, 4, 1494 + range, 2, 1495 + wxRA_SPECIFY_COLS); 1496 + visibilitySizer->Add(rangeBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1497 + rangeBox->SetSelection(0); 1498 + visibilitySizer->AddSpacer(20); 1499 + wxBoxSizer *scaleBoxSizer = new wxBoxSizer(wxVERTICAL); 1500 + visibilitySizer->Add(scaleBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1501 + wxBoxSizer *scaleMinSizer = new wxBoxSizer(wxHORIZONTAL); 1502 + scaleBoxSizer->Add(scaleMinSizer, 0, wxALIGN_RIGHT | wxALL, 5); 1503 + wxStaticText *minScaleLabel = 1504 + new wxStaticText(panel, wxID_STATIC, wxT("&Min Scale:")); 1505 + scaleMinSizer->Add(minScaleLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1506 + wxTextCtrl *minScaleCtrl = 1507 + new wxTextCtrl(panel, ID_SYMBOLIZER_MIN_SCALE, wxT("0.0"), 1508 + wxDefaultPosition, wxSize(100, 22)); 1509 + minScaleCtrl->Enable(false); 1510 + scaleMinSizer->Add(minScaleCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1511 + wxBoxSizer *scaleMaxSizer = new wxBoxSizer(wxHORIZONTAL); 1512 + scaleBoxSizer->Add(scaleMaxSizer, 0, wxALIGN_RIGHT | wxALL, 0); 1513 + wxStaticText *maxScaleLabel = 1514 + new wxStaticText(panel, wxID_STATIC, wxT("&Max Scale:")); 1515 + scaleMaxSizer->Add(maxScaleLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1516 + wxTextCtrl *maxScaleCtrl = 1517 + new wxTextCtrl(panel, ID_SYMBOLIZER_MAX_SCALE, wxT("+Infinite"), 1518 + wxDefaultPosition, wxSize(100, 22)); 1519 + maxScaleCtrl->Enable(false); 1520 + scaleMaxSizer->Add(maxScaleCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1521 + panel->SetSizer(topSizer); 1522 + topSizer->Fit(panel); 1523 +// appends event handlers 1524 + Connect(ID_SYMBOLIZER_MINMAX_SCALE, wxEVT_COMMAND_RADIOBOX_SELECTED, 1525 + (wxObjectEventFunction) & 1526 + QuickStyleTopologyDialog::OnCmdScaleChanged); 1527 + return panel; 1528 +} 1529 + 1530 +void QuickStyleTopologyDialog:: 1531 +OnCmdScaleChanged(wxCommandEvent & WXUNUSED(event)) 1532 +{ 1533 +// 1534 +// Visibility Range selection changed 1535 +// 1536 + wxRadioBox *scaleModeCtrl = 1537 + (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MINMAX_SCALE); 1538 + wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); 1539 + wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); 1540 + switch (scaleModeCtrl->GetSelection()) 1541 + { 1542 + case 0: 1543 + Style->EnableMinScale(false); 1544 + Style->EnableMaxScale(false); 1545 + minCtrl->SetValue(wxT("0.0")); 1546 + minCtrl->Enable(false); 1547 + maxCtrl->SetValue(wxT("+Infinite")); 1548 + maxCtrl->Enable(false); 1549 + break; 1550 + case 1: 1551 + Style->EnableMinScale(true); 1552 + Style->EnableMaxScale(false); 1553 + minCtrl->SetValue(wxT("")); 1554 + minCtrl->Enable(true); 1555 + maxCtrl->SetValue(wxT("+Infinite")); 1556 + maxCtrl->Enable(false); 1557 + break; 1558 + case 2: 1559 + Style->EnableMinScale(false); 1560 + Style->EnableMaxScale(true); 1561 + minCtrl->SetValue(wxT("0.0")); 1562 + minCtrl->Enable(false); 1563 + maxCtrl->SetValue(wxT("")); 1564 + maxCtrl->Enable(true); 1565 + break; 1566 + case 3: 1567 + Style->EnableMinScale(true); 1568 + Style->EnableMaxScale(true); 1569 + minCtrl->SetValue(wxT("")); 1570 + minCtrl->Enable(true); 1571 + maxCtrl->SetValue(wxT("")); 1572 + maxCtrl->Enable(true); 1573 + break; 1574 + }; 1575 +} 1576 + 1577 +wxPanel *QuickStyleTopologyDialog::CreateNodePage(wxWindow * parent) 1578 +{ 1579 +// 1580 +// creating the Node Symbolizer page 1581 +// 1582 + wxString StrokeColor = wxT("#000000"); 1583 + wxString FillColor = wxT("#808080"); 1584 + wxPanel *panel = new wxPanel(parent, ID_PANE_POINT); 1585 + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 1586 + panel->SetSizer(topSizer); 1587 + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 1588 + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 1589 +// first row A: Opacity 1590 + wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); 1591 + boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1592 + wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, 1593 + wxT("Opacity"), 1594 + wxDefaultPosition, 1595 + wxDefaultSize); 1596 + wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); 1597 + opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1598 + wxSlider *opacityCtrl = 1599 + new wxSlider(panel, ID_SYMBOLIZER_NODE_OPACITY, 100, 0, 100, 1600 + wxDefaultPosition, wxSize(600, 45), 1601 + wxSL_HORIZONTAL | wxSL_LABELS); 1602 + opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1603 +// Well Known Mark Name 1604 + wxBoxSizer *box1Sizer = new wxBoxSizer(wxHORIZONTAL); 1605 + boxSizer->Add(box1Sizer, 0, wxALIGN_CENTER | wxALL, 5); 1606 + wxBoxSizer *markSizer = new wxBoxSizer(wxHORIZONTAL); 1607 + box1Sizer->Add(markSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 1608 + wxString mark[6]; 1609 + mark[0] = wxT("&Square"); 1610 + mark[1] = wxT("&Circle"); 1611 + mark[2] = wxT("&Triangle"); 1612 + mark[3] = wxT("&Star"); 1613 + mark[4] = wxT("&Cross"); 1614 + mark[5] = wxT("&X"); 1615 + wxRadioBox *markBox = new wxRadioBox(panel, ID_SYMBOLIZER_NODE_MARK, 1616 + wxT("&Mark"), 1617 + wxDefaultPosition, 1618 + wxDefaultSize, 6, 1619 + mark, 1, 1620 + wxRA_SPECIFY_COLS); 1621 + markSizer->Add(markBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1622 + markBox->SetSelection(0); 1623 +// second row: Size and Rotation 1624 + wxBoxSizer *box2Sizer = new wxBoxSizer(wxVERTICAL); 1625 + box1Sizer->Add(box2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1626 + wxBoxSizer *sizeBoxSizer = new wxBoxSizer(wxHORIZONTAL); 1627 + box2Sizer->Add(sizeBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1628 +// second row A: Size 1629 + wxStaticBox *sizeBox = new wxStaticBox(panel, wxID_STATIC, 1630 + wxT("Size"), 1631 + wxDefaultPosition, 1632 + wxDefaultSize); 1633 + wxBoxSizer *sizeSizer = new wxStaticBoxSizer(sizeBox, wxVERTICAL); 1634 + sizeBoxSizer->Add(sizeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 1635 + wxBoxSizer *size1Sizer = new wxBoxSizer(wxHORIZONTAL); 1636 + sizeSizer->Add(size1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1637 + wxTextCtrl *sizeCtrl = 1638 + new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_SIZE, wxT("16.0"), 1639 + wxDefaultPosition, wxSize(100, 22)); 1640 + size1Sizer->Add(sizeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1641 +// second row B: Rotation 1642 + wxStaticBox *rotBox = new wxStaticBox(panel, wxID_STATIC, 1643 + wxT("Rotation"), 1644 + wxDefaultPosition, 1645 + wxDefaultSize); 1646 + wxBoxSizer *rotSizer = new wxStaticBoxSizer(rotBox, wxVERTICAL); 1647 + sizeBoxSizer->Add(rotSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 1648 + wxBoxSizer *rot1Sizer = new wxBoxSizer(wxHORIZONTAL); 1649 + rotSizer->Add(rot1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1650 + wxTextCtrl *rotCtrl = 1651 + new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_ROTATION, wxT("0.0"), 1652 + wxDefaultPosition, wxSize(100, 22)); 1653 + rot1Sizer->Add(rotCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1654 +// third row: AnchorNode and Displacement 1655 + wxBoxSizer *anchorBoxSizer = new wxBoxSizer(wxHORIZONTAL); 1656 + box2Sizer->Add(anchorBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1657 +// third row A: Anchor Node 1658 + wxStaticBox *anchorBox = new wxStaticBox(panel, wxID_STATIC, 1659 + wxT("Anchor Node"), 1660 + wxDefaultPosition, 1661 + wxDefaultSize); 1662 + wxBoxSizer *anchorSizer = new wxStaticBoxSizer(anchorBox, wxVERTICAL); 1663 + anchorBoxSizer->Add(anchorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 1664 + wxBoxSizer *anchor1Sizer = new wxBoxSizer(wxHORIZONTAL); 1665 + anchorSizer->Add(anchor1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1666 + wxStaticText *anchor1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); 1667 + anchor1Sizer->Add(anchor1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1668 + wxTextCtrl *anchorXCtrl = 1669 + new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_ANCHOR_X, wxT("0.5"), 1670 + wxDefaultPosition, wxSize(100, 22)); 1671 + anchor1Sizer->Add(anchorXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1672 + wxBoxSizer *anchor2Sizer = new wxBoxSizer(wxHORIZONTAL); 1673 + anchorSizer->Add(anchor2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1674 + wxStaticText *anchor2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); 1675 + anchor2Sizer->Add(anchor2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1676 + wxTextCtrl *anchorYCtrl = 1677 + new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_ANCHOR_Y, wxT("0.5"), 1678 + wxDefaultPosition, wxSize(100, 22)); 1679 + anchor2Sizer->Add(anchorYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1680 +// third row B: Displacement 1681 + wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, 1682 + wxT("Displacement"), 1683 + wxDefaultPosition, 1684 + wxDefaultSize); 1685 + wxBoxSizer *displacementSizer = 1686 + new wxStaticBoxSizer(displacementBox, wxVERTICAL); 1687 + anchorBoxSizer->Add(displacementSizer, 0, 1688 + wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 1689 + wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); 1690 + displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1691 + wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); 1692 + displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1693 + wxTextCtrl *displacementXCtrl = 1694 + new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_DISPLACEMENT_X, wxT("0.0"), 1695 + wxDefaultPosition, wxSize(100, 22)); 1696 + displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1697 + wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); 1698 + displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1699 + wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); 1700 + displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1701 + wxTextCtrl *displacementYCtrl = 1702 + new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_DISPLACEMENT_Y, wxT("0.0"), 1703 + wxDefaultPosition, wxSize(100, 22)); 1704 + displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1705 +// fourth row: colors 1706 + wxBoxSizer *box3Sizer = new wxBoxSizer(wxHORIZONTAL); 1707 + boxSizer->Add(box3Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1708 +// first row A: Fill Color 1709 + wxBoxSizer *fillBoxSizer = new wxBoxSizer(wxVERTICAL); 1710 + box3Sizer->Add(fillBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1711 + wxStaticBox *colorFillBox = new wxStaticBox(panel, wxID_STATIC, 1712 + wxT("Fill Color"), 1713 + wxDefaultPosition, 1714 + wxDefaultSize); 1715 + wxBoxSizer *colorFillSizer = new wxStaticBoxSizer(colorFillBox, wxVERTICAL); 1716 + box3Sizer->Add(colorFillSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 1717 + wxBoxSizer *fill1Sizer = new wxBoxSizer(wxHORIZONTAL); 1718 + colorFillSizer->Add(fill1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 1719 + wxTextCtrl *fillColorCtrl = 1720 + new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_FILL_COLOR, FillColor, 1721 + wxDefaultPosition, wxSize(80, 22)); 1722 + fill1Sizer->Add(fillColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1723 + wxBitmap bmp; 1724 + wxColour color(0, 0, 0); 1725 + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 1726 + wxStaticBitmap *sampleFillCtrl = 1727 + new wxStaticBitmap(panel, ID_SYMBOLIZER_NODE_FILL_PICKER_HEX, bmp, 1728 + wxDefaultPosition, wxSize(32, 32)); 1729 + fill1Sizer->Add(sampleFillCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1730 + wxButton *pickFill = new wxButton(panel, ID_SYMBOLIZER_NODE_FILL_PICKER_BTN, 1731 + wxT("&Pick a color")); 1732 + fill1Sizer->Add(pickFill, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1733 +// second row B: Stroke Color 1734 + box3Sizer->AddSpacer(30); 1735 + wxStaticBox *colorStrokeBox = new wxStaticBox(panel, wxID_STATIC, 1736 + wxT("Stroke Color"), 1737 + wxDefaultPosition, 1738 + wxDefaultSize); 1739 + wxBoxSizer *colorStrokeSizer = 1740 + new wxStaticBoxSizer(colorStrokeBox, wxVERTICAL); 1741 + box3Sizer->Add(colorStrokeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 1742 + wxBoxSizer *stroke1Sizer = new wxBoxSizer(wxHORIZONTAL); 1743 + colorStrokeSizer->Add(stroke1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 1744 + wxTextCtrl *strokeColorCtrl = 1745 + new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_STROKE_COLOR, StrokeColor, 1746 + wxDefaultPosition, wxSize(80, 22)); 1747 + stroke1Sizer->Add(strokeColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1748 + wxStaticBitmap *sampleStrokeCtrl = 1749 + new wxStaticBitmap(panel, ID_SYMBOLIZER_NODE_STROKE_PICKER_HEX, bmp, 1750 + wxDefaultPosition, wxSize(32, 32)); 1751 + stroke1Sizer->Add(sampleStrokeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1752 + wxButton *pickStroke = 1753 + new wxButton(panel, ID_SYMBOLIZER_NODE_STROKE_PICKER_BTN, 1754 + wxT("&Pick a color")); 1755 + stroke1Sizer->Add(pickStroke, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1756 + panel->SetSizer(topSizer); 1757 + topSizer->Fit(panel); 1758 +// appends event handlers 1759 + Connect(ID_SYMBOLIZER_NODE_MARK, wxEVT_COMMAND_RADIOBOX_SELECTED, 1760 + (wxObjectEventFunction) & 1761 + QuickStyleTopologyDialog::OnCmdNodeMarkChanged); 1762 + Connect(ID_SYMBOLIZER_NODE_FILL_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 1763 + (wxObjectEventFunction) & 1764 + QuickStyleTopologyDialog::OnCmdNodeColorFillPicker); 1765 + Connect(ID_SYMBOLIZER_NODE_FILL_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 1766 + (wxObjectEventFunction) & 1767 + QuickStyleTopologyDialog::OnCmdNodeColorFillChanged); 1768 + Connect(ID_SYMBOLIZER_NODE_STROKE_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 1769 + (wxObjectEventFunction) & 1770 + QuickStyleTopologyDialog::OnCmdNodeColorStrokePicker); 1771 + Connect(ID_SYMBOLIZER_NODE_STROKE_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 1772 + (wxObjectEventFunction) & 1773 + QuickStyleTopologyDialog::OnCmdNodeColorStrokeChanged); 1774 + return panel; 1775 +} 1776 + 1777 +void QuickStyleTopologyDialog:: 1778 +OnCmdNodeMarkChanged(wxCommandEvent & WXUNUSED(event)) 1779 +{ 1780 +// 1781 +// Mark selection changed 1782 +// 1783 + wxRadioBox *markCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_NODE_MARK); 1784 + switch (markCtrl->GetSelection()) 1785 + { 1786 + case 1: 1787 + Style->SetNodeWellKnownMark(RL2_GRAPHIC_MARK_CIRCLE); 1788 + break; 1789 + case 2: 1790 + Style->SetNodeWellKnownMark(RL2_GRAPHIC_MARK_TRIANGLE); 1791 + break; 1792 + case 3: 1793 + Style->SetNodeWellKnownMark(RL2_GRAPHIC_MARK_STAR); 1794 + break; 1795 + case 4: 1796 + Style->SetNodeWellKnownMark(RL2_GRAPHIC_MARK_CROSS); 1797 + break; 1798 + case 5: 1799 + Style->SetNodeWellKnownMark(RL2_GRAPHIC_MARK_X); 1800 + break; 1801 + default: 1802 + Style->SetNodeWellKnownMark(RL2_GRAPHIC_MARK_SQUARE); 1803 + break; 1804 + }; 1805 +} 1806 + 1807 +void QuickStyleTopologyDialog:: 1808 +OnCmdNodeColorFillChanged(wxCommandEvent & WXUNUSED(event)) 1809 +{ 1810 +// 1811 +// Fill color changed: updating the visual sample 1812 +// 1813 + wxTextCtrl *colorCtrl = 1814 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_FILL_COLOR); 1815 + wxStaticBitmap *sampleCtrl = 1816 + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_NODE_FILL_PICKER_HEX); 1817 + wxColour back = wxColour(255, 255, 255); 1818 + wxString str = colorCtrl->GetValue(); 1819 + if (ColorMapEntry::IsValidColor(str) == true) 1820 + ColorMapEntry::GetWxColor(str, back); 1821 + wxBitmap bmp; 1822 + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 1823 + sampleCtrl->SetBitmap(bmp); 1824 + sampleCtrl->Refresh(); 1825 + sampleCtrl->Update(); 1826 +} 1827 + 1828 +void QuickStyleTopologyDialog:: 1829 +OnCmdNodeColorFillPicker(wxCommandEvent & WXUNUSED(event)) 1830 +{ 1831 +// 1832 +// color picker 1833 +// 1834 + wxTextCtrl *colorCtrl = 1835 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_FILL_COLOR); 1836 + wxColour clr = wxNullColour; 1837 + wxString str = colorCtrl->GetValue(); 1838 + if (ColorMapEntry::IsValidColor(str) == true) 1839 + ColorMapEntry::GetWxColor(str, clr); 1840 + wxColour color = wxGetColourFromUser(this, clr); 1841 + if (color.IsOk() == true) 1842 + { 1843 + char hex[16]; 1844 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 1845 + wxString str = wxString::FromUTF8(hex); 1846 + colorCtrl->SetValue(str); 1847 + } 1848 +} 1849 + 1850 +void QuickStyleTopologyDialog:: 1851 +OnCmdNodeColorStrokeChanged(wxCommandEvent & WXUNUSED(event)) 1852 +{ 1853 +// 1854 +// Stroke color changed: updating the visual sample 1855 +// 1856 + wxTextCtrl *colorCtrl = 1857 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_STROKE_COLOR); 1858 + wxStaticBitmap *sampleCtrl = 1859 + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_NODE_STROKE_PICKER_HEX); 1860 + wxColour back = wxColour(255, 255, 255); 1861 + wxString str = colorCtrl->GetValue(); 1862 + if (ColorMapEntry::IsValidColor(str) == true) 1863 + ColorMapEntry::GetWxColor(str, back); 1864 + wxBitmap bmp; 1865 + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 1866 + sampleCtrl->SetBitmap(bmp); 1867 + sampleCtrl->Refresh(); 1868 + sampleCtrl->Update(); 1869 +} 1870 + 1871 +void QuickStyleTopologyDialog:: 1872 +OnCmdNodeColorStrokePicker(wxCommandEvent & WXUNUSED(event)) 1873 +{ 1874 +// 1875 +// color picker 1876 +// 1877 + wxTextCtrl *colorCtrl = 1878 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_STROKE_COLOR); 1879 + wxColour clr = wxNullColour; 1880 + wxString str = colorCtrl->GetValue(); 1881 + if (ColorMapEntry::IsValidColor(str) == true) 1882 + ColorMapEntry::GetWxColor(str, clr); 1883 + wxColour color = wxGetColourFromUser(this, clr); 1884 + if (color.IsOk() == true) 1885 + { 1886 + char hex[16]; 1887 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 1888 + wxString str = wxString::FromUTF8(hex); 1889 + colorCtrl->SetValue(str); 1890 + } 1891 +} 1892 + 1893 +wxPanel *QuickStyleTopologyDialog::CreateEdgeLinkPage(wxWindow * parent) 1894 +{ 1895 +// 1896 +// creating the EdgeLink Symbolizer page 1897 +// 1898 + wxString StrokeColor = wxT("#000000"); 1899 + wxPanel *panel = new wxPanel(parent, ID_PANE_LINE); 1900 + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 1901 + panel->SetSizer(topSizer); 1902 + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 1903 + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 1904 +// first row A: the Stroke #1 Opacity and Perpendicular Offset 1905 + boxSizer->AddSpacer(50); 1906 + wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxVERTICAL); 1907 + boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1908 + wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, 1909 + wxT("Opacity"), 1910 + wxDefaultPosition, 1911 + wxDefaultSize); 1912 + wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxHORIZONTAL); 1913 + opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1914 + wxSlider *opacityCtrl = 1915 + new wxSlider(panel, ID_SYMBOLIZER_STROKE1_OPACITY, 100, 0, 100, 1916 + wxDefaultPosition, wxSize(600, 45), 1917 + wxSL_HORIZONTAL | wxSL_LABELS); 1918 + opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1919 +// first row B: PerpendicularOffset 1920 + wxBoxSizer *perpendicularBoxSizer = new wxBoxSizer(wxHORIZONTAL); 1921 + opacityBoxSizer->Add(perpendicularBoxSizer, 0, 1922 + wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1923 + wxStaticBox *perpendicularBox = new wxStaticBox(panel, wxID_STATIC, 1924 + wxT("Perpendicular Offset"), 1925 + wxDefaultPosition, 1926 + wxDefaultSize); 1927 + wxBoxSizer *perpendicularSizer = 1928 + new wxStaticBoxSizer(perpendicularBox, wxVERTICAL); 1929 + perpendicularBoxSizer->Add(perpendicularSizer, 0, 1930 + wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 1931 + wxBoxSizer *perp1Sizer = new wxBoxSizer(wxHORIZONTAL); 1932 + perpendicularSizer->Add(perp1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1933 + wxTextCtrl *perpendicularCtrl = 1934 + new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE1_PERPENDICULAR, wxT("0.0"), 1935 + wxDefaultPosition, wxSize(100, 22)); 1936 + perp1Sizer->Add(perpendicularCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 1937 + wxStaticText *perp1Label = new wxStaticText(panel, wxID_STATIC, 1938 + wxT 1939 + ("Draw lines in parallel to the original geometry.")); 1940 + perp1Sizer->Add(perp1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 1941 + wxStaticText *perp2Label = new wxStaticText(panel, wxID_STATIC, 1942 + wxT 1943 + ("Positive to the left-hand side. Negative numbers mean right.")); 1944 + perpendicularSizer->Add(perp2Label, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1945 +// second row: Stroke color or Graphic 1946 + wxBoxSizer *strokeSizer = new wxBoxSizer(wxHORIZONTAL); 1947 + boxSizer->Add(strokeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1948 +// second row B: Stroke Color 1949 + wxBoxSizer *colorBoxSizer = new wxBoxSizer(wxHORIZONTAL); 1950 + strokeSizer->Add(colorBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 1951 + wxStaticBox *colorBox = new wxStaticBox(panel, wxID_STATIC, 1952 + wxT("Stroke Color"), 1953 + wxDefaultPosition, 1954 + wxDefaultSize); 1955 + wxBoxSizer *colorSizer = new wxStaticBoxSizer(colorBox, wxVERTICAL); 1956 + colorBoxSizer->Add(colorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1957 + wxBoxSizer *color1Sizer = new wxBoxSizer(wxHORIZONTAL); 1958 + colorSizer->Add(color1Sizer, 0, wxALIGN_RIGHT | wxALL, 0); 1959 + wxTextCtrl *colorCtrl = 1960 + new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE1_COLOR, StrokeColor, 1961 + wxDefaultPosition, wxSize(80, 22)); 1962 + color1Sizer->Add(colorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1963 + wxBitmap bmp; 1964 + wxColour color(0, 0, 0); 1965 + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 1966 + wxStaticBitmap *sampleCtrl = 1967 + new wxStaticBitmap(panel, ID_SYMBOLIZER_STROKE1_PICKER_HEX, bmp, 1968 + wxDefaultPosition, wxSize(32, 32)); 1969 + color1Sizer->Add(sampleCtrl, 0, wxALIGN_RIGHT | wxALL, 5); 1970 + wxBoxSizer *pickerSizer = new wxBoxSizer(wxHORIZONTAL); 1971 + colorSizer->Add(pickerSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1972 + wxButton *pick = 1973 + new wxButton(panel, ID_SYMBOLIZER_STROKE1_PICKER_BTN, wxT("&Pick a color")); 1974 + pickerSizer->Add(pick, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 1975 +// third row: Stroke-Width 1976 + wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); 1977 + colorBoxSizer->Add(miscSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 1978 +// third row A: StrokeWidth 1979 + wxBoxSizer *widthBoxSizer = new wxBoxSizer(wxHORIZONTAL); 1980 + miscSizer->Add(widthBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 1981 + wxStaticBox *widthBox = new wxStaticBox(panel, wxID_STATIC, 1982 + wxT("Stroke Width"), 1983 + wxDefaultPosition, 1984 + wxDefaultSize); 1985 + wxBoxSizer *widthSizer = new wxStaticBoxSizer(widthBox, wxVERTICAL); 1986 + widthBoxSizer->Add(widthSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 1987 + wxTextCtrl *widthCtrl = 1988 + new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE1_WIDTH, wxT("1.0"), 1989 + wxDefaultPosition, wxSize(100, 22)); 1990 + widthSizer->Add(widthCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1991 +// third row D: DashArray and DashOffset 1992 + wxBoxSizer *dashBoxSizer = new wxBoxSizer(wxHORIZONTAL); 1993 + miscSizer->Add(dashBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 1994 + wxString dot[4]; 1995 + if (Type == MAP_LAYER_NETWORK) 1996 + { 1997 + dot[0] = wxT("&Solid Link"); 1998 + dot[1] = wxT("&Dotted Link"); 1999 + dot[2] = wxT("&Dashed Link"); 2000 + dot[3] = wxT("&Dashed/Dotted Link"); 2001 + } else 2002 + { 2003 + dot[0] = wxT("&Solid Edge"); 2004 + dot[1] = wxT("&Dotted Edge"); 2005 + dot[2] = wxT("&Dashed Edge"); 2006 + dot[3] = wxT("&Dashed/Dotted Edge"); 2007 + } 2008 + wxRadioBox *dotBox = new wxRadioBox(panel, ID_SYMBOLIZER_DASH_DOT, 2009 + wxT("&Dash/Dot Style"), 2010 + wxDefaultPosition, 2011 + wxDefaultSize, 4, 2012 + dot, 1, 2013 + wxRA_SPECIFY_COLS); 2014 + dotBox->SetSelection(0); 2015 + dashBoxSizer->Add(dotBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2016 + panel->SetSizer(topSizer); 2017 + topSizer->Fit(panel); 2018 +// appends event handlers 2019 + Connect(ID_SYMBOLIZER_STROKE1_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 2020 + (wxObjectEventFunction) & 2021 + QuickStyleTopologyDialog::OnCmdEdgeLinkColorChanged); 2022 + Connect(ID_SYMBOLIZER_STROKE1_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 2023 + (wxObjectEventFunction) & 2024 + QuickStyleTopologyDialog::OnCmdEdgeLinkColorPicker); 2025 + return panel; 2026 +} 2027 + 2028 +void QuickStyleTopologyDialog:: 2029 +OnCmdEdgeLinkColorChanged(wxCommandEvent & WXUNUSED(event)) 2030 +{ 2031 +// 2032 +// Stroke color changed: updating the visual sample 2033 +// 2034 + wxTextCtrl *colorCtrl = 2035 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); 2036 + wxStaticBitmap *sampleCtrl = 2037 + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_STROKE1_PICKER_HEX); 2038 + wxColour back = wxColour(255, 255, 255); 2039 + wxString str = colorCtrl->GetValue(); 2040 + if (ColorMapEntry::IsValidColor(str) == true) 2041 + ColorMapEntry::GetWxColor(str, back); 2042 + wxBitmap bmp; 2043 + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 2044 + sampleCtrl->SetBitmap(bmp); 2045 + sampleCtrl->Refresh(); 2046 + sampleCtrl->Update(); 2047 +} 2048 + 2049 +void QuickStyleTopologyDialog:: 2050 +OnCmdEdgeLinkColorPicker(wxCommandEvent & WXUNUSED(event)) 2051 +{ 2052 +// 2053 +// color picker 2054 +// 2055 + wxTextCtrl *colorCtrl = 2056 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); 2057 + wxColour clr = wxNullColour; 2058 + wxString str = colorCtrl->GetValue(); 2059 + if (ColorMapEntry::IsValidColor(str) == true) 2060 + ColorMapEntry::GetWxColor(str, clr); 2061 + wxColour color = wxGetColourFromUser(this, clr); 2062 + if (color.IsOk() == true) 2063 + { 2064 + char hex[16]; 2065 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 2066 + wxString str = wxString::FromUTF8(hex); 2067 + colorCtrl->SetValue(str); 2068 + } 2069 +} 2070 + 2071 +wxPanel *QuickStyleTopologyDialog::CreateFacePage(wxWindow * parent) 2072 +{ 2073 +// 2074 +// creating the Face Symbolizer page 2075 +// 2076 + wxString StrokeColor = wxT("#000000"); 2077 + wxString FillColor = wxT("#808080"); 2078 + wxPanel *panel = new wxPanel(parent, ID_PANE_FILL2); 2079 + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 2080 + panel->SetSizer(topSizer); 2081 + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 2082 + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 2083 +// first row: the Face Displacement and Perpendicular Offset 2084 + wxBoxSizer *polygonBoxSizer = new wxBoxSizer(wxHORIZONTAL); 2085 + boxSizer->Add(polygonBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2086 +// first row A: Displacement 2087 + wxBoxSizer *displacementBoxSizer = new wxBoxSizer(wxHORIZONTAL); 2088 + polygonBoxSizer->Add(displacementBoxSizer, 0, 2089 + wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2090 + wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, 2091 + wxT("Displacement"), 2092 + wxDefaultPosition, 2093 + wxDefaultSize); 2094 + wxBoxSizer *displacementSizer = 2095 + new wxStaticBoxSizer(displacementBox, wxVERTICAL); 2096 + displacementBoxSizer->Add(displacementSizer, 0, 2097 + wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2098 + wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); 2099 + displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2100 + wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); 2101 + displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2102 + wxTextCtrl *displacementXCtrl = 2103 + new wxTextCtrl(panel, ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_X, wxT("0.0"), 2104 + wxDefaultPosition, wxSize(100, 22)); 2105 + displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2106 + wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); 2107 + displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2108 + wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); 2109 + displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2110 + wxTextCtrl *displacementYCtrl = 2111 + new wxTextCtrl(panel, ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_Y, wxT("0.0"), 2112 + wxDefaultPosition, wxSize(100, 22)); 2113 + displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2114 +// first row B: PerpendicularOffset 2115 + wxBoxSizer *perpendicularBoxSizer = new wxBoxSizer(wxHORIZONTAL); 2116 + polygonBoxSizer->Add(perpendicularBoxSizer, 0, 2117 + wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2118 + wxStaticBox *perpendicularBox = new wxStaticBox(panel, wxID_STATIC, 2119 + wxT("Perpendicular Offset"), 2120 + wxDefaultPosition, 2121 + wxDefaultSize); 2122 + wxBoxSizer *perpendicularSizer = 2123 + new wxStaticBoxSizer(perpendicularBox, wxVERTICAL); 2124 + perpendicularBoxSizer->Add(perpendicularSizer, 0, 2125 + wxALIGN_CENTER_VERTICAL | wxALL, 5); 2126 + wxBoxSizer *perp1Sizer = new wxBoxSizer(wxHORIZONTAL); 2127 + perpendicularSizer->Add(perp1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2128 + wxTextCtrl *perpendicularCtrl = 2129 + new wxTextCtrl(panel, ID_SYMBOLIZER_POLYGON1_PERPENDICULAR, wxT("0.0"), 2130 + wxDefaultPosition, wxSize(100, 22)); 2131 + perp1Sizer->Add(perpendicularCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2132 + wxStaticText *perp1Label = new wxStaticText(panel, wxID_STATIC, 2133 + wxT 2134 + ("Positive: larger. / Negative: smaller.")); 2135 + perp1Sizer->Add(perp1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2136 + wxStaticText *perp2Label = new wxStaticText(panel, wxID_STATIC, 2137 + wxT 2138 + ("Drawing polygons smaller or larger than their actual geometry (Buffer).")); 2139 + perpendicularSizer->Add(perp2Label, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2140 +// second row: Fill Opacity 2141 + wxBoxSizer *auxBoxSizer = new wxBoxSizer(wxHORIZONTAL); 2142 + boxSizer->Add(auxBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2143 + wxStaticBox *auxBox = new wxStaticBox(panel, wxID_STATIC, 2144 + wxT("Face Fill"), 2145 + wxDefaultPosition, 2146 + wxDefaultSize); 2147 + wxBoxSizer *auxSizer = new wxStaticBoxSizer(auxBox, wxHORIZONTAL); 2148 + auxBoxSizer->Add(auxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2149 + wxBoxSizer *enableSizer = new wxBoxSizer(wxHORIZONTAL); 2150 + auxSizer->Add(enableSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2151 + wxCheckBox *enableCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_FILL2_ENABLE, 2152 + wxT("Enable"), 2153 + wxDefaultPosition, wxDefaultSize); 2154 + enableCtrl->SetValue(Style->IsFaceFill()); 2155 + enableSizer->Add(enableCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2156 + wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); 2157 + enableSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2158 + wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, 2159 + wxT("Opacity"), 2160 + wxDefaultPosition, 2161 + wxDefaultSize); 2162 + wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); 2163 + opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2164 + wxSlider *opacityCtrl = 2165 + new wxSlider(panel, ID_SYMBOLIZER_FILL2_OPACITY, 100, 0, 100, 2166 + wxDefaultPosition, wxSize(400, 45), 2167 + wxSL_HORIZONTAL | wxSL_LABELS); 2168 + opacityCtrl->Enable(Style->IsFaceFill()); 2169 + opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2170 +// third row B: Fill Color 2171 + wxBoxSizer *colorBoxSizer = new wxBoxSizer(wxVERTICAL); 2172 + auxSizer->Add(colorBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2173 + wxStaticBox *colorBox = new wxStaticBox(panel, wxID_STATIC, 2174 + wxT("Fill Color"), 2175 + wxDefaultPosition, 2176 + wxDefaultSize); 2177 + wxBoxSizer *colorSizer = new wxStaticBoxSizer(colorBox, wxVERTICAL); 2178 + colorBoxSizer->Add(colorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2179 + wxBoxSizer *color1Sizer = new wxBoxSizer(wxHORIZONTAL); 2180 + colorSizer->Add(color1Sizer, 0, wxALIGN_RIGHT | wxALL, 0); 2181 + wxTextCtrl *colorCtrl = 2182 + new wxTextCtrl(panel, ID_SYMBOLIZER_FILL2_COLOR, FillColor, 2183 + wxDefaultPosition, wxSize(80, 22)); 2184 + color1Sizer->Add(colorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2185 + wxBitmap bmp; 2186 + wxColour color(0, 0, 0); 2187 + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 2188 + wxStaticBitmap *sampleCtrl = 2189 + new wxStaticBitmap(panel, ID_SYMBOLIZER_FILL2_PICKER_HEX, bmp, 2190 + wxDefaultPosition, wxSize(32, 32)); 2191 + sampleCtrl->Enable(Style->IsFaceFill()); 2192 + color1Sizer->Add(sampleCtrl, 0, wxALIGN_RIGHT | wxALL, 5); 2193 + wxBoxSizer *pickerSizer = new wxBoxSizer(wxHORIZONTAL); 2194 + colorSizer->Add(pickerSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2195 + wxButton *pick = 2196 + new wxButton(panel, ID_SYMBOLIZER_FILL2_PICKER_BTN, wxT("&Pick a color")); 2197 + pick->Enable(Style->IsFaceFill()); 2198 + pickerSizer->Add(pick, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2199 +// first row A: the Stroke #1 Opacity 2200 + wxBoxSizer *opacity2BoxSizer = new wxBoxSizer(wxHORIZONTAL); 2201 + boxSizer->Add(opacity2BoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2202 + wxStaticBox *enableBox = new wxStaticBox(panel, wxID_STATIC, 2203 + wxT("Face Stroke"), 2204 + wxDefaultPosition, 2205 + wxDefaultSize); 2206 + wxBoxSizer *enable2Sizer = new wxStaticBoxSizer(enableBox, wxHORIZONTAL); 2207 + opacity2BoxSizer->Add(enable2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2208 + wxCheckBox *enable2Ctrl = new wxCheckBox(panel, ID_SYMBOLIZER_STROKE2_ENABLE, 2209 + wxT("Enable"), 2210 + wxDefaultPosition, wxDefaultSize); 2211 + enable2Ctrl->SetValue(Style->IsFaceStroke()); 2212 + enable2Sizer->Add(enable2Ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2213 + wxStaticBox *opacity2Box = new wxStaticBox(panel, wxID_STATIC, 2214 + wxT("Opacity"), 2215 + wxDefaultPosition, 2216 + wxDefaultSize); 2217 + wxBoxSizer *opacity2Sizer = new wxStaticBoxSizer(opacity2Box, wxVERTICAL); 2218 + enable2Sizer->Add(opacity2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2219 + wxSlider *opacity2Ctrl = 2220 + new wxSlider(panel, ID_SYMBOLIZER_STROKE2_OPACITY, 100, 0, 100, 2221 + wxDefaultPosition, wxSize(250, 45), 2222 + wxSL_HORIZONTAL | wxSL_LABELS); 2223 + opacity2Ctrl->Enable(Style->IsFaceStroke()); 2224 + opacity2Sizer->Add(opacity2Ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2225 +// second row B: Stroke Color 2226 + wxStaticBox *color2Box = new wxStaticBox(panel, wxID_STATIC, 2227 + wxT("Stroke Color"), 2228 + wxDefaultPosition, 2229 + wxDefaultSize); 2230 + wxBoxSizer *color2Sizer = new wxStaticBoxSizer(color2Box, wxVERTICAL); 2231 + enable2Sizer->Add(color2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2232 + wxBoxSizer *color3Sizer = new wxBoxSizer(wxHORIZONTAL); 2233 + color2Sizer->Add(color3Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2234 + wxTextCtrl *color2Ctrl = 2235 + new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE2_COLOR, StrokeColor, 2236 + wxDefaultPosition, wxSize(80, 22)); 2237 + color2Ctrl->Enable(Style->IsFaceStroke()); 2238 + color3Sizer->Add(color2Ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2239 + wxStaticBitmap *sample2Ctrl = 2240 + new wxStaticBitmap(panel, ID_SYMBOLIZER_STROKE2_PICKER_HEX, bmp, 2241 + wxDefaultPosition, wxSize(32, 32)); 2242 + sample2Ctrl->Enable(Style->IsFaceStroke()); 2243 + color3Sizer->Add(sample2Ctrl, 0, wxALIGN_RIGHT | wxALL, 5); 2244 + wxBoxSizer *picker2Sizer = new wxBoxSizer(wxHORIZONTAL); 2245 + color2Sizer->Add(picker2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2246 + wxButton *pick2 = 2247 + new wxButton(panel, ID_SYMBOLIZER_STROKE2_PICKER_BTN, wxT("&Pick a color")); 2248 + pick2->Enable(Style->IsFaceStroke()); 2249 + picker2Sizer->Add(pick2, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2250 +// third row: Stroke-Width, 2251 + wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); 2252 + enable2Sizer->Add(miscSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2253 +// third row A: StrokeWidth 2254 + wxBoxSizer *widthBoxSizer = new wxBoxSizer(wxHORIZONTAL); 2255 + miscSizer->Add(widthBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2256 + wxStaticBox *widthBox = new wxStaticBox(panel, wxID_STATIC, 2257 + wxT("Stroke Width"), 2258 + wxDefaultPosition, 2259 + wxDefaultSize); 2260 + wxBoxSizer *widthSizer = new wxStaticBoxSizer(widthBox, wxVERTICAL); 2261 + widthBoxSizer->Add(widthSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2262 + wxTextCtrl *widthCtrl = 2263 + new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE2_WIDTH, wxT("1.0"), 2264 + wxDefaultPosition, wxSize(100, 22)); 2265 + widthCtrl->Enable(false); 2266 + widthSizer->Add(widthCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2267 + 2268 + panel->SetSizer(topSizer); 2269 + topSizer->Fit(panel); 2270 +// appends event handlers 2271 + Connect(ID_SYMBOLIZER_STROKE2_ENABLE, wxEVT_COMMAND_CHECKBOX_CLICKED, 2272 + (wxObjectEventFunction) & 2273 + QuickStyleTopologyDialog::OnCmdFaceStrokeChanged); 2274 + Connect(ID_SYMBOLIZER_FILL2_ENABLE, wxEVT_COMMAND_CHECKBOX_CLICKED, 2275 + (wxObjectEventFunction) & 2276 + QuickStyleTopologyDialog::OnCmdFaceFillChanged); 2277 + Connect(ID_SYMBOLIZER_FILL2_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 2278 + (wxObjectEventFunction) & 2279 + QuickStyleTopologyDialog::OnCmdFaceColorFillChanged); 2280 + Connect(ID_SYMBOLIZER_FILL2_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 2281 + (wxObjectEventFunction) & 2282 + QuickStyleTopologyDialog::OnCmdFaceColorFillPicker); 2283 + Connect(ID_SYMBOLIZER_STROKE2_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 2284 + (wxObjectEventFunction) & 2285 + QuickStyleTopologyDialog::OnCmdFaceColorStrokeChanged); 2286 + Connect(ID_SYMBOLIZER_STROKE2_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 2287 + (wxObjectEventFunction) & 2288 + QuickStyleTopologyDialog::OnCmdFaceColorStrokePicker); 2289 + return panel; 2290 +} 2291 + 2292 +void QuickStyleTopologyDialog:: 2293 +OnCmdFaceStrokeChanged(wxCommandEvent & WXUNUSED(event)) 2294 +{ 2295 +// 2296 +// Stroke enable/disable 2297 +// 2298 + wxCheckBox *enableCtrl = 2299 + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_STROKE2_ENABLE); 2300 + if (enableCtrl->IsChecked() == true) 2301 + Style->SetFaceStroke(true); 2302 + else 2303 + Style->SetFaceStroke(false); 2304 + RetrieveFacePage(false); 2305 + UpdateFacePage(); 2306 +} 2307 + 2308 +void QuickStyleTopologyDialog:: 2309 +OnCmdFaceFillChanged(wxCommandEvent & WXUNUSED(event)) 2310 +{ 2311 +// 2312 +// Fill enable/disable 2313 +// 2314 + wxCheckBox *enableCtrl = 2315 + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_FILL2_ENABLE); 2316 + if (enableCtrl->IsChecked() == true) 2317 + Style->SetFaceFill(true); 2318 + else 2319 + Style->SetFaceFill(false); 2320 + RetrieveFacePage(false); 2321 + UpdateFacePage(); 2322 +} 2323 + 2324 +void QuickStyleTopologyDialog:: 2325 +OnCmdFaceColorFillChanged(wxCommandEvent & WXUNUSED(event)) 2326 +{ 2327 +// 2328 +// Fill color changed: updating the visual sample 2329 +// 2330 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); 2331 + wxStaticBitmap *sampleCtrl = 2332 + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FILL2_PICKER_HEX); 2333 + wxColour back = wxColour(255, 255, 255); 2334 + wxString str = colorCtrl->GetValue(); 2335 + if (ColorMapEntry::IsValidColor(str) == true) 2336 + ColorMapEntry::GetWxColor(str, back); 2337 + wxBitmap bmp; 2338 + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 2339 + sampleCtrl->SetBitmap(bmp); 2340 + sampleCtrl->Refresh(); 2341 + sampleCtrl->Update(); 2342 +} 2343 + 2344 +void QuickStyleTopologyDialog:: 2345 +OnCmdFaceColorFillPicker(wxCommandEvent & WXUNUSED(event)) 2346 +{ 2347 +// 2348 +// color picker 2349 +// 2350 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); 2351 + wxColour clr = wxNullColour; 2352 + wxString str = colorCtrl->GetValue(); 2353 + if (ColorMapEntry::IsValidColor(str) == true) 2354 + ColorMapEntry::GetWxColor(str, clr); 2355 + wxColour color = wxGetColourFromUser(this, clr); 2356 + if (color.IsOk() == true) 2357 + { 2358 + char hex[16]; 2359 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 2360 + wxString str = wxString::FromUTF8(hex); 2361 + colorCtrl->SetValue(str); 2362 + } 2363 +} 2364 + 2365 +void QuickStyleTopologyDialog:: 2366 +OnCmdFaceColorStrokeChanged(wxCommandEvent & WXUNUSED(event)) 2367 +{ 2368 +// 2369 +// Stroke color changed: updating the visual sample 2370 +// 2371 + wxTextCtrl *colorCtrl = 2372 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); 2373 + wxStaticBitmap *sampleCtrl = 2374 + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_STROKE2_PICKER_HEX); 2375 + wxColour back = wxColour(255, 255, 255); 2376 + wxString str = colorCtrl->GetValue(); 2377 + if (ColorMapEntry::IsValidColor(str) == true) 2378 + ColorMapEntry::GetWxColor(str, back); 2379 + wxBitmap bmp; 2380 + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 2381 + sampleCtrl->SetBitmap(bmp); 2382 + sampleCtrl->Refresh(); 2383 + sampleCtrl->Update(); 2384 +} 2385 + 2386 +void QuickStyleTopologyDialog:: 2387 +OnCmdFaceColorStrokePicker(wxCommandEvent & WXUNUSED(event)) 2388 +{ 2389 +// 2390 +// color picker 2391 +// 2392 + wxTextCtrl *colorCtrl = 2393 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); 2394 + wxColour clr = wxNullColour; 2395 + wxString str = colorCtrl->GetValue(); 2396 + if (ColorMapEntry::IsValidColor(str) == true) 2397 + ColorMapEntry::GetWxColor(str, clr); 2398 + wxColour color = wxGetColourFromUser(this, clr); 2399 + if (color.IsOk() == true) 2400 + { 2401 + char hex[16]; 2402 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 2403 + wxString str = wxString::FromUTF8(hex); 2404 + colorCtrl->SetValue(str); 2405 + } 2406 +} 2407 + 2408 +wxPanel *QuickStyleTopologyDialog::CreateEdgeLinkSeedPage(wxWindow * parent) 2409 +{ 2410 +// 2411 +// creating the EdgeLinkSeed Symbolizer page 2412 +// 2413 + wxString StrokeColor = wxT("#000000"); 2414 + wxString FillColor = wxT("#808080"); 2415 + wxPanel *panel = new wxPanel(parent, ID_PANE_POINT); 2416 + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 2417 + panel->SetSizer(topSizer); 2418 + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 2419 + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 2420 +// first row A: Opacity 2421 + wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); 2422 + boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2423 + wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, 2424 + wxT("Opacity"), 2425 + wxDefaultPosition, 2426 + wxDefaultSize); 2427 + wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); 2428 + opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2429 + wxSlider *opacityCtrl = 2430 + new wxSlider(panel, ID_SYMBOLIZER_EDGELINK_SEED_OPACITY, 100, 0, 100, 2431 + wxDefaultPosition, wxSize(600, 45), 2432 + wxSL_HORIZONTAL | wxSL_LABELS); 2433 + opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2434 +// Well Known Mark Name 2435 + wxBoxSizer *box1Sizer = new wxBoxSizer(wxHORIZONTAL); 2436 + boxSizer->Add(box1Sizer, 0, wxALIGN_CENTER | wxALL, 5); 2437 + wxBoxSizer *markSizer = new wxBoxSizer(wxHORIZONTAL); 2438 + box1Sizer->Add(markSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2439 + wxString mark[6]; 2440 + mark[0] = wxT("&Square"); 2441 + mark[1] = wxT("&Circle"); 2442 + mark[2] = wxT("&Triangle"); 2443 + mark[3] = wxT("&Star"); 2444 + mark[4] = wxT("&Cross"); 2445 + mark[5] = wxT("&X"); 2446 + wxRadioBox *markBox = new wxRadioBox(panel, ID_SYMBOLIZER_EDGELINK_SEED_MARK, 2447 + wxT("&Mark"), 2448 + wxDefaultPosition, 2449 + wxDefaultSize, 6, 2450 + mark, 1, 2451 + wxRA_SPECIFY_COLS); 2452 + markSizer->Add(markBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2453 + markBox->SetSelection(0); 2454 +// second row: Size and Rotation 2455 + wxBoxSizer *box2Sizer = new wxBoxSizer(wxVERTICAL); 2456 + box1Sizer->Add(box2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2457 + wxBoxSizer *sizeBoxSizer = new wxBoxSizer(wxHORIZONTAL); 2458 + box2Sizer->Add(sizeBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2459 +// second row A: Size 2460 + wxStaticBox *sizeBox = new wxStaticBox(panel, wxID_STATIC, 2461 + wxT("Size"), 2462 + wxDefaultPosition, 2463 + wxDefaultSize); 2464 + wxBoxSizer *sizeSizer = new wxStaticBoxSizer(sizeBox, wxVERTICAL); 2465 + sizeBoxSizer->Add(sizeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 2466 + wxBoxSizer *size1Sizer = new wxBoxSizer(wxHORIZONTAL); 2467 + sizeSizer->Add(size1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2468 + wxTextCtrl *sizeCtrl = 2469 + new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_SIZE, wxT("16.0"), 2470 + wxDefaultPosition, wxSize(100, 22)); 2471 + size1Sizer->Add(sizeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2472 +// second row B: Rotation 2473 + wxStaticBox *rotBox = new wxStaticBox(panel, wxID_STATIC, 2474 + wxT("Rotation"), 2475 + wxDefaultPosition, 2476 + wxDefaultSize); 2477 + wxBoxSizer *rotSizer = new wxStaticBoxSizer(rotBox, wxVERTICAL); 2478 + sizeBoxSizer->Add(rotSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 2479 + wxBoxSizer *rot1Sizer = new wxBoxSizer(wxHORIZONTAL); 2480 + rotSizer->Add(rot1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2481 + wxTextCtrl *rotCtrl = 2482 + new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_ROTATION, wxT("0.0"), 2483 + wxDefaultPosition, wxSize(100, 22)); 2484 + rot1Sizer->Add(rotCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2485 +// third row: AnchorEdgeLinkSeed and Displacement 2486 + wxBoxSizer *anchorBoxSizer = new wxBoxSizer(wxHORIZONTAL); 2487 + box2Sizer->Add(anchorBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2488 +// third row A: Anchor EdgeLinkSeed 2489 + wxStaticBox *anchorBox = new wxStaticBox(panel, wxID_STATIC, 2490 + wxT("Anchor EdgeLinkSeed"), 2491 + wxDefaultPosition, 2492 + wxDefaultSize); 2493 + wxBoxSizer *anchorSizer = new wxStaticBoxSizer(anchorBox, wxVERTICAL); 2494 + anchorBoxSizer->Add(anchorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 2495 + wxBoxSizer *anchor1Sizer = new wxBoxSizer(wxHORIZONTAL); 2496 + anchorSizer->Add(anchor1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2497 + wxStaticText *anchor1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); 2498 + anchor1Sizer->Add(anchor1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2499 + wxTextCtrl *anchorXCtrl = 2500 + new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_ANCHOR_X, wxT("0.5"), 2501 + wxDefaultPosition, wxSize(100, 22)); 2502 + anchor1Sizer->Add(anchorXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2503 + wxBoxSizer *anchor2Sizer = new wxBoxSizer(wxHORIZONTAL); 2504 + anchorSizer->Add(anchor2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2505 + wxStaticText *anchor2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); 2506 + anchor2Sizer->Add(anchor2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2507 + wxTextCtrl *anchorYCtrl = 2508 + new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_ANCHOR_Y, wxT("0.5"), 2509 + wxDefaultPosition, wxSize(100, 22)); 2510 + anchor2Sizer->Add(anchorYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2511 +// third row B: Displacement 2512 + wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, 2513 + wxT("Displacement"), 2514 + wxDefaultPosition, 2515 + wxDefaultSize); 2516 + wxBoxSizer *displacementSizer = 2517 + new wxStaticBoxSizer(displacementBox, wxVERTICAL); 2518 + anchorBoxSizer->Add(displacementSizer, 0, 2519 + wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 2520 + wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); 2521 + displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2522 + wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); 2523 + displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2524 + wxTextCtrl *displacementXCtrl = 2525 + new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_DISPLACEMENT_X, 2526 + wxT("0.0"), 2527 + wxDefaultPosition, wxSize(100, 22)); 2528 + displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2529 + wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); 2530 + displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2531 + wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); 2532 + displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2533 + wxTextCtrl *displacementYCtrl = 2534 + new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_DISPLACEMENT_Y, 2535 + wxT("0.0"), 2536 + wxDefaultPosition, wxSize(100, 22)); 2537 + displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2538 +// fourth row: colors 2539 + wxBoxSizer *box3Sizer = new wxBoxSizer(wxHORIZONTAL); 2540 + boxSizer->Add(box3Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2541 +// first row A: Fill Color 2542 + wxBoxSizer *fillBoxSizer = new wxBoxSizer(wxVERTICAL); 2543 + box3Sizer->Add(fillBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2544 + wxStaticBox *colorFillBox = new wxStaticBox(panel, wxID_STATIC, 2545 + wxT("Fill Color"), 2546 + wxDefaultPosition, 2547 + wxDefaultSize); 2548 + wxBoxSizer *colorFillSizer = new wxStaticBoxSizer(colorFillBox, wxVERTICAL); 2549 + box3Sizer->Add(colorFillSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2550 + wxBoxSizer *fill1Sizer = new wxBoxSizer(wxHORIZONTAL); 2551 + colorFillSizer->Add(fill1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2552 + wxTextCtrl *fillColorCtrl = 2553 + new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_FILL_COLOR, FillColor, 2554 + wxDefaultPosition, wxSize(80, 22)); 2555 + fill1Sizer->Add(fillColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2556 + wxBitmap bmp; 2557 + wxColour color(0, 0, 0); 2558 + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 2559 + wxStaticBitmap *sampleFillCtrl = 2560 + new wxStaticBitmap(panel, ID_SYMBOLIZER_EDGELINK_SEED_FILL_PICKER_HEX, bmp, 2561 + wxDefaultPosition, wxSize(32, 32)); 2562 + fill1Sizer->Add(sampleFillCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2563 + wxButton *pickFill = 2564 + new wxButton(panel, ID_SYMBOLIZER_EDGELINK_SEED_FILL_PICKER_BTN, 2565 + wxT("&Pick a color")); 2566 + fill1Sizer->Add(pickFill, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2567 +// second row B: Stroke Color 2568 + box3Sizer->AddSpacer(30); 2569 + wxStaticBox *colorStrokeBox = new wxStaticBox(panel, wxID_STATIC, 2570 + wxT("Stroke Color"), 2571 + wxDefaultPosition, 2572 + wxDefaultSize); 2573 + wxBoxSizer *colorStrokeSizer = 2574 + new wxStaticBoxSizer(colorStrokeBox, wxVERTICAL); 2575 + box3Sizer->Add(colorStrokeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2576 + wxBoxSizer *stroke1Sizer = new wxBoxSizer(wxHORIZONTAL); 2577 + colorStrokeSizer->Add(stroke1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2578 + wxTextCtrl *strokeColorCtrl = 2579 + new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_STROKE_COLOR, StrokeColor, 2580 + wxDefaultPosition, wxSize(80, 22)); 2581 + stroke1Sizer->Add(strokeColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2582 + wxStaticBitmap *sampleStrokeCtrl = 2583 + new wxStaticBitmap(panel, ID_SYMBOLIZER_EDGELINK_SEED_STROKE_PICKER_HEX, 2584 + bmp, 2585 + wxDefaultPosition, wxSize(32, 32)); 2586 + stroke1Sizer->Add(sampleStrokeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2587 + wxButton *pickStroke = 2588 + new wxButton(panel, ID_SYMBOLIZER_EDGELINK_SEED_STROKE_PICKER_BTN, 2589 + wxT("&Pick a color")); 2590 + stroke1Sizer->Add(pickStroke, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2591 + panel->SetSizer(topSizer); 2592 + topSizer->Fit(panel); 2593 +// appends event handlers 2594 + Connect(ID_SYMBOLIZER_EDGELINK_SEED_MARK, wxEVT_COMMAND_RADIOBOX_SELECTED, 2595 + (wxObjectEventFunction) & 2596 + QuickStyleTopologyDialog::OnCmdEdgeLinkSeedMarkChanged); 2597 + Connect(ID_SYMBOLIZER_EDGELINK_SEED_FILL_PICKER_BTN, 2598 + wxEVT_COMMAND_BUTTON_CLICKED, 2599 + (wxObjectEventFunction) & 2600 + QuickStyleTopologyDialog::OnCmdEdgeLinkSeedColorFillPicker); 2601 + Connect(ID_SYMBOLIZER_EDGELINK_SEED_FILL_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 2602 + (wxObjectEventFunction) & 2603 + QuickStyleTopologyDialog::OnCmdEdgeLinkSeedColorFillChanged); 2604 + Connect(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_PICKER_BTN, 2605 + wxEVT_COMMAND_BUTTON_CLICKED, 2606 + (wxObjectEventFunction) & 2607 + QuickStyleTopologyDialog::OnCmdEdgeLinkSeedColorStrokePicker); 2608 + Connect(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 2609 + (wxObjectEventFunction) & 2610 + QuickStyleTopologyDialog::OnCmdEdgeLinkSeedColorStrokeChanged); 2611 + return panel; 2612 +} 2613 + 2614 +void QuickStyleTopologyDialog:: 2615 +OnCmdEdgeLinkSeedMarkChanged(wxCommandEvent & WXUNUSED(event)) 2616 +{ 2617 +// 2618 +// Mark selection changed 2619 +// 2620 + wxRadioBox *markCtrl = 2621 + (wxRadioBox *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_MARK); 2622 + switch (markCtrl->GetSelection()) 2623 + { 2624 + case 1: 2625 + Style->SetEdgeLinkSeedWellKnownMark(RL2_GRAPHIC_MARK_CIRCLE); 2626 + break; 2627 + case 2: 2628 + Style->SetEdgeLinkSeedWellKnownMark(RL2_GRAPHIC_MARK_TRIANGLE); 2629 + break; 2630 + case 3: 2631 + Style->SetEdgeLinkSeedWellKnownMark(RL2_GRAPHIC_MARK_STAR); 2632 + break; 2633 + case 4: 2634 + Style->SetEdgeLinkSeedWellKnownMark(RL2_GRAPHIC_MARK_CROSS); 2635 + break; 2636 + case 5: 2637 + Style->SetEdgeLinkSeedWellKnownMark(RL2_GRAPHIC_MARK_X); 2638 + break; 2639 + default: 2640 + Style->SetEdgeLinkSeedWellKnownMark(RL2_GRAPHIC_MARK_SQUARE); 2641 + break; 2642 + }; 2643 +} 2644 + 2645 +void QuickStyleTopologyDialog:: 2646 +OnCmdEdgeLinkSeedColorFillChanged(wxCommandEvent & WXUNUSED(event)) 2647 +{ 2648 +// 2649 +// Fill color changed: updating the visual sample 2650 +// 2651 + wxTextCtrl *colorCtrl = 2652 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_FILL_COLOR); 2653 + wxStaticBitmap *sampleCtrl = 2654 + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_FILL_PICKER_HEX); 2655 + wxColour back = wxColour(255, 255, 255); 2656 + wxString str = colorCtrl->GetValue(); 2657 + if (ColorMapEntry::IsValidColor(str) == true) 2658 + ColorMapEntry::GetWxColor(str, back); 2659 + wxBitmap bmp; 2660 + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 2661 + sampleCtrl->SetBitmap(bmp); 2662 + sampleCtrl->Refresh(); 2663 + sampleCtrl->Update(); 2664 +} 2665 + 2666 +void QuickStyleTopologyDialog:: 2667 +OnCmdEdgeLinkSeedColorFillPicker(wxCommandEvent & WXUNUSED(event)) 2668 +{ 2669 +// 2670 +// color picker 2671 +// 2672 + wxTextCtrl *colorCtrl = 2673 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_FILL_COLOR); 2674 + wxColour clr = wxNullColour; 2675 + wxString str = colorCtrl->GetValue(); 2676 + if (ColorMapEntry::IsValidColor(str) == true) 2677 + ColorMapEntry::GetWxColor(str, clr); 2678 + wxColour color = wxGetColourFromUser(this, clr); 2679 + if (color.IsOk() == true) 2680 + { 2681 + char hex[16]; 2682 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 2683 + wxString str = wxString::FromUTF8(hex); 2684 + colorCtrl->SetValue(str); 2685 + } 2686 +} 2687 + 2688 +void QuickStyleTopologyDialog:: 2689 +OnCmdEdgeLinkSeedColorStrokeChanged(wxCommandEvent & WXUNUSED(event)) 2690 +{ 2691 +// 2692 +// Stroke color changed: updating the visual sample 2693 +// 2694 + wxTextCtrl *colorCtrl = 2695 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_COLOR); 2696 + wxStaticBitmap *sampleCtrl = 2697 + (wxStaticBitmap *) 2698 + FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_PICKER_HEX); 2699 + wxColour back = wxColour(255, 255, 255); 2700 + wxString str = colorCtrl->GetValue(); 2701 + if (ColorMapEntry::IsValidColor(str) == true) 2702 + ColorMapEntry::GetWxColor(str, back); 2703 + wxBitmap bmp; 2704 + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 2705 + sampleCtrl->SetBitmap(bmp); 2706 + sampleCtrl->Refresh(); 2707 + sampleCtrl->Update(); 2708 +} 2709 + 2710 +void QuickStyleTopologyDialog:: 2711 +OnCmdEdgeLinkSeedColorStrokePicker(wxCommandEvent & WXUNUSED(event)) 2712 +{ 2713 +// 2714 +// color picker 2715 +// 2716 + wxTextCtrl *colorCtrl = 2717 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_COLOR); 2718 + wxColour clr = wxNullColour; 2719 + wxString str = colorCtrl->GetValue(); 2720 + if (ColorMapEntry::IsValidColor(str) == true) 2721 + ColorMapEntry::GetWxColor(str, clr); 2722 + wxColour color = wxGetColourFromUser(this, clr); 2723 + if (color.IsOk() == true) 2724 + { 2725 + char hex[16]; 2726 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 2727 + wxString str = wxString::FromUTF8(hex); 2728 + colorCtrl->SetValue(str); 2729 + } 2730 +} 2731 + 2732 +wxPanel *QuickStyleTopologyDialog::CreateFaceSeedPage(wxWindow * parent) 2733 +{ 2734 +// 2735 +// creating the FaceSeed Symbolizer page 2736 +// 2737 + wxString StrokeColor = wxT("#000000"); 2738 + wxString FillColor = wxT("#808080"); 2739 + wxPanel *panel = new wxPanel(parent, ID_PANE_POINT); 2740 + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 2741 + panel->SetSizer(topSizer); 2742 + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 2743 + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 2744 +// first row A: Opacity 2745 + wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); 2746 + boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2747 + wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, 2748 + wxT("Opacity"), 2749 + wxDefaultPosition, 2750 + wxDefaultSize); 2751 + wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); 2752 + opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2753 + wxSlider *opacityCtrl = 2754 + new wxSlider(panel, ID_SYMBOLIZER_FACE_SEED_OPACITY, 100, 0, 100, 2755 + wxDefaultPosition, wxSize(600, 45), 2756 + wxSL_HORIZONTAL | wxSL_LABELS); 2757 + opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2758 +// Well Known Mark Name 2759 + wxBoxSizer *box1Sizer = new wxBoxSizer(wxHORIZONTAL); 2760 + boxSizer->Add(box1Sizer, 0, wxALIGN_CENTER | wxALL, 5); 2761 + wxBoxSizer *markSizer = new wxBoxSizer(wxHORIZONTAL); 2762 + box1Sizer->Add(markSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2763 + wxString mark[6]; 2764 + mark[0] = wxT("&Square"); 2765 + mark[1] = wxT("&Circle"); 2766 + mark[2] = wxT("&Triangle"); 2767 + mark[3] = wxT("&Star"); 2768 + mark[4] = wxT("&Cross"); 2769 + mark[5] = wxT("&X"); 2770 + wxRadioBox *markBox = new wxRadioBox(panel, ID_SYMBOLIZER_FACE_SEED_MARK, 2771 + wxT("&Mark"), 2772 + wxDefaultPosition, 2773 + wxDefaultSize, 6, 2774 + mark, 1, 2775 + wxRA_SPECIFY_COLS); 2776 + markSizer->Add(markBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2777 + markBox->SetSelection(0); 2778 +// second row: Size and Rotation 2779 + wxBoxSizer *box2Sizer = new wxBoxSizer(wxVERTICAL); 2780 + box1Sizer->Add(box2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2781 + wxBoxSizer *sizeBoxSizer = new wxBoxSizer(wxHORIZONTAL); 2782 + box2Sizer->Add(sizeBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2783 +// second row A: Size 2784 + wxStaticBox *sizeBox = new wxStaticBox(panel, wxID_STATIC, 2785 + wxT("Size"), 2786 + wxDefaultPosition, 2787 + wxDefaultSize); 2788 + wxBoxSizer *sizeSizer = new wxStaticBoxSizer(sizeBox, wxVERTICAL); 2789 + sizeBoxSizer->Add(sizeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 2790 + wxBoxSizer *size1Sizer = new wxBoxSizer(wxHORIZONTAL); 2791 + sizeSizer->Add(size1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2792 + wxTextCtrl *sizeCtrl = 2793 + new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_SIZE, wxT("16.0"), 2794 + wxDefaultPosition, wxSize(100, 22)); 2795 + size1Sizer->Add(sizeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2796 +// second row B: Rotation 2797 + wxStaticBox *rotBox = new wxStaticBox(panel, wxID_STATIC, 2798 + wxT("Rotation"), 2799 + wxDefaultPosition, 2800 + wxDefaultSize); 2801 + wxBoxSizer *rotSizer = new wxStaticBoxSizer(rotBox, wxVERTICAL); 2802 + sizeBoxSizer->Add(rotSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 2803 + wxBoxSizer *rot1Sizer = new wxBoxSizer(wxHORIZONTAL); 2804 + rotSizer->Add(rot1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2805 + wxTextCtrl *rotCtrl = 2806 + new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_ROTATION, wxT("0.0"), 2807 + wxDefaultPosition, wxSize(100, 22)); 2808 + rot1Sizer->Add(rotCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2809 +// third row: AnchorFaceSeed and Displacement 2810 + wxBoxSizer *anchorBoxSizer = new wxBoxSizer(wxHORIZONTAL); 2811 + box2Sizer->Add(anchorBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2812 +// third row A: Anchor FaceSeed 2813 + wxStaticBox *anchorBox = new wxStaticBox(panel, wxID_STATIC, 2814 + wxT("Anchor FaceSeed"), 2815 + wxDefaultPosition, 2816 + wxDefaultSize); 2817 + wxBoxSizer *anchorSizer = new wxStaticBoxSizer(anchorBox, wxVERTICAL); 2818 + anchorBoxSizer->Add(anchorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 2819 + wxBoxSizer *anchor1Sizer = new wxBoxSizer(wxHORIZONTAL); 2820 + anchorSizer->Add(anchor1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2821 + wxStaticText *anchor1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); 2822 + anchor1Sizer->Add(anchor1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2823 + wxTextCtrl *anchorXCtrl = 2824 + new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_ANCHOR_X, wxT("0.5"), 2825 + wxDefaultPosition, wxSize(100, 22)); 2826 + anchor1Sizer->Add(anchorXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2827 + wxBoxSizer *anchor2Sizer = new wxBoxSizer(wxHORIZONTAL); 2828 + anchorSizer->Add(anchor2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2829 + wxStaticText *anchor2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); 2830 + anchor2Sizer->Add(anchor2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2831 + wxTextCtrl *anchorYCtrl = 2832 + new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_ANCHOR_Y, wxT("0.5"), 2833 + wxDefaultPosition, wxSize(100, 22)); 2834 + anchor2Sizer->Add(anchorYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2835 +// third row B: Displacement 2836 + wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, 2837 + wxT("Displacement"), 2838 + wxDefaultPosition, 2839 + wxDefaultSize); 2840 + wxBoxSizer *displacementSizer = 2841 + new wxStaticBoxSizer(displacementBox, wxVERTICAL); 2842 + anchorBoxSizer->Add(displacementSizer, 0, 2843 + wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 2844 + wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); 2845 + displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2846 + wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); 2847 + displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2848 + wxTextCtrl *displacementXCtrl = 2849 + new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_DISPLACEMENT_X, wxT("0.0"), 2850 + wxDefaultPosition, wxSize(100, 22)); 2851 + displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2852 + wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); 2853 + displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2854 + wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); 2855 + displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2856 + wxTextCtrl *displacementYCtrl = 2857 + new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_DISPLACEMENT_Y, wxT("0.0"), 2858 + wxDefaultPosition, wxSize(100, 22)); 2859 + displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2860 +// fourth row: colors 2861 + wxBoxSizer *box3Sizer = new wxBoxSizer(wxHORIZONTAL); 2862 + boxSizer->Add(box3Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2863 +// first row A: Fill Color 2864 + wxBoxSizer *fillBoxSizer = new wxBoxSizer(wxVERTICAL); 2865 + box3Sizer->Add(fillBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2866 + wxStaticBox *colorFillBox = new wxStaticBox(panel, wxID_STATIC, 2867 + wxT("Fill Color"), 2868 + wxDefaultPosition, 2869 + wxDefaultSize); 2870 + wxBoxSizer *colorFillSizer = new wxStaticBoxSizer(colorFillBox, wxVERTICAL); 2871 + box3Sizer->Add(colorFillSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2872 + wxBoxSizer *fill1Sizer = new wxBoxSizer(wxHORIZONTAL); 2873 + colorFillSizer->Add(fill1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2874 + wxTextCtrl *fillColorCtrl = 2875 + new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_FILL_COLOR, FillColor, 2876 + wxDefaultPosition, wxSize(80, 22)); 2877 + fill1Sizer->Add(fillColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2878 + wxBitmap bmp; 2879 + wxColour color(0, 0, 0); 2880 + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 2881 + wxStaticBitmap *sampleFillCtrl = 2882 + new wxStaticBitmap(panel, ID_SYMBOLIZER_FACE_SEED_FILL_PICKER_HEX, bmp, 2883 + wxDefaultPosition, wxSize(32, 32)); 2884 + fill1Sizer->Add(sampleFillCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2885 + wxButton *pickFill = 2886 + new wxButton(panel, ID_SYMBOLIZER_FACE_SEED_FILL_PICKER_BTN, 2887 + wxT("&Pick a color")); 2888 + fill1Sizer->Add(pickFill, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2889 +// second row B: Stroke Color 2890 + box3Sizer->AddSpacer(30); 2891 + wxStaticBox *colorStrokeBox = new wxStaticBox(panel, wxID_STATIC, 2892 + wxT("Stroke Color"), 2893 + wxDefaultPosition, 2894 + wxDefaultSize); 2895 + wxBoxSizer *colorStrokeSizer = 2896 + new wxStaticBoxSizer(colorStrokeBox, wxVERTICAL); 2897 + box3Sizer->Add(colorStrokeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2898 + wxBoxSizer *stroke1Sizer = new wxBoxSizer(wxHORIZONTAL); 2899 + colorStrokeSizer->Add(stroke1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2900 + wxTextCtrl *strokeColorCtrl = 2901 + new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR, StrokeColor, 2902 + wxDefaultPosition, wxSize(80, 22)); 2903 + stroke1Sizer->Add(strokeColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2904 + wxStaticBitmap *sampleStrokeCtrl = 2905 + new wxStaticBitmap(panel, ID_SYMBOLIZER_FACE_SEED_STROKE_PICKER_HEX, bmp, 2906 + wxDefaultPosition, wxSize(32, 32)); 2907 + stroke1Sizer->Add(sampleStrokeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2908 + wxButton *pickStroke = 2909 + new wxButton(panel, ID_SYMBOLIZER_FACE_SEED_STROKE_PICKER_BTN, 2910 + wxT("&Pick a color")); 2911 + stroke1Sizer->Add(pickStroke, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2912 + panel->SetSizer(topSizer); 2913 + topSizer->Fit(panel); 2914 +// appends event handlers 2915 + Connect(ID_SYMBOLIZER_FACE_SEED_MARK, wxEVT_COMMAND_RADIOBOX_SELECTED, 2916 + (wxObjectEventFunction) & 2917 + QuickStyleTopologyDialog::OnCmdFaceSeedMarkChanged); 2918 + Connect(ID_SYMBOLIZER_FACE_SEED_FILL_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 2919 + (wxObjectEventFunction) & 2920 + QuickStyleTopologyDialog::OnCmdFaceSeedColorFillPicker); 2921 + Connect(ID_SYMBOLIZER_FACE_SEED_FILL_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 2922 + (wxObjectEventFunction) & 2923 + QuickStyleTopologyDialog::OnCmdFaceSeedColorFillChanged); 2924 + Connect(ID_SYMBOLIZER_FACE_SEED_STROKE_PICKER_BTN, 2925 + wxEVT_COMMAND_BUTTON_CLICKED, 2926 + (wxObjectEventFunction) & 2927 + QuickStyleTopologyDialog::OnCmdFaceSeedColorStrokePicker); 2928 + Connect(ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 2929 + (wxObjectEventFunction) & 2930 + QuickStyleTopologyDialog::OnCmdFaceSeedColorStrokeChanged); 2931 + return panel; 2932 +} 2933 + 2934 +void QuickStyleTopologyDialog:: 2935 +OnCmdFaceSeedMarkChanged(wxCommandEvent & WXUNUSED(event)) 2936 +{ 2937 +// 2938 +// Mark selection changed 2939 +// 2940 + wxRadioBox *markCtrl = 2941 + (wxRadioBox *) FindWindow(ID_SYMBOLIZER_FACE_SEED_MARK); 2942 + switch (markCtrl->GetSelection()) 2943 + { 2944 + case 1: 2945 + Style->SetFaceSeedWellKnownMark(RL2_GRAPHIC_MARK_CIRCLE); 2946 + break; 2947 + case 2: 2948 + Style->SetFaceSeedWellKnownMark(RL2_GRAPHIC_MARK_TRIANGLE); 2949 + break; 2950 + case 3: 2951 + Style->SetFaceSeedWellKnownMark(RL2_GRAPHIC_MARK_STAR); 2952 + break; 2953 + case 4: 2954 + Style->SetFaceSeedWellKnownMark(RL2_GRAPHIC_MARK_CROSS); 2955 + break; 2956 + case 5: 2957 + Style->SetFaceSeedWellKnownMark(RL2_GRAPHIC_MARK_X); 2958 + break; 2959 + default: 2960 + Style->SetFaceSeedWellKnownMark(RL2_GRAPHIC_MARK_SQUARE); 2961 + break; 2962 + }; 2963 +} 2964 + 2965 +void QuickStyleTopologyDialog:: 2966 +OnCmdFaceSeedColorFillChanged(wxCommandEvent & WXUNUSED(event)) 2967 +{ 2968 +// 2969 +// Fill color changed: updating the visual sample 2970 +// 2971 + wxTextCtrl *colorCtrl = 2972 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_FILL_COLOR); 2973 + wxStaticBitmap *sampleCtrl = 2974 + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FACE_SEED_FILL_PICKER_HEX); 2975 + wxColour back = wxColour(255, 255, 255); 2976 + wxString str = colorCtrl->GetValue(); 2977 + if (ColorMapEntry::IsValidColor(str) == true) 2978 + ColorMapEntry::GetWxColor(str, back); 2979 + wxBitmap bmp; 2980 + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 2981 + sampleCtrl->SetBitmap(bmp); 2982 + sampleCtrl->Refresh(); 2983 + sampleCtrl->Update(); 2984 +} 2985 + 2986 +void QuickStyleTopologyDialog:: 2987 +OnCmdFaceSeedColorFillPicker(wxCommandEvent & WXUNUSED(event)) 2988 +{ 2989 +// 2990 +// color picker 2991 +// 2992 + wxTextCtrl *colorCtrl = 2993 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_FILL_COLOR); 2994 + wxColour clr = wxNullColour; 2995 + wxString str = colorCtrl->GetValue(); 2996 + if (ColorMapEntry::IsValidColor(str) == true) 2997 + ColorMapEntry::GetWxColor(str, clr); 2998 + wxColour color = wxGetColourFromUser(this, clr); 2999 + if (color.IsOk() == true) 3000 + { 3001 + char hex[16]; 3002 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 3003 + wxString str = wxString::FromUTF8(hex); 3004 + colorCtrl->SetValue(str); 3005 + } 3006 +} 3007 + 3008 +void QuickStyleTopologyDialog:: 3009 +OnCmdFaceSeedColorStrokeChanged(wxCommandEvent & WXUNUSED(event)) 3010 +{ 3011 +// 3012 +// Stroke color changed: updating the visual sample 3013 +// 3014 + wxTextCtrl *colorCtrl = 3015 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR); 3016 + wxStaticBitmap *sampleCtrl = 3017 + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FACE_SEED_STROKE_PICKER_HEX); 3018 + wxColour back = wxColour(255, 255, 255); 3019 + wxString str = colorCtrl->GetValue(); 3020 + if (ColorMapEntry::IsValidColor(str) == true) 3021 + ColorMapEntry::GetWxColor(str, back); 3022 + wxBitmap bmp; 3023 + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 3024 + sampleCtrl->SetBitmap(bmp); 3025 + sampleCtrl->Refresh(); 3026 + sampleCtrl->Update(); 3027 +} 3028 + 3029 +void QuickStyleTopologyDialog:: 3030 +OnCmdFaceSeedColorStrokePicker(wxCommandEvent & WXUNUSED(event)) 3031 +{ 3032 +// 3033 +// color picker 3034 +// 3035 + wxTextCtrl *colorCtrl = 3036 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR); 3037 + wxColour clr = wxNullColour; 3038 + wxString str = colorCtrl->GetValue(); 3039 + if (ColorMapEntry::IsValidColor(str) == true) 3040 + ColorMapEntry::GetWxColor(str, clr); 3041 + wxColour color = wxGetColourFromUser(this, clr); 3042 + if (color.IsOk() == true) 3043 + { 3044 + char hex[16]; 3045 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 3046 + wxString str = wxString::FromUTF8(hex); 3047 + colorCtrl->SetValue(str); 3048 + } 3049 +} 3050 + 3051 + 3052 + 3053 + 3054 + 3055 +bool QuickStyleTopologyDialog::RetrieveMainPage() 3056 +{ 3057 +// 3058 +// retrieving params from the MAIN page 3059 +// 3060 + double min = Style->GetScaleMin(); 3061 + double max = Style->GetScaleMax(); 3062 + if (Style->IsMinScaleEnabled() == true) 3063 + { 3064 + wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); 3065 + wxString value = minCtrl->GetValue(); 3066 + if (value.ToDouble(&min) != true) 3067 + { 3068 + wxMessageBox(wxT 3069 + ("MIN_SCALE isn't a valid decimal number !!!"), 3070 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3071 + return false; 3072 + } 3073 + if (min < 0.0) 3074 + { 3075 + wxMessageBox(wxT 3076 + ("MIN_SCALE must be a positive number !!!"), 3077 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3078 + return false; 3079 + } 3080 + } 3081 + if (Style->IsMaxScaleEnabled() == true) 3082 + { 3083 + wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); 3084 + wxString value = maxCtrl->GetValue(); 3085 + if (value.ToDouble(&max) != true) 3086 + { 3087 + wxMessageBox(wxT 3088 + ("MAX_SCALE isn't a valid decimal number !!!"), 3089 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3090 + return false; 3091 + } 3092 + if (max < 0.0) 3093 + { 3094 + wxMessageBox(wxT 3095 + ("MAX_SCALE must be a positive number !!!"), 3096 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3097 + return false; 3098 + } 3099 + } 3100 + if (Style->IsMinScaleEnabled() == true && Style->IsMaxScaleEnabled() == true) 3101 + { 3102 + if (min >= max) 3103 + { 3104 + wxMessageBox(wxT 3105 + ("MAX_SCALE is always expected to be greater than MIN_SCALE !!!"), 3106 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3107 + return false; 3108 + } 3109 + } 3110 + Style->SetScaleMin(min); 3111 + Style->SetScaleMax(max); 3112 + return true; 3113 +} 3114 + 3115 +void QuickStyleTopologyDialog::UpdateMainPage() 3116 +{ 3117 +// 3118 +// updating the MAIN page 3119 +// 3120 + wxRadioBox *rangeBox = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MINMAX_SCALE); 3121 + if (Style->IsMinScaleEnabled() != true && Style->IsMaxScaleEnabled() != true) 3122 + rangeBox->SetSelection(0); 3123 + else if (Style->IsMinScaleEnabled() == true 3124 + && Style->IsMaxScaleEnabled() != true) 3125 + rangeBox->SetSelection(1); 3126 + else if (Style->IsMinScaleEnabled() != true 3127 + && Style->IsMaxScaleEnabled() == true) 3128 + rangeBox->SetSelection(2); 3129 + else 3130 + rangeBox->SetSelection(3); 3131 + wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); 3132 + char dummy[64]; 3133 + wxString str; 3134 + if (Style->IsMinScaleEnabled() == true) 3135 + { 3136 + sprintf(dummy, "%1.2f", Style->GetScaleMin()); 3137 + str = wxString::FromUTF8(dummy); 3138 + minCtrl->SetValue(str); 3139 + minCtrl->Enable(true); 3140 + } else 3141 + { 3142 + str = wxT("0.0"); 3143 + minCtrl->SetValue(str); 3144 + minCtrl->Enable(false); 3145 + } 3146 + wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); 3147 + if (Style->IsMaxScaleEnabled() == true) 3148 + { 3149 + sprintf(dummy, "%1.2f", Style->GetScaleMax()); 3150 + str = wxString::FromUTF8(dummy); 3151 + maxCtrl->SetValue(str); 3152 + maxCtrl->Enable(true); 3153 + } else 3154 + { 3155 + str = wxT("+Infinite"); 3156 + maxCtrl->SetValue(str); 3157 + maxCtrl->Enable(false); 3158 + } 3159 +} 3160 + 3161 +bool QuickStyleTopologyDialog::RetrieveNodePage(bool check) 3162 +{ 3163 +// 3164 +// retrieving params from the Node Nodeizer page 3165 +// 3166 + double opacity; 3167 + double size; 3168 + double rotation; 3169 + double anchorNodeX; 3170 + double anchorNodeY; 3171 + double displacementX; 3172 + double displacementY; 3173 + char fillColor[8]; 3174 + char strokeColor[8]; 3175 + wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_NODE_OPACITY); 3176 + opacity = opacityCtrl->GetValue() / 100.0; 3177 + wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_SIZE); 3178 + wxString value = sizeCtrl->GetValue(); 3179 + if (value.ToDouble(&size) != true) 3180 + { 3181 + if (check == true) 3182 + { 3183 + wxMessageBox(wxT 3184 + ("SIZE isn't a valid decimal number !!!"), 3185 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3186 + return false; 3187 + } 3188 + } 3189 + if (size < 0.0) 3190 + { 3191 + if (check == true) 3192 + { 3193 + wxMessageBox(wxT 3194 + ("SIZE must be a positive number !!!"), 3195 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3196 + return false; 3197 + } 3198 + } 3199 + wxTextCtrl *rotationCtrl = 3200 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_ROTATION); 3201 + value = rotationCtrl->GetValue(); 3202 + if (value.ToDouble(&rotation) != true) 3203 + { 3204 + if (check == true) 3205 + { 3206 + wxMessageBox(wxT 3207 + ("ROTATION isn't a valid decimal number !!!"), 3208 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3209 + return false; 3210 + } 3211 + } 3212 + wxTextCtrl *anchorXCtrl = 3213 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_ANCHOR_X); 3214 + value = anchorXCtrl->GetValue(); 3215 + if (value.ToDouble(&anchorNodeX) != true) 3216 + { 3217 + if (check == true) 3218 + { 3219 + wxMessageBox(wxT 3220 + ("ANCHOR-POINT-X isn't a valid decimal number !!!"), 3221 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3222 + return false; 3223 + } 3224 + } 3225 + if (anchorNodeX < 0.0 || anchorNodeX > 1.0) 3226 + { 3227 + if (check == true) 3228 + { 3229 + wxMessageBox(wxT 3230 + ("ANCHOR-POINT-X must be between 0.0 and 1.0 !!!"), 3231 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3232 + return false; 3233 + } 3234 + } 3235 + wxTextCtrl *anchorYCtrl = 3236 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_ANCHOR_Y); 3237 + value = anchorYCtrl->GetValue(); 3238 + if (value.ToDouble(&anchorNodeY) != true) 3239 + { 3240 + if (check == true) 3241 + { 3242 + wxMessageBox(wxT 3243 + ("ANCHOR-POINT-Y isn't a valid decimal number !!!"), 3244 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3245 + return false; 3246 + } 3247 + } 3248 + if (anchorNodeY < 0.0 || anchorNodeY > 1.0) 3249 + { 3250 + if (check == true) 3251 + { 3252 + wxMessageBox(wxT 3253 + ("ANCHOR-POINT-Y must be between 0.0 and 1.0 !!!"), 3254 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3255 + return false; 3256 + } 3257 + } 3258 + wxTextCtrl *displXCtrl = 3259 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_DISPLACEMENT_X); 3260 + value = displXCtrl->GetValue(); 3261 + if (value.ToDouble(&displacementX) != true) 3262 + { 3263 + if (check == true) 3264 + { 3265 + wxMessageBox(wxT 3266 + ("DISPLACEMENT-X isn't a valid decimal number !!!"), 3267 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3268 + return false; 3269 + } 3270 + } 3271 + wxTextCtrl *displYCtrl = 3272 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_DISPLACEMENT_Y); 3273 + value = displYCtrl->GetValue(); 3274 + if (value.ToDouble(&displacementY) != true) 3275 + { 3276 + if (check == true) 3277 + { 3278 + wxMessageBox(wxT 3279 + ("DISPLACEMENT-Y isn't a valid decimal number !!!"), 3280 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3281 + return false; 3282 + } 3283 + } 3284 + wxTextCtrl *colorCtrl = 3285 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_FILL_COLOR); 3286 + wxString color = colorCtrl->GetValue(); 3287 + if (ColorMapEntry::IsValidColor(color) != true) 3288 + { 3289 + if (check == true) 3290 + { 3291 + wxMessageBox(wxT 3292 + ("FILL-COLOR isn't a valid HexRGB color !!!"), 3293 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3294 + return false; 3295 + } 3296 + } 3297 + strcpy(fillColor, color.ToUTF8()); 3298 + colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_STROKE_COLOR); 3299 + color = colorCtrl->GetValue(); 3300 + if (ColorMapEntry::IsValidColor(color) != true) 3301 + { 3302 + if (check == true) 3303 + { 3304 + wxMessageBox(wxT 3305 + ("STROKE-COLOR isn't a valid HexRGB color !!!"), 3306 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3307 + return false; 3308 + } 3309 + } 3310 + strcpy(strokeColor, color.ToUTF8()); 3311 + Style->SetNodeOpacity(opacity); 3312 + Style->SetNodeSize(size); 3313 + Style->SetNodeRotation(rotation); 3314 + Style->SetNodeAnchorX(anchorNodeX); 3315 + Style->SetNodeAnchorY(anchorNodeY); 3316 + Style->SetNodeDisplacementX(displacementX); 3317 + Style->SetNodeDisplacementY(displacementY); 3318 + Style->SetNodeFillColor(fillColor); 3319 + Style->SetNodeStrokeColor(strokeColor); 3320 + return true; 3321 +} 3322 + 3323 +void QuickStyleTopologyDialog::UpdateNodePage() 3324 +{ 3325 +// 3326 +// updating the Node Nodeizer page 3327 +// 3328 + wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_NODE_OPACITY); 3329 + opacityCtrl->SetValue(Style->GetNodeOpacity() * 100.0); 3330 + wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_SIZE); 3331 + char dummy[64]; 3332 + sprintf(dummy, "%1.2f", Style->GetNodeSize()); 3333 + wxString str = wxString::FromUTF8(dummy); 3334 + sizeCtrl->SetValue(str); 3335 + wxTextCtrl *rotationCtrl = 3336 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_ROTATION); 3337 + sprintf(dummy, "%1.2f", Style->GetNodeRotation()); 3338 + str = wxString::FromUTF8(dummy); 3339 + rotationCtrl->SetValue(str); 3340 + wxTextCtrl *anchorXCtrl = 3341 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_ANCHOR_X); 3342 + sprintf(dummy, "%1.2f", Style->GetNodeAnchorX()); 3343 + str = wxString::FromUTF8(dummy); 3344 + anchorXCtrl->SetValue(str); 3345 + wxTextCtrl *anchorYCtrl = 3346 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_ANCHOR_Y); 3347 + sprintf(dummy, "%1.2f", Style->GetNodeAnchorY()); 3348 + str = wxString::FromUTF8(dummy); 3349 + anchorYCtrl->SetValue(str); 3350 + wxTextCtrl *displXCtrl = 3351 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_DISPLACEMENT_X); 3352 + sprintf(dummy, "%1.2f", Style->GetNodeDisplacementX()); 3353 + str = wxString::FromUTF8(dummy); 3354 + displXCtrl->SetValue(str); 3355 + wxTextCtrl *displYCtrl = 3356 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_DISPLACEMENT_Y); 3357 + sprintf(dummy, "%1.2f", Style->GetNodeDisplacementY()); 3358 + str = wxString::FromUTF8(dummy); 3359 + displYCtrl->SetValue(str); 3360 + wxRadioBox *markCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_NODE_MARK); 3361 + switch (Style->GetNodeWellKnownMark()) 3362 + { 3363 + case RL2_GRAPHIC_MARK_CIRCLE: 3364 + markCtrl->SetSelection(1); 3365 + break; 3366 + case RL2_GRAPHIC_MARK_TRIANGLE: 3367 + markCtrl->SetSelection(2); 3368 + break; 3369 + case RL2_GRAPHIC_MARK_STAR: 3370 + markCtrl->SetSelection(3); 3371 + break; 3372 + case RL2_GRAPHIC_MARK_CROSS: 3373 + markCtrl->SetSelection(4); 3374 + break; 3375 + case RL2_GRAPHIC_MARK_X: 3376 + markCtrl->SetSelection(5); 3377 + break; 3378 + default: 3379 + markCtrl->SetSelection(0); 3380 + break; 3381 + }; 3382 + wxTextCtrl *colorFillCtrl = 3383 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_FILL_COLOR); 3384 + wxString fillColor = wxString::FromUTF8(Style->GetNodeFillColor()); 3385 + colorFillCtrl->SetValue(fillColor); 3386 + wxTextCtrl *colorStrokeCtrl = 3387 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_STROKE_COLOR); 3388 + wxString strokeColor = wxString::FromUTF8(Style->GetNodeStrokeColor()); 3389 + colorStrokeCtrl->SetValue(strokeColor); 3390 +} 3391 + 3392 +bool QuickStyleTopologyDialog::RetrieveEdgeLinkPage(bool check) 3393 +{ 3394 +// 3395 +// retrieving params from the EdgeLink Symbolizer page 3396 +// 3397 + double opacity; 3398 + double perpendicularOffset; 3399 + char strokeColor[8]; 3400 + double strokeWidth; 3401 + wxSlider *opacityCtrl = 3402 + (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE1_OPACITY); 3403 + opacity = opacityCtrl->GetValue() / 100.0; 3404 + wxTextCtrl *perpCtrl = 3405 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_PERPENDICULAR); 3406 + wxString value = perpCtrl->GetValue(); 3407 + if (value.ToDouble(&perpendicularOffset) != true) 3408 + { 3409 + if (check == true) 3410 + { 3411 + wxMessageBox(wxT 3412 + ("PERPENDICULAR-OFFSET isn't a valid decimal number !!!"), 3413 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3414 + return false; 3415 + } 3416 + } 3417 + wxTextCtrl *colorCtrl = 3418 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); 3419 + wxString color = colorCtrl->GetValue(); 3420 + if (ColorMapEntry::IsValidColor(color) != true) 3421 + { 3422 + if (check == true) 3423 + { 3424 + wxMessageBox(wxT 3425 + ("STROKE-COLOR isn't a valid HexRGB color !!!"), 3426 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3427 + return false; 3428 + } 3429 + } 3430 + strcpy(strokeColor, color.ToUTF8()); 3431 + wxTextCtrl *widthCtrl = 3432 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_WIDTH); 3433 + value = widthCtrl->GetValue(); 3434 + if (value.ToDouble(&strokeWidth) != true) 3435 + { 3436 + if (check == true) 3437 + { 3438 + wxMessageBox(wxT 3439 + ("STROKE-WIDTH isn't a valid decimal number !!!"), 3440 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3441 + return false; 3442 + } 3443 + } 3444 + if (strokeWidth <= 0.0) 3445 + { 3446 + if (check == true) 3447 + { 3448 + wxMessageBox(wxT 3449 + ("STROKE-WIDTH must be a positive number !!!"), 3450 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3451 + return false; 3452 + } 3453 + } 3454 + wxRadioBox *dotCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_DASH_DOT); 3455 + switch (dotCtrl->GetSelection()) 3456 + { 3457 + case 1: 3458 + Style->SetEdgeLinkDotStyle(QUICK_STYLE_DOT_LINE); 3459 + break; 3460 + case 2: 3461 + Style->SetEdgeLinkDotStyle(QUICK_STYLE_DASH_LINE); 3462 + break; 3463 + case 3: 3464 + Style->SetEdgeLinkDotStyle(QUICK_STYLE_DASH_DOT_LINE); 3465 + break; 3466 + default: 3467 + Style->SetEdgeLinkDotStyle(QUICK_STYLE_SOLID_LINE); 3468 + break; 3469 + }; 3470 + Style->SetEdgeLinkOpacity(opacity); 3471 + Style->SetEdgeLinkPerpendicularOffset(perpendicularOffset); 3472 + Style->SetEdgeLinkStrokeWidth(strokeWidth); 3473 + Style->SetEdgeLinkStrokeColor(strokeColor); 3474 + return true; 3475 +} 3476 + 3477 +void QuickStyleTopologyDialog::UpdateEdgeLinkPage() 3478 +{ 3479 +// 3480 +// updating the EdgeLink Symbolizer page 3481 +// 3482 + wxSlider *opacityCtrl = 3483 + (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE1_OPACITY); 3484 + opacityCtrl->SetValue(Style->GetEdgeLinkOpacity() * 100.0); 3485 + wxTextCtrl *perpCtrl = 3486 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_PERPENDICULAR); 3487 + char dummy[64]; 3488 + sprintf(dummy, "%1.2f", Style->GetEdgeLinkPerpendicularOffset()); 3489 + wxString str = wxString::FromUTF8(dummy); 3490 + perpCtrl->SetValue(str); 3491 + wxTextCtrl *colorCtrl = 3492 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); 3493 + wxButton *pick = (wxButton *) FindWindow(ID_SYMBOLIZER_STROKE1_PICKER_BTN); 3494 + colorCtrl->Enable(true); 3495 + pick->Enable(true); 3496 + wxString strokeColor = wxString::FromUTF8(Style->GetEdgeLinkStrokeColor()); 3497 + colorCtrl->SetValue(strokeColor); 3498 + wxTextCtrl *widthCtrl = 3499 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_WIDTH); 3500 + sprintf(dummy, "%1.2f", Style->GetEdgeLinkStrokeWidth()); 3501 + str = wxString::FromUTF8(dummy); 3502 + wxRadioBox *dotCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_DASH_DOT); 3503 + switch (Style->GetEdgeLinkDotStyle()) 3504 + { 3505 + case QUICK_STYLE_DOT_LINE: 3506 + dotCtrl->SetSelection(1); 3507 + break; 3508 + case QUICK_STYLE_DASH_LINE: 3509 + dotCtrl->SetSelection(2); 3510 + break; 3511 + case QUICK_STYLE_DASH_DOT_LINE: 3512 + dotCtrl->SetSelection(3); 3513 + break; 3514 + default: 3515 + dotCtrl->SetSelection(0); 3516 + break; 3517 + }; 3518 + widthCtrl->SetValue(str); 3519 +} 3520 + 3521 +bool QuickStyleTopologyDialog::RetrieveFacePage(bool check) 3522 +{ 3523 +// 3524 +// retrieving params from the Face Synbolizer page 3525 +// 3526 + double fillOpacity; 3527 + double displacementX; 3528 + double displacementY; 3529 + double perpendicularOffset; 3530 + char fillColor[8]; 3531 + wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_FILL2_OPACITY); 3532 + fillOpacity = opacityCtrl->GetValue() / 100.0; 3533 + wxTextCtrl *displXCtrl = 3534 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_X); 3535 + wxString value = displXCtrl->GetValue(); 3536 + if (Style->IsFaceFill() != true && Style->IsFaceStroke() != true) 3537 + { 3538 + if (check == true) 3539 + { 3540 + wxMessageBox(wxT 3541 + ("You can't disable both FILL and STROKE at the same time !!!"), 3542 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3543 + return false; 3544 + } 3545 + } 3546 + if (value.ToDouble(&displacementX) != true) 3547 + { 3548 + if (check == true) 3549 + { 3550 + wxMessageBox(wxT 3551 + ("DISPLACEMENT-X isn't a valid decimal number !!!"), 3552 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3553 + return false; 3554 + } 3555 + } 3556 + wxTextCtrl *displYCtrl = 3557 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_Y); 3558 + value = displYCtrl->GetValue(); 3559 + if (value.ToDouble(&displacementY) != true) 3560 + { 3561 + if (check == true) 3562 + { 3563 + wxMessageBox(wxT 3564 + ("DISPLACEMENT-Y isn't a valid decimal number !!!"), 3565 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3566 + return false; 3567 + } 3568 + } 3569 + wxTextCtrl *perpCtrl = 3570 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_PERPENDICULAR); 3571 + value = perpCtrl->GetValue(); 3572 + if (value.ToDouble(&perpendicularOffset) != true) 3573 + { 3574 + if (check == true) 3575 + { 3576 + wxMessageBox(wxT 3577 + ("PERPENDICULAR-OFFSET isn't a valid decimal number !!!"), 3578 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3579 + return false; 3580 + } 3581 + } 3582 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); 3583 + wxString color = colorCtrl->GetValue(); 3584 + if (ColorMapEntry::IsValidColor(color) != true) 3585 + { 3586 + if (check == true) 3587 + { 3588 + wxMessageBox(wxT 3589 + ("FILL-COLOR isn't a valid HexRGB color !!!"), 3590 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3591 + return false; 3592 + } 3593 + } 3594 + strcpy(fillColor, color.ToUTF8()); 3595 + Style->SetFaceFillOpacity(fillOpacity); 3596 + Style->SetFaceDisplacementX(displacementX); 3597 + Style->SetFaceDisplacementY(displacementY); 3598 + Style->SetFacePerpendicularOffset(perpendicularOffset); 3599 + Style->SetFaceFillColor(fillColor); 3600 + return true; 3601 +} 3602 + 3603 +void QuickStyleTopologyDialog::UpdateFacePage() 3604 +{ 3605 +// 3606 +// updating the Face Symbolizer page 3607 +// 3608 + wxCheckBox *enableBox = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_FILL2_ENABLE); 3609 + enableBox->SetValue(Style->IsFaceFill()); 3610 + wxTextCtrl *displXCtrl = 3611 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_X); 3612 + char dummy[64]; 3613 + sprintf(dummy, "%1.2f", Style->GetFaceDisplacementX()); 3614 + wxString str = wxString::FromUTF8(dummy); 3615 + displXCtrl->SetValue(str); 3616 + wxTextCtrl *displYCtrl = 3617 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_Y); 3618 + sprintf(dummy, "%1.2f", Style->GetFaceDisplacementY()); 3619 + str = wxString::FromUTF8(dummy); 3620 + displYCtrl->SetValue(str); 3621 + wxTextCtrl *perpCtrl = 3622 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_PERPENDICULAR); 3623 + sprintf(dummy, "%1.2f", Style->GetFacePerpendicularOffset()); 3624 + str = wxString::FromUTF8(dummy); 3625 + perpCtrl->SetValue(str); 3626 + wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_FILL2_OPACITY); 3627 + opacityCtrl->SetValue(Style->GetFaceFillOpacity() * 100.0); 3628 + opacityCtrl->Enable(Style->IsFaceFill()); 3629 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); 3630 + wxButton *pick = (wxButton *) FindWindow(ID_SYMBOLIZER_FILL2_PICKER_BTN); 3631 + wxColour color = wxNullColour; 3632 + str = wxString::FromUTF8(Style->GetFaceFillColor()); 3633 + ColorMapEntry::GetWxColor(str, color); 3634 + if (color.IsOk() == true) 3635 + { 3636 + char hex[16]; 3637 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 3638 + wxString str = wxString::FromUTF8(hex); 3639 + colorCtrl->SetValue(str); 3640 + } 3641 + colorCtrl->Enable(Style->IsFaceFill()); 3642 + pick->Enable(Style->IsFaceFill()); 3643 + wxSlider *opacity2Ctrl = 3644 + (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE2_OPACITY); 3645 + opacity2Ctrl->SetValue(Style->GetFaceStrokeOpacity() * 100.0); 3646 + opacity2Ctrl->Enable(Style->IsFaceStroke()); 3647 + wxTextCtrl *color2Ctrl = 3648 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); 3649 + wxButton *pick2 = (wxButton *) FindWindow(ID_SYMBOLIZER_STROKE2_PICKER_BTN); 3650 + color = wxNullColour; 3651 + str = wxString::FromUTF8(Style->GetFaceStrokeColor()); 3652 + ColorMapEntry::GetWxColor(str, color); 3653 + if (color.IsOk() == true) 3654 + { 3655 + char hex[16]; 3656 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 3657 + wxString str = wxString::FromUTF8(hex); 3658 + color2Ctrl->SetValue(str); 3659 + } 3660 + color2Ctrl->Enable(Style->IsFaceStroke()); 3661 + pick2->Enable(Style->IsFaceStroke()); 3662 + wxTextCtrl *widthCtrl = 3663 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_WIDTH); 3664 + sprintf(dummy, "%1.2f", Style->GetFaceStrokeWidth()); 3665 + str = wxString::FromUTF8(dummy); 3666 + widthCtrl->SetValue(str); 3667 + widthCtrl->Enable(Style->IsFaceStroke()); 3668 +} 3669 + 3670 +bool QuickStyleTopologyDialog::RetrieveEdgeLinkSeedPage(bool check) 3671 +{ 3672 +// 3673 +// retrieving params from the EdgeLinkSeed EdgeLinkSeedizer page 3674 +// 3675 + double opacity; 3676 + double size; 3677 + double rotation; 3678 + double anchorEdgeLinkSeedX; 3679 + double anchorEdgeLinkSeedY; 3680 + double displacementX; 3681 + double displacementY; 3682 + char fillColor[8]; 3683 + char strokeColor[8]; 3684 + wxSlider *opacityCtrl = 3685 + (wxSlider *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_OPACITY); 3686 + opacity = opacityCtrl->GetValue() / 100.0; 3687 + wxTextCtrl *sizeCtrl = 3688 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_SIZE); 3689 + wxString value = sizeCtrl->GetValue(); 3690 + if (value.ToDouble(&size) != true) 3691 + { 3692 + if (check == true) 3693 + { 3694 + wxMessageBox(wxT 3695 + ("SIZE isn't a valid decimal number !!!"), 3696 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3697 + return false; 3698 + } 3699 + } 3700 + if (size < 0.0) 3701 + { 3702 + if (check == true) 3703 + { 3704 + wxMessageBox(wxT 3705 + ("SIZE must be a positive number !!!"), 3706 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3707 + return false; 3708 + } 3709 + } 3710 + wxTextCtrl *rotationCtrl = 3711 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_ROTATION); 3712 + value = rotationCtrl->GetValue(); 3713 + if (value.ToDouble(&rotation) != true) 3714 + { 3715 + if (check == true) 3716 + { 3717 + wxMessageBox(wxT 3718 + ("ROTATION isn't a valid decimal number !!!"), 3719 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3720 + return false; 3721 + } 3722 + } 3723 + wxTextCtrl *anchorXCtrl = 3724 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_ANCHOR_X); 3725 + value = anchorXCtrl->GetValue(); 3726 + if (value.ToDouble(&anchorEdgeLinkSeedX) != true) 3727 + { 3728 + if (check == true) 3729 + { 3730 + wxMessageBox(wxT 3731 + ("ANCHOR-POINT-X isn't a valid decimal number !!!"), 3732 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3733 + return false; 3734 + } 3735 + } 3736 + if (anchorEdgeLinkSeedX < 0.0 || anchorEdgeLinkSeedX > 1.0) 3737 + { 3738 + if (check == true) 3739 + { 3740 + wxMessageBox(wxT 3741 + ("ANCHOR-POINT-X must be between 0.0 and 1.0 !!!"), 3742 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3743 + return false; 3744 + } 3745 + } 3746 + wxTextCtrl *anchorYCtrl = 3747 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_ANCHOR_Y); 3748 + value = anchorYCtrl->GetValue(); 3749 + if (value.ToDouble(&anchorEdgeLinkSeedY) != true) 3750 + { 3751 + if (check == true) 3752 + { 3753 + wxMessageBox(wxT 3754 + ("ANCHOR-POINT-Y isn't a valid decimal number !!!"), 3755 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3756 + return false; 3757 + } 3758 + } 3759 + if (anchorEdgeLinkSeedY < 0.0 || anchorEdgeLinkSeedY > 1.0) 3760 + { 3761 + if (check == true) 3762 + { 3763 + wxMessageBox(wxT 3764 + ("ANCHOR-POINT-Y must be between 0.0 and 1.0 !!!"), 3765 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3766 + return false; 3767 + } 3768 + } 3769 + wxTextCtrl *displXCtrl = 3770 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_DISPLACEMENT_X); 3771 + value = displXCtrl->GetValue(); 3772 + if (value.ToDouble(&displacementX) != true) 3773 + { 3774 + if (check == true) 3775 + { 3776 + wxMessageBox(wxT 3777 + ("DISPLACEMENT-X isn't a valid decimal number !!!"), 3778 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3779 + return false; 3780 + } 3781 + } 3782 + wxTextCtrl *displYCtrl = 3783 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_DISPLACEMENT_Y); 3784 + value = displYCtrl->GetValue(); 3785 + if (value.ToDouble(&displacementY) != true) 3786 + { 3787 + if (check == true) 3788 + { 3789 + wxMessageBox(wxT 3790 + ("DISPLACEMENT-Y isn't a valid decimal number !!!"), 3791 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3792 + return false; 3793 + } 3794 + } 3795 + wxTextCtrl *colorCtrl = 3796 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_FILL_COLOR); 3797 + wxString color = colorCtrl->GetValue(); 3798 + if (ColorMapEntry::IsValidColor(color) != true) 3799 + { 3800 + if (check == true) 3801 + { 3802 + wxMessageBox(wxT 3803 + ("FILL-COLOR isn't a valid HexRGB color !!!"), 3804 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3805 + return false; 3806 + } 3807 + } 3808 + strcpy(fillColor, color.ToUTF8()); 3809 + colorCtrl = 3810 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_COLOR); 3811 + color = colorCtrl->GetValue(); 3812 + if (ColorMapEntry::IsValidColor(color) != true) 3813 + { 3814 + if (check == true) 3815 + { 3816 + wxMessageBox(wxT 3817 + ("STROKE-COLOR isn't a valid HexRGB color !!!"), 3818 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3819 + return false; 3820 + } 3821 + } 3822 + strcpy(strokeColor, color.ToUTF8()); 3823 + Style->SetEdgeLinkSeedOpacity(opacity); 3824 + Style->SetEdgeLinkSeedSize(size); 3825 + Style->SetEdgeLinkSeedRotation(rotation); 3826 + Style->SetEdgeLinkSeedAnchorX(anchorEdgeLinkSeedX); 3827 + Style->SetEdgeLinkSeedAnchorY(anchorEdgeLinkSeedY); 3828 + Style->SetEdgeLinkSeedDisplacementX(displacementX); 3829 + Style->SetEdgeLinkSeedDisplacementY(displacementY); 3830 + Style->SetEdgeLinkSeedFillColor(fillColor); 3831 + Style->SetEdgeLinkSeedStrokeColor(strokeColor); 3832 + return true; 3833 +} 3834 + 3835 +void QuickStyleTopologyDialog::UpdateEdgeLinkSeedPage() 3836 +{ 3837 +// 3838 +// updating the EdgeLinkSeed EdgeLinkSeedizer page 3839 +// 3840 + wxSlider *opacityCtrl = 3841 + (wxSlider *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_OPACITY); 3842 + opacityCtrl->SetValue(Style->GetEdgeLinkSeedOpacity() * 100.0); 3843 + wxTextCtrl *sizeCtrl = 3844 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_SIZE); 3845 + char dummy[64]; 3846 + sprintf(dummy, "%1.2f", Style->GetEdgeLinkSeedSize()); 3847 + wxString str = wxString::FromUTF8(dummy); 3848 + sizeCtrl->SetValue(str); 3849 + wxTextCtrl *rotationCtrl = 3850 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_ROTATION); 3851 + sprintf(dummy, "%1.2f", Style->GetEdgeLinkSeedRotation()); 3852 + str = wxString::FromUTF8(dummy); 3853 + rotationCtrl->SetValue(str); 3854 + wxTextCtrl *anchorXCtrl = 3855 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_ANCHOR_X); 3856 + sprintf(dummy, "%1.2f", Style->GetEdgeLinkSeedAnchorX()); 3857 + str = wxString::FromUTF8(dummy); 3858 + anchorXCtrl->SetValue(str); 3859 + wxTextCtrl *anchorYCtrl = 3860 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_ANCHOR_Y); 3861 + sprintf(dummy, "%1.2f", Style->GetEdgeLinkSeedAnchorY()); 3862 + str = wxString::FromUTF8(dummy); 3863 + anchorYCtrl->SetValue(str); 3864 + wxTextCtrl *displXCtrl = 3865 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_DISPLACEMENT_X); 3866 + sprintf(dummy, "%1.2f", Style->GetEdgeLinkSeedDisplacementX()); 3867 + str = wxString::FromUTF8(dummy); 3868 + displXCtrl->SetValue(str); 3869 + wxTextCtrl *displYCtrl = 3870 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_DISPLACEMENT_Y); 3871 + sprintf(dummy, "%1.2f", Style->GetEdgeLinkSeedDisplacementY()); 3872 + str = wxString::FromUTF8(dummy); 3873 + displYCtrl->SetValue(str); 3874 + wxRadioBox *markCtrl = 3875 + (wxRadioBox *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_MARK); 3876 + switch (Style->GetEdgeLinkSeedWellKnownMark()) 3877 + { 3878 + case RL2_GRAPHIC_MARK_CIRCLE: 3879 + markCtrl->SetSelection(1); 3880 + break; 3881 + case RL2_GRAPHIC_MARK_TRIANGLE: 3882 + markCtrl->SetSelection(2); 3883 + break; 3884 + case RL2_GRAPHIC_MARK_STAR: 3885 + markCtrl->SetSelection(3); 3886 + break; 3887 + case RL2_GRAPHIC_MARK_CROSS: 3888 + markCtrl->SetSelection(4); 3889 + break; 3890 + case RL2_GRAPHIC_MARK_X: 3891 + markCtrl->SetSelection(5); 3892 + break; 3893 + default: 3894 + markCtrl->SetSelection(0); 3895 + break; 3896 + }; 3897 + wxTextCtrl *colorFillCtrl = 3898 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_FILL_COLOR); 3899 + wxString fillColor = wxString::FromUTF8(Style->GetEdgeLinkSeedFillColor()); 3900 + colorFillCtrl->SetValue(fillColor); 3901 + wxTextCtrl *colorStrokeCtrl = 3902 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_COLOR); 3903 + wxString strokeColor = 3904 + wxString::FromUTF8(Style->GetEdgeLinkSeedStrokeColor()); 3905 + colorStrokeCtrl->SetValue(strokeColor); 3906 +} 3907 + 3908 +bool QuickStyleTopologyDialog::RetrieveFaceSeedPage(bool check) 3909 +{ 3910 +// 3911 +// retrieving params from the FaceSeed FaceSeedizer page 3912 +// 3913 + double opacity; 3914 + double size; 3915 + double rotation; 3916 + double anchorFaceSeedX; 3917 + double anchorFaceSeedY; 3918 + double displacementX; 3919 + double displacementY; 3920 + char fillColor[8]; 3921 + char strokeColor[8]; 3922 + wxSlider *opacityCtrl = 3923 + (wxSlider *) FindWindow(ID_SYMBOLIZER_FACE_SEED_OPACITY); 3924 + opacity = opacityCtrl->GetValue() / 100.0; 3925 + wxTextCtrl *sizeCtrl = 3926 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_SIZE); 3927 + wxString value = sizeCtrl->GetValue(); 3928 + if (value.ToDouble(&size) != true) 3929 + { 3930 + if (check == true) 3931 + { 3932 + wxMessageBox(wxT 3933 + ("SIZE isn't a valid decimal number !!!"), 3934 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3935 + return false; 3936 + } 3937 + } 3938 + if (size < 0.0) 3939 + { 3940 + if (check == true) 3941 + { 3942 + wxMessageBox(wxT 3943 + ("SIZE must be a positive number !!!"), 3944 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3945 + return false; 3946 + } 3947 + } 3948 + wxTextCtrl *rotationCtrl = 3949 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_ROTATION); 3950 + value = rotationCtrl->GetValue(); 3951 + if (value.ToDouble(&rotation) != true) 3952 + { 3953 + if (check == true) 3954 + { 3955 + wxMessageBox(wxT 3956 + ("ROTATION isn't a valid decimal number !!!"), 3957 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3958 + return false; 3959 + } 3960 + } 3961 + wxTextCtrl *anchorXCtrl = 3962 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_ANCHOR_X); 3963 + value = anchorXCtrl->GetValue(); 3964 + if (value.ToDouble(&anchorFaceSeedX) != true) 3965 + { 3966 + if (check == true) 3967 + { 3968 + wxMessageBox(wxT 3969 + ("ANCHOR-POINT-X isn't a valid decimal number !!!"), 3970 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3971 + return false; 3972 + } 3973 + } 3974 + if (anchorFaceSeedX < 0.0 || anchorFaceSeedX > 1.0) 3975 + { 3976 + if (check == true) 3977 + { 3978 + wxMessageBox(wxT 3979 + ("ANCHOR-POINT-X must be between 0.0 and 1.0 !!!"), 3980 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3981 + return false; 3982 + } 3983 + } 3984 + wxTextCtrl *anchorYCtrl = 3985 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_ANCHOR_Y); 3986 + value = anchorYCtrl->GetValue(); 3987 + if (value.ToDouble(&anchorFaceSeedY) != true) 3988 + { 3989 + if (check == true) 3990 + { 3991 + wxMessageBox(wxT 3992 + ("ANCHOR-POINT-Y isn't a valid decimal number !!!"), 3993 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3994 + return false; 3995 + } 3996 + } 3997 + if (anchorFaceSeedY < 0.0 || anchorFaceSeedY > 1.0) 3998 + { 3999 + if (check == true) 4000 + { 4001 + wxMessageBox(wxT 4002 + ("ANCHOR-POINT-Y must be between 0.0 and 1.0 !!!"), 4003 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4004 + return false; 4005 + } 4006 + } 4007 + wxTextCtrl *displXCtrl = 4008 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_DISPLACEMENT_X); 4009 + value = displXCtrl->GetValue(); 4010 + if (value.ToDouble(&displacementX) != true) 4011 + { 4012 + if (check == true) 4013 + { 4014 + wxMessageBox(wxT 4015 + ("DISPLACEMENT-X isn't a valid decimal number !!!"), 4016 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4017 + return false; 4018 + } 4019 + } 4020 + wxTextCtrl *displYCtrl = 4021 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_DISPLACEMENT_Y); 4022 + value = displYCtrl->GetValue(); 4023 + if (value.ToDouble(&displacementY) != true) 4024 + { 4025 + if (check == true) 4026 + { 4027 + wxMessageBox(wxT 4028 + ("DISPLACEMENT-Y isn't a valid decimal number !!!"), 4029 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4030 + return false; 4031 + } 4032 + } 4033 + wxTextCtrl *colorCtrl = 4034 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_FILL_COLOR); 4035 + wxString color = colorCtrl->GetValue(); 4036 + if (ColorMapEntry::IsValidColor(color) != true) 4037 + { 4038 + if (check == true) 4039 + { 4040 + wxMessageBox(wxT 4041 + ("FILL-COLOR isn't a valid HexRGB color !!!"), 4042 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4043 + return false; 4044 + } 4045 + } 4046 + strcpy(fillColor, color.ToUTF8()); 4047 + colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR); 4048 + color = colorCtrl->GetValue(); 4049 + if (ColorMapEntry::IsValidColor(color) != true) 4050 + { 4051 + if (check == true) 4052 + { 4053 + wxMessageBox(wxT 4054 + ("STROKE-COLOR isn't a valid HexRGB color !!!"), 4055 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4056 + return false; 4057 + } 4058 + } 4059 + strcpy(strokeColor, color.ToUTF8()); 4060 + Style->SetFaceSeedOpacity(opacity); 4061 + Style->SetFaceSeedSize(size); 4062 + Style->SetFaceSeedRotation(rotation); 4063 + Style->SetFaceSeedAnchorX(anchorFaceSeedX); 4064 + Style->SetFaceSeedAnchorY(anchorFaceSeedY); 4065 + Style->SetFaceSeedDisplacementX(displacementX); 4066 + Style->SetFaceSeedDisplacementY(displacementY); 4067 + Style->SetFaceSeedFillColor(fillColor); 4068 + Style->SetFaceSeedStrokeColor(strokeColor); 4069 + return true; 4070 +} 4071 + 4072 +void QuickStyleTopologyDialog::UpdateFaceSeedPage() 4073 +{ 4074 +// 4075 +// updating the FaceSeed FaceSeedizer page 4076 +// 4077 + wxSlider *opacityCtrl = 4078 + (wxSlider *) FindWindow(ID_SYMBOLIZER_FACE_SEED_OPACITY); 4079 + opacityCtrl->SetValue(Style->GetFaceSeedOpacity() * 100.0); 4080 + wxTextCtrl *sizeCtrl = 4081 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_SIZE); 4082 + char dummy[64]; 4083 + sprintf(dummy, "%1.2f", Style->GetFaceSeedSize()); 4084 + wxString str = wxString::FromUTF8(dummy); 4085 + sizeCtrl->SetValue(str); 4086 + wxTextCtrl *rotationCtrl = 4087 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_ROTATION); 4088 + sprintf(dummy, "%1.2f", Style->GetFaceSeedRotation()); 4089 + str = wxString::FromUTF8(dummy); 4090 + rotationCtrl->SetValue(str); 4091 + wxTextCtrl *anchorXCtrl = 4092 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_ANCHOR_X); 4093 + sprintf(dummy, "%1.2f", Style->GetFaceSeedAnchorX()); 4094 + str = wxString::FromUTF8(dummy); 4095 + anchorXCtrl->SetValue(str); 4096 + wxTextCtrl *anchorYCtrl = 4097 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_ANCHOR_Y); 4098 + sprintf(dummy, "%1.2f", Style->GetFaceSeedAnchorY()); 4099 + str = wxString::FromUTF8(dummy); 4100 + anchorYCtrl->SetValue(str); 4101 + wxTextCtrl *displXCtrl = 4102 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_DISPLACEMENT_X); 4103 + sprintf(dummy, "%1.2f", Style->GetFaceSeedDisplacementX()); 4104 + str = wxString::FromUTF8(dummy); 4105 + displXCtrl->SetValue(str); 4106 + wxTextCtrl *displYCtrl = 4107 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_DISPLACEMENT_Y); 4108 + sprintf(dummy, "%1.2f", Style->GetFaceSeedDisplacementY()); 4109 + str = wxString::FromUTF8(dummy); 4110 + displYCtrl->SetValue(str); 4111 + wxRadioBox *markCtrl = 4112 + (wxRadioBox *) FindWindow(ID_SYMBOLIZER_FACE_SEED_MARK); 4113 + switch (Style->GetFaceSeedWellKnownMark()) 4114 + { 4115 + case RL2_GRAPHIC_MARK_CIRCLE: 4116 + markCtrl->SetSelection(1); 4117 + break; 4118 + case RL2_GRAPHIC_MARK_TRIANGLE: 4119 + markCtrl->SetSelection(2); 4120 + break; 4121 + case RL2_GRAPHIC_MARK_STAR: 4122 + markCtrl->SetSelection(3); 4123 + break; 4124 + case RL2_GRAPHIC_MARK_CROSS: 4125 + markCtrl->SetSelection(4); 4126 + break; 4127 + case RL2_GRAPHIC_MARK_X: 4128 + markCtrl->SetSelection(5); 4129 + break; 4130 + default: 4131 + markCtrl->SetSelection(0); 4132 + break; 4133 + }; 4134 + wxTextCtrl *colorFillCtrl = 4135 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_FILL_COLOR); 4136 + wxString fillColor = wxString::FromUTF8(Style->GetFaceSeedFillColor()); 4137 + colorFillCtrl->SetValue(fillColor); 4138 + wxTextCtrl *colorStrokeCtrl = 4139 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR); 4140 + wxString strokeColor = wxString::FromUTF8(Style->GetFaceSeedStrokeColor()); 4141 + colorStrokeCtrl->SetValue(strokeColor); 4142 +} 4143 + 4144 +void QuickStyleTopologyDialog::OnPageChanging(wxNotebookEvent & event) 4145 +{ 4146 +// 4147 +// TAB/PAGE selection changing 4148 +// 4149 + bool ret = false; 4150 + int idx = event.GetOldSelection(); 4151 + if (idx == 0) 4152 + ret = RetrieveMainPage(); 4153 + else if (idx == 1) 4154 + ret = RetrieveNodePage(); 4155 + else if (idx == 2) 4156 + ret = RetrieveEdgeLinkPage(); 4157 + else 4158 + { 4159 + if (Type == MAP_LAYER_NETWORK) 4160 + { 4161 + if (idx == 3) 4162 + ret = RetrieveEdgeLinkSeedPage(); 4163 + } else 4164 + { 4165 + if (idx == 3) 4166 + ret = RetrieveFacePage(); 4167 + if (idx == 4) 4168 + ret = RetrieveEdgeLinkSeedPage(); 4169 + if (idx == 5) 4170 + ret = RetrieveFaceSeedPage(); 4171 + } 4172 + } 4173 + if (ret != true) 4174 + event.Veto(); 4175 +} 4176 + 4177 +void QuickStyleTopologyDialog::OnPageChanged(wxNotebookEvent & event) 4178 +{ 4179 +// 4180 +// TAB/PAGE selection changed 4181 +// 4182 + int idx = event.GetSelection(); 4183 + if (idx == 0) 4184 + UpdateMainPage(); 4185 + else if (idx == 1) 4186 + UpdateNodePage(); 4187 + else if (idx == 2) 4188 + UpdateEdgeLinkPage(); 4189 + else 4190 + { 4191 + if (Type == MAP_LAYER_NETWORK) 4192 + { 4193 + if (idx == 3) 4194 + UpdateEdgeLinkSeedPage(); 4195 + } else 4196 + { 4197 + if (idx == 3) 4198 + UpdateFacePage(); 4199 + if (idx == 4) 4200 + UpdateEdgeLinkSeedPage(); 4201 + if (idx == 5) 4202 + UpdateFaceSeedPage(); 4203 + } 4204 + } 4205 +} 4206 + 4207 +bool QuickStyleTopologyDialog::UpdateStyle() 4208 +{ 4209 +// 4210 +// updating the QuickStyle 4211 +// 4212 + bool ret = false; 4213 + int idx = GetBookCtrl()->GetSelection(); 4214 + if (idx == 0) 4215 + ret = RetrieveMainPage(); 4216 + else if (idx == 1) 4217 + ret = RetrieveNodePage(); 4218 + else if (idx == 2) 4219 + ret = RetrieveEdgeLinkPage(); 4220 + else 4221 + { 4222 + if (Type == MAP_LAYER_NETWORK) 4223 + { 4224 + if (idx == 3) 4225 + ret = RetrieveEdgeLinkSeedPage(); 4226 + } else 4227 + { 4228 + if (idx == 3) 4229 + ret = RetrieveFacePage(); 4230 + if (idx == 4) 4231 + ret = RetrieveEdgeLinkSeedPage(); 4232 + if (idx == 5) 4233 + ret = RetrieveFaceSeedPage(); 4234 + } 4235 + } 4236 + if (ret == false) 4237 + return false; 4238 + 4239 + VectorLayerConfig *config = Layer->GetVectorConfig(); 4240 + bool setCurrentStyle = false; 4241 + if (config->GetStyle() == NULL) 4242 + setCurrentStyle = true; 4243 + else 4244 + { 4245 + if (strcmp(Style->GetUUID(), config->GetStyle()) != 0) 4246 + setCurrentStyle = true; 4247 + } 4248 + if (setCurrentStyle == true) 4249 + { 4250 + config->SetStyle(Style->GetUUID()); 4251 + IsConfigChanged = true; 4252 + } 4253 + IsConfigChanged = Layer->UpdateQuickStyle(Style); 4254 + return true; 4255 +} 4256 + 4257 +void QuickStyleTopologyDialog::OnOk(wxCommandEvent & WXUNUSED(event)) 4258 +{ 4259 +// 4260 +// permanently saving the QuickStyle and quitting 4261 +// 4262 + if (UpdateStyle() == true) 4263 + wxDialog::EndModal(wxID_OK); 4264 +} 4265 + 4266 +void QuickStyleTopologyDialog::OnApply(wxCommandEvent & WXUNUSED(event)) 4267 +{ 4268 +// 4269 +// applying the QuickStyle and continuing 4270 +// 4271 + if (UpdateStyle() == true) 4272 + { 4273 + if (IsConfigChanged == true) 4274 + MapPanel->RefreshMap(); 4275 + } 4276 +} 4277 + 4278 +void QuickStyleTopologyDialog::OnExport(wxCommandEvent & WXUNUSED(event)) 4279 +{ 4280 +// 4281 +// exporting the Quick Style as an external file 4282 +// 4283 + bool xret = false; 4284 + int ret; 4285 + wxString path; 4286 + wxString lastDir; 4287 + int idx = GetBookCtrl()->GetSelection(); 4288 + if (idx == 0) 4289 + xret = RetrieveMainPage(); 4290 + else if (idx == 1) 4291 + xret = RetrieveNodePage(); 4292 + else if (idx == 2) 4293 + xret = RetrieveEdgeLinkPage(); 4294 + else 4295 + { 4296 + if (Type == MAP_LAYER_NETWORK) 4297 + { 4298 + if (idx == 3) 4299 + xret = RetrieveEdgeLinkSeedPage(); 4300 + } else 4301 + { 4302 + if (idx == 3) 4303 + xret = RetrieveFacePage(); 4304 + if (idx == 4) 4305 + xret = RetrieveEdgeLinkSeedPage(); 4306 + if (idx == 5) 4307 + xret = RetrieveFaceSeedPage(); 4308 + } 4309 + } 4310 + if (xret == false) 4311 + return; 4312 + 4313 + wxFileDialog fileDialog(this, 4314 + wxT("Exporting an SLD/SE QuickStyle to a file"), 4315 + wxT(""), wxT("style.xml"), 4316 + wxT("XML Document|*.xml|All files (*.*)|*.*"), 4317 + wxFD_SAVE | wxFD_OVERWRITE_PROMPT, wxDefaultPosition, 4318 + wxDefaultSize, wxT("filedlg")); 4319 + lastDir = MainFrame->GetLastDirectory(); 4320 + if (lastDir.Len() >= 1) 4321 + fileDialog.SetDirectory(lastDir); 4322 + ret = fileDialog.ShowModal(); 4323 + if (ret == wxID_OK) 4324 + { 4325 + wxFileName file(fileDialog.GetPath()); 4326 + path = file.GetPath(); 4327 + path += file.GetPathSeparator(); 4328 + path += file.GetName(); 4329 + lastDir = file.GetPath(); 4330 + path = fileDialog.GetPath(); 4331 + FILE *out = fopen(path.ToUTF8(), "wb"); 4332 + if (out == NULL) 4333 + wxMessageBox(wxT("ERROR: unable to create:\n\n\"") + path + wxT("\""), 4334 + wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 4335 + else 4336 + { 4337 + char *xml = Style->CreateXmlStyle(); 4338 + fwrite(xml, 1, strlen(xml), out); 4339 + sqlite3_free(xml); 4340 + fclose(out); 4341 + wxMessageBox(wxT 4342 + ("SLD/SE QuickStyle successfully saved into:\n\n\"") 4343 + + path + wxT("\""), wxT("spatialite_gui"), 4344 + wxOK | wxICON_INFORMATION, this); 4345 + } 4346 + } 4347 +} 4348 + 4349 +void QuickStyleTopologyDialog::OnCopy(wxCommandEvent & WXUNUSED(event)) 4350 +{ 4351 +// 4352 +// Copying the Quick Style into the Clipboard 4353 +// 4354 + bool ret = false; 4355 + int idx = GetBookCtrl()->GetSelection(); 4356 + if (idx == 0) 4357 + ret = RetrieveMainPage(); 4358 + else if (idx == 1) 4359 + ret = RetrieveNodePage(); 4360 + else if (idx == 2) 4361 + ret = RetrieveEdgeLinkPage(); 4362 + else 4363 + { 4364 + if (Type == MAP_LAYER_NETWORK) 4365 + { 4366 + if (idx == 3) 4367 + ret = RetrieveEdgeLinkSeedPage(); 4368 + } else 4369 + { 4370 + if (idx == 3) 4371 + ret = RetrieveFacePage(); 4372 + if (idx == 4) 4373 + ret = RetrieveEdgeLinkSeedPage(); 4374 + if (idx == 5) 4375 + ret = RetrieveFaceSeedPage(); 4376 + } 4377 + } 4378 + if (ret == false) 4379 + return; 4380 + 4381 + char *xml = Style->CreateXmlStyle(); 4382 + wxString XMLstring = wxString::FromUTF8(xml); 4383 + sqlite3_free(xml); 4384 + if (wxTheClipboard->Open()) 4385 + { 4386 + wxTheClipboard->SetData(new wxTextDataObject(XMLstring)); 4387 + wxTheClipboard->Close(); 4388 + } 4389 +} 4390 + 4391 +void QuickStyleTopologyDialog::OnQuit(wxCommandEvent & WXUNUSED(event)) 4392 +{ 4393 +// 4394 +// all done: 4395 +// 4396 + wxDialog::EndModal(wxID_CANCEL); 4397 +}
Added QuickStylesVector.cpp.
1 +/* 2 +/ QuickStylesVector.cpp 3 +/ Quick Styles wizards (Vector layers) 4 +/ 5 +/ version 2.0, 2017 May 26 6 +/ 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 +/ 9 +/ Copyright (C) 2017 Alessandro Furieri 10 +/ 11 +/ This program is free software: you can redistribute it and/or modify 12 +/ it under the terms of the GNU General Public License as published by 13 +/ the Free Software Foundation, either version 3 of the License, or 14 +/ (at your option) any later version. 15 +/ 16 +/ This program is distributed in the hope that it will be useful, 17 +/ but WITHOUT ANY WARRANTY; without even the implied warranty of 18 +/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 +/ GNU General Public License for more details. 20 +/ 21 +/ You should have received a copy of the GNU General Public License 22 +/ along with this program. If not, see <http://www.gnu.org/licenses/>. 23 +/ 24 +*/ 25 + 26 +#include "Classdef.h" 27 + 28 +#include "wx/spinctrl.h" 29 +#include "wx/imaglist.h" 30 +#include "wx/colordlg.h" 31 +#include "wx/filename.h" 32 +#include "wx/clipbrd.h" 33 + 34 +QuickStyleObj::QuickStyleObj(int type) 35 +{ 36 +// ctor 37 + DoGetUUID(UUID); 38 + Type = type; 39 + MinScaleEnabled = false; 40 + MaxScaleEnabled = false; 41 + ScaleMin = 0.0; 42 + ScaleMax = 0.0; 43 + SymbolOpacity = 1.0; 44 + SymbolSize = 16; 45 + SymbolRotation = 0.0; 46 + SymbolAnchorX = 0.5; 47 + SymbolAnchorY = 0.5; 48 + SymbolDisplacementX = 0.0; 49 + SymbolDisplacementY = 0.0; 50 + SymbolWellKnownMark = RandomWellKnownMark(); 51 + RandomColor(SymbolFillColor); 52 + RandomColor(SymbolStrokeColor); 53 + LineOpacity = 1.0; 54 + LinePerpendicularOffset = 0.0; 55 + LineStrokeWidth = 1.0; 56 + RandomColor(LineStrokeColor); 57 + LineDotStyle = QUICK_STYLE_SOLID_LINE; 58 + PolygonFill = true; 59 + PolygonStroke = true; 60 + PolygonDisplacementX = 0.0; 61 + PolygonDisplacementY = 0.0; 62 + PolygonPerpendicularOffset = 0.0; 63 + PolygonFillOpacity = 1.0; 64 + RandomColor(PolygonFillColor); 65 + PolygonStrokeOpacity = 1.0; 66 + PolygonStrokeWidth = 1.0; 67 + RandomColor(PolygonStrokeColor); 68 + LabelLinePlacement = true; 69 + LabelPrint = false; 70 + LabelColumn = NULL; 71 + FontFacename = NULL; 72 + FontSize = 10.0; 73 + FontStyle = RL2_FONTSTYLE_NORMAL; 74 + FontWeight = RL2_FONTWEIGHT_NORMAL; 75 + FontOpacity = 1.0; 76 + strcpy(FontColor, "#000000"); 77 + HasHalo = false; 78 + HaloRadius = 1.0; 79 + HaloOpacity = 1.0; 80 + strcpy(HaloColor, "#ffffff"); 81 + LabelAnchorX = 0.5; 82 + LabelAnchorY = 0.5; 83 + LabelDisplacementX = 0.0; 84 + LabelDisplacementY = 0.0; 85 + LabelRotation = 0.0; 86 + LabelPerpendicularOffset = 0.0; 87 + RepeatedLabel = false; 88 + LabelInitialGap = 0.0; 89 + LabelGap = 0.0; 90 + LabelIsAligned = false; 91 + LabelGeneralizeLine = false; 92 + XmlStyle = NULL; 93 +} 94 + 95 +QuickStyleObj *QuickStyleObj::Clone() 96 +{ 97 +// 98 +// cloning a Quick Style 99 +// 100 + QuickStyleObj *Style = new QuickStyleObj(this->Type); 101 + strcpy(Style->UUID, this->UUID); 102 + Style->MinScaleEnabled = this->MinScaleEnabled; 103 + Style->MaxScaleEnabled = this->MaxScaleEnabled; 104 + Style->ScaleMin = this->ScaleMin; 105 + Style->ScaleMax = this->ScaleMax; 106 + Style->SymbolOpacity = this->SymbolOpacity; 107 + Style->SymbolSize = this->SymbolSize; 108 + Style->SymbolRotation = this->SymbolRotation; 109 + Style->SymbolAnchorX = this->SymbolAnchorX; 110 + Style->SymbolAnchorY = this->SymbolAnchorY; 111 + Style->SymbolDisplacementX = this->SymbolDisplacementX; 112 + Style->SymbolDisplacementY = this->SymbolDisplacementY; 113 + Style->SymbolWellKnownMark = this->SymbolWellKnownMark; 114 + strcpy(Style->SymbolFillColor, this->SymbolFillColor); 115 + strcpy(Style->SymbolStrokeColor, this->SymbolStrokeColor); 116 + Style->LineOpacity = this->LineOpacity; 117 + Style->LinePerpendicularOffset = this->LinePerpendicularOffset; 118 + Style->LineStrokeWidth = this->LineStrokeWidth; 119 + strcpy(Style->LineStrokeColor, this->LineStrokeColor); 120 + Style->LineDotStyle = this->LineDotStyle; 121 + Style->PolygonFill = this->PolygonFill; 122 + Style->PolygonStroke = this->PolygonStroke; 123 + Style->PolygonDisplacementX = this->PolygonDisplacementX; 124 + Style->PolygonDisplacementY = this->PolygonDisplacementY; 125 + Style->PolygonPerpendicularOffset = this->PolygonPerpendicularOffset; 126 + Style->PolygonFillOpacity = this->PolygonFillOpacity; 127 + strcpy(Style->PolygonFillColor, this->PolygonFillColor); 128 + Style->PolygonStrokeOpacity = this->PolygonStrokeOpacity; 129 + Style->PolygonStrokeWidth = this->PolygonStrokeWidth; 130 + strcpy(Style->PolygonStrokeColor, this->PolygonStrokeColor); 131 + Style->LabelLinePlacement = this->LabelLinePlacement; 132 + Style->LabelPrint = this->LabelPrint; 133 + if (this->LabelColumn == NULL) 134 + Style->LabelColumn = NULL; 135 + else 136 + { 137 + int len = strlen(this->LabelColumn); 138 + Style->LabelColumn = (char *) malloc(len + 1); 139 + strcpy(Style->LabelColumn, this->LabelColumn); 140 + } 141 + if (this->FontFacename == NULL) 142 + Style->FontFacename = NULL; 143 + else 144 + { 145 + int len = strlen(this->FontFacename); 146 + Style->FontFacename = (char *) malloc(len + 1); 147 + strcpy(Style->FontFacename, this->FontFacename); 148 + } 149 + Style->FontSize = this->FontSize; 150 + Style->FontStyle = this->FontStyle; 151 + Style->FontWeight = this->FontWeight; 152 + Style->FontOpacity = this->FontOpacity; 153 + strcpy(Style->FontColor, this->FontColor); 154 + Style->HasHalo = this->HasHalo; 155 + Style->HaloRadius = this->HaloRadius; 156 + Style->HaloOpacity = this->HaloOpacity; 157 + strcpy(Style->HaloColor, this->HaloColor); 158 + Style->LabelAnchorX = this->LabelAnchorX; 159 + Style->LabelAnchorY = this->LabelAnchorY; 160 + Style->LabelDisplacementX = this->LabelDisplacementX; 161 + Style->LabelDisplacementY = this->LabelDisplacementY; 162 + Style->LabelRotation = this->LabelRotation; 163 + Style->LabelPerpendicularOffset = this->LabelPerpendicularOffset; 164 + Style->RepeatedLabel = this->RepeatedLabel; 165 + Style->LabelInitialGap = this->LabelInitialGap; 166 + Style->LabelGap = this->LabelGap; 167 + Style->LabelIsAligned = this->LabelIsAligned; 168 + Style->LabelGeneralizeLine = this->LabelGeneralizeLine; 169 + Style->XmlStyle = NULL; 170 + return Style; 171 +} 172 + 173 +bool QuickStyleObj::Compare(QuickStyleObj * Style) 174 +{ 175 +// 176 +// comparing two Quick Style objects 177 +// 178 + if (Style == NULL) 179 + return false; 180 + if (strcmp(Style->UUID, this->UUID) != 0) 181 + return false; 182 + if (Style->MinScaleEnabled != this->MinScaleEnabled) 183 + return false; 184 + if (Style->MaxScaleEnabled != this->MaxScaleEnabled) 185 + return false; 186 + if (Style->ScaleMin != this->ScaleMin) 187 + return false; 188 + if (Style->ScaleMax != this->ScaleMax) 189 + return false; 190 + if (Style->SymbolOpacity != this->SymbolOpacity) 191 + return false; 192 + if (Style->SymbolSize != this->SymbolSize) 193 + return false; 194 + if (Style->SymbolRotation != this->SymbolRotation) 195 + return false; 196 + if (Style->SymbolAnchorX != this->SymbolAnchorX) 197 + return false; 198 + if (Style->SymbolAnchorY != this->SymbolAnchorY) 199 + return false; 200 + if (Style->SymbolDisplacementX != this->SymbolDisplacementX) 201 + return false; 202 + if (Style->SymbolDisplacementY != this->SymbolDisplacementY) 203 + return false; 204 + if (Style->SymbolWellKnownMark != this->SymbolWellKnownMark) 205 + return false; 206 + if (strcmp(Style->SymbolFillColor, this->SymbolFillColor) != 0) 207 + return false; 208 + if (strcmp(Style->SymbolStrokeColor, this->SymbolStrokeColor) != 0) 209 + return false; 210 + if (Style->LineOpacity != this->LineOpacity) 211 + return false; 212 + if (Style->LinePerpendicularOffset != this->LinePerpendicularOffset) 213 + return false; 214 + if (Style->LineStrokeWidth != this->LineStrokeWidth) 215 + return false; 216 + if (strcmp(Style->LineStrokeColor, this->LineStrokeColor) != 0) 217 + return false; 218 + if (Style->LineDotStyle != this->LineDotStyle) 219 + return false; 220 + if (Style->PolygonFill != this->PolygonFill) 221 + return false; 222 + if (Style->PolygonStroke != this->PolygonStroke) 223 + return false; 224 + if (Style->PolygonDisplacementX != this->PolygonDisplacementX) 225 + return false; 226 + if (Style->PolygonDisplacementY != this->PolygonDisplacementY) 227 + return false; 228 + if (Style->PolygonPerpendicularOffset != this->PolygonPerpendicularOffset) 229 + return false; 230 + if (Style->PolygonFillOpacity != this->PolygonFillOpacity) 231 + return false; 232 + if (strcmp(Style->PolygonFillColor, this->PolygonFillColor) != 0) 233 + return false; 234 + if (Style->PolygonStrokeOpacity != this->PolygonStrokeOpacity) 235 + return false; 236 + if (Style->PolygonStrokeWidth != this->PolygonStrokeWidth) 237 + return false; 238 + if (strcmp(Style->PolygonStrokeColor, this->PolygonStrokeColor) != 0) 239 + return false; 240 + if (Style->LabelLinePlacement != this->LabelLinePlacement) 241 + return false; 242 + if (Style->LabelPrint != this->LabelPrint) 243 + return false; 244 + if (Style->LabelColumn == NULL && this->LabelColumn == NULL) 245 + ; 246 + else if (Style->LabelColumn == NULL && this->LabelColumn != NULL) 247 + return false; 248 + else if (Style->LabelColumn != NULL && this->LabelColumn == NULL) 249 + return false; 250 + else if (strcmp(Style->LabelColumn, this->LabelColumn) != 0) 251 + return false; 252 + if (Style->FontFacename == NULL && this->FontFacename == NULL) 253 + ; 254 + else if (Style->FontFacename == NULL && this->FontFacename != NULL) 255 + return false; 256 + else if (Style->FontFacename != NULL && this->FontFacename == NULL) 257 + return false; 258 + else if (strcmp(Style->FontFacename, this->FontFacename) != 0) 259 + return false; 260 + if (Style->FontSize != this->FontSize) 261 + return false; 262 + if (Style->FontStyle != this->FontStyle) 263 + return false; 264 + if (Style->FontWeight != this->FontWeight) 265 + return false; 266 + if (Style->FontOpacity != this->FontOpacity) 267 + return false; 268 + if (strcmp(Style->FontColor, this->FontColor) != 0) 269 + return false; 270 + if (Style->HasHalo != this->HasHalo) 271 + return false; 272 + if (Style->HaloRadius != this->HaloRadius) 273 + return false; 274 + if (Style->HaloOpacity != this->HaloOpacity) 275 + return false; 276 + if (strcmp(Style->HaloColor, this->HaloColor) != 0) 277 + return false; 278 + if (Style->LabelAnchorX != this->LabelAnchorX) 279 + return false; 280 + if (Style->LabelAnchorY != this->LabelAnchorY) 281 + return false; 282 + if (Style->LabelDisplacementX != this->LabelDisplacementX) 283 + return false; 284 + if (Style->LabelDisplacementY != this->LabelDisplacementY) 285 + return false; 286 + if (Style->LabelRotation != this->LabelRotation) 287 + return false; 288 + if (Style->LabelPerpendicularOffset != this->LabelPerpendicularOffset) 289 + return false; 290 + if (Style->RepeatedLabel != this->RepeatedLabel) 291 + return false; 292 + if (Style->LabelInitialGap != this->LabelInitialGap) 293 + return false; 294 + if (Style->LabelGap != this->LabelGap) 295 + return false; 296 + if (Style->LabelIsAligned != this->LabelIsAligned) 297 + return false; 298 + if (Style->LabelGeneralizeLine != this->LabelGeneralizeLine) 299 + return false; 300 + return true; 301 +} 302 + 303 +void QuickStyleObj::SetLabelColumn(const char *x) 304 +{ 305 +// 306 +// setting the Label Column 307 +// 308 + int len; 309 + if (LabelColumn != NULL) 310 + free(LabelColumn); 311 + LabelColumn = NULL; 312 + if (x == NULL) 313 + return; 314 + len = strlen(x); 315 + LabelColumn = (char *) malloc(len + 1); 316 + strcpy(LabelColumn, x); 317 +} 318 + 319 +void QuickStyleObj::SetFontFacename(const char *x) 320 +{ 321 +// 322 +// setting the Font Facename 323 +// 324 + int len; 325 + if (FontFacename != NULL) 326 + free(FontFacename); 327 + FontFacename = NULL; 328 + if (x == NULL) 329 + return; 330 + len = strlen(x); 331 + FontFacename = (char *) malloc(len + 1); 332 + strcpy(FontFacename, x); 333 +} 334 + 335 +void QuickStyleObj::UpdateXmlStyle() 336 +{ 337 +// 338 +// updating the XML Style 339 +// 340 + if (XmlStyle != NULL) 341 + sqlite3_free(XmlStyle); 342 + XmlStyle = CreateXmlStyle(); 343 +} 344 + 345 +char *QuickStyleObj::CreateXmlStyle() 346 +{ 347 +// 348 +// creating the XML Style 349 +// 350 + char *xml; 351 + if ((MinScaleEnabled == true || MaxScaleEnabled == true) || LabelPrint == true 352 + || Type == QUICK_STYLE_GEOMETRY) 353 + xml = DoCreateFeatureTypeXML(); 354 + else 355 + xml = DoCreateSymbolizerXML(false); 356 + return xml; 357 + 358 +} 359 + 360 +char *QuickStyleObj::DoCreateFeatureTypeXML() 361 +{ 362 +// 363 +// creating a FeatureType XML Style 364 +// 365 + char *prev; 366 + char *xml2; 367 + char *xml = sqlite3_mprintf("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"); 368 + prev = xml; 369 + xml = sqlite3_mprintf("%s<FeatureTypeStyle version=\"1.1.0\" ", prev); 370 + sqlite3_free(prev); 371 + prev = xml; 372 + xml = 373 + sqlite3_mprintf 374 + ("%sxsi:schemaLocation=\"http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/FeatureStyle.xsd\" ", 375 + prev); 376 + sqlite3_free(prev); 377 + prev = xml; 378 + xml = sqlite3_mprintf 379 + ("%sxmlns=\"http://www.opengis.net/se\" xmlns:ogc=\"http://www.opengis.net/ogc\" ", 380 + prev); 381 + sqlite3_free(prev); 382 + prev = xml; 383 + xml = 384 + sqlite3_mprintf("%sxmlns:xlink=\"http://www.w3.org/1999/xlink\" ", prev); 385 + sqlite3_free(prev); 386 + prev = xml; 387 + xml = 388 + sqlite3_mprintf 389 + ("%sxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n", prev); 390 + sqlite3_free(prev); 391 + prev = xml; 392 + xml = sqlite3_mprintf("%s\t<Name>%s</Name>\r\n", prev, UUID); 393 + sqlite3_free(prev); 394 + prev = xml; 395 + xml = sqlite3_mprintf("%s\t<Description>\r\n", prev); 396 + sqlite3_free(prev); 397 + prev = xml; 398 + xml = sqlite3_mprintf("%s\t\t<Title>%s</Title>\r\n", prev, "Quick Style"); 399 + sqlite3_free(prev); 400 + prev = xml; 401 + xml = 402 + sqlite3_mprintf("%s\t\t<Abstract>%s</Abstract>\r\n", prev, 403 + "Created by SpatialiteGUI"); 404 + sqlite3_free(prev); 405 + prev = xml; 406 + xml = sqlite3_mprintf("%s\t</Description>\r\n", prev); 407 + sqlite3_free(prev); 408 + prev = xml; 409 + xml = sqlite3_mprintf("%s\t<Rule>\r\n", prev); 410 + sqlite3_free(prev); 411 + prev = xml; 412 + if (MinScaleEnabled == true) 413 + { 414 + xml = 415 + sqlite3_mprintf 416 + ("%s\t\t<MinScaleDenominator>%1.2f</MinScaleDenominator>\r\n", prev, 417 + ScaleMin); 418 + sqlite3_free(prev); 419 + prev = xml; 420 + } 421 + if (MaxScaleEnabled == true) 422 + { 423 + xml = 424 + sqlite3_mprintf 425 + ("%s\t\t<MaxScaleDenominator>%1.2f</MaxScaleDenominator>\r\n", prev, 426 + ScaleMax); 427 + sqlite3_free(prev); 428 + prev = xml; 429 + } 430 + xml2 = NULL; 431 + if (Type == QUICK_STYLE_POINT) 432 + xml2 = DoCreatePointSymbolizerXML(true); 433 + if (Type == QUICK_STYLE_LINE) 434 + xml2 = DoCreateLineSymbolizerXML(true); 435 + if (Type == QUICK_STYLE_POLYGON) 436 + xml2 = DoCreatePolygonSymbolizerXML(true); 437 + else 438 + { 439 + // mixed-type Symbolizers 440 + xml2 = DoCreatePointSymbolizerXML(true); 441 + if (xml2 != NULL) 442 + { 443 + xml = sqlite3_mprintf("%s%s", prev, xml2); 444 + sqlite3_free(prev); 445 + sqlite3_free(xml2); 446 + prev = xml; 447 + } 448 + xml2 = DoCreateLineSymbolizerXML(true); 449 + if (xml2 != NULL) 450 + { 451 + xml = sqlite3_mprintf("%s%s", prev, xml2); 452 + sqlite3_free(prev); 453 + sqlite3_free(xml2); 454 + prev = xml; 455 + } 456 + xml2 = DoCreatePolygonSymbolizerXML(true); 457 + if (xml2 != NULL) 458 + { 459 + xml = sqlite3_mprintf("%s%s", prev, xml2); 460 + sqlite3_free(prev); 461 + sqlite3_free(xml2); 462 + xml2 = NULL; 463 + prev = xml; 464 + } 465 + } 466 + if (xml2 != NULL) 467 + { 468 + xml = sqlite3_mprintf("%s%s", prev, xml2); 469 + sqlite3_free(prev); 470 + sqlite3_free(xml2); 471 + prev = xml; 472 + } 473 + if (LabelPrint == true) 474 + { 475 + // adding a Text Symbolizer 476 + xml2 = NULL; 477 + if (Type == QUICK_STYLE_POINT || Type == QUICK_STYLE_POLYGON) 478 + xml2 = DoCreateTextPointSymbolizerXML(); 479 + if (Type == QUICK_STYLE_LINE) 480 + xml2 = DoCreateTextLineSymbolizerXML(); 481 + if (xml2 != NULL) 482 + { 483 + xml = sqlite3_mprintf("%s%s", prev, xml2); 484 + sqlite3_free(prev); 485 + sqlite3_free(xml2); 486 + prev = xml; 487 + } 488 + } 489 + xml = sqlite3_mprintf("%s\t</Rule>\r\n</FeatureTypeStyle>\r\n", prev); 490 + sqlite3_free(prev); 491 + return xml; 492 +} 493 + 494 +char *QuickStyleObj::DoCreateSymbolizerXML(bool subordered) 495 +{ 496 +// 497 +// creating a Symbolizer XML Style 498 +// 499 + if (Type == QUICK_STYLE_POINT) 500 + return DoCreatePointSymbolizerXML(subordered); 501 + if (Type == QUICK_STYLE_LINE) 502 + return DoCreateLineSymbolizerXML(subordered); 503 + if (Type == QUICK_STYLE_POLYGON) 504 + return DoCreatePolygonSymbolizerXML(subordered); 505 + return NULL; 506 +} 507 + 508 +char *QuickStyleObj::DoCreatePointSymbolizerXML(bool subordered) 509 +{ 510 +// 511 +// creating a Point Symbolizer XML Style 512 +// 513 + const char *cstr; 514 + char *prev; 515 + const char *extra = ""; 516 + char *xml = sqlite3_mprintf("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"); 517 + if (subordered == true) 518 + { 519 + extra = "\t\t"; 520 + sqlite3_free(xml); 521 + prev = (char *) ""; 522 + xml = sqlite3_mprintf("%s%s<PointSymbolizer>\r\n", prev, extra); 523 + } else 524 + { 525 + prev = xml; 526 + xml = sqlite3_mprintf("%s<PointSymbolizer version=\"1.1.0\" ", prev); 527 + sqlite3_free(prev); 528 + prev = xml; 529 + xml = 530 + sqlite3_mprintf 531 + ("%sxsi:schemaLocation=\"http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd\" ", 532 + prev); 533 + sqlite3_free(prev); 534 + prev = xml; 535 + xml = sqlite3_mprintf 536 + ("%sxmlns=\"http://www.opengis.net/se\" xmlns:ogc=\"http://www.opengis.net/ogc\" ", 537 + prev); 538 + sqlite3_free(prev); 539 + prev = xml; 540 + xml = 541 + sqlite3_mprintf("%sxmlns:xlink=\"http://www.w3.org/1999/xlink\" ", 542 + prev); 543 + sqlite3_free(prev); 544 + prev = xml; 545 + cstr = "http://www.opengeospatial.org/se/units/pixel"; 546 + xml = 547 + sqlite3_mprintf 548 + ("%sxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" uom=\"%s\">\r\n", 549 + prev, cstr); 550 + sqlite3_free(prev); 551 + } 552 + prev = xml; 553 + if (subordered != true) 554 + { 555 + xml = sqlite3_mprintf("%s\t<Name>%s</Name>\r\n", prev, UUID); 556 + sqlite3_free(prev); 557 + prev = xml; 558 + xml = sqlite3_mprintf("%s\t<Description>\r\n", prev); 559 + sqlite3_free(prev); 560 + prev = xml; 561 + xml = 562 + sqlite3_mprintf("%s\t\t<Title>%s</Title>\r\n", prev, 563 + "Quick Style - PointSymbolizer"); 564 + sqlite3_free(prev); 565 + prev = xml; 566 + xml = 567 + sqlite3_mprintf("%s\t\t<Abstract>%s</Abstract>\r\n", prev, 568 + "Created by SpatialiteGUI"); 569 + sqlite3_free(prev); 570 + prev = xml; 571 + xml = sqlite3_mprintf("%s\t</Description>\r\n", prev); 572 + sqlite3_free(prev); 573 + prev = xml; 574 + } 575 + xml = sqlite3_mprintf("%s%s\t<Graphic>\r\n", prev, extra); 576 + sqlite3_free(prev); 577 + prev = xml; 578 +// mark symbol 579 + xml = sqlite3_mprintf("%s%s\t\t<Mark>\r\n", prev, extra); 580 + sqlite3_free(prev); 581 + prev = xml; 582 + switch (SymbolWellKnownMark) 583 + { 584 + case RL2_GRAPHIC_MARK_CIRCLE: 585 + cstr = "circle"; 586 + break; 587 + case RL2_GRAPHIC_MARK_TRIANGLE: 588 + cstr = "triangle"; 589 + break; 590 + case RL2_GRAPHIC_MARK_STAR: 591 + cstr = "star"; 592 + break; 593 + case RL2_GRAPHIC_MARK_CROSS: 594 + cstr = "cross"; 595 + break; 596 + case RL2_GRAPHIC_MARK_X: 597 + cstr = "x"; 598 + break; 599 + default: 600 + cstr = "square"; 601 + break; 602 + }; 603 + xml = 604 + sqlite3_mprintf("%s%s\t\t\t<WellKnownName>%s</WellKnownName>\r\n", prev, 605 + extra, cstr); 606 + sqlite3_free(prev); 607 + prev = xml; 608 +// Mark Fill 609 + xml = sqlite3_mprintf("%s%s\t\t\t<Fill>\r\n", prev, extra); 610 + sqlite3_free(prev); 611 + prev = xml; 612 + xml = 613 + sqlite3_mprintf 614 + ("%s%s\t\t\t\t<SvgParameter name=\"fill\">%s</SvgParameter>\r\n", 615 + prev, extra, SymbolFillColor); 616 + sqlite3_free(prev); 617 + prev = xml; 618 + xml = sqlite3_mprintf("%s%s\t\t\t</Fill>\r\n", prev, extra); 619 + sqlite3_free(prev); 620 + prev = xml; 621 +// Mark Stroke 622 + xml = sqlite3_mprintf("%s%s\t\t\t<Stroke>\r\n", prev, extra); 623 + sqlite3_free(prev); 624 + prev = xml; 625 + xml = 626 + sqlite3_mprintf 627 + ("%s%s\t\t\t\t<SvgParameter name=\"stroke\">%s</SvgParameter>\r\n", 628 + prev, extra, SymbolStrokeColor); 629 + sqlite3_free(prev); 630 + prev = xml; 631 + xml = 632 + sqlite3_mprintf 633 + ("%s%s\t\t\t\t<SvgParameter name=\"stroke-width\">%1.2f</SvgParameter>\r\n", 634 + prev, extra, 1.0); 635 + sqlite3_free(prev); 636 + prev = xml; 637 + xml = 638 + sqlite3_mprintf 639 + ("%s%s\t\t\t\t<SvgParameter name=\"stroke-linejoin\">round</SvgParameter>\r\n", 640 + prev, extra); 641 + sqlite3_free(prev); 642 + prev = xml; 643 + xml = 644 + sqlite3_mprintf 645 + ("%s%s\t\t\t\t<SvgParameter name=\"stroke-linecap\">round</SvgParameter>\r\n", 646 + prev, extra); 647 + sqlite3_free(prev); 648 + prev = xml; 649 + xml = sqlite3_mprintf("%s%s\t\t\t</Stroke>\r\n", prev, extra); 650 + sqlite3_free(prev); 651 + prev = xml; 652 + xml = sqlite3_mprintf("%s%s\t\t</Mark>\r\n", prev, extra); 653 + sqlite3_free(prev); 654 + prev = xml; 655 + if (SymbolOpacity != 1.0) 656 + { 657 + xml = 658 + sqlite3_mprintf("%s%s\t\t<Opacity>%1.2f</Opacity>\r\n", prev, extra, 659 + SymbolOpacity); 660 + sqlite3_free(prev); 661 + prev = xml; 662 + } 663 + xml = 664 + sqlite3_mprintf("%s%s\t\t<Size>%1.2f</Size>\r\n", prev, extra, SymbolSize); 665 + sqlite3_free(prev); 666 + prev = xml; 667 + if (SymbolRotation != 0.0) 668 + { 669 + xml = 670 + sqlite3_mprintf("%s%s\t\t<Rotation>%1.2f</Rotation>\r\n", prev, extra, 671 + SymbolRotation); 672 + sqlite3_free(prev); 673 + prev = xml; 674 + } 675 + if (SymbolAnchorX != 0.5 || SymbolAnchorY != 0.5) 676 + { 677 + xml = sqlite3_mprintf("%s%s\t\t<AnchorPoint>\r\n", prev, extra); 678 + sqlite3_free(prev); 679 + prev = xml; 680 + xml = 681 + sqlite3_mprintf("%s%s\t\t\t<AnchorPointX>%1.4f</AnchorPointX>\r\n", 682 + prev, extra, SymbolAnchorX); 683 + sqlite3_free(prev); 684 + prev = xml; 685 + xml = 686 + sqlite3_mprintf("%s%s\t\t\t<AnchorPointY>%1.4f</AnchorPointY>\r\n", 687 + prev, extra, SymbolAnchorY); 688 + sqlite3_free(prev); 689 + prev = xml; 690 + xml = sqlite3_mprintf("%s%s\t\t</AnchorPoint>\r\n", prev, extra); 691 + sqlite3_free(prev); 692 + prev = xml; 693 + } 694 + if (SymbolDisplacementX != 0.0 || SymbolDisplacementY != 0.0) 695 + { 696 + xml = sqlite3_mprintf("%s%s\t\t<Displacement>\r\n", prev, extra); 697 + sqlite3_free(prev); 698 + prev = xml; 699 + xml = 700 + sqlite3_mprintf("%s%s\t\t\t<DisplacementX>%1.4f</DisplacementX>\r\n", 701 + prev, extra, SymbolDisplacementX); 702 + sqlite3_free(prev); 703 + prev = xml; 704 + xml = 705 + sqlite3_mprintf("%s%s\t\t\t<DisplacementY>%1.4f</DisplacementY>\r\n", 706 + prev, extra, SymbolDisplacementY); 707 + sqlite3_free(prev); 708 + prev = xml; 709 + xml = sqlite3_mprintf("%s%s\t\t</Displacement>\r\n", prev, extra); 710 + sqlite3_free(prev); 711 + prev = xml; 712 + } 713 + xml = sqlite3_mprintf("%s%s\t</Graphic>\r\n", prev, extra); 714 + sqlite3_free(prev); 715 + prev = xml; 716 + xml = sqlite3_mprintf("%s%s</PointSymbolizer>\r\n", prev, extra); 717 + sqlite3_free(prev); 718 + return xml; 719 +} 720 + 721 +char *QuickStyleObj::DoCreateLineSymbolizerXML(bool subordered) 722 +{ 723 +// 724 +// creating a Line Symbolizer XML Style 725 +// 726 + const char *cstr; 727 + char *prev; 728 + const char *extra = ""; 729 + char *xml = sqlite3_mprintf("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"); 730 + prev = xml; 731 + if (subordered == true) 732 + { 733 + extra = "\t\t"; 734 + sqlite3_free(xml); 735 + prev = (char *) ""; 736 + xml = sqlite3_mprintf("%s%s<LineSymbolizer>\r\n", prev, extra); 737 + } else 738 + { 739 + xml = sqlite3_mprintf("%s<LineSymbolizer version=\"1.1.0\" ", prev); 740 + sqlite3_free(prev); 741 + prev = xml; 742 + xml = 743 + sqlite3_mprintf 744 + ("%sxsi:schemaLocation=\"http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd\" ", 745 + prev); 746 + sqlite3_free(prev); 747 + prev = xml; 748 + xml = sqlite3_mprintf 749 + ("%sxmlns=\"http://www.opengis.net/se\" xmlns:ogc=\"http://www.opengis.net/ogc\" ", 750 + prev); 751 + sqlite3_free(prev); 752 + prev = xml; 753 + xml = 754 + sqlite3_mprintf("%sxmlns:xlink=\"http://www.w3.org/1999/xlink\" ", 755 + prev); 756 + sqlite3_free(prev); 757 + prev = xml; 758 + cstr = "http://www.opengeospatial.org/se/units/pixel"; 759 + xml = 760 + sqlite3_mprintf 761 + ("%sxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" uom=\"%s\">\r\n", 762 + prev, cstr); 763 + sqlite3_free(prev); 764 + } 765 + prev = xml; 766 + if (subordered != true) 767 + { 768 + xml = sqlite3_mprintf("%s\t<Name>%s</Name>\r\n", prev, UUID); 769 + sqlite3_free(prev); 770 + prev = xml; 771 + xml = sqlite3_mprintf("%s\t<Description>\r\n", prev); 772 + sqlite3_free(prev); 773 + prev = xml; 774 + xml = 775 + sqlite3_mprintf("%s\t\t<Title>%s</Title>\r\n", prev, 776 + "Quick Style - LineSymbolizer"); 777 + sqlite3_free(prev); 778 + prev = xml; 779 + xml = 780 + sqlite3_mprintf("%s\t\t<Abstract>%s</Abstract>\r\n", prev, 781 + "Created by SpatialiteGUI"); 782 + sqlite3_free(prev); 783 + prev = xml; 784 + xml = sqlite3_mprintf("%s\t</Description>\r\n", prev); 785 + sqlite3_free(prev); 786 + prev = xml; 787 + } 788 + xml = sqlite3_mprintf("%s%s\t<Stroke>\r\n", prev, extra); 789 + sqlite3_free(prev); 790 + prev = xml; 791 +// using a Solid Color 792 + xml = 793 + sqlite3_mprintf 794 + ("%s%s\t\t<SvgParameter name=\"stroke\">%s</SvgParameter>\r\n", prev, extra, 795 + LineStrokeColor); 796 + sqlite3_free(prev); 797 + prev = xml; 798 + xml = 799 + sqlite3_mprintf 800 + ("%s%s\t\t<SvgParameter name=\"stroke-opacity\">%1.2f</SvgParameter>\r\n", 801 + prev, extra, LineOpacity); 802 + sqlite3_free(prev); 803 + prev = xml; 804 + xml = 805 + sqlite3_mprintf 806 + ("%s%s\t\t<SvgParameter name=\"stroke-width\">%1.2f</SvgParameter>\r\n", 807 + prev, extra, LineStrokeWidth); 808 + sqlite3_free(prev); 809 + prev = xml; 810 + xml = 811 + sqlite3_mprintf 812 + ("%s%s\t\t<SvgParameter name=\"stroke-linejoin\">round</SvgParameter>\r\n", 813 + prev, extra); 814 + sqlite3_free(prev); 815 + prev = xml; 816 + xml = 817 + sqlite3_mprintf 818 + ("%s%s\t\t<SvgParameter name=\"stroke-linecap\">round</SvgParameter>\r\n", 819 + prev, extra); 820 + sqlite3_free(prev); 821 + prev = xml; 822 + const char *dashArray; 823 + switch (LineDotStyle) 824 + { 825 + case QUICK_STYLE_DOT_LINE: 826 + dashArray = "5.0, 10.0"; 827 + break; 828 + case QUICK_STYLE_DASH_LINE: 829 + dashArray = "20.0, 20.0"; 830 + break; 831 + case QUICK_STYLE_DASH_DOT_LINE: 832 + dashArray = "20.0, 10.0, 5.0, 10.0"; 833 + break; 834 + default: 835 + dashArray = NULL; 836 + break; 837 + }; 838 + if (dashArray != NULL) 839 + { 840 + xml = 841 + sqlite3_mprintf 842 + ("%s%s\t\t<SvgParameter name=\"stroke-dasharray\">%s</SvgParameter>\r\n", 843 + prev, extra, dashArray); 844 + sqlite3_free(prev); 845 + prev = xml; 846 + } 847 + xml = sqlite3_mprintf("%s%s\t</Stroke>\r\n", prev, extra); 848 + sqlite3_free(prev); 849 + prev = xml; 850 + if (LinePerpendicularOffset != 0.0) 851 + { 852 + xml = 853 + sqlite3_mprintf 854 + ("%s%s\t<PerpendicularOffset>%1.2f</PerpendicularOffset>\r\n", prev, 855 + extra, LinePerpendicularOffset); 856 + sqlite3_free(prev); 857 + prev = xml; 858 + } 859 + xml = sqlite3_mprintf("%s%s</LineSymbolizer>\r\n", prev, extra); 860 + sqlite3_free(prev); 861 + return xml; 862 +} 863 + 864 +char *QuickStyleObj::DoCreatePolygonSymbolizerXML(bool subordered) 865 +{ 866 +// 867 +// creating a Polygon Symbolizer XML Style 868 +// 869 + const char *cstr; 870 + char *prev; 871 + const char *extra = ""; 872 + char *xml = sqlite3_mprintf("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"); 873 + prev = xml; 874 + if (subordered == true) 875 + { 876 + extra = "\t\t"; 877 + sqlite3_free(xml); 878 + prev = (char *) ""; 879 + xml = sqlite3_mprintf("%s%s<PolygonSymbolizer>\r\n", prev, extra); 880 + } else 881 + { 882 + xml = sqlite3_mprintf("%s<PolygonSymbolizer version=\"1.1.0\" ", prev); 883 + sqlite3_free(prev); 884 + prev = xml; 885 + xml = 886 + sqlite3_mprintf 887 + ("%sxsi:schemaLocation=\"http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd\" ", 888 + prev); 889 + sqlite3_free(prev); 890 + prev = xml; 891 + xml = sqlite3_mprintf 892 + ("%sxmlns=\"http://www.opengis.net/se\" xmlns:ogc=\"http://www.opengis.net/ogc\" ", 893 + prev); 894 + sqlite3_free(prev); 895 + prev = xml; 896 + xml = 897 + sqlite3_mprintf("%sxmlns:xlink=\"http://www.w3.org/1999/xlink\" ", 898 + prev); 899 + sqlite3_free(prev); 900 + prev = xml; 901 + cstr = "http://www.opengeospatial.org/se/units/pixel"; 902 + xml = 903 + sqlite3_mprintf 904 + ("%sxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" uom=\"%s\">\r\n", 905 + prev, cstr); 906 + sqlite3_free(prev); 907 + } 908 + prev = xml; 909 + if (subordered != true) 910 + { 911 + xml = sqlite3_mprintf("%s\t<Name>%s</Name>\r\n", prev, UUID); 912 + sqlite3_free(prev); 913 + prev = xml; 914 + xml = sqlite3_mprintf("%s\t<Description>\r\n", prev); 915 + sqlite3_free(prev); 916 + prev = xml; 917 + xml = 918 + sqlite3_mprintf("%s\t\t<Title>%s</Title>\r\n", prev, 919 + "Quick Style - Polygon Symbolizer"); 920 + sqlite3_free(prev); 921 + prev = xml; 922 + xml = 923 + sqlite3_mprintf("%s\t\t<Abstract>%s</Abstract>\r\n", prev, 924 + "Created by SpatialiteGUI"); 925 + sqlite3_free(prev); 926 + prev = xml; 927 + xml = sqlite3_mprintf("%s\t</Description>\r\n", prev); 928 + sqlite3_free(prev); 929 + prev = xml; 930 + } 931 + if (PolygonFill == true) 932 + { 933 + // Polygon Fill 934 + xml = sqlite3_mprintf("%s%s\t<Fill>\r\n", prev, extra); 935 + sqlite3_free(prev); 936 + prev = xml; 937 + // using a Solid Color 938 + xml = 939 + sqlite3_mprintf 940 + ("%s%s\t\t<SvgParameter name=\"fill\">%s</SvgParameter>\r\n", prev, 941 + extra, PolygonFillColor); 942 + sqlite3_free(prev); 943 + prev = xml; 944 + xml = 945 + sqlite3_mprintf 946 + ("%s%s\t\t<SvgParameter name=\"fill-opacity\">%1.2f</SvgParameter>\r\n", 947 + prev, extra, PolygonFillOpacity); 948 + sqlite3_free(prev); 949 + prev = xml; 950 + xml = sqlite3_mprintf("%s%s\t</Fill>\r\n", prev, extra); 951 + sqlite3_free(prev); 952 + prev = xml; 953 + } 954 + if (PolygonStroke == true) 955 + { 956 + // Polygon Stroke 957 + xml = sqlite3_mprintf("%s%s\t<Stroke>\r\n", prev, extra); 958 + sqlite3_free(prev); 959 + prev = xml; 960 + // using a Solid Color 961 + xml = 962 + sqlite3_mprintf 963 + ("%s%s\t\t<SvgParameter name=\"stroke\">%s</SvgParameter>\r\n", prev, 964 + extra, PolygonStrokeColor); 965 + sqlite3_free(prev); 966 + prev = xml; 967 + xml = 968 + sqlite3_mprintf 969 + ("%s%s\t\t<SvgParameter name=\"stroke-opacity\">%1.2f</SvgParameter>\r\n", 970 + prev, extra, PolygonStrokeOpacity); 971 + sqlite3_free(prev); 972 + prev = xml; 973 + xml = 974 + sqlite3_mprintf 975 + ("%s%s\t\t<SvgParameter name=\"stroke-width\">%1.2f</SvgParameter>\r\n", 976 + prev, extra, PolygonStrokeWidth); 977 + sqlite3_free(prev); 978 + prev = xml; 979 + xml = 980 + sqlite3_mprintf 981 + ("%s%s\t\t<SvgParameter name=\"stroke-linejoin\">round</SvgParameter>\r\n", 982 + prev, extra); 983 + sqlite3_free(prev); 984 + prev = xml; 985 + xml = 986 + sqlite3_mprintf 987 + ("%s%s\t\t<SvgParameter name=\"stroke-linecap\">round</SvgParameter>\r\n", 988 + prev, extra); 989 + sqlite3_free(prev); 990 + prev = xml; 991 + xml = sqlite3_mprintf("%s%s\t</Stroke>\r\n", prev, extra); 992 + sqlite3_free(prev); 993 + prev = xml; 994 + } 995 + if (PolygonDisplacementX != 0.0 || PolygonDisplacementY != 0.0) 996 + { 997 + xml = sqlite3_mprintf("%s%s\t<Displacement>\r\n", prev, extra); 998 + sqlite3_free(prev); 999 + prev = xml; 1000 + xml = 1001 + sqlite3_mprintf("%s%s\t\t<DisplacementX>%1.4f</DisplacementX>\r\n", 1002 + prev, extra, PolygonDisplacementX); 1003 + sqlite3_free(prev); 1004 + prev = xml; 1005 + xml = 1006 + sqlite3_mprintf("%s%s\t\t<DisplacementY>%1.4f</DisplacementY>\r\n", 1007 + prev, extra, PolygonDisplacementY); 1008 + sqlite3_free(prev); 1009 + prev = xml; 1010 + xml = sqlite3_mprintf("%s%s\t</Displacement>\r\n", prev, extra); 1011 + sqlite3_free(prev); 1012 + prev = xml; 1013 + } 1014 + if (PolygonPerpendicularOffset != 0.0) 1015 + { 1016 + xml = 1017 + sqlite3_mprintf 1018 + ("%s%s\t<PerpendicularOffset>%1.4f</PerpendicularOffset>\r\n", prev, 1019 + extra, PolygonPerpendicularOffset); 1020 + sqlite3_free(prev); 1021 + prev = xml; 1022 + } 1023 + xml = sqlite3_mprintf("%s%s</PolygonSymbolizer>\r\n", prev, extra); 1024 + sqlite3_free(prev); 1025 + return xml; 1026 +} 1027 + 1028 +char *QuickStyleObj::DoCreateTextPointSymbolizerXML() 1029 +{ 1030 +// 1031 +// creating a Text Symbolizer (Point Placement) 1032 +// 1033 + char *xml; 1034 + char *prev; 1035 + xml = sqlite3_mprintf("\t\t<TextSymbolizer>\r\n"); 1036 + prev = xml; 1037 + xml = sqlite3_mprintf("%s\t\t\t<Label>@%s@</Label>\r\n", prev, LabelColumn); 1038 + sqlite3_free(prev); 1039 + prev = xml; 1040 + xml = sqlite3_mprintf("%s\t\t\t<Font>\r\n", prev); 1041 + sqlite3_free(prev); 1042 + prev = xml; 1043 + const char *font; 1044 + if (strcmp(FontFacename, "ToyFont: serif") == 0) 1045 + font = "serif"; 1046 + else if (strcmp(FontFacename, "ToyFont: sans-serif") == 0) 1047 + font = "sans serif"; 1048 + else if (strcmp(FontFacename, "ToyFont: monospace") == 0) 1049 + font = "monospace"; 1050 + else 1051 + font = FontFacename; 1052 + xml = 1053 + sqlite3_mprintf 1054 + ("%s\t\t\t\t<SvgParameter name=\"font-family\">%s</SvgParameter>\r\n", prev, 1055 + font); 1056 + sqlite3_free(prev); 1057 + prev = xml; 1058 + if (FontStyle == RL2_FONTSTYLE_ITALIC) 1059 + xml = 1060 + sqlite3_mprintf 1061 + ("%s\t\t\t\t<SvgParameter name=\"font-style\">italic</SvgParameter>\r\n", 1062 + prev); 1063 + else if (FontStyle == RL2_FONTSTYLE_OBLIQUE) 1064 + xml = 1065 + sqlite3_mprintf 1066 + ("%s\t\t\t\t<SvgParameter name=\"font-style\">oblique</SvgParameter>\r\n", 1067 + prev); 1068 + else 1069 + xml = 1070 + sqlite3_mprintf 1071 + ("%s\t\t\t\t<SvgParameter name=\"font-style\">normal</SvgParameter>\r\n", 1072 + prev); 1073 + sqlite3_free(prev); 1074 + prev = xml; 1075 + if (FontWeight == RL2_FONTWEIGHT_BOLD) 1076 + xml = 1077 + sqlite3_mprintf 1078 + ("%s\t\t\t\t<SvgParameter name=\"font-weight\">bold</SvgParameter>\r\n", 1079 + prev); 1080 + else 1081 + xml = 1082 + sqlite3_mprintf 1083 + ("%s\t\t\t\t<SvgParameter name=\"font-weight\">normal</SvgParameter>\r\n", 1084 + prev); 1085 + sqlite3_free(prev); 1086 + prev = xml; 1087 + xml = 1088 + sqlite3_mprintf 1089 + ("%s\t\t\t\t<SvgParameter name=\"font-size\">%1.2f</SvgParameter>\r\n", 1090 + prev, FontSize); 1091 + sqlite3_free(prev); 1092 + prev = xml; 1093 + xml = sqlite3_mprintf("%s\t\t\t</Font>\r\n", prev); 1094 + sqlite3_free(prev); 1095 + prev = xml; 1096 + xml = sqlite3_mprintf("%s\t\t\t<LabelPlacement>\n", prev); 1097 + sqlite3_free(prev); 1098 + prev = xml; 1099 +// PointPlacement 1100 + xml = sqlite3_mprintf("%s\t\t\t\t<PointPlacement>\n", prev); 1101 + sqlite3_free(prev); 1102 + prev = xml; 1103 + if (LabelAnchorX != 0.5 || LabelAnchorY != 0.5) 1104 + { 1105 + xml = sqlite3_mprintf("%s\t\t\t\t\t<AnchorPoint>\r\n", prev); 1106 + sqlite3_free(prev); 1107 + prev = xml; 1108 + xml = 1109 + sqlite3_mprintf 1110 + ("%s\t\t\t\t\t\t<AnchorPointX>%1.4f</AnchorPointX>\r\n", prev, 1111 + LabelAnchorX); 1112 + sqlite3_free(prev); 1113 + prev = xml; 1114 + xml = 1115 + sqlite3_mprintf 1116 + ("%s\t\t\t\t\t\t<AnchorPointY>%1.4f</AnchorPointY>\r\n", prev, 1117 + LabelAnchorY); 1118 + sqlite3_free(prev); 1119 + prev = xml; 1120 + xml = sqlite3_mprintf("%s\t\t\t\t\t</AnchorPoint>\r\n", prev); 1121 + sqlite3_free(prev); 1122 + prev = xml; 1123 + } 1124 + if (LabelDisplacementX != 0.0 || LabelDisplacementY != 0.0) 1125 + { 1126 + xml = sqlite3_mprintf("%s\t\t\t\t\t<Displacement>\r\n", prev); 1127 + sqlite3_free(prev); 1128 + prev = xml; 1129 + xml = 1130 + sqlite3_mprintf 1131 + ("%s\t\t\t\t\t\t<DisplacementX>%1.4f</DisplacementX>\r\n", prev, 1132 + LabelDisplacementX); 1133 + sqlite3_free(prev); 1134 + prev = xml; 1135 + xml = 1136 + sqlite3_mprintf 1137 + ("%s\t\t\t\t\t\t<DisplacementY>%1.4f</DisplacementY>\r\n", prev, 1138 + LabelDisplacementY); 1139 + sqlite3_free(prev); 1140 + prev = xml; 1141 + xml = sqlite3_mprintf("%s\t\t\t\t\t</Displacement>\r\n", prev); 1142 + sqlite3_free(prev); 1143 + prev = xml; 1144 + } 1145 + if (LabelRotation != 0.0) 1146 + { 1147 + xml = 1148 + sqlite3_mprintf 1149 + ("%s\t\t\t\t\t<Rotation>%1.2f</Rotation>\r\n", prev, LabelRotation); 1150 + sqlite3_free(prev); 1151 + prev = xml; 1152 + } 1153 + xml = sqlite3_mprintf("%s\t\t\t\t</PointPlacement>\r\n", prev); 1154 + sqlite3_free(prev); 1155 + prev = xml; 1156 + xml = sqlite3_mprintf("%s\t\t\t</LabelPlacement>\r\n", prev); 1157 + sqlite3_free(prev); 1158 + prev = xml; 1159 + if (HasHalo == true) 1160 + { 1161 + // Halo 1162 + xml = sqlite3_mprintf("%s\t\t\t<Halo>\r\n", prev); 1163 + sqlite3_free(prev); 1164 + prev = xml; 1165 + xml = 1166 + sqlite3_mprintf("%s\t\t\t\t<Radius>%1.2f</Radius>\r\n", prev, 1167 + HaloRadius); 1168 + sqlite3_free(prev); 1169 + prev = xml; 1170 + xml = sqlite3_mprintf("%s\t\t\t\t<Fill>\r\n", prev); 1171 + sqlite3_free(prev); 1172 + prev = xml; 1173 + xml = 1174 + sqlite3_mprintf 1175 + ("%s\t\t\t\t\t<SvgParameter name=\"fill\">%s</SvgParameter>\r\n", 1176 + prev, HaloColor); 1177 + sqlite3_free(prev); 1178 + prev = xml; 1179 + xml = 1180 + sqlite3_mprintf 1181 + ("%s\t\t\t\t\t<SvgParameter name=\"fill-opacity\">%1.2f</SvgParameter>\r\n", 1182 + prev, HaloOpacity); 1183 + sqlite3_free(prev); 1184 + prev = xml; 1185 + xml = sqlite3_mprintf("%s\t\t\t\t</Fill>\r\n", prev); 1186 + sqlite3_free(prev); 1187 + prev = xml; 1188 + xml = sqlite3_mprintf("%s\t\t\t</Halo>\r\n", prev); 1189 + sqlite3_free(prev); 1190 + prev = xml; 1191 + } 1192 + xml = sqlite3_mprintf("%s\t\t\t<Fill>\r\n", prev); 1193 + sqlite3_free(prev); 1194 + prev = xml; 1195 + xml = 1196 + sqlite3_mprintf 1197 + ("%s\t\t\t\t<SvgParameter name=\"fill\">%s</SvgParameter>\r\n", prev, 1198 + FontColor); 1199 + sqlite3_free(prev); 1200 + prev = xml; 1201 + xml = 1202 + sqlite3_mprintf 1203 + ("%s\t\t\t\t<SvgParameter name=\"fill-opacity\">%1.2f</SvgParameter>\r\n", 1204 + prev, FontOpacity); 1205 + sqlite3_free(prev); 1206 + prev = xml; 1207 + xml = sqlite3_mprintf("%s\t\t\t</Fill>\r\n", prev); 1208 + sqlite3_free(prev); 1209 + prev = xml; 1210 + xml = sqlite3_mprintf("%s\t\t</TextSymbolizer>\r\n", prev); 1211 + sqlite3_free(prev); 1212 + return xml; 1213 +} 1214 + 1215 +char *QuickStyleObj::DoCreateTextLineSymbolizerXML() 1216 +{ 1217 +// 1218 +// creating a Text Symbolizer (Line Placement) 1219 +// 1220 + char *xml; 1221 + char *prev; 1222 + xml = sqlite3_mprintf("\t\t<TextSymbolizer>\r\n"); 1223 + prev = xml; 1224 + xml = sqlite3_mprintf("%s\t\t\t<Label>@%s@</Label>\r\n", prev, LabelColumn); 1225 + sqlite3_free(prev); 1226 + prev = xml; 1227 + xml = sqlite3_mprintf("%s\t\t\t<Font>\r\n", prev); 1228 + sqlite3_free(prev); 1229 + prev = xml; 1230 + const char *font; 1231 + if (strcmp(FontFacename, "ToyFont: serif") == 0) 1232 + font = "serif"; 1233 + else if (strcmp(FontFacename, "ToyFont: sans-serif") == 0) 1234 + font = "sans serif"; 1235 + else if (strcmp(FontFacename, "ToyFont: monospace") == 0) 1236 + font = "monospace"; 1237 + else 1238 + font = FontFacename; 1239 + xml = 1240 + sqlite3_mprintf 1241 + ("%s\t\t\t\t<SvgParameter name=\"font-family\">%s</SvgParameter>\r\n", prev, 1242 + font); 1243 + sqlite3_free(prev); 1244 + prev = xml; 1245 + if (FontStyle == RL2_FONTSTYLE_ITALIC) 1246 + xml = 1247 + sqlite3_mprintf 1248 + ("%s\t\t\t\t<SvgParameter name=\"font-style\">italic</SvgParameter>\r\n", 1249 + prev); 1250 + else if (FontStyle == RL2_FONTSTYLE_OBLIQUE) 1251 + xml = 1252 + sqlite3_mprintf 1253 + ("%s\t\t\t\t<SvgParameter name=\"font-style\">oblique</SvgParameter>\r\n", 1254 + prev); 1255 + else 1256 + xml = 1257 + sqlite3_mprintf 1258 + ("%s\t\t\t\t<SvgParameter name=\"font-style\">normal</SvgParameter>\r\n", 1259 + prev); 1260 + sqlite3_free(prev); 1261 + prev = xml; 1262 + if (FontWeight == RL2_FONTWEIGHT_BOLD) 1263 + xml = 1264 + sqlite3_mprintf 1265 + ("%s\t\t\t\t<SvgParameter name=\"font-weight\">bold</SvgParameter>\r\n", 1266 + prev); 1267 + else 1268 + xml = 1269 + sqlite3_mprintf 1270 + ("%s\t\t\t\t<SvgParameter name=\"font-weight\">normal</SvgParameter>\r\n", 1271 + prev); 1272 + sqlite3_free(prev); 1273 + prev = xml; 1274 + xml = 1275 + sqlite3_mprintf 1276 + ("%s\t\t\t\t<SvgParameter name=\"font-size\">%1.2f</SvgParameter>\r\n", 1277 + prev, FontSize); 1278 + sqlite3_free(prev); 1279 + prev = xml; 1280 + xml = sqlite3_mprintf("%s%s\t\t\t</Font>\r\n", prev); 1281 + sqlite3_free(prev); 1282 + prev = xml; 1283 + xml = sqlite3_mprintf("%s\t\t\t<LabelPlacement>\n", prev); 1284 + sqlite3_free(prev); 1285 + prev = xml; 1286 +// LinePlacement 1287 + xml = sqlite3_mprintf("%s\t\t\t\t<LinePlacement>\n", prev); 1288 + sqlite3_free(prev); 1289 + prev = xml; 1290 + if (LabelPerpendicularOffset != 0.0) 1291 + { 1292 + xml = 1293 + sqlite3_mprintf 1294 + ("%s\t\t\t\t\t<PerpendicularOffset>%1.4f</PerpendicularOffset>\r\n", 1295 + prev, LabelPerpendicularOffset); 1296 + sqlite3_free(prev); 1297 + prev = xml; 1298 + } 1299 + if (RepeatedLabel == true) 1300 + { 1301 + // Repeated: InitialGap and Gap 1302 + xml = 1303 + sqlite3_mprintf("%s\t\t\t\t\t<IsRepeated>true</IsRepeated>\r\n", prev); 1304 + sqlite3_free(prev); 1305 + prev = xml; 1306 + xml = 1307 + sqlite3_mprintf 1308 + ("%s\t\t\t\t\t<InitialGap>%1.4f</InitialGap>\r\n", prev, 1309 + LabelInitialGap); 1310 + sqlite3_free(prev); 1311 + prev = xml; 1312 + xml = sqlite3_mprintf("%s\t\t\t\t\t<Gap>%1.4f</Gap>\r\n", prev, LabelGap); 1313 + sqlite3_free(prev); 1314 + prev = xml; 1315 + } 1316 + if (LabelIsAligned == true) 1317 + { 1318 + xml = 1319 + sqlite3_mprintf("%s\t\t\t\t\t<IsAligned>true</IsAligned>\r\n", prev); 1320 + sqlite3_free(prev); 1321 + prev = xml; 1322 + } 1323 + if (LabelGeneralizeLine == true) 1324 + { 1325 + xml = 1326 + sqlite3_mprintf 1327 + ("%s\t\t\t\t\t<GeneralizeLine>true</GeneralizeLine>\r\n", prev); 1328 + sqlite3_free(prev); 1329 + prev = xml; 1330 + } 1331 + xml = sqlite3_mprintf("%s\t\t\t\t</LinePlacement>\r\n", prev); 1332 + sqlite3_free(prev); 1333 + prev = xml; 1334 + xml = sqlite3_mprintf("%s\t\t\t</LabelPlacement>\r\n", prev); 1335 + sqlite3_free(prev); 1336 + prev = xml; 1337 + if (HasHalo == true) 1338 + { 1339 + // Halo 1340 + xml = sqlite3_mprintf("%s\t\t\t<Halo>\r\n", prev); 1341 + sqlite3_free(prev); 1342 + prev = xml; 1343 + xml = 1344 + sqlite3_mprintf("%s\t\t\t\t<Radius>%1.2f</Radius>\r\n", prev, 1345 + HaloRadius); 1346 + sqlite3_free(prev); 1347 + prev = xml; 1348 + xml = sqlite3_mprintf("%s\t\t\t\t<Fill>\r\n", prev); 1349 + sqlite3_free(prev); 1350 + prev = xml; 1351 + xml = 1352 + sqlite3_mprintf 1353 + ("%s\t\t\t\t\t<SvgParameter name=\"fill\">%s</SvgParameter>\r\n", 1354 + prev, HaloColor); 1355 + sqlite3_free(prev); 1356 + prev = xml; 1357 + xml = 1358 + sqlite3_mprintf 1359 + ("%s\t\t\t\t\t<SvgParameter name=\"fill-opacity\">%1.2f</SvgParameter>\r\n", 1360 + prev, HaloOpacity); 1361 + sqlite3_free(prev); 1362 + prev = xml; 1363 + xml = sqlite3_mprintf("%s\t\t\t\t</Fill>\r\n", prev); 1364 + sqlite3_free(prev); 1365 + prev = xml; 1366 + xml = sqlite3_mprintf("%s\t\t\t</Halo>\r\n", prev); 1367 + sqlite3_free(prev); 1368 + prev = xml; 1369 + } 1370 + xml = sqlite3_mprintf("%s\t\t\t<Fill>\r\n", prev); 1371 + sqlite3_free(prev); 1372 + prev = xml; 1373 + xml = 1374 + sqlite3_mprintf 1375 + ("%s\t\t\t\t<SvgParameter name=\"fill\">%s</SvgParameter>\r\n", prev, 1376 + FontColor); 1377 + sqlite3_free(prev); 1378 + prev = xml; 1379 + xml = 1380 + sqlite3_mprintf 1381 + ("%s\t\t\t\t<SvgParameter name=\"fill-opacity\">%1.2f</SvgParameter>\r\n", 1382 + prev, FontOpacity); 1383 + sqlite3_free(prev); 1384 + prev = xml; 1385 + xml = sqlite3_mprintf("%s\t\t\t</Fill>\r\n", prev); 1386 + sqlite3_free(prev); 1387 + prev = xml; 1388 + xml = sqlite3_mprintf("%s\t\t</TextSymbolizer>\r\n", prev); 1389 + sqlite3_free(prev); 1390 + return xml; 1391 +} 1392 + 1393 +const unsigned char *QuickStyleObj::CloneXmlStyle() 1394 +{ 1395 +// 1396 +// cloning the XML Style definition 1397 +// 1398 + if (XmlStyle == NULL) 1399 + XmlStyle = CreateXmlStyle(); 1400 + if (XmlStyle == NULL) 1401 + return NULL; 1402 + int len = strlen(XmlStyle); 1403 + char *cloned = (char *) malloc(len + 1); 1404 + strcpy(cloned, XmlStyle); 1405 + return (const unsigned char *) cloned; 1406 +} 1407 + 1408 +void QuickStyleObj::DoGetUUID(char *uuid) 1409 +{ 1410 +// 1411 +// creating an UUID value 1412 +// 1413 + unsigned char rnd[16]; 1414 + char *p = uuid; 1415 + int i; 1416 + sqlite3_randomness(16, rnd); 1417 + for (i = 0; i < 16; i++) 1418 + { 1419 + if (i == 4 || i == 6 || i == 8 || i == 10) 1420 + *p++ = '-'; 1421 + sprintf(p, "%02x", rnd[i]); 1422 + p += 2; 1423 + } 1424 + *p = '\0'; 1425 + uuid[14] = '4'; 1426 + uuid[19] = '8'; 1427 +} 1428 + 1429 +int QuickStyleObj::RandomWellKnownMark() 1430 +{ 1431 +// 1432 +// returning a random Symbol Well Known Mark 1433 +// 1434 + int wkt; 1435 + int mod = rand() % 6; 1436 + switch (mod) 1437 + { 1438 + case 0: 1439 + wkt = RL2_GRAPHIC_MARK_SQUARE; 1440 + break; 1441 + case 1: 1442 + wkt = RL2_GRAPHIC_MARK_CIRCLE; 1443 + break; 1444 + case 2: 1445 + wkt = RL2_GRAPHIC_MARK_TRIANGLE; 1446 + break; 1447 + case 3: 1448 + wkt = RL2_GRAPHIC_MARK_STAR; 1449 + break; 1450 + case 4: 1451 + wkt = RL2_GRAPHIC_MARK_CROSS; 1452 + break; 1453 + default: 1454 + wkt = RL2_GRAPHIC_MARK_X; 1455 + break; 1456 + }; 1457 + return wkt; 1458 +} 1459 + 1460 +void QuickStyleObj::RandomColor(char *color) 1461 +{ 1462 +// 1463 +// setting a random Color 1464 +// 1465 + unsigned char red = rand() % 256; 1466 + unsigned char green = rand() % 256; 1467 + unsigned char blue = rand() % 256; 1468 + sprintf(color, "#%02x%02x%02x", red, green, blue); 1469 +} 1470 + 1471 +bool QuickStyleVectorDialog::Create(MyMapPanel * parent, MapLayer * layer, 1472 + int type) 1473 +{ 1474 +// 1475 +// creating the dialog 1476 +// 1477 + MainFrame = parent->GetParent(); 1478 + MapPanel = parent; 1479 + Layer = layer; 1480 + Type = type; 1481 + DbPrefix = layer->GetDbPrefix(); 1482 + LayerName = layer->GetName(); 1483 + IsConfigChanged = false; 1484 + 1485 + if (wxPropertySheetDialog::Create 1486 + (parent, wxID_ANY, wxT("QuickStyle (Vector) Edit")) == false) 1487 + return false; 1488 + if (Layer->GetQuickStyle() != NULL) 1489 + Style = Layer->CloneQuickStyle(); 1490 + else 1491 + Style = new QuickStyleObj(Type); 1492 + 1493 + wxBookCtrlBase *book = GetBookCtrl(); 1494 +// creates individual panels 1495 + int next = 1; 1496 + PagePointIndex = 0; 1497 + PageLineIndex = 0; 1498 + PagePolygonIndex = 0; 1499 + PageTextPointIndex = 0; 1500 + PageTextLineIndex = 0; 1501 + wxPanel *mainPage = CreateMainPage(book); 1502 + book->AddPage(mainPage, wxT("General"), true); 1503 + if (Type == QUICK_STYLE_POINT || Type == QUICK_STYLE_GEOMETRY) 1504 + { 1505 + wxPanel *pointPage = CreatePointPage(book); 1506 + book->AddPage(pointPage, wxT("Point Symbolizer"), false); 1507 + PagePointIndex = next++; 1508 + } 1509 + if (Type == QUICK_STYLE_LINE || Type == QUICK_STYLE_GEOMETRY) 1510 + { 1511 + wxPanel *linePage = CreateLinePage(book); 1512 + book->AddPage(linePage, wxT("Line Symbolyzer"), false); 1513 + PageLineIndex = next++; 1514 + } 1515 + if (Type == QUICK_STYLE_POLYGON || Type == QUICK_STYLE_GEOMETRY) 1516 + { 1517 + wxPanel *polygonPage = CreatePolygonPage(book); 1518 + book->AddPage(polygonPage, wxT("Polygon Symbolizer"), false); 1519 + PagePolygonIndex = next++; 1520 + } 1521 + if (Type == QUICK_STYLE_POINT || Type == QUICK_STYLE_POLYGON) 1522 + { 1523 + wxPanel *textPointPage = CreateTextPointPage(book); 1524 + book->AddPage(textPointPage, wxT("Text Symbolizer"), false); 1525 + PageTextPointIndex = next++; 1526 + } 1527 + if (Type == QUICK_STYLE_LINE) 1528 + { 1529 + wxPanel *textLinePage = CreateTextLinePage(book); 1530 + book->AddPage(textLinePage, wxT("Text Symbolizer"), false); 1531 + PageTextLineIndex = next++; 1532 + } 1533 + 1534 + CreateButtons(); 1535 + LayoutDialog(); 1536 +// appends event handler for TAB/PAGE changing 1537 + Connect(wxID_ANY, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, 1538 + (wxObjectEventFunction) & QuickStyleVectorDialog::OnPageChanging); 1539 + Connect(wxID_ANY, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, 1540 + (wxObjectEventFunction) & QuickStyleVectorDialog::OnPageChanged); 1541 +// appends event handler for buttons 1542 + Connect(wxID_CANCEL, wxEVT_COMMAND_BUTTON_CLICKED, 1543 + (wxObjectEventFunction) & QuickStyleVectorDialog::OnQuit); 1544 + Connect(wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, 1545 + (wxObjectEventFunction) & QuickStyleVectorDialog::OnOk); 1546 + Connect(ID_QUICK_STYLE_APPLY, wxEVT_COMMAND_BUTTON_CLICKED, 1547 + (wxObjectEventFunction) & QuickStyleVectorDialog::OnApply); 1548 + Connect(ID_QUICK_STYLE_EXPORT, wxEVT_COMMAND_BUTTON_CLICKED, 1549 + (wxObjectEventFunction) & QuickStyleVectorDialog::OnExport); 1550 + Connect(ID_QUICK_STYLE_COPY, wxEVT_COMMAND_BUTTON_CLICKED, 1551 + (wxObjectEventFunction) & QuickStyleVectorDialog::OnCopy); 1552 +// centers the dialog window 1553 + Centre(); 1554 + UpdateMainPage(); 1555 + return true; 1556 +} 1557 + 1558 +void QuickStyleVectorDialog::CreateButtons() 1559 +{ 1560 +// 1561 +// adding the common Buttons 1562 +// 1563 + wxBoxSizer *topSizer = (wxBoxSizer *) (this->GetSizer()); 1564 + wxBoxSizer *btnBox = new wxBoxSizer(wxHORIZONTAL); 1565 + topSizer->Add(btnBox, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1566 + wxButton *save = new wxButton(this, ID_QUICK_STYLE_APPLY, wxT("&Apply")); 1567 + btnBox->Add(save, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1568 + wxButton *exp = 1569 + new wxButton(this, ID_QUICK_STYLE_EXPORT, wxT("&Export to file")); 1570 + btnBox->Add(exp, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1571 + wxButton *copy = new wxButton(this, ID_QUICK_STYLE_COPY, wxT("&Copy")); 1572 + btnBox->Add(copy, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1573 + btnBox->AddSpacer(100); 1574 + wxButton *ok = new wxButton(this, wxID_OK, wxT("&Ok")); 1575 + btnBox->Add(ok, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1576 + wxButton *cancel = new wxButton(this, wxID_CANCEL, wxT("&Cancel")); 1577 + btnBox->Add(cancel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1578 +} 1579 + 1580 +wxPanel *QuickStyleVectorDialog::CreateMainPage(wxWindow * parent) 1581 +{ 1582 +// 1583 +// creating the MAIN page 1584 +// 1585 + wxPanel *panel = new wxPanel(parent, ID_PANE_MAIN); 1586 + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 1587 + panel->SetSizer(topSizer); 1588 + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 1589 + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 1590 +// First row: Layer name 1591 + boxSizer->AddSpacer(50); 1592 + wxBoxSizer *lyrBoxSizer = new wxBoxSizer(wxVERTICAL); 1593 + boxSizer->Add(lyrBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1594 + wxBoxSizer *nameSizer = new wxBoxSizer(wxVERTICAL); 1595 + lyrBoxSizer->Add(nameSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1596 + wxStaticBox *nameBox = new wxStaticBox(panel, wxID_ANY, 1597 + wxT("Layer FullName"), 1598 + wxDefaultPosition, 1599 + wxDefaultSize); 1600 + wxBoxSizer *nameBoxSizer = new wxStaticBoxSizer(nameBox, wxHORIZONTAL); 1601 + nameSizer->Add(nameBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1602 + wxString fullName = DbPrefix + wxT(".") + LayerName; 1603 + wxTextCtrl *nameCtrl = new wxTextCtrl(panel, ID_VECTOR_LAYER, fullName, 1604 + wxDefaultPosition, wxSize(370, 22), 1605 + wxTE_READONLY); 1606 + nameBoxSizer->Add(nameCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1607 + wxStaticBox *typeBox = new wxStaticBox(panel, wxID_ANY, 1608 + wxT("Geometry Type"), 1609 + wxDefaultPosition, 1610 + wxDefaultSize); 1611 + wxBoxSizer *typeBoxSizer = new wxStaticBoxSizer(typeBox, wxHORIZONTAL); 1612 + nameSizer->Add(typeBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1613 + wxString typeName = wxT("UNKNOWN"); 1614 + if (Type == QUICK_STYLE_POINT) 1615 + typeName = wxT("POINT-Type Geometries"); 1616 + if (Type == QUICK_STYLE_LINE) 1617 + typeName = wxT("LINE-Type Geometries"); 1618 + if (Type == QUICK_STYLE_POLYGON) 1619 + typeName = wxT("POLYGON-Type Geometries"); 1620 + if (Type == QUICK_STYLE_GEOMETRY) 1621 + typeName = wxT("MIXED-Type Geometries"); 1622 + wxTextCtrl *typeCtrl = new wxTextCtrl(panel, ID_VECTOR_TYPE, typeName, 1623 + wxDefaultPosition, wxSize(370, 22), 1624 + wxTE_READONLY); 1625 + typeBoxSizer->Add(typeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1626 + wxStaticBox *uuidBox = new wxStaticBox(panel, wxID_ANY, 1627 + wxT("QuickStyle Name"), 1628 + wxDefaultPosition, 1629 + wxDefaultSize); 1630 + wxBoxSizer *uuidBoxSizer = new wxStaticBoxSizer(uuidBox, wxHORIZONTAL); 1631 + nameSizer->Add(uuidBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1632 + wxString uuid = wxString::FromUTF8(Style->GetUUID()); 1633 + wxTextCtrl *uuidCtrl = new wxTextCtrl(panel, ID_VECTOR_UUID, uuid, 1634 + wxDefaultPosition, wxSize(370, 22), 1635 + wxTE_READONLY); 1636 + uuidBoxSizer->Add(uuidCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1637 + boxSizer->AddSpacer(25); 1638 +// second row: Visibility Range 1639 + wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); 1640 + boxSizer->Add(miscSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 1641 + wxBoxSizer *visibilityBoxSizer = new wxBoxSizer(wxHORIZONTAL); 1642 + miscSizer->Add(visibilityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 1643 + wxStaticBox *visibilityBox = new wxStaticBox(panel, wxID_STATIC, 1644 + wxT("Visibility Range"), 1645 + wxDefaultPosition, 1646 + wxDefaultSize); 1647 + wxBoxSizer *visibilitySizer = 1648 + new wxStaticBoxSizer(visibilityBox, wxHORIZONTAL); 1649 + visibilityBoxSizer->Add(visibilitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 1650 + 5); 1651 + wxString range[4]; 1652 + range[0] = wxT("&None"); 1653 + range[1] = wxT("&Min"); 1654 + range[2] = wxT("&Max"); 1655 + range[3] = wxT("&Both"); 1656 + wxRadioBox *rangeBox = new wxRadioBox(panel, ID_SYMBOLIZER_MINMAX_SCALE, 1657 + wxT("&Range Type"), 1658 + wxDefaultPosition, 1659 + wxDefaultSize, 4, 1660 + range, 2, 1661 + wxRA_SPECIFY_COLS); 1662 + visibilitySizer->Add(rangeBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1663 + rangeBox->SetSelection(0); 1664 + visibilitySizer->AddSpacer(20); 1665 + wxBoxSizer *scaleBoxSizer = new wxBoxSizer(wxVERTICAL); 1666 + visibilitySizer->Add(scaleBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1667 + wxBoxSizer *scaleMinSizer = new wxBoxSizer(wxHORIZONTAL); 1668 + scaleBoxSizer->Add(scaleMinSizer, 0, wxALIGN_RIGHT | wxALL, 5); 1669 + wxStaticText *minScaleLabel = 1670 + new wxStaticText(panel, wxID_STATIC, wxT("&Min Scale:")); 1671 + scaleMinSizer->Add(minScaleLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1672 + wxTextCtrl *minScaleCtrl = 1673 + new wxTextCtrl(panel, ID_SYMBOLIZER_MIN_SCALE, wxT("0.0"), 1674 + wxDefaultPosition, wxSize(100, 22)); 1675 + minScaleCtrl->Enable(false); 1676 + scaleMinSizer->Add(minScaleCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1677 + wxBoxSizer *scaleMaxSizer = new wxBoxSizer(wxHORIZONTAL); 1678 + scaleBoxSizer->Add(scaleMaxSizer, 0, wxALIGN_RIGHT | wxALL, 0); 1679 + wxStaticText *maxScaleLabel = 1680 + new wxStaticText(panel, wxID_STATIC, wxT("&Max Scale:")); 1681 + scaleMaxSizer->Add(maxScaleLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1682 + wxTextCtrl *maxScaleCtrl = 1683 + new wxTextCtrl(panel, ID_SYMBOLIZER_MAX_SCALE, wxT("+Infinite"), 1684 + wxDefaultPosition, wxSize(100, 22)); 1685 + maxScaleCtrl->Enable(false); 1686 + scaleMaxSizer->Add(maxScaleCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1687 + panel->SetSizer(topSizer); 1688 + topSizer->Fit(panel); 1689 +// appends event handlers 1690 + Connect(ID_SYMBOLIZER_MINMAX_SCALE, wxEVT_COMMAND_RADIOBOX_SELECTED, 1691 + (wxObjectEventFunction) & QuickStyleVectorDialog::OnCmdScaleChanged); 1692 + return panel; 1693 +} 1694 + 1695 +void QuickStyleVectorDialog:: 1696 +OnCmdScaleChanged(wxCommandEvent & WXUNUSED(event)) 1697 +{ 1698 +// 1699 +// Visibility Range selection changed 1700 +// 1701 + wxRadioBox *scaleModeCtrl = 1702 + (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MINMAX_SCALE); 1703 + wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); 1704 + wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); 1705 + switch (scaleModeCtrl->GetSelection()) 1706 + { 1707 + case 0: 1708 + Style->EnableMinScale(false); 1709 + Style->EnableMaxScale(false); 1710 + minCtrl->SetValue(wxT("0.0")); 1711 + minCtrl->Enable(false); 1712 + maxCtrl->SetValue(wxT("+Infinite")); 1713 + maxCtrl->Enable(false); 1714 + break; 1715 + case 1: 1716 + Style->EnableMinScale(true); 1717 + Style->EnableMaxScale(false); 1718 + minCtrl->SetValue(wxT("")); 1719 + minCtrl->Enable(true); 1720 + maxCtrl->SetValue(wxT("+Infinite")); 1721 + maxCtrl->Enable(false); 1722 + break; 1723 + case 2: 1724 + Style->EnableMinScale(false); 1725 + Style->EnableMaxScale(true); 1726 + minCtrl->SetValue(wxT("0.0")); 1727 + minCtrl->Enable(false); 1728 + maxCtrl->SetValue(wxT("")); 1729 + maxCtrl->Enable(true); 1730 + break; 1731 + case 3: 1732 + Style->EnableMinScale(true); 1733 + Style->EnableMaxScale(true); 1734 + minCtrl->SetValue(wxT("")); 1735 + minCtrl->Enable(true); 1736 + maxCtrl->SetValue(wxT("")); 1737 + maxCtrl->Enable(true); 1738 + break; 1739 + }; 1740 +} 1741 + 1742 +wxPanel *QuickStyleVectorDialog::CreatePointPage(wxWindow * parent) 1743 +{ 1744 +// 1745 +// creating the Point Symbolizer page 1746 +// 1747 + wxString StrokeColor = wxT("#000000"); 1748 + wxString FillColor = wxT("#808080"); 1749 + wxPanel *panel = new wxPanel(parent, ID_PANE_POINT); 1750 + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 1751 + panel->SetSizer(topSizer); 1752 + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 1753 + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 1754 +// first row A: Opacity 1755 + wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); 1756 + boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1757 + wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, 1758 + wxT("Opacity"), 1759 + wxDefaultPosition, 1760 + wxDefaultSize); 1761 + wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); 1762 + opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1763 + wxSlider *opacityCtrl = 1764 + new wxSlider(panel, ID_SYMBOLIZER_OPACITY, 100, 0, 100, 1765 + wxDefaultPosition, wxSize(600, 45), 1766 + wxSL_HORIZONTAL | wxSL_LABELS); 1767 + opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1768 +// Well Known Mark Name 1769 + wxBoxSizer *box1Sizer = new wxBoxSizer(wxHORIZONTAL); 1770 + boxSizer->Add(box1Sizer, 0, wxALIGN_CENTER | wxALL, 5); 1771 + wxBoxSizer *markSizer = new wxBoxSizer(wxHORIZONTAL); 1772 + box1Sizer->Add(markSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 1773 + wxString mark[6]; 1774 + mark[0] = wxT("&Square"); 1775 + mark[1] = wxT("&Circle"); 1776 + mark[2] = wxT("&Triangle"); 1777 + mark[3] = wxT("&Star"); 1778 + mark[4] = wxT("&Cross"); 1779 + mark[5] = wxT("&X"); 1780 + wxRadioBox *markBox = new wxRadioBox(panel, ID_SYMBOLIZER_MARK, 1781 + wxT("&Mark"), 1782 + wxDefaultPosition, 1783 + wxDefaultSize, 6, 1784 + mark, 1, 1785 + wxRA_SPECIFY_COLS); 1786 + markSizer->Add(markBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1787 + markBox->SetSelection(0); 1788 +// second row: Size and Rotation 1789 + wxBoxSizer *box2Sizer = new wxBoxSizer(wxVERTICAL); 1790 + box1Sizer->Add(box2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1791 + wxBoxSizer *sizeBoxSizer = new wxBoxSizer(wxHORIZONTAL); 1792 + box2Sizer->Add(sizeBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1793 +// second row A: Size 1794 + wxStaticBox *sizeBox = new wxStaticBox(panel, wxID_STATIC, 1795 + wxT("Size"), 1796 + wxDefaultPosition, 1797 + wxDefaultSize); 1798 + wxBoxSizer *sizeSizer = new wxStaticBoxSizer(sizeBox, wxVERTICAL); 1799 + sizeBoxSizer->Add(sizeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 1800 + wxBoxSizer *size1Sizer = new wxBoxSizer(wxHORIZONTAL); 1801 + sizeSizer->Add(size1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1802 + wxTextCtrl *sizeCtrl = new wxTextCtrl(panel, ID_SYMBOLIZER_SIZE, wxT("16.0"), 1803 + wxDefaultPosition, wxSize(100, 22)); 1804 + size1Sizer->Add(sizeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1805 +// second row B: Rotation 1806 + wxStaticBox *rotBox = new wxStaticBox(panel, wxID_STATIC, 1807 + wxT("Rotation"), 1808 + wxDefaultPosition, 1809 + wxDefaultSize); 1810 + wxBoxSizer *rotSizer = new wxStaticBoxSizer(rotBox, wxVERTICAL); 1811 + sizeBoxSizer->Add(rotSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 1812 + wxBoxSizer *rot1Sizer = new wxBoxSizer(wxHORIZONTAL); 1813 + rotSizer->Add(rot1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1814 + wxTextCtrl *rotCtrl = 1815 + new wxTextCtrl(panel, ID_SYMBOLIZER_ROTATION, wxT("0.0"), 1816 + wxDefaultPosition, wxSize(100, 22)); 1817 + rot1Sizer->Add(rotCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1818 +// third row: AnchorPoint and Displacement 1819 + wxBoxSizer *anchorBoxSizer = new wxBoxSizer(wxHORIZONTAL); 1820 + box2Sizer->Add(anchorBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1821 +// third row A: Anchor Point 1822 + wxStaticBox *anchorBox = new wxStaticBox(panel, wxID_STATIC, 1823 + wxT("Anchor Point"), 1824 + wxDefaultPosition, 1825 + wxDefaultSize); 1826 + wxBoxSizer *anchorSizer = new wxStaticBoxSizer(anchorBox, wxVERTICAL); 1827 + anchorBoxSizer->Add(anchorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 1828 + wxBoxSizer *anchor1Sizer = new wxBoxSizer(wxHORIZONTAL); 1829 + anchorSizer->Add(anchor1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1830 + wxStaticText *anchor1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); 1831 + anchor1Sizer->Add(anchor1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1832 + wxTextCtrl *anchorXCtrl = 1833 + new wxTextCtrl(panel, ID_SYMBOLIZER_ANCHOR_X, wxT("0.5"), 1834 + wxDefaultPosition, wxSize(100, 22)); 1835 + anchor1Sizer->Add(anchorXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1836 + wxBoxSizer *anchor2Sizer = new wxBoxSizer(wxHORIZONTAL); 1837 + anchorSizer->Add(anchor2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1838 + wxStaticText *anchor2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); 1839 + anchor2Sizer->Add(anchor2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1840 + wxTextCtrl *anchorYCtrl = 1841 + new wxTextCtrl(panel, ID_SYMBOLIZER_ANCHOR_Y, wxT("0.5"), 1842 + wxDefaultPosition, wxSize(100, 22)); 1843 + anchor2Sizer->Add(anchorYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1844 +// third row B: Displacement 1845 + wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, 1846 + wxT("Displacement"), 1847 + wxDefaultPosition, 1848 + wxDefaultSize); 1849 + wxBoxSizer *displacementSizer = 1850 + new wxStaticBoxSizer(displacementBox, wxVERTICAL); 1851 + anchorBoxSizer->Add(displacementSizer, 0, 1852 + wxALIGN_CENTER_HORIZONTAL | wxALL, 20); 1853 + wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); 1854 + displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1855 + wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); 1856 + displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1857 + wxTextCtrl *displacementXCtrl = 1858 + new wxTextCtrl(panel, ID_SYMBOLIZER_DISPLACEMENT_X, wxT("0.0"), 1859 + wxDefaultPosition, wxSize(100, 22)); 1860 + displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1861 + wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); 1862 + displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1863 + wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); 1864 + displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1865 + wxTextCtrl *displacementYCtrl = 1866 + new wxTextCtrl(panel, ID_SYMBOLIZER_DISPLACEMENT_Y, wxT("0.0"), 1867 + wxDefaultPosition, wxSize(100, 22)); 1868 + displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1869 +// fourth row: colors 1870 + wxBoxSizer *box3Sizer = new wxBoxSizer(wxHORIZONTAL); 1871 + boxSizer->Add(box3Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 1872 +// first row A: Fill Color 1873 + wxBoxSizer *fillBoxSizer = new wxBoxSizer(wxVERTICAL); 1874 + box3Sizer->Add(fillBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1875 + wxStaticBox *colorFillBox = new wxStaticBox(panel, wxID_STATIC, 1876 + wxT("Fill Color"), 1877 + wxDefaultPosition, 1878 + wxDefaultSize); 1879 + wxBoxSizer *colorFillSizer = new wxStaticBoxSizer(colorFillBox, wxVERTICAL); 1880 + box3Sizer->Add(colorFillSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 1881 + wxBoxSizer *fill1Sizer = new wxBoxSizer(wxHORIZONTAL); 1882 + colorFillSizer->Add(fill1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 1883 + wxTextCtrl *fillColorCtrl = 1884 + new wxTextCtrl(panel, ID_SYMBOLIZER_FILL_COLOR, FillColor, 1885 + wxDefaultPosition, wxSize(80, 22)); 1886 + fill1Sizer->Add(fillColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1887 + wxBitmap bmp; 1888 + wxColour color(0, 0, 0); 1889 + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 1890 + wxStaticBitmap *sampleFillCtrl = 1891 + new wxStaticBitmap(panel, ID_SYMBOLIZER_FILL_PICKER_HEX, bmp, 1892 + wxDefaultPosition, wxSize(32, 32)); 1893 + fill1Sizer->Add(sampleFillCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1894 + wxButton *pickFill = 1895 + new wxButton(panel, ID_SYMBOLIZER_FILL_PICKER_BTN, wxT("&Pick a color")); 1896 + fill1Sizer->Add(pickFill, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1897 +// second row B: Stroke Color 1898 + box3Sizer->AddSpacer(30); 1899 + wxStaticBox *colorStrokeBox = new wxStaticBox(panel, wxID_STATIC, 1900 + wxT("Stroke Color"), 1901 + wxDefaultPosition, 1902 + wxDefaultSize); 1903 + wxBoxSizer *colorStrokeSizer = 1904 + new wxStaticBoxSizer(colorStrokeBox, wxVERTICAL); 1905 + box3Sizer->Add(colorStrokeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 1906 + wxBoxSizer *stroke1Sizer = new wxBoxSizer(wxHORIZONTAL); 1907 + colorStrokeSizer->Add(stroke1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 1908 + wxTextCtrl *strokeColorCtrl = 1909 + new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE_COLOR, StrokeColor, 1910 + wxDefaultPosition, wxSize(80, 22)); 1911 + stroke1Sizer->Add(strokeColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1912 + wxStaticBitmap *sampleStrokeCtrl = 1913 + new wxStaticBitmap(panel, ID_SYMBOLIZER_STROKE_PICKER_HEX, bmp, 1914 + wxDefaultPosition, wxSize(32, 32)); 1915 + stroke1Sizer->Add(sampleStrokeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1916 + wxButton *pickStroke = 1917 + new wxButton(panel, ID_SYMBOLIZER_STROKE_PICKER_BTN, wxT("&Pick a color")); 1918 + stroke1Sizer->Add(pickStroke, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 1919 + panel->SetSizer(topSizer); 1920 + topSizer->Fit(panel); 1921 +// appends event handlers 1922 + Connect(ID_SYMBOLIZER_MARK, wxEVT_COMMAND_RADIOBOX_SELECTED, 1923 + (wxObjectEventFunction) & QuickStyleVectorDialog::OnCmdMarkChanged); 1924 + Connect(ID_SYMBOLIZER_FILL_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 1925 + (wxObjectEventFunction) & 1926 + QuickStyleVectorDialog::OnCmdPointColorFillPicker); 1927 + Connect(ID_SYMBOLIZER_FILL_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 1928 + (wxObjectEventFunction) & 1929 + QuickStyleVectorDialog::OnCmdPointColorFillChanged); 1930 + Connect(ID_SYMBOLIZER_STROKE_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 1931 + (wxObjectEventFunction) & 1932 + QuickStyleVectorDialog::OnCmdPointColorStrokePicker); 1933 + Connect(ID_SYMBOLIZER_STROKE_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 1934 + (wxObjectEventFunction) & 1935 + QuickStyleVectorDialog::OnCmdPointColorStrokeChanged); 1936 + return panel; 1937 +} 1938 + 1939 +void QuickStyleVectorDialog::OnCmdMarkChanged(wxCommandEvent & WXUNUSED(event)) 1940 +{ 1941 +// 1942 +// Mark selection changed 1943 +// 1944 + wxRadioBox *markCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MARK); 1945 + switch (markCtrl->GetSelection()) 1946 + { 1947 + case 1: 1948 + Style->SetSymbolWellKnownMark(RL2_GRAPHIC_MARK_CIRCLE); 1949 + break; 1950 + case 2: 1951 + Style->SetSymbolWellKnownMark(RL2_GRAPHIC_MARK_TRIANGLE); 1952 + break; 1953 + case 3: 1954 + Style->SetSymbolWellKnownMark(RL2_GRAPHIC_MARK_STAR); 1955 + break; 1956 + case 4: 1957 + Style->SetSymbolWellKnownMark(RL2_GRAPHIC_MARK_CROSS); 1958 + break; 1959 + case 5: 1960 + Style->SetSymbolWellKnownMark(RL2_GRAPHIC_MARK_X); 1961 + break; 1962 + default: 1963 + Style->SetSymbolWellKnownMark(RL2_GRAPHIC_MARK_SQUARE); 1964 + break; 1965 + }; 1966 +} 1967 + 1968 +void QuickStyleVectorDialog:: 1969 +OnCmdPointColorFillChanged(wxCommandEvent & WXUNUSED(event)) 1970 +{ 1971 +// 1972 +// Fill color changed: updating the visual sample 1973 +// 1974 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL_COLOR); 1975 + wxStaticBitmap *sampleCtrl = 1976 + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FILL_PICKER_HEX); 1977 + wxColour back = wxColour(255, 255, 255); 1978 + wxString str = colorCtrl->GetValue(); 1979 + if (ColorMapEntry::IsValidColor(str) == true) 1980 + ColorMapEntry::GetWxColor(str, back); 1981 + wxBitmap bmp; 1982 + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 1983 + sampleCtrl->SetBitmap(bmp); 1984 + sampleCtrl->Refresh(); 1985 + sampleCtrl->Update(); 1986 +} 1987 + 1988 +void QuickStyleVectorDialog:: 1989 +OnCmdPointColorFillPicker(wxCommandEvent & WXUNUSED(event)) 1990 +{ 1991 +// 1992 +// color picker 1993 +// 1994 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL_COLOR); 1995 + wxColour clr = wxNullColour; 1996 + wxString str = colorCtrl->GetValue(); 1997 + if (ColorMapEntry::IsValidColor(str) == true) 1998 + ColorMapEntry::GetWxColor(str, clr); 1999 + wxColour color = wxGetColourFromUser(this, clr); 2000 + if (color.IsOk() == true) 2001 + { 2002 + char hex[16]; 2003 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 2004 + wxString str = wxString::FromUTF8(hex); 2005 + colorCtrl->SetValue(str); 2006 + } 2007 +} 2008 + 2009 +void QuickStyleVectorDialog:: 2010 +OnCmdPointColorStrokeChanged(wxCommandEvent & WXUNUSED(event)) 2011 +{ 2012 +// 2013 +// Stroke color changed: updating the visual sample 2014 +// 2015 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE_COLOR); 2016 + wxStaticBitmap *sampleCtrl = 2017 + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_STROKE_PICKER_HEX); 2018 + wxColour back = wxColour(255, 255, 255); 2019 + wxString str = colorCtrl->GetValue(); 2020 + if (ColorMapEntry::IsValidColor(str) == true) 2021 + ColorMapEntry::GetWxColor(str, back); 2022 + wxBitmap bmp; 2023 + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 2024 + sampleCtrl->SetBitmap(bmp); 2025 + sampleCtrl->Refresh(); 2026 + sampleCtrl->Update(); 2027 +} 2028 + 2029 +void QuickStyleVectorDialog:: 2030 +OnCmdPointColorStrokePicker(wxCommandEvent & WXUNUSED(event)) 2031 +{ 2032 +// 2033 +// color picker 2034 +// 2035 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE_COLOR); 2036 + wxColour clr = wxNullColour; 2037 + wxString str = colorCtrl->GetValue(); 2038 + if (ColorMapEntry::IsValidColor(str) == true) 2039 + ColorMapEntry::GetWxColor(str, clr); 2040 + wxColour color = wxGetColourFromUser(this, clr); 2041 + if (color.IsOk() == true) 2042 + { 2043 + char hex[16]; 2044 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 2045 + wxString str = wxString::FromUTF8(hex); 2046 + colorCtrl->SetValue(str); 2047 + } 2048 +} 2049 + 2050 +wxPanel *QuickStyleVectorDialog::CreateLinePage(wxWindow * parent) 2051 +{ 2052 +// 2053 +// creating the Line Symbolizer page 2054 +// 2055 + wxString StrokeColor = wxT("#000000"); 2056 + wxPanel *panel = new wxPanel(parent, ID_PANE_LINE); 2057 + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 2058 + panel->SetSizer(topSizer); 2059 + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 2060 + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 2061 +// first row A: the Stroke #1 Opacity and Perpendicular Offset 2062 + boxSizer->AddSpacer(50); 2063 + wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxVERTICAL); 2064 + boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2065 + wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, 2066 + wxT("Opacity"), 2067 + wxDefaultPosition, 2068 + wxDefaultSize); 2069 + wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxHORIZONTAL); 2070 + opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2071 + wxSlider *opacityCtrl = 2072 + new wxSlider(panel, ID_SYMBOLIZER_STROKE1_OPACITY, 100, 0, 100, 2073 + wxDefaultPosition, wxSize(600, 45), 2074 + wxSL_HORIZONTAL | wxSL_LABELS); 2075 + opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2076 +// first row B: PerpendicularOffset 2077 + wxBoxSizer *perpendicularBoxSizer = new wxBoxSizer(wxHORIZONTAL); 2078 + opacityBoxSizer->Add(perpendicularBoxSizer, 0, 2079 + wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2080 + wxStaticBox *perpendicularBox = new wxStaticBox(panel, wxID_STATIC, 2081 + wxT("Perpendicular Offset"), 2082 + wxDefaultPosition, 2083 + wxDefaultSize); 2084 + wxBoxSizer *perpendicularSizer = 2085 + new wxStaticBoxSizer(perpendicularBox, wxVERTICAL); 2086 + perpendicularBoxSizer->Add(perpendicularSizer, 0, 2087 + wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2088 + wxBoxSizer *perp1Sizer = new wxBoxSizer(wxHORIZONTAL); 2089 + perpendicularSizer->Add(perp1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2090 + wxTextCtrl *perpendicularCtrl = 2091 + new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE1_PERPENDICULAR, wxT("0.0"), 2092 + wxDefaultPosition, wxSize(100, 22)); 2093 + perp1Sizer->Add(perpendicularCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2094 + wxStaticText *perp1Label = new wxStaticText(panel, wxID_STATIC, 2095 + wxT 2096 + ("Draw lines in parallel to the original geometry.")); 2097 + perp1Sizer->Add(perp1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2098 + wxStaticText *perp2Label = new wxStaticText(panel, wxID_STATIC, 2099 + wxT 2100 + ("Positive to the left-hand side. Negative numbers mean right.")); 2101 + perpendicularSizer->Add(perp2Label, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2102 +// second row: Stroke color or Graphic 2103 + wxBoxSizer *strokeSizer = new wxBoxSizer(wxHORIZONTAL); 2104 + boxSizer->Add(strokeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2105 +// second row B: Stroke Color 2106 + wxBoxSizer *colorBoxSizer = new wxBoxSizer(wxHORIZONTAL); 2107 + strokeSizer->Add(colorBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2108 + wxStaticBox *colorBox = new wxStaticBox(panel, wxID_STATIC, 2109 + wxT("Stroke Color"), 2110 + wxDefaultPosition, 2111 + wxDefaultSize); 2112 + wxBoxSizer *colorSizer = new wxStaticBoxSizer(colorBox, wxVERTICAL); 2113 + colorBoxSizer->Add(colorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2114 + wxBoxSizer *color1Sizer = new wxBoxSizer(wxHORIZONTAL); 2115 + colorSizer->Add(color1Sizer, 0, wxALIGN_RIGHT | wxALL, 0); 2116 + wxTextCtrl *colorCtrl = 2117 + new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE1_COLOR, StrokeColor, 2118 + wxDefaultPosition, wxSize(80, 22)); 2119 + color1Sizer->Add(colorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2120 + wxBitmap bmp; 2121 + wxColour color(0, 0, 0); 2122 + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 2123 + wxStaticBitmap *sampleCtrl = 2124 + new wxStaticBitmap(panel, ID_SYMBOLIZER_STROKE1_PICKER_HEX, bmp, 2125 + wxDefaultPosition, wxSize(32, 32)); 2126 + color1Sizer->Add(sampleCtrl, 0, wxALIGN_RIGHT | wxALL, 5); 2127 + wxBoxSizer *pickerSizer = new wxBoxSizer(wxHORIZONTAL); 2128 + colorSizer->Add(pickerSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2129 + wxButton *pick = 2130 + new wxButton(panel, ID_SYMBOLIZER_STROKE1_PICKER_BTN, wxT("&Pick a color")); 2131 + pickerSizer->Add(pick, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2132 +// third row: Stroke-Width 2133 + wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); 2134 + colorBoxSizer->Add(miscSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2135 +// third row A: StrokeWidth 2136 + wxBoxSizer *widthBoxSizer = new wxBoxSizer(wxHORIZONTAL); 2137 + miscSizer->Add(widthBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2138 + wxStaticBox *widthBox = new wxStaticBox(panel, wxID_STATIC, 2139 + wxT("Stroke Width"), 2140 + wxDefaultPosition, 2141 + wxDefaultSize); 2142 + wxBoxSizer *widthSizer = new wxStaticBoxSizer(widthBox, wxVERTICAL); 2143 + widthBoxSizer->Add(widthSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2144 + wxTextCtrl *widthCtrl = 2145 + new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE1_WIDTH, wxT("1.0"), 2146 + wxDefaultPosition, wxSize(100, 22)); 2147 + widthSizer->Add(widthCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2148 +// third row D: DashArray and DashOffset 2149 + wxBoxSizer *dashBoxSizer = new wxBoxSizer(wxHORIZONTAL); 2150 + miscSizer->Add(dashBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2151 + wxString dot[4]; 2152 + dot[0] = wxT("&Solid Line"); 2153 + dot[1] = wxT("&Dotted Line"); 2154 + dot[2] = wxT("&Dashed Line"); 2155 + dot[3] = wxT("&Dashed/Dotted Line"); 2156 + wxRadioBox *dotBox = new wxRadioBox(panel, ID_SYMBOLIZER_DASH_DOT, 2157 + wxT("&Dash/Dot Style"), 2158 + wxDefaultPosition, 2159 + wxDefaultSize, 4, 2160 + dot, 1, 2161 + wxRA_SPECIFY_COLS); 2162 + dotBox->SetSelection(0); 2163 + dashBoxSizer->Add(dotBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2164 + panel->SetSizer(topSizer); 2165 + topSizer->Fit(panel); 2166 +// appends event handlers 2167 + Connect(ID_SYMBOLIZER_STROKE1_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 2168 + (wxObjectEventFunction) & 2169 + QuickStyleVectorDialog::OnCmdLineColorChanged); 2170 + Connect(ID_SYMBOLIZER_STROKE1_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 2171 + (wxObjectEventFunction) & 2172 + QuickStyleVectorDialog::OnCmdLineColorPicker); 2173 + return panel; 2174 +} 2175 + 2176 +void QuickStyleVectorDialog:: 2177 +OnCmdLineColorChanged(wxCommandEvent & WXUNUSED(event)) 2178 +{ 2179 +// 2180 +// Stroke color changed: updating the visual sample 2181 +// 2182 + wxTextCtrl *colorCtrl = 2183 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); 2184 + wxStaticBitmap *sampleCtrl = 2185 + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_STROKE1_PICKER_HEX); 2186 + wxColour back = wxColour(255, 255, 255); 2187 + wxString str = colorCtrl->GetValue(); 2188 + if (ColorMapEntry::IsValidColor(str) == true) 2189 + ColorMapEntry::GetWxColor(str, back); 2190 + wxBitmap bmp; 2191 + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 2192 + sampleCtrl->SetBitmap(bmp); 2193 + sampleCtrl->Refresh(); 2194 + sampleCtrl->Update(); 2195 +} 2196 + 2197 +void QuickStyleVectorDialog:: 2198 +OnCmdLineColorPicker(wxCommandEvent & WXUNUSED(event)) 2199 +{ 2200 +// 2201 +// color picker 2202 +// 2203 + wxTextCtrl *colorCtrl = 2204 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); 2205 + wxColour clr = wxNullColour; 2206 + wxString str = colorCtrl->GetValue(); 2207 + if (ColorMapEntry::IsValidColor(str) == true) 2208 + ColorMapEntry::GetWxColor(str, clr); 2209 + wxColour color = wxGetColourFromUser(this, clr); 2210 + if (color.IsOk() == true) 2211 + { 2212 + char hex[16]; 2213 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 2214 + wxString str = wxString::FromUTF8(hex); 2215 + colorCtrl->SetValue(str); 2216 + } 2217 +} 2218 + 2219 +wxPanel *QuickStyleVectorDialog::CreatePolygonPage(wxWindow * parent) 2220 +{ 2221 +// 2222 +// creating the Polygon Symbolizer page 2223 +// 2224 + wxString StrokeColor = wxT("#000000"); 2225 + wxString FillColor = wxT("#808080"); 2226 + wxPanel *panel = new wxPanel(parent, ID_PANE_FILL2); 2227 + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 2228 + panel->SetSizer(topSizer); 2229 + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 2230 + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 2231 +// first row: the Polygon Displacement and Perpendicular Offset 2232 + wxBoxSizer *polygonBoxSizer = new wxBoxSizer(wxHORIZONTAL); 2233 + boxSizer->Add(polygonBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2234 +// first row A: Displacement 2235 + wxBoxSizer *displacementBoxSizer = new wxBoxSizer(wxHORIZONTAL); 2236 + polygonBoxSizer->Add(displacementBoxSizer, 0, 2237 + wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2238 + wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, 2239 + wxT("Displacement"), 2240 + wxDefaultPosition, 2241 + wxDefaultSize); 2242 + wxBoxSizer *displacementSizer = 2243 + new wxStaticBoxSizer(displacementBox, wxVERTICAL); 2244 + displacementBoxSizer->Add(displacementSizer, 0, 2245 + wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2246 + wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); 2247 + displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2248 + wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); 2249 + displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2250 + wxTextCtrl *displacementXCtrl = 2251 + new wxTextCtrl(panel, ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_X, wxT("0.0"), 2252 + wxDefaultPosition, wxSize(100, 22)); 2253 + displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2254 + wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); 2255 + displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2256 + wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); 2257 + displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2258 + wxTextCtrl *displacementYCtrl = 2259 + new wxTextCtrl(panel, ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_Y, wxT("0.0"), 2260 + wxDefaultPosition, wxSize(100, 22)); 2261 + displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2262 +// first row B: PerpendicularOffset 2263 + wxBoxSizer *perpendicularBoxSizer = new wxBoxSizer(wxHORIZONTAL); 2264 + polygonBoxSizer->Add(perpendicularBoxSizer, 0, 2265 + wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2266 + wxStaticBox *perpendicularBox = new wxStaticBox(panel, wxID_STATIC, 2267 + wxT("Perpendicular Offset"), 2268 + wxDefaultPosition, 2269 + wxDefaultSize); 2270 + wxBoxSizer *perpendicularSizer = 2271 + new wxStaticBoxSizer(perpendicularBox, wxVERTICAL); 2272 + perpendicularBoxSizer->Add(perpendicularSizer, 0, 2273 + wxALIGN_CENTER_VERTICAL | wxALL, 5); 2274 + wxBoxSizer *perp1Sizer = new wxBoxSizer(wxHORIZONTAL); 2275 + perpendicularSizer->Add(perp1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2276 + wxTextCtrl *perpendicularCtrl = 2277 + new wxTextCtrl(panel, ID_SYMBOLIZER_POLYGON1_PERPENDICULAR, wxT("0.0"), 2278 + wxDefaultPosition, wxSize(100, 22)); 2279 + perp1Sizer->Add(perpendicularCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2280 + wxStaticText *perp1Label = new wxStaticText(panel, wxID_STATIC, 2281 + wxT 2282 + ("Positive: larger. / Negative: smaller.")); 2283 + perp1Sizer->Add(perp1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2284 + wxStaticText *perp2Label = new wxStaticText(panel, wxID_STATIC, 2285 + wxT 2286 + ("Drawing polygons smaller or larger than their actual geometry (Buffer).")); 2287 + perpendicularSizer->Add(perp2Label, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2288 +// second row: Fill Opacity 2289 + wxBoxSizer *auxBoxSizer = new wxBoxSizer(wxHORIZONTAL); 2290 + boxSizer->Add(auxBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2291 + wxStaticBox *auxBox = new wxStaticBox(panel, wxID_STATIC, 2292 + wxT("Polygon Fill"), 2293 + wxDefaultPosition, 2294 + wxDefaultSize); 2295 + wxBoxSizer *auxSizer = new wxStaticBoxSizer(auxBox, wxHORIZONTAL); 2296 + auxBoxSizer->Add(auxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2297 + wxBoxSizer *enableSizer = new wxBoxSizer(wxHORIZONTAL); 2298 + auxSizer->Add(enableSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2299 + wxCheckBox *enableCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_FILL2_ENABLE, 2300 + wxT("Enable"), 2301 + wxDefaultPosition, wxDefaultSize); 2302 + enableCtrl->SetValue(Style->IsPolygonFill()); 2303 + enableSizer->Add(enableCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2304 + wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); 2305 + enableSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2306 + wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, 2307 + wxT("Opacity"), 2308 + wxDefaultPosition, 2309 + wxDefaultSize); 2310 + wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); 2311 + opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2312 + wxSlider *opacityCtrl = 2313 + new wxSlider(panel, ID_SYMBOLIZER_FILL2_OPACITY, 100, 0, 100, 2314 + wxDefaultPosition, wxSize(400, 45), 2315 + wxSL_HORIZONTAL | wxSL_LABELS); 2316 + opacityCtrl->Enable(Style->IsPolygonFill()); 2317 + opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2318 +// third row B: Fill Color 2319 + wxBoxSizer *colorBoxSizer = new wxBoxSizer(wxVERTICAL); 2320 + auxSizer->Add(colorBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2321 + wxStaticBox *colorBox = new wxStaticBox(panel, wxID_STATIC, 2322 + wxT("Fill Color"), 2323 + wxDefaultPosition, 2324 + wxDefaultSize); 2325 + wxBoxSizer *colorSizer = new wxStaticBoxSizer(colorBox, wxVERTICAL); 2326 + colorBoxSizer->Add(colorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2327 + wxBoxSizer *color1Sizer = new wxBoxSizer(wxHORIZONTAL); 2328 + colorSizer->Add(color1Sizer, 0, wxALIGN_RIGHT | wxALL, 0); 2329 + wxTextCtrl *colorCtrl = 2330 + new wxTextCtrl(panel, ID_SYMBOLIZER_FILL2_COLOR, FillColor, 2331 + wxDefaultPosition, wxSize(80, 22)); 2332 + color1Sizer->Add(colorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2333 + wxBitmap bmp; 2334 + wxColour color(0, 0, 0); 2335 + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 2336 + wxStaticBitmap *sampleCtrl = 2337 + new wxStaticBitmap(panel, ID_SYMBOLIZER_FILL2_PICKER_HEX, bmp, 2338 + wxDefaultPosition, wxSize(32, 32)); 2339 + sampleCtrl->Enable(Style->IsPolygonFill()); 2340 + color1Sizer->Add(sampleCtrl, 0, wxALIGN_RIGHT | wxALL, 5); 2341 + wxBoxSizer *pickerSizer = new wxBoxSizer(wxHORIZONTAL); 2342 + colorSizer->Add(pickerSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2343 + wxButton *pick = 2344 + new wxButton(panel, ID_SYMBOLIZER_FILL2_PICKER_BTN, wxT("&Pick a color")); 2345 + pick->Enable(Style->IsPolygonFill()); 2346 + pickerSizer->Add(pick, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2347 +// first row A: the Stroke #1 Opacity 2348 + wxBoxSizer *opacity2BoxSizer = new wxBoxSizer(wxHORIZONTAL); 2349 + boxSizer->Add(opacity2BoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2350 + wxStaticBox *enableBox = new wxStaticBox(panel, wxID_STATIC, 2351 + wxT("Polygon Stroke"), 2352 + wxDefaultPosition, 2353 + wxDefaultSize); 2354 + wxBoxSizer *enable2Sizer = new wxStaticBoxSizer(enableBox, wxHORIZONTAL); 2355 + opacity2BoxSizer->Add(enable2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2356 + wxCheckBox *enable2Ctrl = new wxCheckBox(panel, ID_SYMBOLIZER_STROKE2_ENABLE, 2357 + wxT("Enable"), 2358 + wxDefaultPosition, wxDefaultSize); 2359 + enable2Ctrl->SetValue(Style->IsPolygonStroke()); 2360 + enable2Sizer->Add(enable2Ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2361 + wxStaticBox *opacity2Box = new wxStaticBox(panel, wxID_STATIC, 2362 + wxT("Opacity"), 2363 + wxDefaultPosition, 2364 + wxDefaultSize); 2365 + wxBoxSizer *opacity2Sizer = new wxStaticBoxSizer(opacity2Box, wxVERTICAL); 2366 + enable2Sizer->Add(opacity2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2367 + wxSlider *opacity2Ctrl = 2368 + new wxSlider(panel, ID_SYMBOLIZER_STROKE2_OPACITY, 100, 0, 100, 2369 + wxDefaultPosition, wxSize(250, 45), 2370 + wxSL_HORIZONTAL | wxSL_LABELS); 2371 + opacity2Ctrl->Enable(Style->IsPolygonStroke()); 2372 + opacity2Sizer->Add(opacity2Ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2373 +// second row B: Stroke Color 2374 + wxStaticBox *color2Box = new wxStaticBox(panel, wxID_STATIC, 2375 + wxT("Stroke Color"), 2376 + wxDefaultPosition, 2377 + wxDefaultSize); 2378 + wxBoxSizer *color2Sizer = new wxStaticBoxSizer(color2Box, wxVERTICAL); 2379 + enable2Sizer->Add(color2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2380 + wxBoxSizer *color3Sizer = new wxBoxSizer(wxHORIZONTAL); 2381 + color2Sizer->Add(color3Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2382 + wxTextCtrl *color2Ctrl = 2383 + new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE2_COLOR, StrokeColor, 2384 + wxDefaultPosition, wxSize(80, 22)); 2385 + color2Ctrl->Enable(Style->IsPolygonStroke()); 2386 + color3Sizer->Add(color2Ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2387 + wxStaticBitmap *sample2Ctrl = 2388 + new wxStaticBitmap(panel, ID_SYMBOLIZER_STROKE2_PICKER_HEX, bmp, 2389 + wxDefaultPosition, wxSize(32, 32)); 2390 + sample2Ctrl->Enable(Style->IsPolygonStroke()); 2391 + color3Sizer->Add(sample2Ctrl, 0, wxALIGN_RIGHT | wxALL, 5); 2392 + wxBoxSizer *picker2Sizer = new wxBoxSizer(wxHORIZONTAL); 2393 + color2Sizer->Add(picker2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2394 + wxButton *pick2 = 2395 + new wxButton(panel, ID_SYMBOLIZER_STROKE2_PICKER_BTN, wxT("&Pick a color")); 2396 + pick2->Enable(Style->IsPolygonStroke()); 2397 + picker2Sizer->Add(pick2, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2398 +// third row: Stroke-Width, 2399 + wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); 2400 + enable2Sizer->Add(miscSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2401 +// third row A: StrokeWidth 2402 + wxBoxSizer *widthBoxSizer = new wxBoxSizer(wxHORIZONTAL); 2403 + miscSizer->Add(widthBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2404 + wxStaticBox *widthBox = new wxStaticBox(panel, wxID_STATIC, 2405 + wxT("Stroke Width"), 2406 + wxDefaultPosition, 2407 + wxDefaultSize); 2408 + wxBoxSizer *widthSizer = new wxStaticBoxSizer(widthBox, wxVERTICAL); 2409 + widthBoxSizer->Add(widthSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2410 + wxTextCtrl *widthCtrl = 2411 + new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE2_WIDTH, wxT("1.0"), 2412 + wxDefaultPosition, wxSize(100, 22)); 2413 + widthCtrl->Enable(false); 2414 + widthSizer->Add(widthCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2415 + 2416 + panel->SetSizer(topSizer); 2417 + topSizer->Fit(panel); 2418 +// appends event handlers 2419 + Connect(ID_SYMBOLIZER_STROKE2_ENABLE, wxEVT_COMMAND_CHECKBOX_CLICKED, 2420 + (wxObjectEventFunction) & 2421 + QuickStyleVectorDialog::OnCmdPolygonStrokeChanged); 2422 + Connect(ID_SYMBOLIZER_FILL2_ENABLE, wxEVT_COMMAND_CHECKBOX_CLICKED, 2423 + (wxObjectEventFunction) & 2424 + QuickStyleVectorDialog::OnCmdPolygonFillChanged); 2425 + Connect(ID_SYMBOLIZER_FILL2_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 2426 + (wxObjectEventFunction) & 2427 + QuickStyleVectorDialog::OnCmdPolygonColorFillChanged); 2428 + Connect(ID_SYMBOLIZER_FILL2_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 2429 + (wxObjectEventFunction) & 2430 + QuickStyleVectorDialog::OnCmdPolygonColorFillPicker); 2431 + Connect(ID_SYMBOLIZER_STROKE2_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 2432 + (wxObjectEventFunction) & 2433 + QuickStyleVectorDialog::OnCmdPolygonColorStrokeChanged); 2434 + Connect(ID_SYMBOLIZER_STROKE2_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 2435 + (wxObjectEventFunction) & 2436 + QuickStyleVectorDialog::OnCmdPolygonColorStrokePicker); 2437 + return panel; 2438 +} 2439 + 2440 +void QuickStyleVectorDialog:: 2441 +OnCmdPolygonStrokeChanged(wxCommandEvent & WXUNUSED(event)) 2442 +{ 2443 +// 2444 +// Stroke enable/disable 2445 +// 2446 + wxCheckBox *enableCtrl = 2447 + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_STROKE2_ENABLE); 2448 + if (enableCtrl->IsChecked() == true) 2449 + Style->SetPolygonStroke(true); 2450 + else 2451 + Style->SetPolygonStroke(false); 2452 + RetrievePolygonPage(false); 2453 + UpdatePolygonPage(); 2454 +} 2455 + 2456 +void QuickStyleVectorDialog:: 2457 +OnCmdPolygonFillChanged(wxCommandEvent & WXUNUSED(event)) 2458 +{ 2459 +// 2460 +// Fill enable/disable 2461 +// 2462 + wxCheckBox *enableCtrl = 2463 + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_FILL2_ENABLE); 2464 + if (enableCtrl->IsChecked() == true) 2465 + Style->SetPolygonFill(true); 2466 + else 2467 + Style->SetPolygonFill(false); 2468 + RetrievePolygonPage(false); 2469 + UpdatePolygonPage(); 2470 +} 2471 + 2472 +void QuickStyleVectorDialog:: 2473 +OnCmdPolygonColorFillChanged(wxCommandEvent & WXUNUSED(event)) 2474 +{ 2475 +// 2476 +// Fill color changed: updating the visual sample 2477 +// 2478 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); 2479 + wxStaticBitmap *sampleCtrl = 2480 + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FILL2_PICKER_HEX); 2481 + wxColour back = wxColour(255, 255, 255); 2482 + wxString str = colorCtrl->GetValue(); 2483 + if (ColorMapEntry::IsValidColor(str) == true) 2484 + ColorMapEntry::GetWxColor(str, back); 2485 + wxBitmap bmp; 2486 + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 2487 + sampleCtrl->SetBitmap(bmp); 2488 + sampleCtrl->Refresh(); 2489 + sampleCtrl->Update(); 2490 +} 2491 + 2492 +void QuickStyleVectorDialog:: 2493 +OnCmdPolygonColorFillPicker(wxCommandEvent & WXUNUSED(event)) 2494 +{ 2495 +// 2496 +// color picker 2497 +// 2498 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); 2499 + wxColour clr = wxNullColour; 2500 + wxString str = colorCtrl->GetValue(); 2501 + if (ColorMapEntry::IsValidColor(str) == true) 2502 + ColorMapEntry::GetWxColor(str, clr); 2503 + wxColour color = wxGetColourFromUser(this, clr); 2504 + if (color.IsOk() == true) 2505 + { 2506 + char hex[16]; 2507 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 2508 + wxString str = wxString::FromUTF8(hex); 2509 + colorCtrl->SetValue(str); 2510 + } 2511 +} 2512 + 2513 +void QuickStyleVectorDialog:: 2514 +OnCmdPolygonColorStrokeChanged(wxCommandEvent & WXUNUSED(event)) 2515 +{ 2516 +// 2517 +// Stroke color changed: updating the visual sample 2518 +// 2519 + wxTextCtrl *colorCtrl = 2520 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); 2521 + wxStaticBitmap *sampleCtrl = 2522 + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_STROKE2_PICKER_HEX); 2523 + wxColour back = wxColour(255, 255, 255); 2524 + wxString str = colorCtrl->GetValue(); 2525 + if (ColorMapEntry::IsValidColor(str) == true) 2526 + ColorMapEntry::GetWxColor(str, back); 2527 + wxBitmap bmp; 2528 + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 2529 + sampleCtrl->SetBitmap(bmp); 2530 + sampleCtrl->Refresh(); 2531 + sampleCtrl->Update(); 2532 +} 2533 + 2534 +void QuickStyleVectorDialog:: 2535 +OnCmdPolygonColorStrokePicker(wxCommandEvent & WXUNUSED(event)) 2536 +{ 2537 +// 2538 +// color picker 2539 +// 2540 + wxTextCtrl *colorCtrl = 2541 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); 2542 + wxColour clr = wxNullColour; 2543 + wxString str = colorCtrl->GetValue(); 2544 + if (ColorMapEntry::IsValidColor(str) == true) 2545 + ColorMapEntry::GetWxColor(str, clr); 2546 + wxColour color = wxGetColourFromUser(this, clr); 2547 + if (color.IsOk() == true) 2548 + { 2549 + char hex[16]; 2550 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 2551 + wxString str = wxString::FromUTF8(hex); 2552 + colorCtrl->SetValue(str); 2553 + } 2554 +} 2555 + 2556 +bool QuickStyleVectorDialog::DoCheckDatasource(const char *prefix, 2557 + const char *coverage, 2558 + char *table, char *geometry) 2559 +{ 2560 +// 2561 +// retrieving the real table and geometry column names 2562 +// 2563 + sqlite3 *sqlite = MainFrame->GetSqlite(); 2564 + char *sql; 2565 + int ret; 2566 + char **results; 2567 + int rows; 2568 + int columns; 2569 + int i; 2570 + char *qprefix; 2571 + bool ok = false; 2572 + 2573 + qprefix = gaiaDoubleQuotedSql(prefix); 2574 + sql = sqlite3_mprintf("SELECT f_table_name, f_geometry_column, view_name, " 2575 + "view_geometry, virt_name, virt_geometry " 2576 + "FROM \"%s\".vector_coverages WHERE coverage_name = %Q", 2577 + qprefix, coverage); 2578 + free(qprefix); 2579 + ret = sqlite3_get_table(sqlite, sql, &results, &rows, &columns, NULL); 2580 + sqlite3_free(sql); 2581 + if (ret != SQLITE_OK) 2582 + return false; 2583 + if (rows < 1) 2584 + ; 2585 + else 2586 + { 2587 + for (i = 1; i <= rows; i++) 2588 + { 2589 + const char *t = results[(i * columns) + 0]; 2590 + const char *g = results[(i * columns) + 1]; 2591 + if (t != NULL && g != NULL) 2592 + { 2593 + strcpy(table, t); 2594 + strcpy(geometry, g); 2595 + ok = true; 2596 + } 2597 + t = results[(i * columns) + 2]; 2598 + g = results[(i * columns) + 3]; 2599 + if (t != NULL && g != NULL) 2600 + { 2601 + strcpy(table, t); 2602 + strcpy(geometry, g); 2603 + ok = true; 2604 + } 2605 + t = results[(i * columns) + 4]; 2606 + g = results[(i * columns) + 5]; 2607 + if (t != NULL && g != NULL) 2608 + { 2609 + strcpy(table, t); 2610 + strcpy(geometry, g); 2611 + ok = true; 2612 + } 2613 + } 2614 + } 2615 + sqlite3_free_table(results); 2616 + return ok; 2617 +} 2618 + 2619 +void QuickStyleVectorDialog::InitializeComboColumns(wxComboBox * ctrl) 2620 +{ 2621 +// 2622 +// initializing a Column list ComboBox 2623 +// 2624 + sqlite3 *sqlite = MainFrame->GetSqlite(); 2625 + char *sql; 2626 + int ret; 2627 + char **results; 2628 + int rows; 2629 + int columns; 2630 + int i; 2631 + char prefix[1024]; 2632 + char coverage[1024]; 2633 + char table[1024]; 2634 + char geometry[1024]; 2635 + char *qprefix; 2636 + char *qtable; 2637 + 2638 + if (DbPrefix.Len() == 0) 2639 + strcpy(prefix, "MAIN"); 2640 + else 2641 + strcpy(prefix, DbPrefix.ToUTF8()); 2642 + strcpy(coverage, LayerName.ToUTF8()); 2643 + if (DoCheckDatasource(prefix, coverage, table, geometry) != true) 2644 + return; 2645 + 2646 + qprefix = gaiaDoubleQuotedSql(prefix); 2647 + qtable = gaiaDoubleQuotedSql(table); 2648 + sql = sqlite3_mprintf("PRAGMA \"%s\".table_info(\"%s\")", qprefix, qtable); 2649 + free(qprefix); 2650 + free(qtable); 2651 + ret = sqlite3_get_table(sqlite, sql, &results, &rows, &columns, NULL); 2652 + sqlite3_free(sql); 2653 + if (ret != SQLITE_OK) 2654 + return; 2655 + if (rows < 1) 2656 + ; 2657 + else 2658 + { 2659 + for (i = 1; i <= rows; i++) 2660 + { 2661 + const char *value = results[(i * columns) + 1]; 2662 + if (strcasecmp(value, geometry) == 0) 2663 + continue; // skipping the Geometry column 2664 + wxString col = wxString::FromUTF8(value); 2665 + ctrl->Append(col); 2666 + } 2667 + } 2668 + sqlite3_free_table(results); 2669 +} 2670 + 2671 +void QuickStyleVectorDialog::InitializeComboFonts(wxComboBox * ctrl) 2672 +{ 2673 +// 2674 +// initializing a Font list ComboBox 2675 +// 2676 + sqlite3 *sqlite = MainFrame->GetSqlite(); 2677 + char *sql; 2678 + int ret; 2679 + char **results; 2680 + int rows; 2681 + int columns; 2682 + int i; 2683 + char prefix[1024]; 2684 + char *qprefix; 2685 + 2686 +// inserting the default TOY FONTS 2687 + wxString font = wxT("ToyFont: serif"); 2688 + ctrl->Append(font); 2689 + font = wxT("ToyFont: sans-serif"); 2690 + ctrl->Append(font); 2691 + font = wxT("ToyFont: monospace"); 2692 + ctrl->Append(font); 2693 + 2694 + if (DbPrefix.Len() == 0) 2695 + strcpy(prefix, "MAIN"); 2696 + else 2697 + strcpy(prefix, DbPrefix.ToUTF8()); 2698 + qprefix = gaiaDoubleQuotedSql(prefix); 2699 + sql = 2700 + sqlite3_mprintf 2701 + ("SELECT font_facename FROM \"%s\".SE_fonts ORDER BY font_facename", 2702 + qprefix); 2703 + free(qprefix); 2704 + ret = sqlite3_get_table(sqlite, sql, &results, &rows, &columns, NULL); 2705 + sqlite3_free(sql); 2706 + if (ret != SQLITE_OK) 2707 + return; 2708 + if (rows < 1) 2709 + ; 2710 + else 2711 + { 2712 + for (i = 1; i <= rows; i++) 2713 + { 2714 + const char *value = results[(i * columns) + 0]; 2715 + wxString col = wxString::FromUTF8(value); 2716 + ctrl->Append(col); 2717 + } 2718 + } 2719 + sqlite3_free_table(results); 2720 +} 2721 + 2722 +wxPanel *QuickStyleVectorDialog::CreateTextPointPage(wxWindow * parent) 2723 +{ 2724 +// 2725 +// creating the Text Symbolizer page (Point Placement) 2726 +// 2727 + wxString FillColor = wxT("#808080"); 2728 + wxPanel *panel = new wxPanel(parent, ID_PANE_TEXT1); 2729 + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 2730 + panel->SetSizer(topSizer); 2731 + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 2732 + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 2733 +// enable/disable Labels 2734 + wxBoxSizer *auxBoxSizer = new wxBoxSizer(wxHORIZONTAL); 2735 + boxSizer->Add(auxBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2736 + wxStaticBox *auxBox = new wxStaticBox(panel, wxID_STATIC, 2737 + wxT("Labels"), 2738 + wxDefaultPosition, 2739 + wxDefaultSize); 2740 + wxBoxSizer *auxSizer = new wxStaticBoxSizer(auxBox, wxVERTICAL); 2741 + auxBoxSizer->Add(auxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2742 + wxBoxSizer *enableSizer = new wxBoxSizer(wxHORIZONTAL); 2743 + auxSizer->Add(enableSizer, 0, wxALIGN_LEFT | wxALL, 5); 2744 + wxCheckBox *enableCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_TEXT1_ENABLE, 2745 + wxT("Enable"), 2746 + wxDefaultPosition, wxDefaultSize); 2747 + enableCtrl->SetValue(Style->IsLabelPrint()); 2748 + enableSizer->Add(enableCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2749 + enableSizer->AddSpacer(20); 2750 + enableSizer->AddSpacer(20); 2751 + enableSizer->AddSpacer(20); 2752 + enableSizer->AddSpacer(20); 2753 + wxStaticText *columnLabel = 2754 + new wxStaticText(panel, wxID_STATIC, wxT("&Column:")); 2755 + enableSizer->Add(columnLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2756 + wxComboBox *columnList = 2757 + new wxComboBox(panel, ID_SYMBOLIZER_TEXT1_LABEL, wxT(""), wxDefaultPosition, 2758 + wxSize(400, 22), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); 2759 + InitializeComboColumns(columnList); 2760 + enableSizer->Add(columnList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2761 + 2762 + 2763 + wxStaticBox *fontBox = new wxStaticBox(panel, wxID_STATIC, 2764 + wxT("Font"), 2765 + wxDefaultPosition, 2766 + wxDefaultSize); 2767 + wxBoxSizer *font9Sizer = new wxStaticBoxSizer(fontBox, wxHORIZONTAL); 2768 + auxSizer->Add(font9Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2769 +// Second row: Font Name, Size and Fill 2770 + wxBoxSizer *fontSizer = new wxBoxSizer(wxHORIZONTAL); 2771 + font9Sizer->Add(fontSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2772 + wxBoxSizer *font0Sizer = new wxBoxSizer(wxHORIZONTAL); 2773 + fontSizer->Add(font0Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2774 +// Font Name 2775 + wxBoxSizer *fontXSizer = new wxBoxSizer(wxVERTICAL); 2776 + font0Sizer->Add(fontXSizer, 0, wxALIGN_LEFT | wxALL, 0); 2777 + wxComboBox *fontList = 2778 + new wxComboBox(panel, ID_SYMBOLIZER_FONT1_NAME, wxT(""), wxDefaultPosition, 2779 + wxSize(250, 21), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); 2780 + InitializeComboFonts(fontList); 2781 + fontList->Select(0); 2782 + fontXSizer->Add(fontList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2783 +// Font Size 2784 + wxBoxSizer *fontYSizer = new wxBoxSizer(wxHORIZONTAL); 2785 + fontXSizer->Add(fontYSizer, 0, wxALIGN_LEFT | wxALL, 0); 2786 + wxStaticBox *sizeBox = new wxStaticBox(panel, wxID_STATIC, 2787 + wxT("Font Size"), 2788 + wxDefaultPosition, 2789 + wxDefaultSize); 2790 + wxBoxSizer *sizeSizer = new wxStaticBoxSizer(sizeBox, wxHORIZONTAL); 2791 + fontYSizer->Add(sizeSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2792 + wxTextCtrl *sizeCtrl = 2793 + new wxTextCtrl(panel, ID_SYMBOLIZER_FONT1_SIZE, wxT("15.0"), 2794 + wxDefaultPosition, wxSize(100, 22)); 2795 + sizeSizer->Add(sizeCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2796 + wxBoxSizer *boldBoxSizer = new wxBoxSizer(wxVERTICAL); 2797 + fontYSizer->Add(boldBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2798 + wxStaticBox *boldBox = new wxStaticBox(panel, wxID_STATIC, 2799 + wxT("Font Style"), 2800 + wxDefaultPosition, 2801 + wxDefaultSize); 2802 + wxBoxSizer *boldSizer = new wxStaticBoxSizer(boldBox, wxVERTICAL); 2803 + boldBoxSizer->Add(boldSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2804 + wxBoxSizer *italicSizer = new wxBoxSizer(wxVERTICAL); 2805 + boldSizer->Add(italicSizer, 0, wxALIGN_LEFT | wxALL, 5); 2806 + wxCheckBox *italicCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_TEXT1_ITALIC, 2807 + wxT("Italic"), 2808 + wxDefaultPosition, wxDefaultSize); 2809 + italicCtrl->SetValue(false); 2810 + italicCtrl->Enable(false); 2811 + italicSizer->Add(italicCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2812 + wxCheckBox *boldCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_TEXT1_BOLD, 2813 + wxT("Bold"), 2814 + wxDefaultPosition, wxDefaultSize); 2815 + boldCtrl->SetValue(false); 2816 + boldCtrl->Enable(false); 2817 + italicSizer->Add(boldCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 2818 +// Font Opacity 2819 + wxStaticBox *opacityFontBox = new wxStaticBox(panel, wxID_STATIC, 2820 + wxT("Opacity"), 2821 + wxDefaultPosition, 2822 + wxDefaultSize); 2823 + wxBoxSizer *opacityFontSizer = 2824 + new wxStaticBoxSizer(opacityFontBox, wxVERTICAL); 2825 + fontSizer->Add(opacityFontSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2826 + wxSlider *opacityFontCtrl = 2827 + new wxSlider(panel, ID_SYMBOLIZER_FONT1_OPACITY, 100, 0, 100, 2828 + wxDefaultPosition, wxSize(150, 45), 2829 + wxSL_HORIZONTAL | wxSL_LABELS); 2830 + opacityFontSizer->Add(opacityFontCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2831 +// Font color 2832 + wxStaticBox *fontColorBox = new wxStaticBox(panel, wxID_STATIC, 2833 + wxT("Color"), 2834 + wxDefaultPosition, 2835 + wxDefaultSize); 2836 + wxBoxSizer *fontColorSizer = new wxStaticBoxSizer(fontColorBox, wxVERTICAL); 2837 + fontSizer->Add(fontColorSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2838 + wxBoxSizer *font2Sizer = new wxBoxSizer(wxHORIZONTAL); 2839 + fontColorSizer->Add(font2Sizer, 0, wxALIGN_RIGHT | wxALL, 0); 2840 + wxTextCtrl *fontCtrl = new wxTextCtrl(panel, ID_SYMBOLIZER_FONT1_COLOR, 2841 + FillColor, 2842 + wxDefaultPosition, wxSize(80, 22)); 2843 + font2Sizer->Add(fontCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2844 + wxBitmap bmp; 2845 + wxColour color(0, 0, 0); 2846 + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 2847 + wxStaticBitmap *sampleFontCtrl = 2848 + new wxStaticBitmap(panel, ID_SYMBOLIZER_FONT1_PICKER_HEX, bmp, 2849 + wxDefaultPosition, wxSize(32, 32)); 2850 + font2Sizer->Add(sampleFontCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2851 + wxButton *pickFont = new wxButton(panel, ID_SYMBOLIZER_FONT1_PICKER_BTN, 2852 + wxT("&Pick a color")); 2853 + fontColorSizer->Add(pickFont, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2854 +// first row: PointPlacement 2855 + wxBoxSizer *pointBoxSizer = new wxBoxSizer(wxHORIZONTAL); 2856 + auxSizer->Add(pointBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2857 + wxStaticBox *pointBox = new wxStaticBox(panel, wxID_STATIC, 2858 + wxT("Label Point Placement"), 2859 + wxDefaultPosition, 2860 + wxDefaultSize); 2861 + wxBoxSizer *pointSizer = new wxStaticBoxSizer(pointBox, wxHORIZONTAL); 2862 + pointBoxSizer->Add(pointSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2863 +// first row A: Anchor Point 2864 + wxStaticBox *anchorBox = new wxStaticBox(panel, wxID_STATIC, 2865 + wxT("Anchor Point"), 2866 + wxDefaultPosition, 2867 + wxDefaultSize); 2868 + wxBoxSizer *anchorSizer = new wxStaticBoxSizer(anchorBox, wxVERTICAL); 2869 + pointSizer->Add(anchorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2870 + wxBoxSizer *anchor1Sizer = new wxBoxSizer(wxHORIZONTAL); 2871 + anchorSizer->Add(anchor1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2872 + wxStaticText *anchor1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); 2873 + anchor1Sizer->Add(anchor1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2874 + wxTextCtrl *anchorXCtrl = 2875 + new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_ANCHOR_X, wxT("0.5"), 2876 + wxDefaultPosition, wxSize(60, 22)); 2877 + anchor1Sizer->Add(anchorXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2878 + wxBoxSizer *anchor2Sizer = new wxBoxSizer(wxHORIZONTAL); 2879 + anchorSizer->Add(anchor2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2880 + wxStaticText *anchor2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); 2881 + anchor2Sizer->Add(anchor2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2882 + wxTextCtrl *anchorYCtrl = 2883 + new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_ANCHOR_Y, wxT("0.5"), 2884 + wxDefaultPosition, wxSize(60, 22)); 2885 + anchor2Sizer->Add(anchorYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2886 +// first row B: Displacement 2887 + wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, 2888 + wxT("Displacement"), 2889 + wxDefaultPosition, 2890 + wxDefaultSize); 2891 + wxBoxSizer *displacementSizer = 2892 + new wxStaticBoxSizer(displacementBox, wxVERTICAL); 2893 + pointSizer->Add(displacementSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 2894 + wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); 2895 + displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2896 + wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); 2897 + displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2898 + wxTextCtrl *displacementXCtrl = 2899 + new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_DISPLACEMENT_X, wxT("0.0"), 2900 + wxDefaultPosition, wxSize(60, 22)); 2901 + displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2902 + wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); 2903 + displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2904 + wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); 2905 + displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2906 + wxTextCtrl *displacementYCtrl = 2907 + new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_DISPLACEMENT_Y, wxT("0.0"), 2908 + wxDefaultPosition, wxSize(60, 22)); 2909 + displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2910 +// first row C: Rotation 2911 + wxStaticBox *rotBox = new wxStaticBox(panel, wxID_STATIC, 2912 + wxT("Rotation"), 2913 + wxDefaultPosition, 2914 + wxDefaultSize); 2915 + wxBoxSizer *rotSizer = new wxStaticBoxSizer(rotBox, wxVERTICAL); 2916 + pointSizer->Add(rotSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2917 + wxBoxSizer *rot1Sizer = new wxBoxSizer(wxHORIZONTAL); 2918 + rotSizer->Add(rot1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 2919 + wxTextCtrl *rotCtrl = 2920 + new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_ROTATION, wxT("0.0"), 2921 + wxDefaultPosition, wxSize(60, 22)); 2922 + rot1Sizer->Add(rotCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2923 +// Font Halo 2924 + wxStaticBox *haloBox = new wxStaticBox(panel, wxID_STATIC, 2925 + wxT("Font Halo"), 2926 + wxDefaultPosition, 2927 + wxDefaultSize); 2928 + wxBoxSizer *haloSizer = new wxStaticBoxSizer(haloBox, wxVERTICAL); 2929 + pointBoxSizer->Add(haloSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2930 + wxBoxSizer *halo1Sizer = new wxBoxSizer(wxHORIZONTAL); 2931 + haloSizer->Add(halo1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2932 + wxCheckBox *enableHaloCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_HALO1_ENABLE, 2933 + wxT("Enable"), 2934 + wxDefaultPosition, wxDefaultSize); 2935 + enableHaloCtrl->SetValue(Style->IsHaloEnabled()); 2936 + enableHaloCtrl->Enable(false); 2937 + halo1Sizer->Add(enableHaloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2938 +// Halo Radius 2939 + wxStaticBox *radiusBox = new wxStaticBox(panel, wxID_STATIC, 2940 + wxT("Radius"), 2941 + wxDefaultPosition, 2942 + wxDefaultSize); 2943 + wxBoxSizer *radiusSizer = new wxStaticBoxSizer(radiusBox, wxVERTICAL); 2944 + halo1Sizer->Add(radiusSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2945 + wxTextCtrl *radiusCtrl = 2946 + new wxTextCtrl(panel, ID_SYMBOLIZER_HALO1_RADIUS, wxT("1.0"), 2947 + wxDefaultPosition, wxSize(50, 22)); 2948 + radiusCtrl->Enable(false); 2949 + radiusSizer->Add(radiusCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2950 +// Halo Opacity 2951 + wxStaticBox *opacityHaloBox = new wxStaticBox(panel, wxID_STATIC, 2952 + wxT("Opacity"), 2953 + wxDefaultPosition, 2954 + wxDefaultSize); 2955 + wxBoxSizer *opacityHaloSizer = 2956 + new wxStaticBoxSizer(opacityHaloBox, wxVERTICAL); 2957 + halo1Sizer->Add(opacityHaloSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2958 + wxSlider *opacityHaloCtrl = 2959 + new wxSlider(panel, ID_SYMBOLIZER_HALO1_OPACITY, 100, 0, 100, 2960 + wxDefaultPosition, wxSize(75, 45), 2961 + wxSL_HORIZONTAL | wxSL_LABELS); 2962 + opacityHaloSizer->Add(opacityHaloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2963 + opacityHaloCtrl->Enable(false); 2964 +// Halo color 2965 + wxStaticBox *haloColorBox = new wxStaticBox(panel, wxID_STATIC, 2966 + wxT("Color"), 2967 + wxDefaultPosition, 2968 + wxDefaultSize); 2969 + wxBoxSizer *haloColorSizer = new wxStaticBoxSizer(haloColorBox, wxHORIZONTAL); 2970 + haloSizer->Add(haloColorSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2971 + wxTextCtrl *haloCtrl = new wxTextCtrl(panel, ID_SYMBOLIZER_HALO1_COLOR, 2972 + FillColor, 2973 + wxDefaultPosition, wxSize(80, 22)); 2974 + haloColorSizer->Add(haloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2975 + haloCtrl->Enable(false); 2976 + color = wxColour(0, 0, 0); 2977 + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 2978 + wxStaticBitmap *sampleHaloCtrl = 2979 + new wxStaticBitmap(panel, ID_SYMBOLIZER_HALO1_PICKER_HEX, bmp, 2980 + wxDefaultPosition, wxSize(32, 32)); 2981 + haloColorSizer->Add(sampleHaloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 2982 + wxButton *pickHalo = new wxButton(panel, ID_SYMBOLIZER_HALO1_PICKER_BTN, 2983 + wxT("&Pick a color")); 2984 + haloColorSizer->Add(pickHalo, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 2985 + pickHalo->Enable(false); 2986 + 2987 + panel->SetSizer(topSizer); 2988 + topSizer->Fit(panel); 2989 +// appends event handlers 2990 + Connect(ID_SYMBOLIZER_TEXT1_ENABLE, 2991 + wxEVT_COMMAND_CHECKBOX_CLICKED, 2992 + (wxObjectEventFunction) & QuickStyleVectorDialog::OnCmdLabel1Changed); 2993 + Connect(ID_SYMBOLIZER_FONT1_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 2994 + (wxObjectEventFunction) & 2995 + QuickStyleVectorDialog::OnCmdFont1ColorPicker); 2996 + Connect(ID_SYMBOLIZER_FONT1_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 2997 + (wxObjectEventFunction) & 2998 + QuickStyleVectorDialog::OnCmdFont1ColorChanged); 2999 + Connect(ID_SYMBOLIZER_FONT1_NAME, wxEVT_COMMAND_COMBOBOX_SELECTED, 3000 + (wxObjectEventFunction) & QuickStyleVectorDialog::OnFont1Changed); 3001 + Connect(ID_SYMBOLIZER_HALO1_ENABLE, 3002 + wxEVT_COMMAND_CHECKBOX_CLICKED, 3003 + (wxObjectEventFunction) & 3004 + QuickStyleVectorDialog::OnCmdHalo1EnableChanged); 3005 + Connect(ID_SYMBOLIZER_HALO1_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 3006 + (wxObjectEventFunction) & 3007 + QuickStyleVectorDialog::OnCmdColorHalo1Picker); 3008 + Connect(ID_SYMBOLIZER_HALO1_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 3009 + (wxObjectEventFunction) & 3010 + QuickStyleVectorDialog::OnCmdColorHalo1Changed); 3011 + return panel; 3012 +} 3013 + 3014 +void QuickStyleVectorDialog:: 3015 +OnCmdLabel1Changed(wxCommandEvent & WXUNUSED(event)) 3016 +{ 3017 +// 3018 +// Label enable/disable 3019 +// 3020 + wxCheckBox *enableCtrl = 3021 + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_ENABLE); 3022 + if (enableCtrl->IsChecked() == true) 3023 + { 3024 + Style->SetLabelPrint(true); 3025 + Style->SetLabelLinePlacement(false); 3026 + } else 3027 + Style->SetLabelPrint(false); 3028 + RetrieveTextPointPage(false); 3029 + UpdateTextPointPage(); 3030 +} 3031 + 3032 +void QuickStyleVectorDialog::OnFont1Changed(wxCommandEvent & WXUNUSED(event)) 3033 +{ 3034 +// 3035 +// the Font is changed 3036 +// 3037 + wxCheckBox *boldCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_BOLD); 3038 + wxCheckBox *italicCtrl = 3039 + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_ITALIC); 3040 + wxComboBox *fontList = (wxComboBox *) FindWindow(ID_SYMBOLIZER_FONT1_NAME); 3041 + wxString font = fontList->GetValue(); 3042 + char facename[1024]; 3043 + strcpy(facename, font.ToUTF8()); 3044 + if (strncmp(facename, "ToyFont: ", 9) == 0) 3045 + { 3046 + boldCtrl->Enable(true); 3047 + italicCtrl->Enable(true); 3048 + } else 3049 + { 3050 + bool bold = false; 3051 + bool italic = false; 3052 + MainFrame->CheckTTFont(facename, &bold, &italic); 3053 + boldCtrl->SetValue(bold); 3054 + italicCtrl->SetValue(italic); 3055 + boldCtrl->Enable(false); 3056 + italicCtrl->Enable(false); 3057 + } 3058 +} 3059 + 3060 +void QuickStyleVectorDialog:: 3061 +OnCmdFont1ColorPicker(wxCommandEvent & WXUNUSED(event)) 3062 +{ 3063 +// 3064 +// color picker 3065 +// 3066 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT1_COLOR); 3067 + wxColour clr = wxNullColour; 3068 + wxString str = colorCtrl->GetValue(); 3069 + if (ColorMapEntry::IsValidColor(str) == true) 3070 + ColorMapEntry::GetWxColor(str, clr); 3071 + wxColour color = wxGetColourFromUser(this, clr); 3072 + if (color.IsOk() == true) 3073 + { 3074 + char hex[16]; 3075 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 3076 + wxString str = wxString::FromUTF8(hex); 3077 + colorCtrl->SetValue(str); 3078 + } 3079 +} 3080 + 3081 +void QuickStyleVectorDialog:: 3082 +OnCmdFont1ColorChanged(wxCommandEvent & WXUNUSED(event)) 3083 +{ 3084 +// 3085 +// Font Color changed: updating the visual sample 3086 +// 3087 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT1_COLOR); 3088 + wxStaticBitmap *sampleCtrl = 3089 + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FONT1_PICKER_HEX); 3090 + wxColour back = wxColour(255, 255, 255); 3091 + wxString str = colorCtrl->GetValue(); 3092 + if (ColorMapEntry::IsValidColor(str) == true) 3093 + ColorMapEntry::GetWxColor(str, back); 3094 + wxBitmap bmp; 3095 + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 3096 + sampleCtrl->SetBitmap(bmp); 3097 + sampleCtrl->Refresh(); 3098 + sampleCtrl->Update(); 3099 +} 3100 + 3101 +void QuickStyleVectorDialog:: 3102 +OnCmdColorHalo1Picker(wxCommandEvent & WXUNUSED(event)) 3103 +{ 3104 +// 3105 +// color picker 3106 +// 3107 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO1_COLOR); 3108 + wxColour clr = wxNullColour; 3109 + wxString str = colorCtrl->GetValue(); 3110 + if (ColorMapEntry::IsValidColor(str) == true) 3111 + ColorMapEntry::GetWxColor(str, clr); 3112 + wxColour color = wxGetColourFromUser(this, clr); 3113 + if (color.IsOk() == true) 3114 + { 3115 + char hex[16]; 3116 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 3117 + wxString str = wxString::FromUTF8(hex); 3118 + colorCtrl->SetValue(str); 3119 + } 3120 +} 3121 + 3122 +void QuickStyleVectorDialog:: 3123 +OnCmdColorHalo1Changed(wxCommandEvent & WXUNUSED(event)) 3124 +{ 3125 +// 3126 +// Halo Color changed: updating the visual sample 3127 +// 3128 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO1_COLOR); 3129 + wxStaticBitmap *sampleCtrl = 3130 + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_HALO1_PICKER_HEX); 3131 + wxColour back = wxColour(255, 255, 255); 3132 + wxString str = colorCtrl->GetValue(); 3133 + if (ColorMapEntry::IsValidColor(str) == true) 3134 + ColorMapEntry::GetWxColor(str, back); 3135 + wxBitmap bmp; 3136 + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 3137 + sampleCtrl->SetBitmap(bmp); 3138 + sampleCtrl->Refresh(); 3139 + sampleCtrl->Update(); 3140 +} 3141 + 3142 +void QuickStyleVectorDialog:: 3143 +OnCmdHalo1EnableChanged(wxCommandEvent & WXUNUSED(event)) 3144 +{ 3145 +// 3146 +// Graphic Halo enable/disable 3147 +// 3148 + wxCheckBox *enableCtrl = 3149 + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_HALO1_ENABLE); 3150 + if (enableCtrl->IsChecked() == true) 3151 + Style->EnableHalo(true); 3152 + else 3153 + Style->EnableHalo(false); 3154 + RetrieveTextPointPage(false); 3155 + UpdateTextPointPage(); 3156 +} 3157 + 3158 +wxPanel *QuickStyleVectorDialog::CreateTextLinePage(wxWindow * parent) 3159 +{ 3160 +// 3161 +// creating the Text Symbolizer page (Line Placement) 3162 +// 3163 + wxString FillColor = wxT("#808080"); 3164 + wxPanel *panel = new wxPanel(parent, ID_PANE_TEXT1); 3165 + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); 3166 + panel->SetSizer(topSizer); 3167 + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); 3168 + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); 3169 +// enable/disable Labels 3170 + wxBoxSizer *auxBoxSizer = new wxBoxSizer(wxHORIZONTAL); 3171 + boxSizer->Add(auxBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3172 + wxStaticBox *auxBox = new wxStaticBox(panel, wxID_STATIC, 3173 + wxT("Labels"), 3174 + wxDefaultPosition, 3175 + wxDefaultSize); 3176 + wxBoxSizer *auxSizer = new wxStaticBoxSizer(auxBox, wxVERTICAL); 3177 + auxBoxSizer->Add(auxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3178 + wxBoxSizer *enableSizer = new wxBoxSizer(wxHORIZONTAL); 3179 + auxSizer->Add(enableSizer, 0, wxALIGN_LEFT | wxALL, 5); 3180 + wxCheckBox *enableCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_TEXT2_ENABLE, 3181 + wxT("Enable"), 3182 + wxDefaultPosition, wxDefaultSize); 3183 + enableCtrl->SetValue(Style->IsLabelPrint()); 3184 + enableSizer->Add(enableCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3185 + enableSizer->AddSpacer(20); 3186 + enableSizer->AddSpacer(20); 3187 + enableSizer->AddSpacer(20); 3188 + enableSizer->AddSpacer(20); 3189 + wxStaticText *columnLabel = 3190 + new wxStaticText(panel, wxID_STATIC, wxT("&Column:")); 3191 + enableSizer->Add(columnLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3192 + wxComboBox *columnList = 3193 + new wxComboBox(panel, ID_SYMBOLIZER_TEXT2_LABEL, wxT(""), wxDefaultPosition, 3194 + wxSize(400, 22), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); 3195 + InitializeComboColumns(columnList); 3196 + enableSizer->Add(columnList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3197 + 3198 + 3199 + wxStaticBox *fontBox = new wxStaticBox(panel, wxID_STATIC, 3200 + wxT("Font"), 3201 + wxDefaultPosition, 3202 + wxDefaultSize); 3203 + wxBoxSizer *font9Sizer = new wxStaticBoxSizer(fontBox, wxHORIZONTAL); 3204 + auxSizer->Add(font9Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3205 +// Second row: Font Name, Size and Fill 3206 + wxBoxSizer *fontSizer = new wxBoxSizer(wxHORIZONTAL); 3207 + font9Sizer->Add(fontSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3208 + wxBoxSizer *font0Sizer = new wxBoxSizer(wxHORIZONTAL); 3209 + fontSizer->Add(font0Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3210 +// Font Name 3211 + wxBoxSizer *fontXSizer = new wxBoxSizer(wxVERTICAL); 3212 + font0Sizer->Add(fontXSizer, 0, wxALIGN_LEFT | wxALL, 0); 3213 + wxComboBox *fontList = 3214 + new wxComboBox(panel, ID_SYMBOLIZER_FONT2_NAME, wxT(""), wxDefaultPosition, 3215 + wxSize(250, 21), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); 3216 + InitializeComboFonts(fontList); 3217 + fontList->Select(0); 3218 + fontXSizer->Add(fontList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3219 +// Font Size 3220 + wxBoxSizer *fontYSizer = new wxBoxSizer(wxHORIZONTAL); 3221 + fontXSizer->Add(fontYSizer, 0, wxALIGN_LEFT | wxALL, 0); 3222 + wxStaticBox *sizeBox = new wxStaticBox(panel, wxID_STATIC, 3223 + wxT("Font Size"), 3224 + wxDefaultPosition, 3225 + wxDefaultSize); 3226 + wxBoxSizer *sizeSizer = new wxStaticBoxSizer(sizeBox, wxVERTICAL); 3227 + fontYSizer->Add(sizeSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3228 + wxTextCtrl *sizeCtrl = 3229 + new wxTextCtrl(panel, ID_SYMBOLIZER_FONT2_SIZE, wxT("15.0"), 3230 + wxDefaultPosition, wxSize(100, 22)); 3231 + sizeSizer->Add(sizeCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 3232 + wxBoxSizer *boldBoxSizer = new wxBoxSizer(wxHORIZONTAL); 3233 + fontYSizer->Add(boldBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3234 + wxStaticBox *boldBox = new wxStaticBox(panel, wxID_STATIC, 3235 + wxT("Font Style"), 3236 + wxDefaultPosition, 3237 + wxDefaultSize); 3238 + wxBoxSizer *boldSizer = new wxStaticBoxSizer(boldBox, wxHORIZONTAL); 3239 + boldBoxSizer->Add(boldSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3240 + wxBoxSizer *italicSizer = new wxBoxSizer(wxHORIZONTAL); 3241 + boldSizer->Add(italicSizer, 0, wxALIGN_LEFT | wxALL, 5); 3242 + wxCheckBox *italicCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_TEXT2_ITALIC, 3243 + wxT("Italic"), 3244 + wxDefaultPosition, wxDefaultSize); 3245 + italicCtrl->SetValue(false); 3246 + italicCtrl->Enable(false); 3247 + italicSizer->Add(italicCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3248 + wxCheckBox *boldCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_TEXT2_BOLD, 3249 + wxT("Bold"), 3250 + wxDefaultPosition, wxDefaultSize); 3251 + boldCtrl->SetValue(false); 3252 + boldCtrl->Enable(false); 3253 + italicSizer->Add(boldCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3254 +// Font Opacity 3255 + wxStaticBox *opacityFontBox = new wxStaticBox(panel, wxID_STATIC, 3256 + wxT("Opacity"), 3257 + wxDefaultPosition, 3258 + wxDefaultSize); 3259 + wxBoxSizer *opacityFontSizer = 3260 + new wxStaticBoxSizer(opacityFontBox, wxVERTICAL); 3261 + fontSizer->Add(opacityFontSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3262 + wxSlider *opacityFontCtrl = 3263 + new wxSlider(panel, ID_SYMBOLIZER_FONT2_OPACITY, 100, 0, 100, 3264 + wxDefaultPosition, wxSize(150, 35), 3265 + wxSL_HORIZONTAL | wxSL_LABELS); 3266 + opacityFontSizer->Add(opacityFontCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3267 +// Font color 3268 + wxStaticBox *fontColorBox = new wxStaticBox(panel, wxID_STATIC, 3269 + wxT("Color"), 3270 + wxDefaultPosition, 3271 + wxDefaultSize); 3272 + wxBoxSizer *fontColorSizer = new wxStaticBoxSizer(fontColorBox, wxHORIZONTAL); 3273 + fontSizer->Add(fontColorSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 3274 + wxBoxSizer *font2Sizer = new wxBoxSizer(wxVERTICAL); 3275 + fontColorSizer->Add(font2Sizer, 0, wxALIGN_RIGHT | wxALL, 0); 3276 + wxTextCtrl *fontCtrl = new wxTextCtrl(panel, ID_SYMBOLIZER_FONT2_COLOR, 3277 + FillColor, 3278 + wxDefaultPosition, wxSize(80, 22)); 3279 + font2Sizer->Add(fontCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2); 3280 + wxBitmap bmp; 3281 + wxColour color(0, 0, 0); 3282 + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 3283 + wxStaticBitmap *sampleFontCtrl = 3284 + new wxStaticBitmap(panel, ID_SYMBOLIZER_FONT2_PICKER_HEX, bmp, 3285 + wxDefaultPosition, wxSize(32, 32)); 3286 + fontColorSizer->Add(sampleFontCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 3287 + wxButton *pickFont = new wxButton(panel, ID_SYMBOLIZER_FONT2_PICKER_BTN, 3288 + wxT("&Pick a color")); 3289 + font2Sizer->Add(pickFont, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2); 3290 +// second row: LinePlacement 3291 + wxBoxSizer *lineBoxSizer = new wxBoxSizer(wxHORIZONTAL); 3292 + auxSizer->Add(lineBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3293 + wxStaticBox *lineBox = new wxStaticBox(panel, wxID_STATIC, 3294 + wxT("Label Line Placement"), 3295 + wxDefaultPosition, 3296 + wxDefaultSize); 3297 + wxBoxSizer *lineSizer = new wxStaticBoxSizer(lineBox, wxVERTICAL); 3298 + lineBoxSizer->Add(lineSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3299 +// second row A: PerpendicularOffset 3300 + wxBoxSizer *perpendicularBoxSizer = new wxBoxSizer(wxHORIZONTAL); 3301 + lineSizer->Add(perpendicularBoxSizer, 0, 3302 + wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3303 + wxStaticBox *perpendicularBox = new wxStaticBox(panel, wxID_STATIC, 3304 + wxT("Perpendicular Offset"), 3305 + wxDefaultPosition, 3306 + wxDefaultSize); 3307 + wxBoxSizer *perpendicularSizer = 3308 + new wxStaticBoxSizer(perpendicularBox, wxVERTICAL); 3309 + perpendicularBoxSizer->Add(perpendicularSizer, 0, 3310 + wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 3311 + wxBoxSizer *perp1Sizer = new wxBoxSizer(wxHORIZONTAL); 3312 + perpendicularSizer->Add(perp1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3313 + wxTextCtrl *perpendicularCtrl = 3314 + new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_PERPENDICULAR, wxT("0.0"), 3315 + wxDefaultPosition, wxSize(100, 22)); 3316 + perp1Sizer->Add(perpendicularCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 3317 + perpendicularCtrl->Enable(false); 3318 + wxStaticText *perp1Label = new wxStaticText(panel, wxID_STATIC, 3319 + wxT 3320 + ("Draw lines in parallel to the original geometry.")); 3321 + perp1Sizer->Add(perp1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 3322 + wxStaticText *perp2Label = new wxStaticText(panel, wxID_STATIC, 3323 + wxT 3324 + ("Positive to the left-hand side. Negative numbers mean right.")); 3325 + perpendicularSizer->Add(perp2Label, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3326 +// second row B: IsRepeated, InitialGap and Gap 3327 + wxBoxSizer *repeatedBoxSizer = new wxBoxSizer(wxHORIZONTAL); 3328 + lineSizer->Add(repeatedBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3329 + wxStaticBox *repeatedBox = new wxStaticBox(panel, wxID_STATIC, 3330 + wxT("Repeated Label"), 3331 + wxDefaultPosition, 3332 + wxDefaultSize); 3333 + wxBoxSizer *repeatedSizer = new wxStaticBoxSizer(repeatedBox, wxHORIZONTAL); 3334 + repeatedBoxSizer->Add(repeatedSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 3335 + wxCheckBox *isRepeatedCtrl = 3336 + new wxCheckBox(panel, ID_SYMBOLIZER_TEXT_IS_REPEATED, 3337 + wxT("Repeated"), 3338 + wxDefaultPosition, wxDefaultSize); 3339 + isRepeatedCtrl->SetValue(false); 3340 + isRepeatedCtrl->Enable(false); 3341 + repeatedSizer->Add(isRepeatedCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3342 + wxStaticBox *inigapBox = new wxStaticBox(panel, wxID_STATIC, 3343 + wxT("Initial Gap"), 3344 + wxDefaultPosition, 3345 + wxDefaultSize); 3346 + wxBoxSizer *inigapSizer = new wxStaticBoxSizer(inigapBox, wxVERTICAL); 3347 + repeatedSizer->Add(inigapSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 3348 + wxTextCtrl *inigapCtrl = 3349 + new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_INITIAL_GAP, wxT("0.0"), 3350 + wxDefaultPosition, wxSize(60, 22)); 3351 + inigapCtrl->Enable(false); 3352 + inigapSizer->Add(inigapCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3353 + wxStaticBox *gapBox = new wxStaticBox(panel, wxID_STATIC, 3354 + wxT("Gap"), 3355 + wxDefaultPosition, 3356 + wxDefaultSize); 3357 + wxBoxSizer *gapSizer = new wxStaticBoxSizer(gapBox, wxVERTICAL); 3358 + repeatedSizer->Add(gapSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 3359 + wxTextCtrl *gapCtrl = 3360 + new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_GAP, wxT("0.0"), 3361 + wxDefaultPosition, wxSize(60, 22)); 3362 + gapCtrl->Enable(false); 3363 + gapSizer->Add(gapCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3364 +// second row C: IsAligned and Generalize 3365 + wxBoxSizer *optBoxSizer = new wxBoxSizer(wxHORIZONTAL); 3366 + repeatedBoxSizer->Add(optBoxSizer, 0, wxALIGN_LEFT | wxALL, 0); 3367 + wxStaticBox *optBox = new wxStaticBox(panel, wxID_STATIC, 3368 + wxT("Options"), 3369 + wxDefaultPosition, 3370 + wxDefaultSize); 3371 + wxBoxSizer *optSizer = new wxStaticBoxSizer(optBox, wxVERTICAL); 3372 + optBoxSizer->Add(optSizer, 0, wxALIGN_LEFT | wxALL, 5); 3373 + wxCheckBox *isAlignedCtrl = 3374 + new wxCheckBox(panel, ID_SYMBOLIZER_TEXT_IS_ALIGNED, 3375 + wxT("Aligned"), 3376 + wxDefaultPosition, wxDefaultSize); 3377 + isAlignedCtrl->SetValue(false); 3378 + isAlignedCtrl->Enable(false); 3379 + optSizer->Add(isAlignedCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3380 + wxCheckBox *generalizeCtrl = 3381 + new wxCheckBox(panel, ID_SYMBOLIZER_TEXT_GENERALIZE, 3382 + wxT("Generalize"), 3383 + wxDefaultPosition, wxDefaultSize); 3384 + generalizeCtrl->SetValue(false); 3385 + generalizeCtrl->Enable(false); 3386 + optSizer->Add(generalizeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3387 +// Halo 3388 + wxBoxSizer *haloBoxSizer = new wxBoxSizer(wxVERTICAL); 3389 + lineBoxSizer->Add(haloBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 3390 + wxStaticBox *haloBox = new wxStaticBox(panel, wxID_STATIC, 3391 + wxT("Font Halo"), 3392 + wxDefaultPosition, 3393 + wxDefaultSize); 3394 + wxBoxSizer *haloSizer = new wxStaticBoxSizer(haloBox, wxVERTICAL); 3395 + haloBoxSizer->Add(haloSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 3396 + wxBoxSizer *halo0Sizer = new wxBoxSizer(wxHORIZONTAL); 3397 + haloSizer->Add(halo0Sizer, 0, wxALIGN_LEFT | wxALL, 0); 3398 + wxCheckBox *enableHaloCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_HALO2_ENABLE, 3399 + wxT("Enable"), 3400 + wxDefaultPosition, wxDefaultSize); 3401 + enableHaloCtrl->SetValue(Style->IsHaloEnabled()); 3402 + enableHaloCtrl->Enable(false); 3403 + halo0Sizer->Add(enableHaloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 3404 +// Halo Radius 3405 + wxStaticBox *radiusBox = new wxStaticBox(panel, wxID_STATIC, 3406 + wxT("Radius"), 3407 + wxDefaultPosition, 3408 + wxDefaultSize); 3409 + wxBoxSizer *radiusSizer = new wxStaticBoxSizer(radiusBox, wxVERTICAL); 3410 + halo0Sizer->Add(radiusSizer, 0, wxALIGN_RIGHT | wxALL, 2); 3411 + wxTextCtrl *radiusCtrl = 3412 + new wxTextCtrl(panel, ID_SYMBOLIZER_HALO2_RADIUS, wxT("1.0"), 3413 + wxDefaultPosition, wxSize(50, 22)); 3414 + radiusCtrl->Enable(false); 3415 + radiusSizer->Add(radiusCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 3416 +// Halo Opacity 3417 + wxStaticBox *opacityHaloBox = new wxStaticBox(panel, wxID_STATIC, 3418 + wxT("Opacity"), 3419 + wxDefaultPosition, 3420 + wxDefaultSize); 3421 + wxBoxSizer *opacityHaloSizer = 3422 + new wxStaticBoxSizer(opacityHaloBox, wxVERTICAL); 3423 + haloSizer->Add(opacityHaloSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2); 3424 + wxSlider *opacityHaloCtrl = 3425 + new wxSlider(panel, ID_SYMBOLIZER_HALO2_OPACITY, 100, 0, 100, 3426 + wxDefaultPosition, wxSize(130, 35), 3427 + wxSL_HORIZONTAL | wxSL_LABELS); 3428 + opacityHaloSizer->Add(opacityHaloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 3429 + opacityHaloCtrl->Enable(false); 3430 +// Halo color 3431 + wxStaticBox *haloColorBox = new wxStaticBox(panel, wxID_STATIC, 3432 + wxT("Color"), 3433 + wxDefaultPosition, 3434 + wxDefaultSize); 3435 + wxBoxSizer *haloColorSizer = new wxStaticBoxSizer(haloColorBox, wxHORIZONTAL); 3436 + haloSizer->Add(haloColorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2); 3437 + wxBoxSizer *halo2Sizer = new wxBoxSizer(wxVERTICAL); 3438 + haloColorSizer->Add(halo2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 3439 + wxTextCtrl *haloCtrl = new wxTextCtrl(panel, ID_SYMBOLIZER_HALO2_COLOR, 3440 + FillColor, 3441 + wxDefaultPosition, wxSize(80, 22)); 3442 + halo2Sizer->Add(haloCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2); 3443 + haloCtrl->Enable(false); 3444 + color = wxColour(0, 0, 0); 3445 + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 3446 + wxStaticBitmap *sampleHaloCtrl = 3447 + new wxStaticBitmap(panel, ID_SYMBOLIZER_HALO2_PICKER_HEX, bmp, 3448 + wxDefaultPosition, wxSize(32, 32)); 3449 + haloColorSizer->Add(sampleHaloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 3450 + wxButton *pickHalo = new wxButton(panel, ID_SYMBOLIZER_HALO2_PICKER_BTN, 3451 + wxT("&Pick a color")); 3452 + halo2Sizer->Add(pickHalo, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2); 3453 + pickHalo->Enable(false); 3454 + 3455 + panel->SetSizer(topSizer); 3456 + topSizer->Fit(panel); 3457 +// appends event handlers 3458 + Connect(ID_SYMBOLIZER_TEXT2_ENABLE, 3459 + wxEVT_COMMAND_CHECKBOX_CLICKED, 3460 + (wxObjectEventFunction) & QuickStyleVectorDialog::OnCmdLabel2Changed); 3461 + Connect(ID_SYMBOLIZER_FONT2_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 3462 + (wxObjectEventFunction) & 3463 + QuickStyleVectorDialog::OnCmdFont2ColorPicker); 3464 + Connect(ID_SYMBOLIZER_FONT2_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 3465 + (wxObjectEventFunction) & 3466 + QuickStyleVectorDialog::OnCmdFont2ColorChanged); 3467 + Connect(ID_SYMBOLIZER_TEXT_IS_REPEATED, 3468 + wxEVT_COMMAND_CHECKBOX_CLICKED, 3469 + (wxObjectEventFunction) & 3470 + QuickStyleVectorDialog::OnCmdIsRepeatedChanged); 3471 + Connect(ID_SYMBOLIZER_TEXT_IS_ALIGNED, 3472 + wxEVT_COMMAND_CHECKBOX_CLICKED, 3473 + (wxObjectEventFunction) & 3474 + QuickStyleVectorDialog::OnCmdIsAlignedChanged); 3475 + Connect(ID_SYMBOLIZER_TEXT_GENERALIZE, 3476 + wxEVT_COMMAND_CHECKBOX_CLICKED, 3477 + (wxObjectEventFunction) & 3478 + QuickStyleVectorDialog::OnCmdGeneralizeLineChanged); 3479 + Connect(ID_SYMBOLIZER_FONT2_NAME, wxEVT_COMMAND_COMBOBOX_SELECTED, 3480 + (wxObjectEventFunction) & QuickStyleVectorDialog::OnFont2Changed); 3481 + Connect(ID_SYMBOLIZER_HALO2_ENABLE, 3482 + wxEVT_COMMAND_CHECKBOX_CLICKED, 3483 + (wxObjectEventFunction) & 3484 + QuickStyleVectorDialog::OnCmdHalo2EnableChanged); 3485 + Connect(ID_SYMBOLIZER_HALO2_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 3486 + (wxObjectEventFunction) & 3487 + QuickStyleVectorDialog::OnCmdColorHalo2Picker); 3488 + Connect(ID_SYMBOLIZER_HALO2_COLOR, wxEVT_COMMAND_TEXT_UPDATED, 3489 + (wxObjectEventFunction) & 3490 + QuickStyleVectorDialog::OnCmdColorHalo2Changed); 3491 + return panel; 3492 +} 3493 + 3494 +void QuickStyleVectorDialog:: 3495 +OnCmdLabel2Changed(wxCommandEvent & WXUNUSED(event)) 3496 +{ 3497 +// 3498 +// Label enable/disable 3499 +// 3500 + wxCheckBox *enableCtrl = 3501 + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_ENABLE); 3502 + if (enableCtrl->IsChecked() == true) 3503 + { 3504 + Style->SetLabelPrint(true); 3505 + Style->SetLabelLinePlacement(true); 3506 + } else 3507 + Style->SetLabelPrint(false); 3508 + RetrieveTextLinePage(false); 3509 + UpdateTextLinePage(); 3510 +} 3511 + 3512 +void QuickStyleVectorDialog::OnFont2Changed(wxCommandEvent & WXUNUSED(event)) 3513 +{ 3514 +// 3515 +// the Font is changed 3516 +// 3517 + wxCheckBox *boldCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_BOLD); 3518 + wxCheckBox *italicCtrl = 3519 + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_ITALIC); 3520 + wxComboBox *fontList = (wxComboBox *) FindWindow(ID_SYMBOLIZER_FONT2_NAME); 3521 + wxString font = fontList->GetValue(); 3522 + char facename[1024]; 3523 + strcpy(facename, font.ToUTF8()); 3524 + if (strncmp(facename, "ToyFont: ", 9) == 0) 3525 + { 3526 + boldCtrl->Enable(true); 3527 + italicCtrl->Enable(true); 3528 + } else 3529 + { 3530 + bool bold = false; 3531 + bool italic = false; 3532 + MainFrame->CheckTTFont(facename, &bold, &italic); 3533 + boldCtrl->SetValue(bold); 3534 + italicCtrl->SetValue(italic); 3535 + boldCtrl->Enable(false); 3536 + italicCtrl->Enable(false); 3537 + } 3538 +} 3539 + 3540 +void QuickStyleVectorDialog:: 3541 +OnCmdFont2ColorPicker(wxCommandEvent & WXUNUSED(event)) 3542 +{ 3543 +// 3544 +// color picker 3545 +// 3546 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT2_COLOR); 3547 + wxColour clr = wxNullColour; 3548 + wxString str = colorCtrl->GetValue(); 3549 + if (ColorMapEntry::IsValidColor(str) == true) 3550 + ColorMapEntry::GetWxColor(str, clr); 3551 + wxColour color = wxGetColourFromUser(this, clr); 3552 + if (color.IsOk() == true) 3553 + { 3554 + char hex[16]; 3555 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 3556 + wxString str = wxString::FromUTF8(hex); 3557 + colorCtrl->SetValue(str); 3558 + } 3559 +} 3560 + 3561 +void QuickStyleVectorDialog:: 3562 +OnCmdFont2ColorChanged(wxCommandEvent & WXUNUSED(event)) 3563 +{ 3564 +// 3565 +// Font Color changed: updating the visual sample 3566 +// 3567 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT2_COLOR); 3568 + wxStaticBitmap *sampleCtrl = 3569 + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FONT2_PICKER_HEX); 3570 + wxColour back = wxColour(255, 255, 255); 3571 + wxString str = colorCtrl->GetValue(); 3572 + if (ColorMapEntry::IsValidColor(str) == true) 3573 + ColorMapEntry::GetWxColor(str, back); 3574 + wxBitmap bmp; 3575 + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 3576 + sampleCtrl->SetBitmap(bmp); 3577 + sampleCtrl->Refresh(); 3578 + sampleCtrl->Update(); 3579 +} 3580 + 3581 +void QuickStyleVectorDialog:: 3582 +OnCmdIsRepeatedChanged(wxCommandEvent & WXUNUSED(event)) 3583 +{ 3584 +// 3585 +// Label IsRepeated enable/disable 3586 +// 3587 + wxCheckBox *repeatedCtrl = 3588 + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT_IS_REPEATED); 3589 + if (repeatedCtrl->IsChecked() == true) 3590 + Style->SetRepeatedLabel(true); 3591 + else 3592 + Style->SetRepeatedLabel(false); 3593 + RetrieveTextLinePage(false); 3594 + UpdateTextLinePage(); 3595 +} 3596 + 3597 +void QuickStyleVectorDialog:: 3598 +OnCmdIsAlignedChanged(wxCommandEvent & WXUNUSED(event)) 3599 +{ 3600 +// 3601 +// Label IsAligned enable/disable 3602 +// 3603 + wxCheckBox *alignedCtrl = 3604 + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT_IS_ALIGNED); 3605 + if (alignedCtrl->IsChecked() == true) 3606 + Style->SetLabelIsAligned(true); 3607 + else 3608 + Style->SetLabelIsAligned(false); 3609 +} 3610 + 3611 +void QuickStyleVectorDialog:: 3612 +OnCmdGeneralizeLineChanged(wxCommandEvent & WXUNUSED(event)) 3613 +{ 3614 +// 3615 +// Label GeneralizeLine enable/disable 3616 +// 3617 + wxCheckBox *generalizeCtrl = 3618 + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT_GENERALIZE); 3619 + if (generalizeCtrl->IsChecked() == true) 3620 + Style->SetLabelGeneralizeLine(true); 3621 + else 3622 + Style->SetLabelGeneralizeLine(false); 3623 +} 3624 + 3625 +void QuickStyleVectorDialog:: 3626 +OnCmdColorHalo2Picker(wxCommandEvent & WXUNUSED(event)) 3627 +{ 3628 +// 3629 +// color picker 3630 +// 3631 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO2_COLOR); 3632 + wxColour clr = wxNullColour; 3633 + wxString str = colorCtrl->GetValue(); 3634 + if (ColorMapEntry::IsValidColor(str) == true) 3635 + ColorMapEntry::GetWxColor(str, clr); 3636 + wxColour color = wxGetColourFromUser(this, clr); 3637 + if (color.IsOk() == true) 3638 + { 3639 + char hex[16]; 3640 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 3641 + wxString str = wxString::FromUTF8(hex); 3642 + colorCtrl->SetValue(str); 3643 + } 3644 +} 3645 + 3646 +void QuickStyleVectorDialog:: 3647 +OnCmdColorHalo2Changed(wxCommandEvent & WXUNUSED(event)) 3648 +{ 3649 +// 3650 +// Halo Color changed: updating the visual sample 3651 +// 3652 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO2_COLOR); 3653 + wxStaticBitmap *sampleCtrl = 3654 + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_HALO2_PICKER_HEX); 3655 + wxColour back = wxColour(255, 255, 255); 3656 + wxString str = colorCtrl->GetValue(); 3657 + if (ColorMapEntry::IsValidColor(str) == true) 3658 + ColorMapEntry::GetWxColor(str, back); 3659 + wxBitmap bmp; 3660 + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 3661 + sampleCtrl->SetBitmap(bmp); 3662 + sampleCtrl->Refresh(); 3663 + sampleCtrl->Update(); 3664 +} 3665 + 3666 +void QuickStyleVectorDialog:: 3667 +OnCmdHalo2EnableChanged(wxCommandEvent & WXUNUSED(event)) 3668 +{ 3669 +// 3670 +// Graphic Halo enable/disable 3671 +// 3672 + wxCheckBox *enableCtrl = 3673 + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_HALO2_ENABLE); 3674 + if (enableCtrl->IsChecked() == true) 3675 + Style->EnableHalo(true); 3676 + else 3677 + Style->EnableHalo(false); 3678 + RetrieveTextLinePage(false); 3679 + UpdateTextLinePage(); 3680 +} 3681 + 3682 +bool QuickStyleVectorDialog::RetrieveMainPage() 3683 +{ 3684 +// 3685 +// retrieving params from the MAIN page 3686 +// 3687 + double min = Style->GetScaleMin(); 3688 + double max = Style->GetScaleMax(); 3689 + if (Style->IsMinScaleEnabled() == true) 3690 + { 3691 + wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); 3692 + wxString value = minCtrl->GetValue(); 3693 + if (value.ToDouble(&min) != true) 3694 + { 3695 + wxMessageBox(wxT 3696 + ("MIN_SCALE isn't a valid decimal number !!!"), 3697 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3698 + return false; 3699 + } 3700 + if (min < 0.0) 3701 + { 3702 + wxMessageBox(wxT 3703 + ("MIN_SCALE must be a positive number !!!"), 3704 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3705 + return false; 3706 + } 3707 + } 3708 + if (Style->IsMaxScaleEnabled() == true) 3709 + { 3710 + wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); 3711 + wxString value = maxCtrl->GetValue(); 3712 + if (value.ToDouble(&max) != true) 3713 + { 3714 + wxMessageBox(wxT 3715 + ("MAX_SCALE isn't a valid decimal number !!!"), 3716 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3717 + return false; 3718 + } 3719 + if (max < 0.0) 3720 + { 3721 + wxMessageBox(wxT 3722 + ("MAX_SCALE must be a positive number !!!"), 3723 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3724 + return false; 3725 + } 3726 + } 3727 + if (Style->IsMinScaleEnabled() == true && Style->IsMaxScaleEnabled() == true) 3728 + { 3729 + if (min >= max) 3730 + { 3731 + wxMessageBox(wxT 3732 + ("MAX_SCALE is always expected to be greater than MIN_SCALE !!!"), 3733 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3734 + return false; 3735 + } 3736 + } 3737 + Style->SetScaleMin(min); 3738 + Style->SetScaleMax(max); 3739 + return true; 3740 +} 3741 + 3742 +void QuickStyleVectorDialog::UpdateMainPage() 3743 +{ 3744 +// 3745 +// updating the MAIN page 3746 +// 3747 + wxRadioBox *rangeBox = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MINMAX_SCALE); 3748 + if (Style->IsMinScaleEnabled() != true && Style->IsMaxScaleEnabled() != true) 3749 + rangeBox->SetSelection(0); 3750 + else if (Style->IsMinScaleEnabled() == true 3751 + && Style->IsMaxScaleEnabled() != true) 3752 + rangeBox->SetSelection(1); 3753 + else if (Style->IsMinScaleEnabled() != true 3754 + && Style->IsMaxScaleEnabled() == true) 3755 + rangeBox->SetSelection(2); 3756 + else 3757 + rangeBox->SetSelection(3); 3758 + wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); 3759 + char dummy[64]; 3760 + wxString str; 3761 + if (Style->IsMinScaleEnabled() == true) 3762 + { 3763 + sprintf(dummy, "%1.2f", Style->GetScaleMin()); 3764 + str = wxString::FromUTF8(dummy); 3765 + minCtrl->SetValue(str); 3766 + minCtrl->Enable(true); 3767 + } else 3768 + { 3769 + str = wxT("0.0"); 3770 + minCtrl->SetValue(str); 3771 + minCtrl->Enable(false); 3772 + } 3773 + wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); 3774 + if (Style->IsMaxScaleEnabled() == true) 3775 + { 3776 + sprintf(dummy, "%1.2f", Style->GetScaleMax()); 3777 + str = wxString::FromUTF8(dummy); 3778 + maxCtrl->SetValue(str); 3779 + maxCtrl->Enable(true); 3780 + } else 3781 + { 3782 + str = wxT("+Infinite"); 3783 + maxCtrl->SetValue(str); 3784 + maxCtrl->Enable(false); 3785 + } 3786 +} 3787 + 3788 +bool QuickStyleVectorDialog::RetrievePointPage(bool check) 3789 +{ 3790 +// 3791 +// retrieving params from the Point Symbolizer page 3792 +// 3793 + double opacity; 3794 + double size; 3795 + double rotation; 3796 + double anchorPointX; 3797 + double anchorPointY; 3798 + double displacementX; 3799 + double displacementY; 3800 + char fillColor[8]; 3801 + char strokeColor[8]; 3802 + wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_OPACITY); 3803 + opacity = opacityCtrl->GetValue() / 100.0; 3804 + wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_SIZE); 3805 + wxString value = sizeCtrl->GetValue(); 3806 + if (value.ToDouble(&size) != true) 3807 + { 3808 + if (check == true) 3809 + { 3810 + wxMessageBox(wxT 3811 + ("SIZE isn't a valid decimal number !!!"), 3812 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3813 + return false; 3814 + } 3815 + } 3816 + if (size < 0.0) 3817 + { 3818 + if (check == true) 3819 + { 3820 + wxMessageBox(wxT 3821 + ("SIZE must be a positive number !!!"), 3822 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3823 + return false; 3824 + } 3825 + } 3826 + wxTextCtrl *rotationCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_ROTATION); 3827 + value = rotationCtrl->GetValue(); 3828 + if (value.ToDouble(&rotation) != true) 3829 + { 3830 + if (check == true) 3831 + { 3832 + wxMessageBox(wxT 3833 + ("ROTATION isn't a valid decimal number !!!"), 3834 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3835 + return false; 3836 + } 3837 + } 3838 + wxTextCtrl *anchorXCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_ANCHOR_X); 3839 + value = anchorXCtrl->GetValue(); 3840 + if (value.ToDouble(&anchorPointX) != true) 3841 + { 3842 + if (check == true) 3843 + { 3844 + wxMessageBox(wxT 3845 + ("ANCHOR-POINT-X isn't a valid decimal number !!!"), 3846 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3847 + return false; 3848 + } 3849 + } 3850 + if (anchorPointX < 0.0 || anchorPointX > 1.0) 3851 + { 3852 + if (check == true) 3853 + { 3854 + wxMessageBox(wxT 3855 + ("ANCHOR-POINT-X must be between 0.0 and 1.0 !!!"), 3856 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3857 + return false; 3858 + } 3859 + } 3860 + wxTextCtrl *anchorYCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_ANCHOR_Y); 3861 + value = anchorYCtrl->GetValue(); 3862 + if (value.ToDouble(&anchorPointY) != true) 3863 + { 3864 + if (check == true) 3865 + { 3866 + wxMessageBox(wxT 3867 + ("ANCHOR-POINT-Y isn't a valid decimal number !!!"), 3868 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3869 + return false; 3870 + } 3871 + } 3872 + if (anchorPointY < 0.0 || anchorPointY > 1.0) 3873 + { 3874 + if (check == true) 3875 + { 3876 + wxMessageBox(wxT 3877 + ("ANCHOR-POINT-Y must be between 0.0 and 1.0 !!!"), 3878 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3879 + return false; 3880 + } 3881 + } 3882 + wxTextCtrl *displXCtrl = 3883 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_DISPLACEMENT_X); 3884 + value = displXCtrl->GetValue(); 3885 + if (value.ToDouble(&displacementX) != true) 3886 + { 3887 + if (check == true) 3888 + { 3889 + wxMessageBox(wxT 3890 + ("DISPLACEMENT-X isn't a valid decimal number !!!"), 3891 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3892 + return false; 3893 + } 3894 + } 3895 + wxTextCtrl *displYCtrl = 3896 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_DISPLACEMENT_Y); 3897 + value = displYCtrl->GetValue(); 3898 + if (value.ToDouble(&displacementY) != true) 3899 + { 3900 + if (check == true) 3901 + { 3902 + wxMessageBox(wxT 3903 + ("DISPLACEMENT-Y isn't a valid decimal number !!!"), 3904 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3905 + return false; 3906 + } 3907 + } 3908 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL_COLOR); 3909 + wxString color = colorCtrl->GetValue(); 3910 + if (ColorMapEntry::IsValidColor(color) != true) 3911 + { 3912 + if (check == true) 3913 + { 3914 + wxMessageBox(wxT 3915 + ("FILL-COLOR isn't a valid HexRGB color !!!"), 3916 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3917 + return false; 3918 + } 3919 + } 3920 + strcpy(fillColor, color.ToUTF8()); 3921 + colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE_COLOR); 3922 + color = colorCtrl->GetValue(); 3923 + if (ColorMapEntry::IsValidColor(color) != true) 3924 + { 3925 + if (check == true) 3926 + { 3927 + wxMessageBox(wxT 3928 + ("STROKE-COLOR isn't a valid HexRGB color !!!"), 3929 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 3930 + return false; 3931 + } 3932 + } 3933 + strcpy(strokeColor, color.ToUTF8()); 3934 + 3935 + Style->SetSymbolOpacity(opacity); 3936 + Style->SetSymbolSize(size); 3937 + Style->SetSymbolAnchorX(anchorPointX); 3938 + Style->SetSymbolAnchorY(anchorPointY); 3939 + Style->SetSymbolRotation(rotation); 3940 + Style->SetSymbolDisplacementX(displacementX); 3941 + Style->SetSymbolDisplacementY(displacementY); 3942 + Style->SetSymbolFillColor(fillColor); 3943 + Style->SetSymbolStrokeColor(strokeColor); 3944 + return true; 3945 +} 3946 + 3947 +void QuickStyleVectorDialog::UpdatePointPage() 3948 +{ 3949 +// 3950 +// updating the Point Symbolizer page 3951 +// 3952 + wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_OPACITY); 3953 + opacityCtrl->SetValue(Style->GetSymbolOpacity() * 100.0); 3954 + wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_SIZE); 3955 + char dummy[64]; 3956 + sprintf(dummy, "%1.2f", Style->GetSymbolSize()); 3957 + wxString str = wxString::FromUTF8(dummy); 3958 + sizeCtrl->SetValue(str); 3959 + wxTextCtrl *rotationCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_ROTATION); 3960 + sprintf(dummy, "%1.2f", Style->GetSymbolRotation()); 3961 + str = wxString::FromUTF8(dummy); 3962 + rotationCtrl->SetValue(str); 3963 + wxTextCtrl *anchorXCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_ANCHOR_X); 3964 + sprintf(dummy, "%1.2f", Style->GetSymbolAnchorX()); 3965 + str = wxString::FromUTF8(dummy); 3966 + anchorXCtrl->SetValue(str); 3967 + wxTextCtrl *anchorYCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_ANCHOR_Y); 3968 + sprintf(dummy, "%1.2f", Style->GetSymbolAnchorY()); 3969 + str = wxString::FromUTF8(dummy); 3970 + anchorYCtrl->SetValue(str); 3971 + wxTextCtrl *displXCtrl = 3972 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_DISPLACEMENT_X); 3973 + sprintf(dummy, "%1.2f", Style->GetSymbolDisplacementX()); 3974 + str = wxString::FromUTF8(dummy); 3975 + displXCtrl->SetValue(str); 3976 + wxTextCtrl *displYCtrl = 3977 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_DISPLACEMENT_Y); 3978 + sprintf(dummy, "%1.2f", Style->GetSymbolDisplacementY()); 3979 + str = wxString::FromUTF8(dummy); 3980 + displYCtrl->SetValue(str); 3981 + wxRadioBox *markCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MARK); 3982 + switch (Style->GetSymbolWellKnownMark()) 3983 + { 3984 + case RL2_GRAPHIC_MARK_CIRCLE: 3985 + markCtrl->SetSelection(1); 3986 + break; 3987 + case RL2_GRAPHIC_MARK_TRIANGLE: 3988 + markCtrl->SetSelection(2); 3989 + break; 3990 + case RL2_GRAPHIC_MARK_STAR: 3991 + markCtrl->SetSelection(3); 3992 + break; 3993 + case RL2_GRAPHIC_MARK_CROSS: 3994 + markCtrl->SetSelection(4); 3995 + break; 3996 + case RL2_GRAPHIC_MARK_X: 3997 + markCtrl->SetSelection(5); 3998 + break; 3999 + default: 4000 + markCtrl->SetSelection(0); 4001 + break; 4002 + }; 4003 + wxTextCtrl *colorFillCtrl = 4004 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL_COLOR); 4005 + wxString fillColor = wxString::FromUTF8(Style->GetSymbolFillColor()); 4006 + colorFillCtrl->SetValue(fillColor); 4007 + wxTextCtrl *colorStrokeCtrl = 4008 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE_COLOR); 4009 + wxString strokeColor = wxString::FromUTF8(Style->GetSymbolStrokeColor()); 4010 + colorStrokeCtrl->SetValue(strokeColor); 4011 +} 4012 + 4013 +bool QuickStyleVectorDialog::RetrieveLinePage(bool check) 4014 +{ 4015 +// 4016 +// retrieving params from the Line Symbolizer page 4017 +// 4018 + double opacity; 4019 + double perpendicularOffset; 4020 + char strokeColor[8]; 4021 + double strokeWidth; 4022 + wxSlider *opacityCtrl = 4023 + (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE1_OPACITY); 4024 + opacity = opacityCtrl->GetValue() / 100.0; 4025 + wxTextCtrl *perpCtrl = 4026 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_PERPENDICULAR); 4027 + wxString value = perpCtrl->GetValue(); 4028 + if (value.ToDouble(&perpendicularOffset) != true) 4029 + { 4030 + if (check == true) 4031 + { 4032 + wxMessageBox(wxT 4033 + ("PERPENDICULAR-OFFSET isn't a valid decimal number !!!"), 4034 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4035 + return false; 4036 + } 4037 + } 4038 + wxTextCtrl *colorCtrl = 4039 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); 4040 + wxString color = colorCtrl->GetValue(); 4041 + if (ColorMapEntry::IsValidColor(color) != true) 4042 + { 4043 + if (check == true) 4044 + { 4045 + wxMessageBox(wxT 4046 + ("STROKE-COLOR isn't a valid HexRGB color !!!"), 4047 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4048 + return false; 4049 + } 4050 + } 4051 + strcpy(strokeColor, color.ToUTF8()); 4052 + wxTextCtrl *widthCtrl = 4053 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_WIDTH); 4054 + value = widthCtrl->GetValue(); 4055 + if (value.ToDouble(&strokeWidth) != true) 4056 + { 4057 + if (check == true) 4058 + { 4059 + wxMessageBox(wxT 4060 + ("STROKE-WIDTH isn't a valid decimal number !!!"), 4061 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4062 + return false; 4063 + } 4064 + } 4065 + if (strokeWidth <= 0.0) 4066 + { 4067 + if (check == true) 4068 + { 4069 + wxMessageBox(wxT 4070 + ("STROKE-WIDTH must be a positive number !!!"), 4071 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4072 + return false; 4073 + } 4074 + } 4075 + wxRadioBox *dotCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_DASH_DOT); 4076 + switch (dotCtrl->GetSelection()) 4077 + { 4078 + case 1: 4079 + Style->SetLineDotStyle(QUICK_STYLE_DOT_LINE); 4080 + break; 4081 + case 2: 4082 + Style->SetLineDotStyle(QUICK_STYLE_DASH_LINE); 4083 + break; 4084 + case 3: 4085 + Style->SetLineDotStyle(QUICK_STYLE_DASH_DOT_LINE); 4086 + break; 4087 + default: 4088 + Style->SetLineDotStyle(QUICK_STYLE_SOLID_LINE); 4089 + break; 4090 + }; 4091 + Style->SetLineOpacity(opacity); 4092 + Style->SetLinePerpendicularOffset(perpendicularOffset); 4093 + Style->SetLineStrokeWidth(strokeWidth); 4094 + Style->SetLineStrokeColor(strokeColor); 4095 + return true; 4096 +} 4097 + 4098 +void QuickStyleVectorDialog::UpdateLinePage() 4099 +{ 4100 +// 4101 +// updating the Line Symbolizer page 4102 +// 4103 + wxSlider *opacityCtrl = 4104 + (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE1_OPACITY); 4105 + opacityCtrl->SetValue(Style->GetLineOpacity() * 100.0); 4106 + wxTextCtrl *perpCtrl = 4107 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_PERPENDICULAR); 4108 + char dummy[64]; 4109 + sprintf(dummy, "%1.2f", Style->GetLinePerpendicularOffset()); 4110 + wxString str = wxString::FromUTF8(dummy); 4111 + perpCtrl->SetValue(str); 4112 + wxTextCtrl *colorCtrl = 4113 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); 4114 + wxButton *pick = (wxButton *) FindWindow(ID_SYMBOLIZER_STROKE1_PICKER_BTN); 4115 + colorCtrl->Enable(true); 4116 + pick->Enable(true); 4117 + wxString strokeColor = wxString::FromUTF8(Style->GetLineStrokeColor()); 4118 + colorCtrl->SetValue(strokeColor); 4119 + wxTextCtrl *widthCtrl = 4120 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_WIDTH); 4121 + sprintf(dummy, "%1.2f", Style->GetLineStrokeWidth()); 4122 + str = wxString::FromUTF8(dummy); 4123 + wxRadioBox *dotCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_DASH_DOT); 4124 + switch (Style->GetLineDotStyle()) 4125 + { 4126 + case QUICK_STYLE_DOT_LINE: 4127 + dotCtrl->SetSelection(1); 4128 + break; 4129 + case QUICK_STYLE_DASH_LINE: 4130 + dotCtrl->SetSelection(2); 4131 + break; 4132 + case QUICK_STYLE_DASH_DOT_LINE: 4133 + dotCtrl->SetSelection(3); 4134 + break; 4135 + default: 4136 + dotCtrl->SetSelection(0); 4137 + break; 4138 + }; 4139 + widthCtrl->SetValue(str); 4140 +} 4141 + 4142 +bool QuickStyleVectorDialog::RetrievePolygonPage(bool check) 4143 +{ 4144 +// 4145 +// retrieving params from the Polygon Synbolizer page 4146 +// 4147 + double fillOpacity; 4148 + double displacementX; 4149 + double displacementY; 4150 + double perpendicularOffset; 4151 + char fillColor[8]; 4152 + double strokeOpacity; 4153 + char strokeColor[8]; 4154 + double strokeWidth; 4155 + wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_FILL2_OPACITY); 4156 + fillOpacity = opacityCtrl->GetValue() / 100.0; 4157 + wxTextCtrl *displXCtrl = 4158 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_X); 4159 + wxString value = displXCtrl->GetValue(); 4160 + if (Style->IsPolygonFill() != true && Style->IsPolygonStroke() != true) 4161 + { 4162 + if (check == true) 4163 + { 4164 + wxMessageBox(wxT 4165 + ("You can't disable both FILL and STROKE at the same time !!!"), 4166 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4167 + return false; 4168 + } 4169 + } 4170 + if (value.ToDouble(&displacementX) != true) 4171 + { 4172 + if (check == true) 4173 + { 4174 + wxMessageBox(wxT 4175 + ("DISPLACEMENT-X isn't a valid decimal number !!!"), 4176 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4177 + return false; 4178 + } 4179 + } 4180 + wxTextCtrl *displYCtrl = 4181 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_Y); 4182 + value = displYCtrl->GetValue(); 4183 + if (value.ToDouble(&displacementY) != true) 4184 + { 4185 + if (check == true) 4186 + { 4187 + wxMessageBox(wxT 4188 + ("DISPLACEMENT-Y isn't a valid decimal number !!!"), 4189 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4190 + return false; 4191 + } 4192 + } 4193 + wxTextCtrl *perpCtrl = 4194 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_PERPENDICULAR); 4195 + value = perpCtrl->GetValue(); 4196 + if (value.ToDouble(&perpendicularOffset) != true) 4197 + { 4198 + if (check == true) 4199 + { 4200 + wxMessageBox(wxT 4201 + ("PERPENDICULAR-OFFSET isn't a valid decimal number !!!"), 4202 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4203 + return false; 4204 + } 4205 + } 4206 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); 4207 + wxString color = colorCtrl->GetValue(); 4208 + if (ColorMapEntry::IsValidColor(color) != true) 4209 + { 4210 + if (check == true) 4211 + { 4212 + wxMessageBox(wxT 4213 + ("FILL-COLOR isn't a valid HexRGB color !!!"), 4214 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4215 + return false; 4216 + } 4217 + } 4218 + strcpy(fillColor, color.ToUTF8()); 4219 + wxSlider *opacity2Ctrl = 4220 + (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE2_OPACITY); 4221 + strokeOpacity = opacity2Ctrl->GetValue() / 100.0; 4222 + wxTextCtrl *color2Ctrl = 4223 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); 4224 + color = color2Ctrl->GetValue(); 4225 + if (ColorMapEntry::IsValidColor(color) != true) 4226 + { 4227 + if (check == true) 4228 + { 4229 + wxMessageBox(wxT 4230 + ("STROKE-COLOR isn't a valid HexRGB color !!!"), 4231 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4232 + return false; 4233 + } 4234 + } 4235 + strcpy(strokeColor, color.ToUTF8()); 4236 + wxTextCtrl *widthCtrl = 4237 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_WIDTH); 4238 + value = widthCtrl->GetValue(); 4239 + if (value.ToDouble(&strokeWidth) != true) 4240 + { 4241 + if (check == true) 4242 + { 4243 + wxMessageBox(wxT 4244 + ("STROKE-WIDTH isn't a valid decimal number !!!"), 4245 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4246 + return false; 4247 + } 4248 + } 4249 + if (strokeWidth <= 0.0) 4250 + { 4251 + if (check == true) 4252 + { 4253 + wxMessageBox(wxT 4254 + ("STROKE-WIDTH must be a positive number !!!"), 4255 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4256 + return false; 4257 + } 4258 + } 4259 + 4260 + Style->SetPolygonFillOpacity(fillOpacity); 4261 + Style->SetPolygonDisplacementX(displacementX); 4262 + Style->SetPolygonDisplacementY(displacementY); 4263 + Style->SetPolygonPerpendicularOffset(perpendicularOffset); 4264 + Style->SetPolygonFillColor(fillColor); 4265 + Style->SetPolygonStrokeOpacity(strokeOpacity); 4266 + Style->SetPolygonStrokeColor(strokeColor); 4267 + Style->SetPolygonStrokeWidth(strokeWidth); 4268 + return true; 4269 +} 4270 + 4271 +void QuickStyleVectorDialog::UpdatePolygonPage() 4272 +{ 4273 +// 4274 +// updating the Polygon Symbolizer page 4275 +// 4276 + wxCheckBox *enableBox = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_FILL2_ENABLE); 4277 + enableBox->SetValue(Style->IsPolygonFill()); 4278 + wxTextCtrl *displXCtrl = 4279 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_X); 4280 + char dummy[64]; 4281 + sprintf(dummy, "%1.2f", Style->GetPolygonDisplacementX()); 4282 + wxString str = wxString::FromUTF8(dummy); 4283 + displXCtrl->SetValue(str); 4284 + wxTextCtrl *displYCtrl = 4285 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_Y); 4286 + sprintf(dummy, "%1.2f", Style->GetPolygonDisplacementY()); 4287 + str = wxString::FromUTF8(dummy); 4288 + displYCtrl->SetValue(str); 4289 + wxTextCtrl *perpCtrl = 4290 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_PERPENDICULAR); 4291 + sprintf(dummy, "%1.2f", Style->GetPolygonPerpendicularOffset()); 4292 + str = wxString::FromUTF8(dummy); 4293 + perpCtrl->SetValue(str); 4294 + wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_FILL2_OPACITY); 4295 + opacityCtrl->SetValue(Style->GetPolygonFillOpacity() * 100.0); 4296 + opacityCtrl->Enable(Style->IsPolygonFill()); 4297 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); 4298 + wxButton *pick = (wxButton *) FindWindow(ID_SYMBOLIZER_FILL2_PICKER_BTN); 4299 + wxColour color = wxNullColour; 4300 + str = wxString::FromUTF8(Style->GetPolygonFillColor()); 4301 + ColorMapEntry::GetWxColor(str, color); 4302 + if (color.IsOk() == true) 4303 + { 4304 + char hex[16]; 4305 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 4306 + wxString str = wxString::FromUTF8(hex); 4307 + colorCtrl->SetValue(str); 4308 + } 4309 + colorCtrl->Enable(Style->IsPolygonFill()); 4310 + pick->Enable(Style->IsPolygonFill()); 4311 + wxCheckBox *enable2Box = 4312 + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_STROKE2_ENABLE); 4313 + enable2Box->SetValue(Style->IsPolygonStroke()); 4314 + wxSlider *opacity2Ctrl = 4315 + (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE2_OPACITY); 4316 + opacity2Ctrl->SetValue(Style->GetPolygonStrokeOpacity() * 100.0); 4317 + opacity2Ctrl->Enable(Style->IsPolygonStroke()); 4318 + wxTextCtrl *color2Ctrl = 4319 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); 4320 + wxButton *pick2 = (wxButton *) FindWindow(ID_SYMBOLIZER_STROKE2_PICKER_BTN); 4321 + color = wxNullColour; 4322 + str = wxString::FromUTF8(Style->GetPolygonStrokeColor()); 4323 + ColorMapEntry::GetWxColor(str, color); 4324 + if (color.IsOk() == true) 4325 + { 4326 + char hex[16]; 4327 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 4328 + wxString str = wxString::FromUTF8(hex); 4329 + color2Ctrl->SetValue(str); 4330 + } 4331 + color2Ctrl->Enable(Style->IsPolygonStroke()); 4332 + pick2->Enable(Style->IsPolygonStroke()); 4333 + wxTextCtrl *widthCtrl = 4334 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_WIDTH); 4335 + sprintf(dummy, "%1.2f", Style->GetPolygonStrokeWidth()); 4336 + str = wxString::FromUTF8(dummy); 4337 + widthCtrl->SetValue(str); 4338 + widthCtrl->Enable(Style->IsPolygonStroke()); 4339 +} 4340 + 4341 +bool QuickStyleVectorDialog::RetrieveTextPointPage(bool check) 4342 +{ 4343 +// 4344 +// retrieving params from the Text Symbolizer page - Point Placement 4345 +// 4346 + wxString column; 4347 + wxString font; 4348 + double fontSize; 4349 + int fontStyle; 4350 + int fontWeight; 4351 + double opacity; 4352 + char fontColor[8]; 4353 + double haloRadius; 4354 + double haloOpacity; 4355 + char haloColor[8]; 4356 + double rotation; 4357 + double anchorPointX; 4358 + double anchorPointY; 4359 + double displacementX; 4360 + double displacementY; 4361 + 4362 + if (Style->IsLabelPrint() == false) 4363 + return true; 4364 + 4365 + wxComboBox *columnCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_TEXT1_LABEL); 4366 + int idSel = columnCtrl->GetSelection(); 4367 + if (idSel == wxNOT_FOUND) 4368 + { 4369 + if (check == true) 4370 + { 4371 + wxMessageBox(wxT 4372 + ("You must select some Column !!!"), 4373 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4374 + return false; 4375 + } 4376 + } 4377 + column = columnCtrl->GetValue(); 4378 + wxComboBox *fontCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_FONT1_NAME); 4379 + idSel = fontCtrl->GetSelection(); 4380 + if (idSel == wxNOT_FOUND) 4381 + { 4382 + if (check == true) 4383 + { 4384 + wxMessageBox(wxT 4385 + ("You must select some Font !!!"), 4386 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4387 + return false; 4388 + } 4389 + } 4390 + font = fontCtrl->GetValue(); 4391 + wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT1_SIZE); 4392 + wxString value = sizeCtrl->GetValue(); 4393 + if (value.ToDouble(&fontSize) != true) 4394 + { 4395 + if (check == true) 4396 + { 4397 + wxMessageBox(wxT 4398 + ("FONT-SIZE isn't a valid decimal number !!!"), 4399 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4400 + return false; 4401 + } 4402 + } 4403 + if (fontSize <= 0.0) 4404 + { 4405 + if (check == true) 4406 + { 4407 + wxMessageBox(wxT 4408 + ("FONT-SIZE should be a positive numberr !!!"), 4409 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4410 + return false; 4411 + } 4412 + } 4413 + wxCheckBox *boldCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_BOLD); 4414 + wxCheckBox *italicCtrl = 4415 + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_ITALIC); 4416 + if (boldCtrl->GetValue() == true) 4417 + fontWeight = RL2_FONTWEIGHT_BOLD; 4418 + else 4419 + fontWeight = RL2_FONTWEIGHT_NORMAL; 4420 + if (italicCtrl->GetValue() == true) 4421 + fontStyle = RL2_FONTSTYLE_ITALIC; 4422 + else 4423 + fontStyle = RL2_FONTSTYLE_NORMAL; 4424 + wxSlider *opacityFontCtrl = 4425 + (wxSlider *) FindWindow(ID_SYMBOLIZER_FONT1_OPACITY); 4426 + opacity = opacityFontCtrl->GetValue() / 100.0; 4427 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT1_COLOR); 4428 + wxString color = colorCtrl->GetValue(); 4429 + if (ColorMapEntry::IsValidColor(color) != true) 4430 + { 4431 + if (check == true) 4432 + { 4433 + wxMessageBox(wxT 4434 + ("FONT-COLOR isn't a valid HexRGB color !!!"), 4435 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4436 + return false; 4437 + } 4438 + } 4439 + strcpy(fontColor, color.ToUTF8()); 4440 +// Point Placement 4441 + wxTextCtrl *rotationCtrl = 4442 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_ROTATION); 4443 + value = rotationCtrl->GetValue(); 4444 + if (value.ToDouble(&rotation) != true) 4445 + { 4446 + if (check == true) 4447 + { 4448 + wxMessageBox(wxT 4449 + ("ROTATION isn't a valid decimal number !!!"), 4450 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4451 + return false; 4452 + } 4453 + } 4454 + wxTextCtrl *anchorXCtrl = 4455 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_ANCHOR_X); 4456 + value = anchorXCtrl->GetValue(); 4457 + if (value.ToDouble(&anchorPointX) != true) 4458 + { 4459 + if (check == true) 4460 + { 4461 + wxMessageBox(wxT 4462 + ("ANCHOR-POINT-X isn't a valid decimal number !!!"), 4463 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4464 + return false; 4465 + } 4466 + } 4467 + if (anchorPointX < 0.0 || anchorPointX > 1.0) 4468 + { 4469 + if (check == true) 4470 + { 4471 + wxMessageBox(wxT 4472 + ("ANCHOR-POINT-X must be between 0.0 and 1.0 !!!"), 4473 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4474 + return false; 4475 + } 4476 + } 4477 + wxTextCtrl *anchorYCtrl = 4478 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_ANCHOR_Y); 4479 + value = anchorYCtrl->GetValue(); 4480 + if (value.ToDouble(&anchorPointY) != true) 4481 + { 4482 + if (check == true) 4483 + { 4484 + wxMessageBox(wxT 4485 + ("ANCHOR-POINT-Y isn't a valid decimal number !!!"), 4486 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4487 + return false; 4488 + } 4489 + } 4490 + if (anchorPointY < 0.0 || anchorPointY > 1.0) 4491 + { 4492 + if (check == true) 4493 + { 4494 + wxMessageBox(wxT 4495 + ("ANCHOR-POINT-Y must be between 0.0 and 1.0 !!!"), 4496 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4497 + return false; 4498 + } 4499 + } 4500 + wxTextCtrl *displXCtrl = 4501 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_DISPLACEMENT_X); 4502 + value = displXCtrl->GetValue(); 4503 + if (value.ToDouble(&displacementX) != true) 4504 + { 4505 + if (check == true) 4506 + { 4507 + wxMessageBox(wxT 4508 + ("DISPLACEMENT-X isn't a valid decimal number !!!"), 4509 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4510 + return false; 4511 + } 4512 + } 4513 + wxTextCtrl *displYCtrl = 4514 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_DISPLACEMENT_Y); 4515 + value = displYCtrl->GetValue(); 4516 + if (value.ToDouble(&displacementY) != true) 4517 + { 4518 + if (check == true) 4519 + { 4520 + wxMessageBox(wxT 4521 + ("DISPLACEMENT-Y isn't a valid decimal number !!!"), 4522 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4523 + return false; 4524 + } 4525 + } 4526 + if (Style->IsHaloEnabled() == true) 4527 + { 4528 + wxSlider *opacityHaloCtrl = 4529 + (wxSlider *) FindWindow(ID_SYMBOLIZER_HALO1_OPACITY); 4530 + haloOpacity = opacityHaloCtrl->GetValue() / 100.0; 4531 + wxTextCtrl *radiusCtrl = 4532 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO1_RADIUS); 4533 + wxString value = radiusCtrl->GetValue(); 4534 + if (value.ToDouble(&haloRadius) != true) 4535 + { 4536 + if (check == true) 4537 + { 4538 + wxMessageBox(wxT 4539 + ("HALO-RADIUS isn't a valid decimal number !!!"), 4540 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4541 + return false; 4542 + } 4543 + } 4544 + if (haloRadius <= 0.0) 4545 + { 4546 + if (check == true) 4547 + { 4548 + wxMessageBox(wxT 4549 + ("HALO-RADIUS should be a positive number !!!"), 4550 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4551 + return false; 4552 + } 4553 + } 4554 + wxTextCtrl *colorHaloCtrl = 4555 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO1_COLOR); 4556 + wxString color = colorHaloCtrl->GetValue(); 4557 + if (ColorMapEntry::IsValidColor(color) != true) 4558 + { 4559 + if (check == true) 4560 + { 4561 + wxMessageBox(wxT 4562 + ("HALO-COLOR isn't a valid HexRGB color !!!"), 4563 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4564 + return false; 4565 + } 4566 + } 4567 + strcpy(haloColor, color.ToUTF8()); 4568 + } 4569 + 4570 + Style->SetLabelColumn(column.ToUTF8()); 4571 + Style->SetFontFacename(font.ToUTF8()); 4572 + Style->SetFontOpacity(opacity); 4573 + Style->SetFontSize(fontSize); 4574 + Style->SetFontStyle(fontStyle); 4575 + Style->SetFontWeight(fontWeight); 4576 + Style->SetFontColor(fontColor); 4577 + Style->SetLabelRotation(rotation); 4578 + Style->SetLabelAnchorX(anchorPointX); 4579 + Style->SetLabelAnchorY(anchorPointY); 4580 + Style->SetLabelDisplacementX(displacementX); 4581 + Style->SetLabelDisplacementY(displacementY); 4582 + if (Style->IsHaloEnabled() == true) 4583 + { 4584 + Style->SetHaloRadius(haloRadius); 4585 + Style->SetHaloOpacity(haloOpacity); 4586 + Style->SetHaloColor(haloColor); 4587 + } 4588 + return true; 4589 +} 4590 + 4591 +void QuickStyleVectorDialog::UpdateTextPointPage() 4592 +{ 4593 +// 4594 +// updating the Text Symbolizer page - Point Placement 4595 +// 4596 + wxCheckBox *enableCtrl = 4597 + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_ENABLE); 4598 + enableCtrl->SetValue(Style->IsLabelPrint()); 4599 + wxComboBox *columnCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_TEXT1_LABEL); 4600 + wxString str = wxString::FromUTF8(Style->GetLabelColumn()); 4601 + int idSel = columnCtrl->FindString(str); 4602 + columnCtrl->SetSelection(idSel); 4603 + columnCtrl->Enable(Style->IsLabelPrint()); 4604 + wxComboBox *fontCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_FONT1_NAME); 4605 + str = wxString::FromUTF8(Style->GetFontFacename()); 4606 + idSel = fontCtrl->FindString(str); 4607 + fontCtrl->SetSelection(idSel); 4608 + fontCtrl->Enable(Style->IsLabelPrint()); 4609 + wxSlider *opacityFontCtrl = 4610 + (wxSlider *) FindWindow(ID_SYMBOLIZER_FONT1_OPACITY); 4611 + opacityFontCtrl->SetValue(Style->GetFontOpacity() * 100.0); 4612 + opacityFontCtrl->Enable(Style->IsLabelPrint()); 4613 + wxTextCtrl *colorFontCtrl = 4614 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT1_COLOR); 4615 + wxButton *pickFont = (wxButton *) FindWindow(ID_SYMBOLIZER_FONT1_PICKER_BTN); 4616 + wxColour color = wxNullColour; 4617 + str = wxString::FromUTF8(Style->GetFontColor()); 4618 + ColorMapEntry::GetWxColor(str, color); 4619 + if (color.IsOk() == true) 4620 + { 4621 + char hex[16]; 4622 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 4623 + wxString str = wxString::FromUTF8(hex); 4624 + colorFontCtrl->SetValue(str); 4625 + } 4626 + colorFontCtrl->Enable(Style->IsLabelPrint()); 4627 + pickFont->Enable(Style->IsLabelPrint()); 4628 + wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT1_SIZE); 4629 + char dummy[64]; 4630 + sprintf(dummy, "%1.2f", Style->GetFontSize()); 4631 + str = wxString::FromUTF8(dummy); 4632 + sizeCtrl->SetValue(str); 4633 + sizeCtrl->Enable(Style->IsLabelPrint()); 4634 + wxCheckBox *boldCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_BOLD); 4635 + wxCheckBox *italicCtrl = 4636 + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_ITALIC); 4637 + if (Style->GetFontWeight() == RL2_FONTWEIGHT_BOLD) 4638 + boldCtrl->SetValue(true); 4639 + else 4640 + boldCtrl->SetValue(false); 4641 + if (Style->GetFontStyle() == RL2_FONTSTYLE_ITALIC) 4642 + italicCtrl->SetValue(true); 4643 + else 4644 + italicCtrl->SetValue(false); 4645 + boldCtrl->Enable(false); 4646 + italicCtrl->Enable(false); 4647 + if (Style->GetFontFacename() != NULL) 4648 + { 4649 + if (strncmp(Style->GetFontFacename(), "ToyFont: ", 9) == 0) 4650 + { 4651 + boldCtrl->Enable(Style->IsLabelPrint()); 4652 + italicCtrl->Enable(Style->IsLabelPrint()); 4653 + } else 4654 + { 4655 + bool bold = false; 4656 + bool italic = false; 4657 + MainFrame->CheckTTFont(Style->GetFontFacename(), &bold, &italic); 4658 + boldCtrl->SetValue(bold); 4659 + italicCtrl->SetValue(italic); 4660 + boldCtrl->Enable(false); 4661 + italicCtrl->Enable(false); 4662 + } 4663 + } 4664 +// Point Placement 4665 + wxTextCtrl *rotationCtrl = 4666 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_ROTATION); 4667 + sprintf(dummy, "%1.2f", Style->GetLabelRotation()); 4668 + str = wxString::FromUTF8(dummy); 4669 + rotationCtrl->SetValue(str); 4670 + rotationCtrl->Enable(Style->IsLabelPrint()); 4671 + wxTextCtrl *anchorXCtrl = 4672 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_ANCHOR_X); 4673 + sprintf(dummy, "%1.2f", Style->GetLabelAnchorX()); 4674 + str = wxString::FromUTF8(dummy); 4675 + anchorXCtrl->SetValue(str); 4676 + anchorXCtrl->Enable(Style->IsLabelPrint()); 4677 + wxTextCtrl *anchorYCtrl = 4678 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_ANCHOR_Y); 4679 + sprintf(dummy, "%1.2f", Style->GetLabelAnchorY()); 4680 + str = wxString::FromUTF8(dummy); 4681 + anchorYCtrl->SetValue(str); 4682 + anchorYCtrl->Enable(Style->IsLabelPrint()); 4683 + wxTextCtrl *displXCtrl = 4684 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_DISPLACEMENT_X); 4685 + sprintf(dummy, "%1.2f", Style->GetLabelDisplacementX()); 4686 + str = wxString::FromUTF8(dummy); 4687 + displXCtrl->SetValue(str); 4688 + displXCtrl->Enable(Style->IsLabelPrint()); 4689 + wxTextCtrl *displYCtrl = 4690 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_DISPLACEMENT_Y); 4691 + sprintf(dummy, "%1.2f", Style->GetLabelDisplacementY()); 4692 + str = wxString::FromUTF8(dummy); 4693 + displYCtrl->SetValue(str); 4694 + displYCtrl->Enable(Style->IsLabelPrint()); 4695 + wxCheckBox *enableHaloBox = 4696 + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_HALO1_ENABLE); 4697 + if (Style->IsHaloEnabled() == true) 4698 + enableHaloBox->SetValue(true); 4699 + else 4700 + enableHaloBox->SetValue(false); 4701 + enableHaloBox->Enable(Style->IsLabelPrint()); 4702 + bool enable = false; 4703 + if (Style->IsLabelPrint() == true) 4704 + enable = Style->IsHaloEnabled(); 4705 + wxTextCtrl *radiusCtrl = 4706 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO1_RADIUS); 4707 + radiusCtrl->Enable(enable); 4708 + wxTextCtrl *colorHaloCtrl = 4709 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO1_COLOR); 4710 + colorHaloCtrl->Enable(enable); 4711 + wxButton *pickHalo = (wxButton *) FindWindow(ID_SYMBOLIZER_HALO1_PICKER_BTN); 4712 + pickHalo->Enable(enable); 4713 + wxSlider *opacityHaloCtrl = 4714 + (wxSlider *) FindWindow(ID_SYMBOLIZER_HALO1_OPACITY); 4715 + opacityHaloCtrl->Enable(enable); 4716 + opacityHaloCtrl->SetValue(Style->GetHaloOpacity() * 100.0); 4717 + sprintf(dummy, "%1.2f", Style->GetHaloRadius()); 4718 + str = wxString::FromUTF8(dummy); 4719 + radiusCtrl->SetValue(str); 4720 + color = wxNullColour; 4721 + str = wxString::FromUTF8(Style->GetHaloColor()); 4722 + ColorMapEntry::GetWxColor(str, color); 4723 + if (color.IsOk() == true) 4724 + { 4725 + char hex[16]; 4726 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 4727 + wxString str = wxString::FromUTF8(hex); 4728 + colorHaloCtrl->SetValue(str); 4729 + } 4730 + if (Style->IsHaloEnabled() == false) 4731 + { 4732 + opacityHaloCtrl->Enable(false); 4733 + pickHalo->Enable(false); 4734 + colorHaloCtrl->Enable(false); 4735 + radiusCtrl->Enable(false); 4736 + } else 4737 + { 4738 + opacityHaloCtrl->Enable(true); 4739 + pickHalo->Enable(true); 4740 + colorHaloCtrl->Enable(true); 4741 + radiusCtrl->Enable(true); 4742 + } 4743 +} 4744 + 4745 +bool QuickStyleVectorDialog::RetrieveTextLinePage(bool check) 4746 +{ 4747 +// 4748 +// retrieving params from the Text Symbolizer page - Line Placement 4749 +// 4750 + wxString column; 4751 + wxString font; 4752 + double fontSize; 4753 + int fontStyle; 4754 + int fontWeight; 4755 + double opacity; 4756 + char fontColor[8]; 4757 + double haloRadius; 4758 + double haloOpacity; 4759 + char haloColor[8]; 4760 + double perpendicularOffset; 4761 + double initialGap; 4762 + double gap; 4763 + 4764 + if (Style->IsLabelPrint() == false) 4765 + return true; 4766 + 4767 + wxComboBox *columnCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_TEXT2_LABEL); 4768 + int idSel = columnCtrl->GetSelection(); 4769 + if (idSel == wxNOT_FOUND) 4770 + { 4771 + if (check == true) 4772 + { 4773 + wxMessageBox(wxT 4774 + ("You must select some Column !!!"), 4775 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4776 + return false; 4777 + } 4778 + } 4779 + column = columnCtrl->GetValue(); 4780 + wxComboBox *fontCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_FONT2_NAME); 4781 + idSel = fontCtrl->GetSelection(); 4782 + if (idSel == wxNOT_FOUND) 4783 + { 4784 + if (check == true) 4785 + { 4786 + wxMessageBox(wxT 4787 + ("You must select some Font !!!"), 4788 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4789 + return false; 4790 + } 4791 + } 4792 + font = fontCtrl->GetValue(); 4793 + wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT2_SIZE); 4794 + wxString value = sizeCtrl->GetValue(); 4795 + if (value.ToDouble(&fontSize) != true) 4796 + { 4797 + if (check == true) 4798 + { 4799 + wxMessageBox(wxT 4800 + ("FONT-SIZE isn't a valid decimal number !!!"), 4801 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4802 + return false; 4803 + } 4804 + } 4805 + if (fontSize <= 0.0) 4806 + { 4807 + if (check == true) 4808 + { 4809 + wxMessageBox(wxT 4810 + ("FONT-SIZE should be a positive numberr !!!"), 4811 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4812 + return false; 4813 + } 4814 + } 4815 + wxCheckBox *boldCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_BOLD); 4816 + wxCheckBox *italicCtrl = 4817 + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_ITALIC); 4818 + if (boldCtrl->GetValue() == true) 4819 + fontWeight = RL2_FONTWEIGHT_BOLD; 4820 + else 4821 + fontWeight = RL2_FONTWEIGHT_NORMAL; 4822 + if (italicCtrl->GetValue() == true) 4823 + fontStyle = RL2_FONTSTYLE_ITALIC; 4824 + else 4825 + fontStyle = RL2_FONTSTYLE_NORMAL; 4826 + wxSlider *opacityFontCtrl = 4827 + (wxSlider *) FindWindow(ID_SYMBOLIZER_FONT2_OPACITY); 4828 + opacity = opacityFontCtrl->GetValue() / 100.0; 4829 + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT2_COLOR); 4830 + wxString color = colorCtrl->GetValue(); 4831 + if (ColorMapEntry::IsValidColor(color) != true) 4832 + { 4833 + if (check == true) 4834 + { 4835 + wxMessageBox(wxT 4836 + ("FONT-COLOR isn't a valid HexRGB color !!!"), 4837 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4838 + return false; 4839 + } 4840 + } 4841 + strcpy(fontColor, color.ToUTF8()); 4842 +// Line Placement 4843 + wxTextCtrl *perpCtrl = 4844 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_PERPENDICULAR); 4845 + value = perpCtrl->GetValue(); 4846 + if (value.ToDouble(&perpendicularOffset) != true) 4847 + { 4848 + if (check == true) 4849 + { 4850 + wxMessageBox(wxT 4851 + ("PERPENDICULAR-OFFSET isn't a valid decimal number !!!"), 4852 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4853 + return false; 4854 + } 4855 + } 4856 + wxTextCtrl *inigapCtrl = 4857 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_INITIAL_GAP); 4858 + value = inigapCtrl->GetValue(); 4859 + if (value.ToDouble(&initialGap) != true) 4860 + { 4861 + if (check == true) 4862 + { 4863 + wxMessageBox(wxT 4864 + ("INITIAL-GAP isn't a valid decimal number !!!"), 4865 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4866 + return false; 4867 + } 4868 + } 4869 + if (initialGap < 0.0) 4870 + { 4871 + if (check == true) 4872 + { 4873 + wxMessageBox(wxT 4874 + ("INITIAL-GAP should be a positive number !!!"), 4875 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4876 + return false; 4877 + } 4878 + } 4879 + wxTextCtrl *gapCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_GAP); 4880 + value = gapCtrl->GetValue(); 4881 + if (value.ToDouble(&gap) != true) 4882 + { 4883 + if (check == true) 4884 + { 4885 + wxMessageBox(wxT 4886 + ("GAP isn't a valid decimal number !!!"), 4887 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4888 + return false; 4889 + } 4890 + } 4891 + if (gap < 0.0) 4892 + { 4893 + if (check == true) 4894 + { 4895 + wxMessageBox(wxT 4896 + ("GAP should be a positive number !!!"), 4897 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4898 + return false; 4899 + } 4900 + } 4901 + if (Style->IsHaloEnabled() == true) 4902 + { 4903 + wxSlider *opacityHaloCtrl = 4904 + (wxSlider *) FindWindow(ID_SYMBOLIZER_HALO2_OPACITY); 4905 + haloOpacity = opacityHaloCtrl->GetValue() / 100.0; 4906 + wxTextCtrl *radiusCtrl = 4907 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO2_RADIUS); 4908 + wxString value = radiusCtrl->GetValue(); 4909 + if (value.ToDouble(&haloRadius) != true) 4910 + { 4911 + if (check == true) 4912 + { 4913 + wxMessageBox(wxT 4914 + ("HALO-RADIUS isn't a valid decimal number !!!"), 4915 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4916 + return false; 4917 + } 4918 + } 4919 + if (haloRadius <= 0.0) 4920 + { 4921 + if (check == true) 4922 + { 4923 + wxMessageBox(wxT 4924 + ("HALO-RADIUS should be a positive number !!!"), 4925 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4926 + return false; 4927 + } 4928 + } 4929 + wxTextCtrl *colorHaloCtrl = 4930 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO2_COLOR); 4931 + wxString color = colorHaloCtrl->GetValue(); 4932 + if (ColorMapEntry::IsValidColor(color) != true) 4933 + { 4934 + if (check == true) 4935 + { 4936 + wxMessageBox(wxT 4937 + ("HALO-COLOR isn't a valid HexRGB color !!!"), 4938 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 4939 + return false; 4940 + } 4941 + } 4942 + strcpy(haloColor, color.ToUTF8()); 4943 + } 4944 + Style->SetLabelColumn(column.ToUTF8()); 4945 + Style->SetFontFacename(font.ToUTF8()); 4946 + Style->SetFontOpacity(opacity); 4947 + Style->SetFontSize(fontSize); 4948 + Style->SetFontStyle(fontStyle); 4949 + Style->SetFontWeight(fontWeight); 4950 + Style->SetFontColor(fontColor); 4951 + Style->SetLabelPerpendicularOffset(perpendicularOffset); 4952 + Style->SetLabelInitialGap(initialGap); 4953 + Style->SetLabelGap(gap); 4954 + if (Style->IsHaloEnabled() == true) 4955 + { 4956 + Style->SetHaloRadius(haloRadius); 4957 + Style->SetHaloOpacity(haloOpacity); 4958 + Style->SetHaloColor(haloColor); 4959 + } 4960 + return true; 4961 +} 4962 + 4963 +void QuickStyleVectorDialog::UpdateTextLinePage() 4964 +{ 4965 +// 4966 +// updating the Text Symbolizer page - Line Placement 4967 +// 4968 + wxCheckBox *enableCtrl = 4969 + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_ENABLE); 4970 + enableCtrl->SetValue(Style->IsLabelPrint()); 4971 + wxComboBox *columnCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_TEXT2_LABEL); 4972 + wxString str = wxString::FromUTF8(Style->GetLabelColumn()); 4973 + int idSel = columnCtrl->FindString(str); 4974 + columnCtrl->SetSelection(idSel); 4975 + columnCtrl->Enable(Style->IsLabelPrint()); 4976 + wxComboBox *fontCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_FONT2_NAME); 4977 + str = wxString::FromUTF8(Style->GetFontFacename()); 4978 + idSel = fontCtrl->FindString(str); 4979 + fontCtrl->SetSelection(idSel); 4980 + fontCtrl->Enable(Style->IsLabelPrint()); 4981 + wxSlider *opacityFontCtrl = 4982 + (wxSlider *) FindWindow(ID_SYMBOLIZER_FONT2_OPACITY); 4983 + opacityFontCtrl->SetValue(Style->GetFontOpacity() * 100.0); 4984 + opacityFontCtrl->Enable(Style->IsLabelPrint()); 4985 + wxTextCtrl *colorFontCtrl = 4986 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT2_COLOR); 4987 + wxButton *pickFont = (wxButton *) FindWindow(ID_SYMBOLIZER_FONT2_PICKER_BTN); 4988 + wxColour color = wxNullColour; 4989 + str = wxString::FromUTF8(Style->GetFontColor()); 4990 + ColorMapEntry::GetWxColor(str, color); 4991 + if (color.IsOk() == true) 4992 + { 4993 + char hex[16]; 4994 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 4995 + wxString str = wxString::FromUTF8(hex); 4996 + colorFontCtrl->SetValue(str); 4997 + } 4998 + colorFontCtrl->Enable(Style->IsLabelPrint()); 4999 + pickFont->Enable(Style->IsLabelPrint()); 5000 + wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT2_SIZE); 5001 + char dummy[64]; 5002 + sprintf(dummy, "%1.2f", Style->GetFontSize()); 5003 + str = wxString::FromUTF8(dummy); 5004 + sizeCtrl->SetValue(str); 5005 + sizeCtrl->Enable(Style->IsLabelPrint()); 5006 + wxCheckBox *boldCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_BOLD); 5007 + wxCheckBox *italicCtrl = 5008 + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_ITALIC); 5009 + if (Style->GetFontWeight() == RL2_FONTWEIGHT_BOLD) 5010 + boldCtrl->SetValue(true); 5011 + else 5012 + boldCtrl->SetValue(false); 5013 + if (Style->GetFontStyle() == RL2_FONTSTYLE_ITALIC) 5014 + italicCtrl->SetValue(true); 5015 + else 5016 + italicCtrl->SetValue(false); 5017 + italicCtrl->Enable(Style->IsLabelPrint()); 5018 + boldCtrl->Enable(false); 5019 + italicCtrl->Enable(false); 5020 + if (Style->GetFontFacename() != NULL) 5021 + { 5022 + if (strncmp(Style->GetFontFacename(), "ToyFont: ", 9) == 0) 5023 + { 5024 + boldCtrl->Enable(Style->IsLabelPrint()); 5025 + italicCtrl->Enable(Style->IsLabelPrint()); 5026 + } else 5027 + { 5028 + bool bold = false; 5029 + bool italic = false; 5030 + MainFrame->CheckTTFont(Style->GetFontFacename(), &bold, &italic); 5031 + boldCtrl->SetValue(bold); 5032 + italicCtrl->SetValue(italic); 5033 + boldCtrl->Enable(false); 5034 + italicCtrl->Enable(false); 5035 + } 5036 + } 5037 +// Line Placement 5038 + wxTextCtrl *perpCtrl = 5039 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_PERPENDICULAR); 5040 + sprintf(dummy, "%1.2f", Style->GetLabelPerpendicularOffset()); 5041 + str = wxString::FromUTF8(dummy); 5042 + perpCtrl->SetValue(str); 5043 + perpCtrl->Enable(Style->IsLabelPrint()); 5044 + wxCheckBox *repeatBox = 5045 + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT_IS_REPEATED); 5046 + repeatBox->SetValue(Style->IsRepeatedLabel()); 5047 + repeatBox->Enable(Style->IsLabelPrint()); 5048 + wxTextCtrl *inigapCtrl = 5049 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_INITIAL_GAP); 5050 + sprintf(dummy, "%1.2f", Style->GetLabelInitialGap()); 5051 + str = wxString::FromUTF8(dummy); 5052 + inigapCtrl->SetValue(str); 5053 + wxTextCtrl *gapCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_GAP); 5054 + sprintf(dummy, "%1.2f", Style->GetLabelGap()); 5055 + str = wxString::FromUTF8(dummy); 5056 + gapCtrl->SetValue(str); 5057 + if (Style->IsLabelPrint() && Style->IsRepeatedLabel()) 5058 + { 5059 + inigapCtrl->Enable(true); 5060 + gapCtrl->Enable(true); 5061 + } else 5062 + { 5063 + inigapCtrl->Enable(false); 5064 + gapCtrl->Enable(false); 5065 + } 5066 + wxCheckBox *alignBox = 5067 + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT_IS_ALIGNED); 5068 + alignBox->SetValue(Style->IsLabelAligned()); 5069 + alignBox->Enable(Style->IsLabelPrint()); 5070 + wxCheckBox *generalizeBox = 5071 + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT_GENERALIZE); 5072 + generalizeBox->SetValue(Style->IsLabelGeneralizeLine()); 5073 + generalizeBox->Enable(Style->IsLabelPrint()); 5074 + wxCheckBox *enableHaloBox = 5075 + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_HALO2_ENABLE); 5076 + if (Style->IsHaloEnabled() == true) 5077 + enableHaloBox->SetValue(true); 5078 + else 5079 + enableHaloBox->SetValue(false); 5080 + enableHaloBox->Enable(Style->IsLabelPrint()); 5081 + bool enable = false; 5082 + if (Style->IsLabelPrint() == true) 5083 + enable = Style->IsHaloEnabled(); 5084 + wxTextCtrl *radiusCtrl = 5085 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO2_RADIUS); 5086 + radiusCtrl->Enable(enable); 5087 + wxTextCtrl *colorHaloCtrl = 5088 + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO2_COLOR); 5089 + colorHaloCtrl->Enable(enable); 5090 + wxButton *pickHalo = (wxButton *) FindWindow(ID_SYMBOLIZER_HALO2_PICKER_BTN); 5091 + pickHalo->Enable(enable); 5092 + wxSlider *opacityHaloCtrl = 5093 + (wxSlider *) FindWindow(ID_SYMBOLIZER_HALO2_OPACITY); 5094 + opacityHaloCtrl->Enable(enable); 5095 + opacityHaloCtrl->SetValue(Style->GetHaloOpacity() * 100.0); 5096 + sprintf(dummy, "%1.2f", Style->GetHaloRadius()); 5097 + str = wxString::FromUTF8(dummy); 5098 + radiusCtrl->SetValue(str); 5099 + color = wxNullColour; 5100 + str = wxString::FromUTF8(Style->GetHaloColor()); 5101 + ColorMapEntry::GetWxColor(str, color); 5102 + if (color.IsOk() == true) 5103 + { 5104 + char hex[16]; 5105 + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); 5106 + wxString str = wxString::FromUTF8(hex); 5107 + colorHaloCtrl->SetValue(str); 5108 + } 5109 + if (Style->IsHaloEnabled() == false) 5110 + { 5111 + opacityHaloCtrl->Enable(false); 5112 + pickHalo->Enable(false); 5113 + colorHaloCtrl->Enable(false); 5114 + radiusCtrl->Enable(false); 5115 + } else 5116 + { 5117 + opacityHaloCtrl->Enable(true); 5118 + pickHalo->Enable(true); 5119 + colorHaloCtrl->Enable(true); 5120 + radiusCtrl->Enable(true); 5121 + } 5122 +} 5123 + 5124 +void QuickStyleVectorDialog::OnPageChanging(wxNotebookEvent & event) 5125 +{ 5126 +// 5127 +// TAB/PAGE selection changing 5128 +// 5129 + bool ret = false; 5130 + int idx = event.GetOldSelection(); 5131 + if (idx == 0) 5132 + ret = RetrieveMainPage(); 5133 + else 5134 + { 5135 + if (idx == PagePointIndex) 5136 + ret = RetrievePointPage(); 5137 + if (idx == PageLineIndex) 5138 + ret = RetrieveLinePage(); 5139 + if (idx == PagePolygonIndex) 5140 + ret = RetrievePolygonPage(); 5141 + if (idx == PageTextPointIndex) 5142 + ret = RetrieveTextPointPage(); 5143 + if (idx == PageTextLineIndex) 5144 + ret = RetrieveTextLinePage(); 5145 + } 5146 + if (ret != true) 5147 + event.Veto(); 5148 +} 5149 + 5150 +void QuickStyleVectorDialog::OnPageChanged(wxNotebookEvent & event) 5151 +{ 5152 +// 5153 +// TAB/PAGE selection changed 5154 +// 5155 + int idx = event.GetSelection(); 5156 + if (idx == 0) 5157 + UpdateMainPage(); 5158 + else 5159 + { 5160 + if (idx == PagePointIndex) 5161 + UpdatePointPage(); 5162 + if (idx == PageLineIndex) 5163 + UpdateLinePage(); 5164 + if (idx == PagePolygonIndex) 5165 + UpdatePolygonPage(); 5166 + if (idx == PageTextPointIndex) 5167 + UpdateTextPointPage(); 5168 + if (idx == PageTextLineIndex) 5169 + UpdateTextLinePage(); 5170 + } 5171 +} 5172 + 5173 +bool QuickStyleVectorDialog::UpdateStyle() 5174 +{ 5175 +// 5176 +// updating the QuickStyle 5177 +// 5178 + bool ret = false; 5179 + int idx = GetBookCtrl()->GetSelection(); 5180 + if (idx == 0) 5181 + ret = RetrieveMainPage(); 5182 + else 5183 + { 5184 + if (idx == PagePointIndex) 5185 + ret = RetrievePointPage(); 5186 + if (idx == PageLineIndex) 5187 + ret = RetrieveLinePage(); 5188 + if (idx == PagePolygonIndex) 5189 + ret = RetrievePolygonPage(); 5190 + if (idx == PageTextPointIndex) 5191 + ret = RetrieveTextPointPage(); 5192 + if (idx == PageTextLineIndex) 5193 + ret = RetrieveTextLinePage(); 5194 + } 5195 + if (ret == false) 5196 + return false; 5197 + 5198 + VectorLayerConfig *config = Layer->GetVectorConfig(); 5199 + bool setCurrentStyle = false; 5200 + if (config->GetStyle() == NULL) 5201 + setCurrentStyle = true; 5202 + else 5203 + { 5204 + if (strcmp(Style->GetUUID(), config->GetStyle()) != 0) 5205 + setCurrentStyle = true; 5206 + } 5207 + if (setCurrentStyle == true) 5208 + { 5209 + config->SetStyle(Style->GetUUID()); 5210 + IsConfigChanged = true; 5211 + } 5212 + IsConfigChanged = Layer->UpdateQuickStyle(Style); 5213 + return true; 5214 +} 5215 + 5216 +void QuickStyleVectorDialog::OnOk(wxCommandEvent & WXUNUSED(event)) 5217 +{ 5218 +// 5219 +// permanently saving the QuickStyle and quitting 5220 +// 5221 + if (UpdateStyle() == true) 5222 + wxDialog::EndModal(wxID_OK); 5223 +} 5224 + 5225 +void QuickStyleVectorDialog::OnApply(wxCommandEvent & WXUNUSED(event)) 5226 +{ 5227 +// 5228 +// applying the QuickStyle and continuing 5229 +// 5230 + if (UpdateStyle() == true) 5231 + { 5232 + if (IsConfigChanged == true) 5233 + MapPanel->RefreshMap(); 5234 + } 5235 +} 5236 + 5237 +void QuickStyleVectorDialog::OnExport(wxCommandEvent & WXUNUSED(event)) 5238 +{ 5239 +// 5240 +// exporting the Quick Style as an external file 5241 +// 5242 + bool xret = false; 5243 + int ret; 5244 + wxString path; 5245 + wxString lastDir; 5246 + int idx = GetBookCtrl()->GetSelection(); 5247 + if (idx == 0) 5248 + xret = RetrieveMainPage(); 5249 + else 5250 + { 5251 + if (idx == PagePointIndex) 5252 + xret = RetrievePointPage(); 5253 + if (idx == PageLineIndex) 5254 + xret = RetrieveLinePage(); 5255 + if (idx == PagePolygonIndex) 5256 + xret = RetrievePolygonPage(); 5257 + if (idx == PageTextPointIndex) 5258 + xret = RetrieveTextPointPage(); 5259 + if (idx == PageTextLineIndex) 5260 + xret = RetrieveTextLinePage(); 5261 + } 5262 + if (xret == false) 5263 + return; 5264 + 5265 + wxFileDialog fileDialog(this, 5266 + wxT("Exporting an SLD/SE QuickStyle to a file"), 5267 + wxT(""), wxT("style.xml"), 5268 + wxT("XML Document|*.xml|All files (*.*)|*.*"), 5269 + wxFD_SAVE | wxFD_OVERWRITE_PROMPT, wxDefaultPosition, 5270 + wxDefaultSize, wxT("filedlg")); 5271 + lastDir = MainFrame->GetLastDirectory(); 5272 + if (lastDir.Len() >= 1) 5273 + fileDialog.SetDirectory(lastDir); 5274 + ret = fileDialog.ShowModal(); 5275 + if (ret == wxID_OK) 5276 + { 5277 + wxFileName file(fileDialog.GetPath()); 5278 + path = file.GetPath(); 5279 + path += file.GetPathSeparator(); 5280 + path += file.GetName(); 5281 + lastDir = file.GetPath(); 5282 + path = fileDialog.GetPath(); 5283 + FILE *out = fopen(path.ToUTF8(), "wb"); 5284 + if (out == NULL) 5285 + wxMessageBox(wxT("ERROR: unable to create:\n\n\"") + path + wxT("\""), 5286 + wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 5287 + else 5288 + { 5289 + char *xml = Style->CreateXmlStyle(); 5290 + fwrite(xml, 1, strlen(xml), out); 5291 + sqlite3_free(xml); 5292 + fclose(out); 5293 + wxMessageBox(wxT 5294 + ("SLD/SE QuickStyle successfully saved into:\n\n\"") 5295 + + path + wxT("\""), wxT("spatialite_gui"), 5296 + wxOK | wxICON_INFORMATION, this); 5297 + } 5298 + } 5299 +} 5300 + 5301 +void QuickStyleVectorDialog::OnCopy(wxCommandEvent & WXUNUSED(event)) 5302 +{ 5303 +// 5304 +// Copying the Quick Style into the Clipboard 5305 +// 5306 + bool ret = false; 5307 + int idx = GetBookCtrl()->GetSelection(); 5308 + if (idx == 0) 5309 + ret = RetrieveMainPage(); 5310 + else 5311 + { 5312 + if (idx == PagePointIndex) 5313 + ret = RetrievePointPage(); 5314 + if (idx == PageLineIndex) 5315 + ret = RetrieveLinePage(); 5316 + if (idx == PagePolygonIndex) 5317 + ret = RetrievePolygonPage(); 5318 + if (idx == PageTextPointIndex) 5319 + ret = RetrieveTextPointPage(); 5320 + if (idx == PageTextLineIndex) 5321 + ret = RetrieveTextLinePage(); 5322 + } 5323 + if (ret == false) 5324 + return; 5325 + 5326 + char *xml = Style->CreateXmlStyle(); 5327 + wxString XMLstring = wxString::FromUTF8(xml); 5328 + sqlite3_free(xml); 5329 + if (wxTheClipboard->Open()) 5330 + { 5331 + wxTheClipboard->SetData(new wxTextDataObject(XMLstring)); 5332 + wxTheClipboard->Close(); 5333 + } 5334 +} 5335 + 5336 +void QuickStyleVectorDialog::OnQuit(wxCommandEvent & WXUNUSED(event)) 5337 +{ 5338 +// 5339 +// all done: 5340 +// 5341 + wxDialog::EndModal(wxID_CANCEL); 5342 +}
Changes to Raster.cpp.
1 1 /* 2 2 / Raster.cpp 3 3 / various dialog classes supporting Raster datasources 4 4 / 5 5 / version 1.8, 2015 March 10 6 6 / 7 -/ Author: Sandro Furieri a-furieri@lqt.it 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 8 / 9 9 / Copyright (C) 2015 Alessandro Furieri 10 10 / 11 11 / This program is free software: you can redistribute it and/or modify 12 12 / it under the terms of the GNU General Public License as published by 13 13 / the Free Software Foundation, either version 3 of the License, or 14 14 / (at your option) any later version. ................................................................................ 292 292 wxT("NO-DATA Pixel"), 293 293 wxDefaultPosition, 294 294 wxDefaultSize); 295 295 wxBoxSizer *ndSizer = new wxStaticBoxSizer(ndBox, wxVERTICAL); 296 296 ndBoxSizer->Add(ndSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 297 297 wxBoxSizer *nodataSizer = new wxBoxSizer(wxHORIZONTAL); 298 298 ndSizer->Add(nodataSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 299 - wxTextCtrl *nodataCtrl = new wxTextCtrl(this, ID_CVG_NODATA, wxT(""), 299 + wxTextCtrl *nodataCtrl = new wxTextCtrl(this, ID_CVG_NODATA, wxT("NONE"), 300 300 wxDefaultPosition, wxSize(200, 22)); 301 301 nodataSizer->Add(nodataCtrl, 0, wxALIGN_RIGHT | wxALL, 1); 302 302 wxStaticText *nodataLabel = new wxStaticText(this, wxID_STATIC, 303 303 wxT 304 - (" (list of comma-separated sample values) e.g.: ")); 304 + (" (list of comma-separated values) e.g.: ")); 305 305 nodataSizer->Add(nodataLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 1); 306 306 wxStaticText *nodata2Label = 307 - new wxStaticText(this, wxID_STATIC, wxT("255,255,255 ")); 307 + new wxStaticText(this, wxID_STATIC, wxT("255,255,255")); 308 308 nodata2Label->SetForegroundColour(wxColour(255, 0, 0)); 309 309 nodataSizer->Add(nodata2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 1); 310 + 311 + 312 + wxStaticText *nodata3Label = 313 + new wxStaticText(this, wxID_STATIC, wxT(" or ")); 314 + nodataSizer->Add(nodata3Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 1); 315 + wxStaticText *nodata4Label = new wxStaticText(this, wxID_STATIC, wxT("NONE")); 316 + nodata4Label->SetForegroundColour(wxColour(255, 0, 0)); 317 + nodataSizer->Add(nodata4Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 1); 310 318 // sixth row: other attributes 311 319 wxBoxSizer *mixSizer = new wxBoxSizer(wxHORIZONTAL); 312 320 boxSizer->Add(mixSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 313 321 // sixth row, column #1: Tile Size 314 322 wxBoxSizer *tileBoxSizer = new wxBoxSizer(wxHORIZONTAL); 315 323 mixSizer->Add(tileBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 316 324 wxStaticBox *tileBox = new wxStaticBox(this, wxID_STATIC, ................................................................................ 1676 1684 { 1677 1685 // 1678 1686 // checking a NO-DATA value 1679 1687 // 1680 1688 int count = 0; 1681 1689 int error = 0; 1682 1690 char dummy[128]; 1683 - if (no_data.Len() == 0) 1691 + if (no_data.CmpNoCase(wxT("NONE")) == 0) 1684 1692 return true; 1693 + if (no_data.Len() == 0) 1694 + { 1695 + wxMessageBox(wxT("You must specify some NO-DATA value"), 1696 + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 1697 + return false; 1698 + } 1685 1699 wxStringTokenizer tokenizer(no_data, wxT(",")); 1686 1700 while (tokenizer.HasMoreTokens()) 1687 1701 { 1688 1702 count++; 1689 1703 wxString token = tokenizer.GetNextToken(); 1690 1704 if (sample == RL2_SAMPLE_FLOAT || sample == RL2_SAMPLE_DOUBLE) 1691 1705 { ................................................................................ 1871 1885 NumBands = bandsCtrl->GetValue(); 1872 1886 if (PixelType == RL2_PIXEL_MULTIBAND && NumBands < 2) 1873 1887 { 1874 1888 wxMessageBox(wxT("Invalid number of Bands"), 1875 1889 wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 1876 1890 return; 1877 1891 } 1878 - wxRadioBox *pixelCtrl = (wxRadioBox *) FindWindow(ID_CVG_PIXEL); 1879 - wxRadioBox *sampleCtrl = (wxRadioBox *) FindWindow(ID_CVG_SAMPLE); 1880 - wxRadioBox *compressionCtrl = (wxRadioBox *) FindWindow(ID_CVG_COMPRESSION); 1881 - wxSpinCtrl *bandCtrl = (wxSpinCtrl *) FindWindow(ID_CVG_BANDS); 1882 1892 if (PixelType == RL2_PIXEL_MULTIBAND) 1883 1893 { 1884 1894 if (RedBand >= 0) 1885 1895 { 1886 1896 if (RedBand >= NumBands) 1887 1897 { 1888 1898 wxMessageBox(wxT("Invalid default Red Band"), ................................................................................ 3242 3252 // populates individual controls 3243 3253 CreateControls(); 3244 3254 // sets dialog sizer 3245 3255 GetSizer()->Fit(this); 3246 3256 GetSizer()->SetSizeHints(this); 3247 3257 // centers the dialog window 3248 3258 Centre(); 3249 - int count = 0; 3250 3259 return true; 3251 3260 } 3252 3261 3253 3262 void RasterInfosDialog::CreateControls() 3254 3263 { 3255 3264 // 3256 3265 // creating individual control and setting initial values
Changes to RasterSymbolizers.cpp.
1 1 /* 2 2 / RasterSymbolizers.cpp 3 3 / various dialog classes 4 4 / 5 5 / version 1.8, 2015 March 23 6 6 / 7 -/ Author: Sandro Furieri a-furieri@lqt.it 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 8 / 9 9 / Copyright (C) 2015 Alessandro Furieri 10 10 / 11 11 / This program is free software: you can redistribute it and/or modify 12 12 / it under the terms of the GNU General Public License as published by 13 13 / the Free Software Foundation, either version 3 of the License, or 14 14 / (at your option) any later version. ................................................................................ 3611 3611 3612 3612 void RasterSymbolizerCategorizeDialog::RefreshGrid() 3613 3613 { 3614 3614 // 3615 3615 // refreshing the Grid 3616 3616 // 3617 3617 int tot_rows = GridCtrl->GetNumberRows(); 3618 - GridCtrl->DeleteRows(0, tot_rows); 3618 + if (tot_rows > 0) 3619 + GridCtrl->DeleteRows(0, tot_rows); 3619 3620 int count = 1; 3620 3621 ColorMapEntry *pE = Map.GetFirst(); 3621 3622 while (pE) 3622 3623 { 3623 3624 // counting how many lines are there 3624 3625 count++; 3625 3626 pE = pE->GetNext(); ................................................................................ 4711 4712 4712 4713 void RasterSymbolizerInterpolateDialog::RefreshGrid() 4713 4714 { 4714 4715 // 4715 4716 // refreshing the Grid 4716 4717 // 4717 4718 int tot_rows = GridCtrl->GetNumberRows(); 4718 - GridCtrl->DeleteRows(0, tot_rows); 4719 + if (tot_rows > 0) 4720 + GridCtrl->DeleteRows(0, tot_rows); 4719 4721 int count = 0; 4720 4722 ColorMapEntry *pE = Map.GetFirst(); 4721 4723 while (pE) 4722 4724 { 4723 4725 // counting how many lines are there 4724 4726 count++; 4725 4727 pE = pE->GetNext(); ................................................................................ 5350 5352 5351 5353 bool RasterSymbolizerMonochromeDialog::Create(MyFrame * parent) 5352 5354 { 5353 5355 // 5354 5356 // creating the dialog 5355 5357 // 5356 5358 MainFrame = parent; 5357 - Color = wxT("#ff0000"); 5359 + Color = wxT("#000000"); 5358 5360 MinScale = false; 5359 5361 MaxScale = false; 5360 5362 if (wxDialog::Create(parent, wxID_ANY, 5361 5363 wxT("RasterSymbolizer: Recolored Monochrome")) == false) 5362 5364 return false; 5363 5365 // populates individual controls 5364 5366 CreateControls(); ................................................................................ 5423 5425 wxBoxSizer *remapBoxSizer = new wxBoxSizer(wxVERTICAL); 5424 5426 miscSizer->Add(remapBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 5425 5427 wxStaticBox *remapBox = new wxStaticBox(this, wxID_STATIC, 5426 5428 wxT("Black remapped Color"), 5427 5429 wxDefaultPosition, 5428 5430 wxDefaultSize); 5429 5431 wxBoxSizer *remapSizer = new wxStaticBoxSizer(remapBox, wxVERTICAL); 5430 - remapBoxSizer->Add(remapSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 5432 + remapBoxSizer->Add(remapSizer, 0, wxALIGN_RIGHT | wxALL, 5); 5431 5433 wxBoxSizer *colorSizer = new wxBoxSizer(wxHORIZONTAL); 5432 - remapSizer->Add(colorSizer, 0, wxALIGN_RIGHT | wxALL, 0); 5434 + remapSizer->Add(colorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); 5433 5435 wxTextCtrl *colorCtrl = new wxTextCtrl(this, ID_SYMBOLIZER_COLOR, Color, 5434 5436 wxDefaultPosition, wxSize(100, 22)); 5435 - colorSizer->Add(colorCtrl, 0, wxALIGN_RIGHT | wxALL, 5); 5436 - wxTextCtrl *sampleCtrl = 5437 - new wxTextCtrl(this, ID_SYMBOLIZER_PICKER_HEX, wxT(" "), 5438 - wxDefaultPosition, wxSize(44, 22), wxTE_READONLY); 5439 - wxColour back = wxColour(255, 0, 0); 5440 - sampleCtrl->SetBackgroundColour(back); 5441 - colorSizer->Add(sampleCtrl, 0, wxALIGN_RIGHT | wxALL, 5); 5442 - wxBoxSizer *pickerSizer = new wxBoxSizer(wxHORIZONTAL); 5443 - remapSizer->Add(pickerSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); 5437 + colorSizer->Add(colorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 5438 + wxBitmap bmp; 5439 + wxColour color(0, 0, 0); 5440 + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); 5441 + wxStaticBitmap *sampleCtrl = 5442 + new wxStaticBitmap(this, ID_SYMBOLIZER_PICKER_HEX, bmp, 5443 + wxDefaultPosition, wxSize(32, 32)); 5444 + colorSizer->Add(sampleCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 5444 5445 wxButton *pick = 5445 5446 new wxButton(this, ID_SYMBOLIZER_PICKER_BTN, wxT("&Pick a color")); 5446 - pickerSizer->Add(pick, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 5447 + colorSizer->Add(pick, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); 5447 5448 // sixth row: optional Visibility Range 5448 5449 miscSizer->AddSpacer(75); 5449 5450 wxBoxSizer *visibilityBoxSizer = new wxBoxSizer(wxVERTICAL); 5450 5451 miscSizer->Add(visibilityBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); 5451 5452 wxStaticBox *visibilityBox = new wxStaticBox(this, wxID_STATIC, 5452 5453 wxT("Visibility Range"), 5453 5454 wxDefaultPosition, ................................................................................ 5502 5503 new wxButton(this, ID_SYMBOLIZER_EXPORT, wxT("&Export to file")); 5503 5504 btnBox->Add(exp, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 5504 5505 wxButton *copy = new wxButton(this, ID_SYMBOLIZER_COPY, wxT("&Copy")); 5505 5506 btnBox->Add(copy, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 5506 5507 btnBox->AddSpacer(100); 5507 5508 wxButton *ok = new wxButton(this, wxID_OK, wxT("&Quit")); 5508 5509 btnBox->Add(ok, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); 5509 -// appends event handler for OK button 5510 +// appends event handler for OK button; 5510 5511 Connect(wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, 5511 5512 (wxObjectEventFunction) & RasterSymbolizerMonochromeDialog::OnQuit); 5512 5513 Connect(ID_SYMBOLIZER_INSERT, wxEVT_COMMAND_BUTTON_CLICKED, 5513 5514 (wxObjectEventFunction) & RasterSymbolizerMonochromeDialog::OnInsert); 5514 5515 Connect(ID_SYMBOLIZER_EXPORT, wxEVT_COMMAND_BUTTON_CLICKED, 5515 5516 (wxObjectEventFunction) & RasterSymbolizerMonochromeDialog::OnExport); 5516 5517 Connect(ID_SYMBOLIZER_COPY, wxEVT_COMMAND_BUTTON_CLICKED, ................................................................................ 5529 5530 void RasterSymbolizerMonochromeDialog:: 5530 5531 OnCmdColorChanged(wxCommandEvent & WXUNUSED(event)) 5531 5532 { 5532 5533 // 5533 5534 // remapped color changed: updating the visual sample 5534 5535 // 5535 5536 wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_COLOR); 5536 - wxTextCtrl *sampleCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_PICKER_HEX); 5537 + wxStaticBitmap *sampleCtrl = 5538 + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_PICKER_HEX); 5537 5539 wxColour back = wxColour(255, 255, 255); 5538 5540 wxString str = colorCtrl->GetValue(); 5539 5541 if (ColorMapEntry::IsValidColor(str) == true) 5540 5542 ColorMapEntry::GetWxColor(str, back); 5541 - sampleCtrl->SetBackgroundColour(back); 5543 + wxBitmap bmp; 5544 + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); 5545 + sampleCtrl->SetBitmap(bmp); 5542 5546 sampleCtrl->Refresh(); 5543 5547 sampleCtrl->Update(); 5544 5548 } 5545 5549 5546 5550 void RasterSymbolizerMonochromeDialog:: 5547 5551 OnCmdColorPicker(wxCommandEvent & WXUNUSED(event)) 5548 5552 { ................................................................................ 5810 5814 sqlite3_free(prev); 5811 5815 prev = xml; 5812 5816 xml = 5813 5817 sqlite3_mprintf("%s\t\t\t\t\t<LookupValue>Rasterdata</LookupValue>\r\n", 5814 5818 prev); 5815 5819 sqlite3_free(prev); 5816 5820 prev = xml; 5817 - xml = sqlite3_mprintf("%s\t\t\t\t\t<Value>#ffffff</Value>\r\n", prev); 5821 + xml = sqlite3_mprintf("%s\t\t\t\t\t<Value>#000000</Value>\r\n", prev); 5818 5822 sqlite3_free(prev); 5819 5823 prev = xml; 5820 5824 str = new char[strlen(Color.ToUTF8()) + 1]; 5821 5825 strcpy(str, Color.ToUTF8()); 5822 5826 xml = 5823 5827 sqlite3_mprintf 5824 5828 ("%s\t\t\t\t\t<Threshold>1</Threshold>\r\n\t\t\t\t\t<Value>%s</Value>\r\n", ................................................................................ 5911 5915 ("%s\t<ColorMap>\r\n\t\t<Categorize fallbackValue=\"#ffffff\">\r\n", prev); 5912 5916 sqlite3_free(prev); 5913 5917 prev = xml; 5914 5918 xml = 5915 5919 sqlite3_mprintf("%s\t\t\t<LookupValue>Rasterdata</LookupValue>\r\n", prev); 5916 5920 sqlite3_free(prev); 5917 5921 prev = xml; 5918 - xml = sqlite3_mprintf("%s\t\t\t<Value>#ffffff</Value>\r\n", prev); 5922 + xml = sqlite3_mprintf("%s\t\t\t<Value>#000000</Value>\r\n", prev); 5919 5923 sqlite3_free(prev); 5920 5924 prev = xml; 5921 5925 str = new char[strlen(Color.ToUTF8()) + 1]; 5922 5926 strcpy(str, Color.ToUTF8()); 5923 5927 xml = 5924 5928 sqlite3_mprintf 5925 5929 ("%s\t\t\t<Threshold>1</Threshold>\r\n\t\t\t<Value>%s</Value>\r\n", prev,
Changes to ResultSetView.cpp.
1 1 /* 2 2 / ResultSetView.cpp 3 3 / a panel to show SQL query results 4 4 / 5 5 / version 1.7, 2013 May 8 6 6 / 7 -/ Author: Sandro Furieri a-furieri@lqt.it 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 8 / 9 9 / Copyright (C) 2008-2013 Alessandro Furieri 10 10 / 11 11 / This program is free software: you can redistribute it and/or modify 12 12 / it under the terms of the GNU General Public License as published by 13 13 / the Free Software Foundation, either version 3 of the License, or 14 14 / (at your option) any later version. ................................................................................ 513 513 } 514 514 515 515 params->Finalize(); 516 516 params->SetEndRow(end_row); 517 517 params->SetMaxRow(i_row); 518 518 goto ok; 519 519 error: 520 + params->Finalize(); 520 521 params->SetError(); 521 522 ok: 522 523 wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, ID_RS_THREAD_FINISHED); 523 524 params->GetMother()->GetEventHandler()->AddPendingEvent(event); 524 525 #if defined(_WIN32) && !defined(__MINGW32__) 525 526 return 0; 526 527 #else ................................................................................ 723 724 TileDataDbPrefix = tile_data_db_prefix; 724 725 TileDataTable = tile_data_table; 725 726 } 726 727 char *xSql = NULL; 727 728 char err_msg[2048]; 728 729 int i_row; 729 730 clock_t clock_start; 730 - sqlite3_stmt *stmt; 731 + sqlite3_stmt *stmt = NULL; 731 732 sqlite3 *sqlite = MainFrame->GetSqlite(); 732 733 SqlErrorMsg = wxT(""); 733 734 if (TableView) 734 735 TableView->Destroy(); 735 736 TableView = NULL; 736 737 if (TableBlobs) 737 738 delete TableBlobs; ................................................................................ 816 817 ::wxEndBusyCursor(); 817 818 sqlite3_finalize(stmt); 818 819 delete[]xSql; 819 820 return false; 820 821 } 821 822 } 822 823 sqlite3_finalize(stmt); 824 + stmt = NULL; 823 825 } 824 826 delete[]xSql; 825 827 CreateStatsGrid(); 826 828 MainFrame->DisableAllTools(); 827 829 828 830 ThreadParams.Initialize(this, sql, stmt, from, sqlite, clock_start); 829 831 if (!ProgressTimer) ................................................................................ 976 978 // 977 979 if (ReadOnly == false) 978 980 { 979 981 // preparing the insert row 980 982 int numCols = 0; 981 983 wxString *colNames = MainFrame->GetColumnNames(TableName, &numCols); 982 984 CreateGrid(0, numCols + 1); 983 - if (isView == false); 984 - TableView->SetColLabelValue(0, wxT("ROWID")); 985 + if (isView == false) 986 + TableView->SetColLabelValue(0, wxT("ROWID")); 985 987 for (i_col = 0; i_col < numCols; i_col++) 986 988 TableView->SetColLabelValue(i_col + 1, *(colNames + i_col)); 987 989 TableView->EnableEditing(true); 988 990 delete[]colNames; 989 991 } else 990 992 { 991 993 // simply showing a warning message ................................................................................ 1081 1083 gaiaGuessBlobType(value->GetBlob(), 1082 1084 value->GetBlobSize()); 1083 1085 switch (type) 1084 1086 { 1085 1087 case GAIA_GEOMETRY_BLOB: 1086 1088 blobType = wxT("GEOMETRY"); 1087 1089 break; 1090 + case GAIA_TINYPOINT_BLOB: 1091 + blobType = wxT("TinyPoint"); 1092 + break; 1088 1093 case GAIA_GPB_BLOB: 1089 1094 blobType = wxT("GeoPackageGEOMETRY"); 1090 1095 break; 1091 1096 case GAIA_XML_BLOB: 1092 1097 blobType = wxT("XmlBLOB"); 1093 1098 break; 1094 1099 case GAIA_JPEG_BLOB: ................................................................................ 1831 1836 menu.Append(menuItem); 1832 1837 menu.AppendSeparator(); 1833 1838 } 1834 1839 } 1835 1840 menuItem = new wxMenuItem(&menu, Grid_Blob, wxT("BLOB &explore")); 1836 1841 menu.Append(menuItem); 1837 1842 blob_type = gaiaGuessBlobType(blobVar->GetBlob(), blobVar->GetBlobSize()); 1838 - if (blob_type == GAIA_GEOMETRY_BLOB) 1843 + if (blob_type == GAIA_GEOMETRY_BLOB || blob_type == GAIA_TINYPOINT_BLOB 1844 + || blob_type == GAIA_GPB_BLOB) 1839 1845 ; 1840 1846 else if (blob_type == GAIA_XML_BLOB) 1841 1847 { 1842 1848 menu.AppendSeparator(); 1843 1849 menuItem = 1844 1850 new wxMenuItem(&menu, Grid_XmlBlobIn, wxT("XmlBLOB &import")); 1845 1851 menu.Append(menuItem); ................................................................................ 2706 2712 blobValue += wxT("TIFF image"); 2707 2713 break; 2708 2714 case GAIA_WEBP_BLOB: 2709 2715 blobValue += wxT("WEBP image"); 2710 2716 break; 2711 2717 case GAIA_JP2_BLOB: 2712 2718 blobValue += wxT("JP2 image (Jpeg2000)"); 2719 + break; 2713 2720 case GAIA_PDF_BLOB: 2714 2721 blobValue += wxT("PDF document"); 2715 2722 break; 2716 2723 case GAIA_ZIP_BLOB: 2717 2724 blobValue += wxT("ZIP archive"); 2718 2725 break; 2719 2726 default:
Changes to Shapefiles.cpp.
1 1 /* 2 2 / Shapefiles.cpp 3 3 / methods related to Shapefile loading and saving 4 4 / 5 5 / version 1.7, 2013 May 8 6 6 / 7 -/ Author: Sandro Furieri a-furieri@lqt.it 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 8 / 9 9 / Copyright (C) 2008-2013 Alessandro Furieri 10 10 / 11 11 / This program is free software: you can redistribute it and/or modify 12 12 / it under the terms of the GNU General Public License as published by 13 13 / the Free Software Foundation, either version 3 of the License, or 14 14 / (at your option) any later version.
Changes to SqlFiltersComposer.cpp.
1 1 /* 2 2 / SqlFiltersComposer.cpp 3 3 / Sql Filters Composer 4 4 / 5 5 / version 2.0, 2016 August 9 6 6 / 7 -/ Author: Sandro Furieri a-furieri@lqt.it 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 8 / 9 9 / Copyright (C) 2016 Alessandro Furieri 10 10 / 11 11 / This program is free software: you can redistribute it and/or modify 12 12 / it under the terms of the GNU General Public License as published by 13 13 / the Free Software Foundation, either version 3 of the License, or 14 14 / (at your option) any later version. ................................................................................ 26 26 #include "Classdef.h" 27 27 28 28 void MyFrame::SqlFiltersComposer() 29 29 { 30 30 // 31 31 // query/view composer invoked 32 32 // 33 - char *xsql; 34 - int ret; 35 - char *errMsg = NULL; 36 33 SqlFiltersDialog dlg; 37 34 38 35 if (SqlFilters.IsValid() == false) 39 36 return; 40 37 41 38 wxString db_prefix = SqlFilters.GetDbPrefix(); 42 39 wxString table = SqlFilters.GetTableName(); ................................................................................ 48 45 int primaryKeys[1024]; 49 46 int blobCols[1024]; 50 47 int pk = 0; 51 48 int pb = 0; 52 49 char **results; 53 50 int rows; 54 51 int columns; 52 + char *xsql; 55 53 int i; 56 54 char *errMsg = NULL; 57 55 wxString sql; 58 - char *xsql; 59 - char *column; 60 56 char *type; 61 57 char *xname; 62 58 char *xname2; 63 59 64 60 for (i = 0; i < 1024; i++) 65 61 { 66 62 primaryKeys[i] = -1;
Changes to Styles.cpp.
1 1 /* 2 2 / Styles.cpp 3 3 / various dialog classes 4 4 / 5 5 / version 1.8, 2015 March 13 6 6 / 7 -/ Author: Sandro Furieri a-furieri@lqt.it 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 8 / 9 9 / Copyright (C) 2015 Alessandro Furieri 10 10 / 11 11 / This program is free software: you can redistribute it and/or modify 12 12 / it under the terms of the GNU General Public License as published by 13 13 / the Free Software Foundation, either version 3 of the License, or 14 14 / (at your option) any later version. ................................................................................ 1282 1282 if (dlg.ShowModal() == wxID_OK) 1283 1283 { 1284 1284 // attempting to register the new styles 1285 1285 DoRegistetRasterCoverageStyles(&dlg); 1286 1286 1287 1287 // updating the Grid 1288 1288 int tot_rows = GridCtrl->GetNumberRows(); 1289 - GridCtrl->DeleteRows(0, tot_rows); 1289 + if (tot_rows > 0) 1290 + GridCtrl->DeleteRows(0, tot_rows); 1290 1291 if (List != NULL) 1291 1292 delete List; 1292 1293 List = MainFrame->FindRasterCoverageStyles(CoverageName); 1293 1294 int count = 0; 1294 1295 RasterCoverageStyle *pS = List->GetFirst(); 1295 1296 while (pS) 1296 1297 { ................................................................................ 3379 3380 if (dlg.ShowModal() == wxID_OK) 3380 3381 { 3381 3382 // attempting to register the new styles 3382 3383 DoRegistetVectorCoverageStyles(&dlg); 3383 3384 3384 3385 // updating the Grid 3385 3386 int tot_rows = GridCtrl->GetNumberRows(); 3386 - GridCtrl->DeleteRows(0, tot_rows); 3387 + if (tot_rows > 0) 3388 + GridCtrl->DeleteRows(0, tot_rows); 3387 3389 if (List != NULL) 3388 3390 delete List; 3389 3391 List = MainFrame->FindVectorCoverageStyles(CoverageName); 3390 3392 int count = 0; 3391 3393 VectorCoverageStyle *pS = List->GetFirst(); 3392 3394 while (pS) 3393 3395 { ................................................................................ 5283 5285 // populates individual controls 5284 5286 CreateControls(); 5285 5287 // sets dialog sizer 5286 5288 GetSizer()->Fit(this); 5287 5289 GetSizer()->SetSizeHints(this); 5288 5290 // centers the dialog window 5289 5291 Centre(); 5290 - int count = 0; 5291 5292 return true; 5292 5293 } 5293 5294 5294 5295 void VectorInfosDialog::CreateControls() 5295 5296 { 5296 5297 // 5297 5298 // creating individual control and setting initial values ................................................................................ 6943 6944 } 6944 6945 // attempting to register the alternative SRID 6945 6946 if (DoRegistetVectorCoverageSrid(srid) == true) 6946 6947 { 6947 6948 // updating the Grid 6948 6949 GridCtrl->Show(false); 6949 6950 int tot_rows = GridCtrl->GetNumberRows(); 6950 - GridCtrl->DeleteRows(0, tot_rows); 6951 + if (tot_rows > 0) 6952 + GridCtrl->DeleteRows(0, tot_rows); 6951 6953 if (List != NULL) 6952 6954 delete List; 6953 6955 List = MainFrame->FindVectorAlternativeSRIDs(CoverageName); 6954 6956 int count = 0; 6955 6957 VectorCoverageSRID *pS = List->GetFirst(); 6956 6958 while (pS) 6957 6959 { ................................................................................ 7507 7509 return; 7508 7510 } 7509 7511 // attempting to register the Keyword 7510 7512 if (DoRegistetVectorCoverageKeyword(keyword) == true) 7511 7513 { 7512 7514 // updating the Grid 7513 7515 int tot_rows = GridCtrl->GetNumberRows(); 7514 - GridCtrl->DeleteRows(0, tot_rows); 7516 + if (tot_rows > 0) 7517 + GridCtrl->DeleteRows(0, tot_rows); 7515 7518 if (List != NULL) 7516 7519 delete List; 7517 7520 List = MainFrame->FindVectorKeywords(CoverageName); 7518 7521 int count = 0; 7519 7522 VectorCoverageKeyword *pK = List->GetFirst(); 7520 7523 while (pK) 7521 7524 { ................................................................................ 8046 8049 } 8047 8050 // attempting to register the alternative SRID 8048 8051 if (DoRegistetRasterCoverageSrid(srid) == true) 8049 8052 { 8050 8053 // updating the Grid 8051 8054 GridCtrl->Show(false); 8052 8055 int tot_rows = GridCtrl->GetNumberRows(); 8053 - GridCtrl->DeleteRows(0, tot_rows); 8056 + if (tot_rows > 0) 8057 + GridCtrl->DeleteRows(0, tot_rows); 8054 8058 if (List != NULL) 8055 8059 delete List; 8056 8060 List = MainFrame->FindRasterAlternativeSRIDs(CoverageName); 8057 8061 int count = 0; 8058 8062 RasterCoverageSRID *pS = List->GetFirst(); 8059 8063 while (pS) 8060 8064 { ................................................................................ 8480 8484 return; 8481 8485 } 8482 8486 // attempting to register the Keyword 8483 8487 if (DoRegistetRasterCoverageKeyword(keyword) == true) 8484 8488 { 8485 8489 // updating the Grid 8486 8490 int tot_rows = GridCtrl->GetNumberRows(); 8487 - GridCtrl->DeleteRows(0, tot_rows); 8491 + if (tot_rows > 0) 8492 + GridCtrl->DeleteRows(0, tot_rows); 8488 8493 if (List != NULL) 8489 8494 delete List; 8490 8495 List = MainFrame->FindRasterKeywords(CoverageName); 8491 8496 int count = 0; 8492 8497 RasterCoverageKeyword *pK = List->GetFirst(); 8493 8498 while (pK) 8494 8499 {
Changes to TableTree.cpp.
1 1 /* 2 2 / TableTree.cpp 3 3 / tree control to show tables, columns, indices and triggers 4 4 / 5 5 / version 1.7, 2013 May 8 6 6 / 7 -/ Author: Sandro Furieri a-furieri@lqt.it 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 8 / 9 9 / Copyright (C) 2008-2013 Alessandro Furieri 10 10 / 11 11 / This program is free software: you can redistribute it and/or modify 12 12 / it under the terms of the GNU General Public License as published by 13 13 / the Free Software Foundation, either version 3 of the License, or 14 14 / (at your option) any later version. ................................................................................ 77 77 #include "icons/coverage_tiles.xpm" 78 78 #include "icons/vector.xpm" 79 79 #include "icons/linestrings_on.xpm" 80 80 #include "icons/points_on.xpm" 81 81 #include "icons/polygons_on.xpm" 82 82 #include "icons/clone.xpm" 83 83 #include "icons/wms.xpm" 84 +#include "icons/postgres.xpm" 85 +#include "icons/postgres_schema.xpm" 86 +#include "icons/postgres_table.xpm" 87 +#include "icons/postgres_view.xpm" 84 88 85 89 MyTableTree::MyTableTree(MyFrame * parent, wxWindowID id):wxTreeCtrl(parent, id) 86 90 { 87 91 // 88 92 // constructor: TREE control to show DB objects 89 93 // 90 94 MainFrame = parent; ................................................................................ 110 114 SetItemData(RootRasterCoverages, 111 115 (wxTreeItemData *) (new MyObject(MY_ROOT_RASTER))); 112 116 RootVectorCoverages = AppendItem(Root, wxT("Vector Coverages")); 113 117 SetItemData(RootVectorCoverages, 114 118 (wxTreeItemData *) (new MyObject(MY_ROOT_VECTOR))); 115 119 RootWMS = AppendItem(Root, wxT("Registered WMS layers")); 116 120 SetItemData(RootWMS, (wxTreeItemData *) (new MyObject(MY_ROOT_WMS))); 121 + RootPostgreSQL = AppendItem(Root, wxT("PostgreSQL")); 122 + SetItemData(RootPostgreSQL, 123 + (wxTreeItemData *) (new MyObject(MY_ROOT_POSTGRESQL))); 117 124 RootMetadata = AppendItem(Root, wxT("Metadata")); 118 125 SetItemData(RootMetadata, 119 126 (wxTreeItemData *) (new MyObject(MY_ROOT_METADATA))); 120 127 RootInternal = AppendItem(Root, wxT("Internal Data")); 121 128 SetItemData(RootInternal, 122 129 (wxTreeItemData *) (new MyObject(MY_ROOT_INTERNAL))); 123 130 RootSpatialIndex = AppendItem(Root, wxT("Spatial Index")); 124 131 SetItemData(RootSpatialIndex, 125 132 (wxTreeItemData *) (new MyObject(MY_ROOT_RTREE))); 126 133 // setting up icons 127 134 Images = new wxImageList(16, 16, true); 128 - wxIcon icons[36]; 135 + wxIcon icons[40]; 129 136 icons[0] = wxIcon(db_xpm); 130 137 icons[1] = wxIcon(table_xpm); 131 138 icons[2] = wxIcon(pkey_xpm); 132 139 icons[3] = wxIcon(column_xpm); 133 140 icons[4] = wxIcon(index_xpm); 134 141 icons[5] = wxIcon(trigger_xpm); 135 142 icons[6] = wxIcon(geometry_xpm); ................................................................................ 158 165 icons[29] = wxIcon(polygons_on_xpm); 159 166 icons[30] = wxIcon(gpkgvtable_xpm); 160 167 icons[31] = wxIcon(gpkgtable_xpm); 161 168 icons[32] = wxIcon(gpkggeom_xpm); 162 169 icons[33] = wxIcon(virtshp_xpm); 163 170 icons[34] = wxIcon(virtgpkg_xpm); 164 171 icons[35] = wxIcon(gpkg_spatialidx_xpm); 172 + icons[36] = wxIcon(postgres_xpm); 173 + icons[37] = wxIcon(postgres_schema_xpm); 174 + icons[38] = wxIcon(postgres_table_xpm); 175 + icons[39] = wxIcon(postgres_view_xpm); 165 176 Images->Add(icons[0]); 166 177 Images->Add(icons[1]); 167 178 Images->Add(icons[2]); 168 179 Images->Add(icons[3]); 169 180 Images->Add(icons[4]); 170 181 Images->Add(icons[5]); 171 182 Images->Add(icons[6]); ................................................................................ 194 205 Images->Add(icons[29]); 195 206 Images->Add(icons[30]); 196 207 Images->Add(icons[31]); 197 208 Images->Add(icons[32]); 198 209 Images->Add(icons[33]); 199 210 Images->Add(icons[34]); 200 211 Images->Add(icons[35]); 212 + Images->Add(icons[36]); 213 + Images->Add(icons[37]); 214 + Images->Add(icons[38]); 215 + Images->Add(icons[39]); 201 216 SetImageList(Images); 202 217 SetItemImage(Root, 0); 203 218 SetItemImage(RootUserData, 17); 204 219 SetItemImage(RootTopologies, 20); 205 220 SetItemImage(RootNetworks, 25); 206 221 SetItemImage(RootRasterCoverages, 22); 207 222 SetItemImage(RootVectorCoverages, 24); 208 223 SetItemImage(RootWMS, 26); 224 + SetItemImage(RootPostgreSQL, 36); 209 225 SetItemImage(RootStyling, 17); 210 226 SetItemImage(RootIsoMetadata, 17); 211 227 SetItemImage(RootMetadata, 17); 212 228 SetItemImage(RootInternal, 17); 213 229 SetItemImage(RootSpatialIndex, 17); 214 230 wxString empty = wxEmptyString; 215 231 ................................................................................ 432 448 (wxObjectEventFunction) & MyTableTree::OnCmdCreateTopoGeo); 433 449 Connect(Tree_DropTopoGeo, wxEVT_COMMAND_MENU_SELECTED, 434 450 (wxObjectEventFunction) & MyTableTree::OnCmdDropTopoGeo); 435 451 Connect(Tree_CreateTopoNet, wxEVT_COMMAND_MENU_SELECTED, 436 452 (wxObjectEventFunction) & MyTableTree::OnCmdCreateTopoNet); 437 453 Connect(Tree_DropTopoNet, wxEVT_COMMAND_MENU_SELECTED, 438 454 (wxObjectEventFunction) & MyTableTree::OnCmdDropTopoNet); 455 + Connect(Tree_CreatePostgreSqlConn, wxEVT_COMMAND_MENU_SELECTED, 456 + (wxObjectEventFunction) & MyTableTree::OnCmdCreatePostgreSqlConn); 457 + Connect(Tree_CloseAllPostgreSqlConns, wxEVT_COMMAND_MENU_SELECTED, 458 + (wxObjectEventFunction) & MyTableTree::OnCmdCloseAllPostgreSqlConns); 459 + Connect(Tree_ClosePostgreSqlConn, wxEVT_COMMAND_MENU_SELECTED, 460 + (wxObjectEventFunction) & MyTableTree::OnCmdClosePostgreSqlConn); 461 + Connect(Tree_PostgreSqlInfos, wxEVT_COMMAND_MENU_SELECTED, 462 + (wxObjectEventFunction) & MyTableTree::OnCmdPostgreSqlInfos); 463 + Connect(Tree_PostgreSqlDropOrphans, wxEVT_COMMAND_MENU_SELECTED, 464 + (wxObjectEventFunction) & MyTableTree::OnCmdPostgreSqlDropOrphans); 439 465 } 440 466 441 467 MyTableTree::~MyTableTree() 442 468 { 443 469 delete Images; 444 470 } 445 471 ................................................................................ 452 478 DeleteChildren(RootUserData); 453 479 DeleteTopologies(RootTopologies); 454 480 DeleteNetworks(RootNetworks); 455 481 DeleteRasterCoverages(RootRasterCoverages); 456 482 DeleteVectorCoverages(RootVectorCoverages); 457 483 DeleteChildren(RootStyling); 458 484 DeleteChildren(RootWMS); 485 + DeleteChildren(RootPostgreSQL); 459 486 DeleteChildren(RootIsoMetadata); 460 487 DeleteChildren(RootMetadata); 461 488 DeleteChildren(RootInternal); 462 489 DeleteChildren(RootSpatialIndex); 463 490 while (ok) 464 491 { 465 492 ok = false; ................................................................................ 478 505 if (child == RootRasterCoverages) 479 506 kill = false; 480 507 if (child == RootVectorCoverages) 481 508 kill = false; 482 509 if (child == RootStyling) 483 510 kill = false; 484 511 if (child == RootWMS) 512 + kill = false; 513 + if (child == RootPostgreSQL) 485 514 kill = false; 486 515 if (child == RootIsoMetadata) 487 516 kill = false; 488 517 if (child == RootMetadata) 489 518 kill = false; 490 519 if (child == RootInternal) 491 520 kill = false; ................................................................................ 512 541 return; 513 542 switch (obj->GetType()) 514 543 { 515 544 case MY_TABLE: 516 545 case MY_VTABLE: 517 546 case MY_TILE_DATA: 518 547 case MY_VIEW: 548 + case MY_POSTGRES_TABLE: 549 + case MY_POSTGRES_VIEW: 550 + case MY_POSTGIS_VIEW: 519 551 DeleteChildren(item); 520 552 AppendItem(item, wxT("placeholder"), 0); 521 553 break; 522 554 }; 523 555 event.Skip(); 524 556 } 525 557 ................................................................................ 549 581 case MY_VIEW: 550 582 DeleteChildren(item); 551 583 if (obj->GetDbAlias().Len() == 0) 552 584 ExpandView(item); 553 585 else 554 586 ExpandAttachedView(item); 555 587 EnsureVisible(item); 588 + return; 589 + case MY_POSTGRES_TABLE: 590 + case MY_POSTGRES_VIEW: 591 + DeleteChildren(item); 592 + ExpandPostgresTable(item); 593 + EnsureVisible(item); 594 + return; 595 + case MY_POSTGIS_VIEW: 596 + DeleteChildren(item); 597 + ExpandPostGisView(item); 598 + EnsureVisible(item); 556 599 return; 557 600 }; 558 601 event.Skip(); 559 602 } 560 603 561 604 void MyTableTree::DeleteTopologies(wxTreeItemId & RootTopologies) 562 605 { ................................................................................ 634 677 if (tableName == wxT("vector_layers")) 635 678 return RootMetadata; 636 679 if (tableName == wxT("topologies")) 637 680 return RootMetadata; 638 681 if (tableName == wxT("networks")) 639 682 return RootMetadata; 640 683 if (tableName == wxT("data_licenses")) 684 + return RootMetadata; 685 + if (tableName == wxT("stored_procedures")) 686 + return RootMetadata; 687 + if (tableName == wxT("stored_variables")) 641 688 return RootMetadata; 642 689 643 690 if (tableName == wxT("wms_getcapabilities")) 644 691 return RootMetadata; 645 692 if (tableName == wxT("wms_getmap")) 646 693 return RootMetadata; 647 694 if (tableName == wxT("wms_settings")) ................................................................................ 862 909 if (tableName == wxT("vector_layers")) 863 910 return nodes->GetRootMetadata(); 864 911 if (tableName == wxT("topologies")) 865 912 return nodes->GetRootMetadata(); 866 913 if (tableName == wxT("networks")) 867 914 return nodes->GetRootMetadata(); 868 915 if (tableName == wxT("data_licenses")) 916 + return nodes->GetRootMetadata(); 917 + if (tableName == wxT("stored_procedures")) 918 + return nodes->GetRootMetadata(); 919 + if (tableName == wxT("stored_variables")) 869 920 return nodes->GetRootMetadata(); 870 921 871 922 if (tableName == wxT("gpkg_spatial_ref_sys")) 872 923 return nodes->GetRootMetadata(); 873 924 if (tableName == wxT("gpkg_contents")) 874 925 return nodes->GetRootMetadata(); 875 926 if (tableName == wxT("gpkg_geometry_columns")) ................................................................................ 1098 1149 else if (isTileData == true) 1099 1150 data = (wxTreeItemData *) (new MyObject(MY_TILE_DATA, dbAlias, tableName)); 1100 1151 else 1101 1152 data = (wxTreeItemData *) (new MyObject(MY_TABLE, dbAlias, tableName)); 1102 1153 item = AppendItem(rootNode, tableName, icon, -1, data); 1103 1154 AppendItem(item, wxT("placeholder"), 0); 1104 1155 } 1156 + 1157 +void MyTableTree::AddTmpMetadata(wxString & name) 1158 +{ 1159 +// adding some TEMPORARY Metadata table 1160 + wxTreeItemId item; 1161 + wxString dbAlias = wxT("temp"); 1162 + wxTreeItemData *data = 1163 + (wxTreeItemData *) (new MyObject(MY_TABLE, dbAlias, name, true)); 1164 + item = AppendItem(RootMetadata, name, 1, -1, data); 1165 + AppendItem(item, wxT("placeholder"), 0); 1166 +} 1105 1167 1106 1168 void MyTableTree::AddGeoPackageTable(wxString & tableName) 1107 1169 { 1108 1170 // 1109 1171 // appends a GPKG table to the TREE list 1110 1172 // 1111 1173 wxTreeItemId item; ................................................................................ 1512 1574 SetItemData(item2, 1513 1575 (wxTreeItemData *) (new 1514 1576 MyObject(MY_TRIGGER, empty, 1515 1577 trgr->GetName()))); 1516 1578 trgr = trgr->GetNext(); 1517 1579 } 1518 1580 } 1581 + 1582 +void MyTableTree::ExpandPostgresTable(wxTreeItemId & item) 1583 +{ 1584 +// 1585 +// expands a TreeItem of the POSTGRES TABLE type 1586 +// 1587 + MyTableInfo list; 1588 + MyColumnInfo *col; 1589 + wxString columnInfo; 1590 + wxTreeItemId item2; 1591 + MyPostgresTable *table = NULL; 1592 + MyObject *obj = (MyObject *) GetItemData(item); 1593 + if (obj == NULL) 1594 + return; 1595 + wxString tableName = obj->GetVirtName(); 1596 + if (obj->GetType() == MY_POSTGRES_TABLE) 1597 + table = MainFrame->FindPostgresTable(tableName); 1598 + 1599 + MainFrame->GetTableColumns(tableName, &list); 1600 + wxString empty = wxEmptyString; 1601 + col = list.GetFirstColumn(); 1602 + while (col) 1603 + { 1604 + int icon = 3; 1605 + columnInfo = col->GetName(); 1606 + if (table != NULL) 1607 + { 1608 + // checking for a PK column 1609 + if (table->IsPkColumn(columnInfo) == true) 1610 + icon = 2; 1611 + } 1612 + item2 = AppendItem(item, columnInfo, icon); 1613 + SetItemData(item2, 1614 + (wxTreeItemData *) (new 1615 + MyObject(MY_POSTGRES_COLUMN, empty, empty, 1616 + -1, empty, empty, empty, empty, 1617 + columnInfo, tableName))); 1618 + col = col->GetNext(); 1619 + } 1620 +} 1621 + 1622 +void MyTableTree::AddPostgresConnection(int num, MyPostgresConn * conn, 1623 + wxTreeItemId & connId) 1624 +{ 1625 +// 1626 +// appends a PostgreSQL Connection to the TREE list 1627 +// 1628 + wxTreeItemId item; 1629 + wxTreeItemData *data; 1630 + int icon = 36; 1631 + data = 1632 + (wxTreeItemData *) (new 1633 + MyObject(MY_POSTGRES_CONN, conn->GetHost(), 1634 + conn->GetHostAddr(), conn->GetPort(), 1635 + conn->GetDbName(), conn->GetUser(), 1636 + conn->IsReadOnly())); 1637 + char dummy[128]; 1638 + sprintf(dummy, "connection #%d", num); 1639 + item = AppendItem(RootPostgreSQL, wxString::FromUTF8(dummy), icon, -1, data); 1640 + connId = item; 1641 +} 1642 + 1643 +void MyTableTree::AddPostgresSchema(wxTreeItemId & parent, 1644 + MyPostgresConn * conn, wxString & schema, 1645 + wxTreeItemId & item) 1646 +{ 1647 +// 1648 +// appends a PostgreSQL Schema to the TREE list 1649 +// 1650 + wxTreeItemData *data; 1651 + int icon = 37; 1652 + data = 1653 + (wxTreeItemData *) (new 1654 + MyObject(MY_POSTGRES_SCHEMA, conn->GetHost(), 1655 + conn->GetHostAddr(), conn->GetPort(), 1656 + conn->GetDbName(), conn->GetUser(), schema)); 1657 + item = AppendItem(parent, schema, icon, -1, data); 1658 +} 1659 + 1660 +void MyTableTree::AddPostgresTable(MyPostgres * list, wxString & virtName) 1661 +{ 1662 +// 1663 +// appends a PostgreSQL Table or View to the TREE list 1664 +// 1665 + int icon; 1666 + int type = -1; 1667 + MyPostgresConn *conn; 1668 + wxTreeItemId parent; 1669 + wxString schema; 1670 + wxString table; 1671 + bool readOnly; 1672 + bool hasPK; 1673 + bool canSelect; 1674 + bool canInsertUpdateDelete; 1675 + MyPostgresConn *pC = list->GetFirst(); 1676 + while (pC != NULL) 1677 + { 1678 + readOnly = pC->IsReadOnly(); 1679 + MyPostgresSchema *pS = pC->GetFirst(); 1680 + while (pS != NULL) 1681 + { 1682 + MyPostgresTable *pT = pS->GetFirstTable(); 1683 + while (pT != NULL) 1684 + { 1685 + if (pT->GetFirst() != NULL) 1686 + { 1687 + if (virtName.Cmp(pT->GetPostGisName()) == 0) 1688 + { 1689 + conn = pC; 1690 + parent = pS->GetTreeNode(); 1691 + icon = 12; 1692 + type = MY_POSTGIS_VIEW; 1693 + schema = pS->GetName(); 1694 + table = pT->GetName(); 1695 + hasPK = pT->HasPK(); 1696 + canSelect = pT->CanSelect(); 1697 + canInsertUpdateDelete = pT->CanInsertUpdateDelete(); 1698 + goto done; 1699 + } 1700 + } 1701 + if (virtName.Cmp(pT->GetVirtName()) == 0) 1702 + { 1703 + MainFrame->InitPostgresPkColumns(pC, pS, pT); 1704 + conn = pC; 1705 + parent = pS->GetTreeNode(); 1706 + icon = 38; 1707 + type = MY_POSTGRES_TABLE; 1708 + schema = pS->GetName(); 1709 + table = pT->GetName(); 1710 + hasPK = pT->HasPK(); 1711 + canSelect = pT->CanSelect(); 1712 + canInsertUpdateDelete = pT->CanInsertUpdateDelete(); 1713 + goto done; 1714 + } 1715 + pT = pT->GetNext(); 1716 + } 1717 + MyPostgresView *pV = pS->GetFirstView(); 1718 + while (pV != NULL) 1719 + { 1720 + if (virtName.Cmp(pV->GetVirtName()) == 0) 1721 + { 1722 + conn = pC; 1723 + parent = pS->GetTreeNode(); 1724 + icon = 39; 1725 + type = MY_POSTGRES_VIEW; 1726 + schema = pS->GetName(); 1727 + table = pV->GetName(); 1728 + hasPK = false; 1729 + canSelect = pV->CanSelect(); 1730 + canInsertUpdateDelete = pV->CanInsertUpdateDelete(); 1731 + goto done; 1732 + } 1733 + pV = pV->GetNext(); 1734 + } 1735 + pS = pS->GetNext(); 1736 + } 1737 + pC = pC->GetNext(); 1738 + } 1739 +done: 1740 + if (type == -1) 1741 + return; 1742 + 1743 +// adding the TREE node 1744 + wxTreeItemId item; 1745 + wxTreeItemData *data; 1746 + if (type == MY_POSTGIS_VIEW) 1747 + data = 1748 + (wxTreeItemData *) (new 1749 + MyObject(type, conn->GetHost(), conn->GetHostAddr(), 1750 + conn->GetPort(), conn->GetDbName(), 1751 + conn->GetUser(), schema, table, 1752 + virtName, readOnly, hasPK, canSelect, 1753 + canInsertUpdateDelete)); 1754 + else 1755 + data = 1756 + (wxTreeItemData *) (new 1757 + MyObject(type, conn->GetHost(), conn->GetHostAddr(), 1758 + conn->GetPort(), conn->GetDbName(), 1759 + conn->GetUser(), schema, table, virtName, 1760 + readOnly, hasPK, canSelect, 1761 + canInsertUpdateDelete)); 1762 + item = AppendItem(parent, virtName, icon, -1, data); 1763 + AppendItem(item, wxT("placeholder"), 0); 1764 +} 1519 1765 1520 1766 void MyTableTree::AddView(wxString & viewName, bool geometry) 1521 1767 { 1522 1768 // 1523 1769 // appends a view to the TREE list 1524 1770 // 1525 1771 wxTreeItemId item; ................................................................................ 1625 1871 SetItemData(item2, 1626 1872 (wxTreeItemData *) (new 1627 1873 MyObject(MY_TRIGGER, empty, 1628 1874 trgr->GetName()))); 1629 1875 trgr = trgr->GetNext(); 1630 1876 } 1631 1877 } 1878 + 1879 +void MyTableTree::ExpandPostGisView(wxTreeItemId & item) 1880 +{ 1881 +// 1882 +// expands a TreeItem of the PostGIS View Type (SpatiaLite wrapper) 1883 +// 1884 + MyViewInfo list; 1885 + MyColumnInfo *col; 1886 + MyTriggerInfo *trgr; 1887 + wxString columnInfo; 1888 + wxTreeItemId item2; 1889 + wxString empty = wxEmptyString; 1890 + MyPostgresTable *table = NULL; 1891 + MyObject *obj = (MyObject *) GetItemData(item); 1892 + if (obj == NULL) 1893 + return; 1894 + wxString viewName = obj->GetVirtName(); 1895 + table = MainFrame->FindPostGisView(viewName); 1896 + 1897 + MainFrame->GetViewColumns(viewName, &list); 1898 + MainFrame->GetViewTriggers(viewName, &list); 1899 + col = list.GetFirst(); 1900 + while (col) 1901 + { 1902 + int icon = 3; 1903 + columnInfo = col->GetName(); 1904 + if (MainFrame->DoCheckPostGisGeometry(viewName, columnInfo) == true) 1905 + { 1906 + icon = 6; 1907 + item2 = AppendItem(item, columnInfo, icon); 1908 + SetItemData(item2, 1909 + (wxTreeItemData *) (new 1910 + MyObject(MY_POSTGIS_GEOMETRY, empty, 1911 + empty, -1, empty, empty, 1912 + empty, empty, columnInfo, 1913 + viewName))); 1914 + } else 1915 + { 1916 + if (table != NULL) 1917 + { 1918 + // checking for a PK column 1919 + if (table->IsPkColumn(columnInfo) == true) 1920 + icon = 2; 1921 + } 1922 + item2 = AppendItem(item, columnInfo, icon); 1923 + SetItemData(item2, 1924 + (wxTreeItemData *) (new 1925 + MyObject(MY_POSTGRES_COLUMN, empty, 1926 + empty, -1, empty, empty, 1927 + empty, empty, columnInfo, 1928 + viewName))); 1929 + } 1930 + col = col->GetNext(); 1931 + } 1932 + trgr = list.GetFirstTrigger(); 1933 + while (trgr) 1934 + { 1935 + // setting up Triggers 1936 + wxString triggerInfo = trgr->GetName(); 1937 + item2 = AppendItem(item, triggerInfo, 5); 1938 + SetItemData(item2, 1939 + (wxTreeItemData *) (new 1940 + MyObject(MY_TRIGGER, empty, 1941 + trgr->GetName()))); 1942 + trgr = trgr->GetNext(); 1943 + } 1944 +} 1632 1945 1633 1946 void MyTableTree::AddTable(wxString & dbAlias, 1634 1947 wxString & tableName, bool virtualTable, 1635 1948 bool geometry, RootNodes * nodes) 1636 1949 { 1637 1950 // 1638 1951 // appends a table to the TREE list [ATTACHED DB] 1639 1952 // 1640 1953 wxTreeItemId item; 1641 1954 wxTreeItemId item2; 1642 1955 wxTreeItemData *data; 1643 - bool isCoverage = false; 1644 1956 bool isTileData = false; 1645 - bool isTopology = false; 1646 1957 int icon = 1; 1647 1958 if (virtualTable == true) 1648 1959 icon = 8; 1649 1960 if (geometry == true) 1650 1961 { 1651 1962 if (virtualTable == false) 1652 1963 icon = 10; ................................................................................ 1961 2272 // 1962 2273 // selecting some node [mouse action] 1963 2274 // 1964 2275 wxTreeItemId item = event.GetItem(); 1965 2276 if (item == Root || item == RootUserData || item == RootTopologies 1966 2277 || item == RootNetworks || item == RootRasterCoverages 1967 2278 || item == RootVectorCoverages || item == RootStyling || item == RootWMS 1968 - || item == RootIsoMetadata || item == RootMetadata || item == RootInternal 2279 + || item == RootPostgreSQL || item == RootIsoMetadata 2280 + || item == RootMetadata || item == RootInternal 1969 2281 || item == RootSpatialIndex) 1970 2282 return; 1971 2283 MyObject *obj = (MyObject *) GetItemData(item); 1972 2284 if (obj == NULL) 1973 2285 return; 1974 2286 CurrentItem = item; 1975 2287 } ................................................................................ 2220 2532 menu.AppendSeparator(); 2221 2533 menuItem = 2222 2534 new wxMenuItem(&menu, Tree_UpdateLayerStatisticsAll, 2223 2535 wxT("Update Layer &Statistics")); 2224 2536 menu.Append(menuItem); 2225 2537 PopupMenu(&menu, pt); 2226 2538 } 2539 + 2540 +void MyTableTree::DoRootPostgreSqlContextMenu(wxPoint & pt) 2541 +{ 2542 +// MAIN: ROOT POTGRESQL context menu 2543 + wxMenuItem *menuItem; 2544 + CurrentItem = wxTreeItemId(); 2545 + wxMenu menu(wxT("PostgreSQL")); 2546 + menuItem = new wxMenuItem(&menu, Tree_Refresh, wxT("&Refresh")); 2547 + menu.Append(menuItem); 2548 + menu.AppendSeparator(); 2549 + menuItem = 2550 + new wxMenuItem(&menu, Tree_CreatePostgreSqlConn, 2551 + wxT("Connect to a PostgreSQL &DBMS")); 2552 + menu.Append(menuItem); 2553 + if (MainFrame->HasPostgreSqlConnections() == true) 2554 + { 2555 + menuItem = 2556 + new wxMenuItem(&menu, Tree_CloseAllPostgreSqlConns, 2557 + wxT("Close all connections to &PostgreSQL")); 2558 + menu.Append(menuItem); 2559 + } 2560 + menuItem = 2561 + new wxMenuItem(&menu, Tree_PostgreSqlDropOrphans, 2562 + wxT("Drop all PostgreSQL &Orphans")); 2563 + menu.Append(menuItem); 2564 + PopupMenu(&menu, pt); 2565 +} 2227 2566 2228 2567 void MyTableTree::DoRootOthersContextMenu(wxPoint & pt, MyObject * obj) 2229 2568 { 2230 2569 // MAIN: OTHER ROOT NODES context menu 2231 2570 wxMenuItem *menuItem; 2232 2571 CurrentItem = wxTreeItemId(); 2233 2572 wxString title; ................................................................................ 3386 3725 wxString title = wxT("FK FIELD: ") + obj->GetDbAlias() + wxT("."); 3387 3726 title += obj->GetMainName() + wxT(".") + obj->GetColName(); 3388 3727 wxMenu menu(title); 3389 3728 menuItem = new wxMenuItem(&menu, Tree_Refresh, wxT("&Refresh")); 3390 3729 menu.Append(menuItem); 3391 3730 PopupMenu(&menu, pt); 3392 3731 } 3732 + 3733 +void MyTableTree::DoPostgreSqlContextMenu(wxPoint & pt, MyObject * obj) 3734 +{ 3735 +// PostgreSQL objects: context menu dispatcher 3736 + switch (obj->GetType()) 3737 + { 3738 + case MY_POSTGRES_CONN: 3739 + DoPostgresConnContextMenu(pt, obj); 3740 + break; 3741 + case MY_POSTGRES_SCHEMA: 3742 + DoPostgresSchemaContextMenu(pt, obj); 3743 + break; 3744 + case MY_POSTGRES_TABLE: 3745 + DoPostgresTableContextMenu(pt, obj); 3746 + break; 3747 + case MY_POSTGRES_VIEW: 3748 + DoPostgresViewContextMenu(pt, obj); 3749 + break; 3750 + case MY_POSTGIS_VIEW: 3751 + DoPostGisViewContextMenu(pt, obj); 3752 + break; 3753 + case MY_POSTGRES_COLUMN: 3754 + DoPostgresColumnContextMenu(pt, obj); 3755 + break; 3756 + case MY_POSTGIS_GEOMETRY: 3757 + DoPostGisGeometryContextMenu(pt, obj); 3758 + break; 3759 + }; 3760 +} 3761 + 3762 +void MyTableTree::DoPostgresConnContextMenu(wxPoint & pt, MyObject * obj) 3763 +{ 3764 +// POSTGRES CONNECTION NODES context menu 3765 + wxMenuItem *menuItem; 3766 + wxString title = wxT("PostgreSQL Connection"); 3767 + wxMenu menu(title); 3768 + menuItem = new wxMenuItem(&menu, Tree_Refresh, wxT("&Refresh")); 3769 + menu.Append(menuItem); 3770 + menu.AppendSeparator(); 3771 + menuItem = 3772 + new wxMenuItem(&menu, Tree_ClosePostgreSqlConn, 3773 + wxT("Close this connection to PostgreSQL")); 3774 + menu.Append(menuItem); 3775 + menuItem = new wxMenuItem(&menu, Tree_PostgreSqlInfos, wxT("&Infos")); 3776 + menu.Append(menuItem); 3777 + PopupMenu(&menu, pt); 3778 +} 3779 + 3780 +void MyTableTree::DoPostgresSchemaContextMenu(wxPoint & pt, MyObject * obj) 3781 +{ 3782 +// POSTGRES SCHEMA NODES context menu 3783 + wxMenuItem *menuItem; 3784 + wxString title = wxT("PostgreSQL Schema"); 3785 + wxMenu menu(title); 3786 + menuItem = new wxMenuItem(&menu, Tree_Refresh, wxT("&Refresh")); 3787 + menu.Append(menuItem); 3788 + menu.AppendSeparator(); 3789 + menuItem = new wxMenuItem(&menu, Tree_PostgreSqlInfos, wxT("&Infos")); 3790 + menu.Append(menuItem); 3791 + PopupMenu(&menu, pt); 3792 +} 3793 + 3794 +void MyTableTree::DoPostgresTableContextMenu(wxPoint & pt, MyObject * obj) 3795 +{ 3796 +// POSTGRES TABLE NODES context menu 3797 + wxMenuItem *menuItem; 3798 + wxString title = wxT("PostgreSQL Table: ") + obj->GetVirtName(); 3799 + wxMenu menu(title); 3800 + menuItem = new wxMenuItem(&menu, Tree_Refresh, wxT("&Refresh")); 3801 + menu.Append(menuItem); 3802 + menu.AppendSeparator(); 3803 + if (obj->IsReadOnly() == false && obj->HasPK() == true 3804 + && obj->CanInsertUpdateDelete() == true) 3805 + { 3806 + menuItem = new wxMenuItem(&menu, Tree_Edit, wxT("&Edit table rows")); 3807 + menu.Append(menuItem); 3808 + } else if (obj->CanSelect() == true) 3809 + { 3810 + menuItem = new wxMenuItem(&menu, Tree_Select, wxT("&Query table")); 3811 + menu.Append(menuItem); 3812 + } 3813 + menuItem = new wxMenuItem(&menu, Tree_Show, wxT("&Show columns")); 3814 + menu.Append(menuItem); 3815 + menuItem = new wxMenuItem(&menu, Tree_ShowSql, wxT("&Show CREATE statement")); 3816 + menu.Append(menuItem); 3817 + menuItem = 3818 + new wxMenuItem(&menu, Tree_PostgreSqlInfos, wxT("PostgreSQL &Infos")); 3819 + menu.Append(menuItem); 3820 + PopupMenu(&menu, pt); 3821 +} 3822 + 3823 +void MyTableTree::DoPostgresViewContextMenu(wxPoint & pt, MyObject * obj) 3824 +{ 3825 +// POSTGRES VIEW NODES context menu 3826 + wxMenuItem *menuItem; 3827 + wxString title = wxT("PostgreSQL View: ") + obj->GetVirtName(); 3828 + wxMenu menu(title); 3829 + menuItem = new wxMenuItem(&menu, Tree_Refresh, wxT("&Refresh")); 3830 + menu.Append(menuItem); 3831 + menu.AppendSeparator(); 3832 + if (obj->CanSelect() == true) 3833 + { 3834 + menuItem = new wxMenuItem(&menu, Tree_Select, wxT("&Query View")); 3835 + menu.Append(menuItem); 3836 + } 3837 + menuItem = new wxMenuItem(&menu, Tree_Show, wxT("&Show columns")); 3838 + menu.Append(menuItem); 3839 + menuItem = new wxMenuItem(&menu, Tree_ShowSql, wxT("&Show CREATE statement")); 3840 + menu.Append(menuItem); 3841 + menuItem = 3842 + new wxMenuItem(&menu, Tree_PostgreSqlInfos, wxT("PostgreSQL &Infos")); 3843 + menu.Append(menuItem); 3844 + PopupMenu(&menu, pt); 3845 +} 3846 + 3847 +void MyTableTree::DoPostGisViewContextMenu(wxPoint & pt, MyObject * obj) 3848 +{ 3849 +// POSTGIS VIEW NODES context menu 3850 + wxMenuItem *menuItem; 3851 + wxString title = wxT("PostGIS-to-SpatiaLite wrapper: ") + obj->GetVirtName(); 3852 + wxMenu menu(title); 3853 + menuItem = new wxMenuItem(&menu, Tree_Refresh, wxT("&Refresh")); 3854 + menu.Append(menuItem); 3855 + menu.AppendSeparator(); 3856 + if (obj->IsReadOnly() == false && obj->HasPK() == true 3857 + && obj->CanInsertUpdateDelete() == true) 3858 + { 3859 + menuItem = new wxMenuItem(&menu, Tree_Edit, wxT("&Edit table rows")); 3860 + menu.Append(menuItem); 3861 + } else if (obj->CanSelect() == true) 3862 + { 3863 + menuItem = new wxMenuItem(&menu, Tree_Select, wxT("&Query table")); 3864 + menu.Append(menuItem); 3865 + } 3866 + menuItem = new wxMenuItem(&menu, Tree_Show, wxT("&Show columns")); 3867 + menu.Append(menuItem); 3868 + menuItem = new wxMenuItem(&menu, Tree_ShowSql, wxT("&Show CREATE statement")); 3869 + menu.Append(menuItem); 3870 + menuItem = 3871 + new wxMenuItem(&menu, Tree_PostgreSqlInfos, wxT("PostgreSQL &Infos")); 3872 + menu.Append(menuItem); 3873 + PopupMenu(&menu, pt); 3874 +} 3875 + 3876 +void MyTableTree::DoPostgresColumnContextMenu(wxPoint & pt, MyObject * obj) 3877 +{ 3878 +// POSTGRESQL COLUMN NODES context menu 3879 + wxMenuItem *menuItem; 3880 + wxString title = 3881 + wxT("PostgreSQL Column: ") + obj->GetVirtName() + wxT(".") + 3882 + obj->GetColumn(); 3883 + wxMenu menu(title); 3884 + menuItem = new wxMenuItem(&menu, Tree_Refresh, wxT("&Refresh")); 3885 + menu.Append(menuItem); 3886 + PopupMenu(&menu, pt); 3887 +} 3888 + 3889 +void MyTableTree::DoPostGisGeometryContextMenu(wxPoint & pt, MyObject * obj) 3890 +{ 3891 +// POSTGIS GEOMETRY COLUMN NODES context menu 3892 + wxMenuItem *menuItem; 3893 + wxString title = 3894 + wxT("PostGIS Geometry: ") + obj->GetVirtName() + wxT(".") + 3895 + obj->GetColumn(); 3896 + wxMenu menu(title); 3897 + menuItem = new wxMenuItem(&menu, Tree_Refresh, wxT("&Refresh")); 3898 + menu.Append(menuItem); 3899 + menu.AppendSeparator(); 3900 + menuItem = 3901 + new wxMenuItem(&menu, Tree_CheckGeometry, wxT("&Check geometries")); 3902 + menu.Append(menuItem); 3903 + menuItem = new wxMenuItem(&menu, Tree_Extent, wxT("&Extent")); 3904 + menu.Append(menuItem); 3905 + menu.AppendSeparator(); 3906 + menuItem = new wxMenuItem(&menu, Tree_DumpShp, wxT("Export as &Shapefile")); 3907 + menuItem->SetBitmap(wxBitmap(dumpshp_xpm)); 3908 + menu.Append(menuItem); 3909 + menuItem = new wxMenuItem(&menu, Tree_DumpKml, wxT("Export as &KML")); 3910 + menu.Append(menuItem); 3911 + menu.AppendSeparator(); 3912 + menuItem = new wxMenuItem(&menu, Tree_MapPreview, wxT("&Map Preview")); 3913 + menuItem->SetBitmap(wxBitmap(map_preview_xpm)); 3914 + menu.Append(menuItem); 3915 + PopupMenu(&menu, pt); 3916 +} 3393 3917 3394 3918 void MyTableTree::OnRightClick(wxTreeEvent & event) 3395 3919 { 3396 3920 // 3397 3921 // right click on some node [mouse action] Context Menu 3398 3922 // 3399 - wxMenuItem *menuItem; 3400 3923 if (MainFrame->IsConnected() == false) 3401 3924 return; 3402 3925 bool metadata = MainFrame->CheckMetadata(); 3403 3926 3404 3927 wxTreeItemId item = event.GetItem(); 3405 3928 SelectItem(item); 3406 3929 wxPoint pt = event.GetPoint(); ................................................................................ 3438 3961 } 3439 3962 if (item == RootStyling) 3440 3963 { 3441 3964 // ROOT STYLING 3442 3965 DoRootStylingContextMenu(pt); 3443 3966 return; 3444 3967 } 3968 + if (item == RootPostgreSQL) 3969 + { 3970 + // ROOT POSTGRESQL 3971 + DoRootPostgreSqlContextMenu(pt); 3972 + return; 3973 + } 3445 3974 3446 3975 MyObject *obj = (MyObject *) GetItemData(item); 3447 3976 if (obj == NULL) 3448 3977 return; 3449 3978 if (item == Root || item == RootUserData || item == RootIsoMetadata 3450 3979 || item == RootMetadata || item == RootInternal 3451 3980 || item == RootSpatialIndex) ................................................................................ 3463 3992 return; 3464 3993 } 3465 3994 if (obj->IsRootAttached()) 3466 3995 { 3467 3996 // ATTACHED ROOT items 3468 3997 DoRootAttachedContextMenu(pt, obj); 3469 3998 return; 3999 + } 4000 +// special cases: PostgreSQL objects 4001 + if (obj->IsPostgreSQL() == true) 4002 + { 4003 + DoPostgreSqlContextMenu(pt, obj); 4004 + return; 3470 4005 } 3471 4006 // special cases: TOPO-GEO and TOPO-NET objects 3472 4007 if (obj->GetType() == MY_TOPO_GEO || obj->GetType() == MY_TOPO_NET) 3473 4008 { 3474 4009 if (obj->IsAttached() == true) 3475 4010 { 3476 4011 wxString title; ................................................................................ 3866 4401 wxString sql; 3867 4402 wxString dummy; 3868 4403 char *xname; 3869 4404 char *xname2; 3870 4405 MyObject *obj = (MyObject *) GetItemData(CurrentItem); 3871 4406 if (obj == NULL) 3872 4407 return; 4408 + if (obj->GetType() == MY_POSTGRES_TABLE || obj->GetType() == MY_POSTGRES_VIEW 4409 + || obj->GetType() == MY_POSTGIS_VIEW) 4410 + { 4411 + // special case: PostgreSQL objects 4412 + bool hasGeom = false; 4413 + wxString viewName; 4414 + if (obj->GetType() == MY_POSTGRES_TABLE) 4415 + { 4416 + MyPostgresTable *table = 4417 + MainFrame->FindPostgresTable(obj->GetVirtName()); 4418 + if (table->GetFirst() != NULL) 4419 + hasGeom = true; 4420 + viewName = table->GetPostGisName(); 4421 + } 4422 + if (hasGeom == true) 4423 + { 4424 + int ret = wxMessageBox(wxT 4425 + ("Directly querying a PostgreSQL table containing PostGIS geometries " 4426 + "is a strongly discouraged operation.\n\n" 4427 + "You should instead query the corresponding Spatial View: ") 4428 + + viewName + wxT("\n\n") + 4429 + wxT("Do you really intend to continue ?"), 4430 + wxT("spatialite_gui"), 4431 + wxYES_NO | wxICON_QUESTION, this); 4432 + if (ret != wxYES) 4433 + return; 4434 + } 4435 + sql = wxT("SELECT * FROM \""); 4436 + xname = (char *) malloc((obj->GetVirtName().Len() * 4) + 1); 4437 + strcpy(xname, obj->GetVirtName().ToUTF8()); 4438 + xname2 = gaiaDoubleQuotedSql(xname); 4439 + free(xname); 4440 + sql += wxString::FromUTF8(xname2); 4441 + free(xname2); 4442 + sql += wxT("\""); 4443 + wxString prefix = wxT("MAIN"); 4444 + wxString noGeom; 4445 + MainFrame->InitializeSqlFilters(prefix, obj->GetVirtName(), true, noGeom); 4446 + MainFrame->SetSql(sql, true, false, dummy, dummy, true); 4447 + MainFrame->GetQueryView()->EnableFilterButton(); 4448 + return; 4449 + } 3873 4450 sql = wxT("SELECT * FROM \""); 3874 4451 if (obj->IsAttached() == true) 3875 4452 { 3876 4453 wxString dbAlias2 = obj->GetDbAlias(); 3877 4454 MyFrame::DoubleQuoted(dbAlias2); 3878 4455 sql += dbAlias2 + wxT("\".\""); 3879 4456 } ................................................................................ 4045 4622 xname = (char *) malloc((obj->GetMainName().Len() * 4) + 1); 4046 4623 strcpy(xname, obj->GetMainName().ToUTF8()); 4047 4624 xname2 = gaiaSingleQuotedSql(xname); 4048 4625 free(xname); 4049 4626 sql += wxString::FromUTF8(xname2); 4050 4627 free(xname2); 4051 4628 sql += wxT("'"); 4629 + } 4630 + if (obj->GetType() == MY_POSTGRES_TABLE || obj->GetType() == MY_POSTGRES_VIEW 4631 + || obj->GetType() == MY_POSTGIS_VIEW) 4632 + { 4633 + sql = wxT("PRAGMA table_info(\""); 4634 + xname = (char *) malloc((obj->GetVirtName().Len() * 4) + 1); 4635 + strcpy(xname, obj->GetVirtName().ToUTF8()); 4636 + xname2 = gaiaDoubleQuotedSql(xname); 4637 + free(xname); 4638 + sql += wxString::FromUTF8(xname2); 4639 + free(xname2); 4640 + sql += wxT("\")"); 4052 4641 } 4053 4642 if (sql.Len() < 1) 4054 4643 return; 4055 4644 MainFrame->GetRsView()->ResetEmpty(); 4056 4645 MainFrame->SetSql(sql, true); 4057 4646 } 4058 4647 ................................................................................ 4518 5107 else 4519 5108 sql += wxT("sqlite_master"); 4520 5109 sql += wxT("\nWHERE type = 'view' AND name = '"); 4521 5110 xname = (char *) malloc((obj->GetMainName().Len() * 4) + 1); 4522 5111 strcpy(xname, obj->GetMainName().ToUTF8()); 4523 5112 xname2 = gaiaSingleQuotedSql(xname); 4524 5113 free(xname); 5114 + sql += wxString::FromUTF8(xname2); 5115 + free(xname2); 5116 + sql += wxT("'"); 5117 + MainFrame->GetRsView()->ResetEmpty(); 5118 + MainFrame->SetSql(sql, true); 5119 + } 5120 + if (obj->GetType() == MY_POSTGRES_TABLE || obj->GetType() == MY_POSTGRES_VIEW) 5121 + { 5122 + sql = wxT("SELECT sql FROM "); 5123 + sql += wxT("sqlite_master"); 5124 + sql += wxT("\nWHERE type = 'table' AND name = '"); 5125 + xname = (char *) malloc((obj->GetVirtName().Len() * 4) + 1); 5126 + strcpy(xname, obj->GetVirtName().ToUTF8()); 5127 + xname2 = gaiaSingleQuotedSql(xname); 5128 + free(xname); 5129 + sql += wxString::FromUTF8(xname2); 5130 + free(xname2); 5131 + sql += wxT("'"); 5132 + MainFrame->GetRsView()->ResetEmpty(); 5133 + MainFrame->SetSql(sql, true); 5134 + } 5135 + if (obj->GetType() == MY_POSTGIS_VIEW) 5136 + { 5137 + sql = wxT("SELECT sql FROM "); 5138 + sql += wxT("sqlite_master"); 5139 + sql += wxT("\nWHERE type = 'view' AND name = '"); 5140 + xname = (char *) malloc((obj->GetVirtName().Len() * 4) + 1); 5141 + strcpy(xname, obj->GetVirtName().ToUTF8()); 5142 + xname2 = gaiaSingleQuotedSql(xname); 5143 + free(xname); 4525 5144 sql += wxString::FromUTF8(xname2); 4526 5145 free(xname2); 4527 5146 sql += wxT("'"); 4528 5147 MainFrame->GetRsView()->ResetEmpty(); 4529 5148 MainFrame->SetSql(sql, true); 4530 5149 } 4531 5150 } ................................................................................ 5175 5794 char *xname; 5176 5795 char *xname2; 5177 5796 MyObject *obj = (MyObject *) GetItemData(CurrentItem); 5178 5797 if (obj == NULL) 5179 5798 return; 5180 5799 if (obj->GetType() == MY_COLUMN || obj->GetType() == MY_GEOMETRY 5181 5800 || obj->GetType() == MY_GEOMETRY_INDEX 5182 - || obj->GetType() == MY_GEOMETRY_CACHED) 5801 + || obj->GetType() == MY_GEOMETRY_CACHED 5802 + || obj->GetType() == MY_POSTGIS_GEOMETRY) 5183 5803 { 5184 5804 sql = wxT("SELECT Count(*), GeometryType(\""); 5185 - xname = (char *) malloc((obj->GetColName().Len() * 4) + 1); 5186 - strcpy(xname, obj->GetColName().ToUTF8()); 5805 + if (obj->GetType() == MY_POSTGIS_GEOMETRY) 5806 + { 5807 + xname = (char *) malloc((obj->GetColumn().Len() * 4) + 1); 5808 + strcpy(xname, obj->GetColumn().ToUTF8()); 5809 + } else 5810 + { 5811 + xname = (char *) malloc((obj->GetColName().Len() * 4) + 1); 5812 + strcpy(xname, obj->GetColName().ToUTF8()); 5813 + } 5187 5814 xname2 = gaiaDoubleQuotedSql(xname); 5188 5815 free(xname); 5189 5816 sql += wxString::FromUTF8(xname2); 5190 - free(xname2); 5191 5817 sql += wxT("\"), Srid(\""); 5192 - xname = (char *) malloc((obj->GetColName().Len() * 4) + 1); 5193 - strcpy(xname, obj->GetColName().ToUTF8()); 5194 - xname2 = gaiaDoubleQuotedSql(xname); 5195 - free(xname); 5196 5818 sql += wxString::FromUTF8(xname2); 5197 - free(xname2); 5198 5819 sql += wxT("\"), CoordDimension(\""); 5199 - xname = (char *) malloc((obj->GetColName().Len() * 4) + 1); 5200 - strcpy(xname, obj->GetColName().ToUTF8()); 5201 - xname2 = gaiaDoubleQuotedSql(xname); 5202 - free(xname); 5203 5820 sql += wxString::FromUTF8(xname2); 5204 5821 free(xname2); 5205 5822 sql += wxT("\")\nFROM \""); 5206 - xname = (char *) malloc((obj->GetMainName().Len() * 4) + 1); 5207 - strcpy(xname, obj->GetMainName().ToUTF8()); 5823 + if (obj->GetType() == MY_POSTGIS_GEOMETRY) 5824 + { 5825 + xname = (char *) malloc((obj->GetVirtName().Len() * 4) + 1); 5826 + strcpy(xname, obj->GetVirtName().ToUTF8()); 5827 + } else 5828 + { 5829 + xname = (char *) malloc((obj->GetMainName().Len() * 4) + 1); 5830 + strcpy(xname, obj->GetMainName().ToUTF8()); 5831 + } 5208 5832 xname2 = gaiaDoubleQuotedSql(xname); 5209 5833 free(xname); 5210 5834 sql += wxString::FromUTF8(xname2); 5211 5835 free(xname2); 5212 5836 sql += wxT("\"\nGROUP BY 2, 3, 4"); 5213 5837 MainFrame->GetRsView()->ResetEmpty(); 5214 5838 MainFrame->SetSql(sql, true); ................................................................................ 5229 5853 if (obj->GetType() == MY_COLUMN || obj->GetType() == MY_GEOMETRY 5230 5854 || obj->GetType() == MY_GEOMETRY_INDEX 5231 5855 || obj->GetType() == MY_GEOMETRY_CACHED 5232 5856 || obj->GetType() == MY_VIEW_GEOMETRY 5233 5857 || obj->GetType() == MY_VIEW_GEOMETRY_INDEX 5234 5858 || obj->GetType() == MY_VIEW_GEOMETRY_CACHED 5235 5859 || obj->GetType() == MY_VIRTUAL_COLUMN 5236 - || obj->GetType() == MY_VIRTUAL_GEOMETRY) 5860 + || obj->GetType() == MY_VIRTUAL_GEOMETRY 5861 + || obj->GetType() == MY_POSTGIS_GEOMETRY) 5237 5862 { 5238 5863 sql = wxT("SELECT Min(MbrMinX(\""); 5239 - xname = (char *) malloc((obj->GetColName().Len() * 4) + 1); 5240 - strcpy(xname, obj->GetColName().ToUTF8()); 5864 + if (obj->GetType() == MY_POSTGIS_GEOMETRY) 5865 + { 5866 + xname = (char *) malloc((obj->GetColumn().Len() * 4) + 1); 5867 + strcpy(xname, obj->GetColumn().ToUTF8()); 5868 + } else 5869 + { 5870 + xname = (char *) malloc((obj->GetColName().Len() * 4) + 1); 5871 + strcpy(xname, obj->GetColName().ToUTF8()); 5872 + } 5241 5873 xname2 = gaiaDoubleQuotedSql(xname); 5242 5874 free(xname); 5243 5875 sql += wxString::FromUTF8(xname2); 5244 - free(xname2); 5245 5876 sql += wxT("\")), Min(MbrMinY(\""); 5246 - xname = (char *) malloc((obj->GetColName().Len() * 4) + 1); 5247 - strcpy(xname, obj->GetColName().ToUTF8()); 5248 - xname2 = gaiaDoubleQuotedSql(xname); 5249 - free(xname); 5250 5877 sql += wxString::FromUTF8(xname2); 5251 - free(xname2); 5252 5878 sql += wxT("\")), Max(MbrMaxX(\""); 5253 - xname = (char *) malloc((obj->GetColName().Len() * 4) + 1); 5254 - strcpy(xname, obj->GetColName().ToUTF8()); 5255 - xname2 = gaiaDoubleQuotedSql(xname); 5256 - free(xname); 5257 5879 sql += wxString::FromUTF8(xname2); 5258 - free(xname2); 5259 5880 sql += wxT("\")), Max(MbrMaxY(\""); 5260 - xname = (char *) malloc((obj->GetColName().Len() * 4) + 1); 5261 - strcpy(xname, obj->GetColName().ToUTF8()); 5262 - xname2 = gaiaDoubleQuotedSql(xname); 5263 - free(xname); 5264 5881 sql += wxString::FromUTF8(xname2); 5265 5882 free(xname2); 5266 5883 sql += wxT("\"))\nFROM \""); 5267 - xname = (char *) malloc((obj->GetMainName().Len() * 4) + 1); 5268 - strcpy(xname, obj->GetMainName().ToUTF8()); 5884 + if (obj->GetType() == MY_POSTGIS_GEOMETRY) 5885 + { 5886 + xname = (char *) malloc((obj->GetVirtName().Len() * 4) + 1); 5887 + strcpy(xname, obj->GetVirtName().ToUTF8()); 5888 + } else 5889 + { 5890 + xname = (char *) malloc((obj->GetMainName().Len() * 4) + 1); 5891 + strcpy(xname, obj->GetMainName().ToUTF8()); 5892 + } 5269 5893 xname2 = gaiaDoubleQuotedSql(xname); 5270 5894 free(xname); 5271 5895 sql += wxString::FromUTF8(xname2) + wxT("\""); 5272 5896 free(xname2); 5273 5897 MainFrame->GetRsView()->ResetEmpty(); 5274 5898 MainFrame->SetSql(sql, true); 5275 5899 } ................................................................................ 5610 6234 // 5611 6235 // menu event - dumping as Shapefile 5612 6236 // 5613 6237 int ret; 5614 6238 wxString path; 5615 6239 wxString lastDir; 5616 6240 bool isView = false; 6241 + bool isPostGIS = false; 5617 6242 int metadata_type = MainFrame->GetMetaDataType(); 5618 6243 MyObject *obj = (MyObject *) GetItemData(CurrentItem); 5619 6244 if (obj == NULL) 5620 6245 return; 6246 + if (obj->GetType() == MY_POSTGIS_GEOMETRY) 6247 + isPostGIS = true; 5621 6248 if (obj->GetType() == MY_VIEW_GEOMETRY 5622 6249 || obj->GetType() == MY_VIEW_GEOMETRY_INDEX 5623 6250 || obj->GetType() == MY_VIEW_GEOMETRY_CACHED) 5624 6251 isView = true; 5625 6252 if (obj->GetType() == MY_GEOMETRY || obj->GetType() == MY_GEOMETRY_INDEX 5626 - || obj->GetType() == MY_GEOMETRY_CACHED || isView == true) 6253 + || obj->GetType() == MY_GEOMETRY_CACHED || isView == true || isPostGIS) 5627 6254 { 5628 6255 wxFileDialog fileDialog(this, wxT("Dump Shapefile"), 5629 6256 wxT(""), wxT("shapefile.shp"), 5630 6257 wxT 5631 6258 ("Shapefile (*.shp)|*.shp|All files (*.*)|*.*"), 5632 6259 wxFD_SAVE | wxFD_OVERWRITE_PROMPT, 5633 6260 wxDefaultPosition, wxDefaultSize, wxT("filedlg")); ................................................................................ 5652 6279 *x_type = '\0'; 5653 6280 wxFileName file(fileDialog.GetPath()); 5654 6281 path = file.GetPath(); 5655 6282 path += file.GetPathSeparator(); 5656 6283 path += file.GetName(); 5657 6284 lastDir = file.GetPath(); 5658 6285 strcpy(x_path, path.ToUTF8()); 5659 - strcpy(x_table, obj->GetMainName().ToUTF8()); 5660 - strcpy(x_column, obj->GetColName().ToUTF8()); 5661 - if (isView == true) 6286 + if (isPostGIS == true) 6287 + { 6288 + strcpy(x_table, obj->GetVirtName().ToUTF8()); 6289 + strcpy(x_column, obj->GetColumn().ToUTF8()); 6290 + } else 6291 + { 6292 + strcpy(x_table, obj->GetMainName().ToUTF8()); 6293 + strcpy(x_column, obj->GetColName().ToUTF8()); 6294 + } 6295 + if (isPostGIS == true) 6296 + { 6297 + char *geom = (char *) malloc(obj->GetColumn().Len() * 4 + 1); 6298 + strcpy(geom, obj->GetColumn().ToUTF8()); 6299 + char *xgeom = gaiaDoubleQuotedSql(geom); 6300 + free(geom); 6301 + char *view = (char *) malloc(obj->GetVirtName().Len() * 4 + 1); 6302 + strcpy(view, obj->GetVirtName().ToUTF8()); 6303 + char *xview = gaiaDoubleQuotedSql(view); 6304 + free(view); 6305 + char *sql = sqlite3_mprintf("SELECT GeometryType(\"%s\") " 6306 + "FROM \"%s\" GROUP BY 1", xgeom, 6307 + xview); 6308 + free(xgeom); 6309 + free(xview); 6310 + ret = 6311 + sqlite3_get_table(MainFrame->GetSqlite(), sql, 6312 + &results, &rows, &columns, &errMsg); 6313 + sqlite3_free(sql); 6314 + if (ret != SQLITE_OK) 6315 + { 6316 + wxMessageBox(wxT("dump shapefile error:") + 6317 + wxString::FromUTF8(errMsg), 6318 + wxT("spatialite_gui"), wxOK | wxICON_ERROR, 6319 + this); 6320 + sqlite3_free(errMsg); 6321 + return; 6322 + } 6323 + if (rows < 1) 6324 + ; 6325 + else 6326 + { 6327 + for (i = 1; i <= rows; i++) 6328 + strcpy(x_type, results[(i * columns) + 0]); 6329 + } 6330 + sqlite3_free_table(results); 6331 + if (strcmp(x_type, "MULTILINESTRING") == 0) 6332 + strcpy(x_type, "LINESTRING"); 6333 + if (strcmp(x_type, "MULTIPOLYGON") == 0) 6334 + strcpy(x_type, "POLYGON"); 6335 + } else if (isView == true) 5662 6336 { 5663 6337 wxString sql; 5664 6338 char *xsql; 5665 6339 if (metadata_type == METADATA_CURRENT) 5666 6340 sql = 5667 6341 wxT("SELECT geometry_type FROM views_geometry_columns AS a "); 5668 6342 else if (metadata_type == METADATA_LEGACY) ................................................................................ 5872 6546 wxMessageBox(wxT("dump shp error:") + 5873 6547 wxString::FromUTF8(err_msg), wxT("spatialite_gui"), 5874 6548 wxOK | wxICON_ERROR, this); 5875 6549 } else 5876 6550 { 5877 6551 // asking the charset to be used 5878 6552 DumpShpDialog dlg; 5879 - dlg.Create(MainFrame, path, obj->GetMainName(), obj->GetColName(), 5880 - MainFrame->GetDefaultCharset()); 6553 + if (isPostGIS == true) 6554 + dlg.Create(MainFrame, path, obj->GetVirtName(), 6555 + obj->GetColumn(), MainFrame->GetDefaultCharset()); 6556 + else 6557 + dlg.Create(MainFrame, path, obj->GetMainName(), 6558 + obj->GetColName(), MainFrame->GetDefaultCharset()); 5881 6559 ret = dlg.ShowModal(); 5882 6560 if (ret == wxID_OK) 5883 6561 { 5884 6562 MainFrame->SetLastDirectory(lastDir); 5885 6563 ::wxBeginBusyCursor(); 5886 6564 strcpy(x_charset, dlg.GetCharset().ToUTF8()); 5887 6565 rt = ................................................................................ 5911 6589 // menu event - dumping as KML 5912 6590 // 5913 6591 int ret; 5914 6592 wxString path; 5915 6593 wxString lastDir; 5916 6594 bool isView = false; 5917 6595 bool isVirtual = false; 6596 + bool isPostGIS = false; 5918 6597 bool isNameConst = false; 5919 6598 bool isDescConst = false; 5920 6599 wxString Name; 5921 6600 wxString Desc; 5922 6601 int precision = -1; 5923 6602 MyObject *obj = (MyObject *) GetItemData(CurrentItem); 5924 6603 if (obj == NULL) 5925 6604 return; 6605 + if (obj->GetType() == MY_POSTGIS_GEOMETRY) 6606 + isPostGIS = true; 5926 6607 if (obj->GetType() == MY_VIEW_GEOMETRY 5927 6608 || obj->GetType() == MY_VIEW_GEOMETRY_INDEX 5928 6609 || obj->GetType() == MY_VIEW_GEOMETRY_CACHED) 5929 6610 isView = true; 5930 6611 if (obj->GetType() == MY_VIRTUAL_GEOMETRY) 5931 6612 isVirtual = true; 5932 6613 if (obj->GetType() == MY_GEOMETRY || obj->GetType() == MY_GEOMETRY_INDEX 5933 6614 || obj->GetType() == MY_GEOMETRY_CACHED || isView == true 5934 - || isVirtual == true) 6615 + || isVirtual == true || isPostGIS == true) 5935 6616 { 5936 6617 DumpKmlDialog dlg; 5937 - dlg.Create(MainFrame, obj->GetMainName(), obj->GetColName()); 6618 + if (isPostGIS == true) 6619 + dlg.Create(MainFrame, obj->GetVirtName(), obj->GetColumn()); 6620 + else 6621 + dlg.Create(MainFrame, obj->GetMainName(), obj->GetColName()); 5938 6622 ret = dlg.ShowModal(); 5939 6623 if (ret == wxID_OK) 5940 6624 { 5941 6625 isNameConst = dlg.IsNameConst(); 5942 6626 Name = dlg.GetName(); 5943 6627 isDescConst = dlg.IsDescConst(); 5944 6628 Desc = dlg.GetDesc(); ................................................................................ 5962 6646 path = file.GetPath(); 5963 6647 path += file.GetPathSeparator(); 5964 6648 path += file.GetName(); 5965 6649 path += wxT(".kml"); 5966 6650 lastDir = file.GetPath(); 5967 6651 MainFrame->SetLastDirectory(lastDir); 5968 6652 ::wxBeginBusyCursor(); 5969 - MainFrame->DumpKml(path, obj->GetMainName(), obj->GetColName(), 5970 - precision, Name, isNameConst, Desc, isDescConst); 6653 + if (isPostGIS == true) 6654 + MainFrame->DumpKml(path, obj->GetVirtName(), obj->GetColumn(), 6655 + precision, Name, isNameConst, Desc, isDescConst); 6656 + else 6657 + MainFrame->DumpKml(path, obj->GetMainName(), obj->GetColName(), 6658 + precision, Name, isNameConst, Desc, isDescConst); 5971 6659 ::wxEndBusyCursor(); 5972 6660 } 5973 6661 } 5974 6662 } 5975 6663 5976 6664 void MyTableTree::OnCmdDumpTxtTab(wxCommandEvent & WXUNUSED(event)) 5977 6665 { ................................................................................ 6936 7624 int ret; 6937 7625 char err_msg[2048]; 6938 7626 sqlite3_stmt *stmt; 6939 7627 double minx = DBL_MAX; 6940 7628 double miny = DBL_MAX; 6941 7629 double maxx = DBL_MAX; 6942 7630 double maxy = DBL_MAX; 7631 + bool isPostGIS = false; 6943 7632 6944 7633 MyObject *obj = (MyObject *) GetItemData(CurrentItem); 6945 7634 if (obj == NULL) 6946 7635 return; 7636 + if (obj->GetType() == MY_POSTGIS_GEOMETRY) 7637 + isPostGIS = true; 6947 7638 6948 7639 ::wxBeginBusyCursor(); 6949 - table_name = (char *) malloc((obj->GetMainName().Len() * 4) + 1); 6950 - strcpy(table_name, obj->GetMainName().ToUTF8()); 6951 - column_name = (char *) malloc((obj->GetColName().Len() * 4) + 1); 6952 - strcpy(column_name, obj->GetColName().ToUTF8()); 7640 + if (isPostGIS == true) 7641 + { 7642 + table_name = (char *) malloc((obj->GetVirtName().Len() * 4) + 1); 7643 + strcpy(table_name, obj->GetVirtName().ToUTF8()); 7644 + column_name = (char *) malloc((obj->GetColumn().Len() * 4) + 1); 7645 + strcpy(column_name, obj->GetColumn().ToUTF8()); 7646 + } else 7647 + { 7648 + table_name = (char *) malloc((obj->GetMainName().Len() * 4) + 1); 7649 + strcpy(table_name, obj->GetMainName().ToUTF8()); 7650 + column_name = (char *) malloc((obj->GetColName().Len() * 4) + 1); 7651 + strcpy(column_name, obj->GetColName().ToUTF8()); 7652 + } 6953 7653 table_name2 = gaiaDoubleQuotedSql(table_name); 6954 7654 column_name2 = gaiaDoubleQuotedSql(column_name); 6955 7655 free(table_name); 6956 7656 free(column_name); 6957 7657 sprintf(sql, "SELECT Min(MbrMinX(\"%s\")), Min(MbrMinY(\"%s\")), ", 6958 7658 column_name2, column_name2); 6959 7659 sprintf(sql2, "Max(MbrMaxX(\"%s\")), Max(MbrMaxY(\"%s\")) ", column_name2, ................................................................................ 7013 7713 { 7014 7714 wxMessageBox(wxT("This Column doesn't contains any Geometry: sorry ..."), 7015 7715 wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 7016 7716 return; 7017 7717 } 7018 7718 7019 7719 MapPreviewDialog dlg; 7020 - dlg.Create(MainFrame, obj->GetMainName(), obj->GetColName(), minx, miny, maxx, 7021 - maxy); 7720 + if (isPostGIS == true) 7721 + dlg.Create(MainFrame, obj->GetVirtName(), obj->GetColumn(), minx, miny, 7722 + maxx, maxy); 7723 + else 7724 + dlg.Create(MainFrame, obj->GetMainName(), obj->GetColName(), minx, miny, 7725 + maxx, maxy); 7022 7726 dlg.ShowModal(); 7023 7727 } 7024 7728 7025 7729 void MyTableTree::OnCmdColumnStats(wxCommandEvent & WXUNUSED(event)) 7026 7730 { 7027 7731 // 7028 7732 // menu event - column stats ................................................................................ 8571 9275 char *type; 8572 9276 int pk = 0; 8573 9277 int pb = 0; 8574 9278 int primaryKeys[1024]; 8575 9279 int blobCols[1024]; 8576 9280 char *xname; 8577 9281 char *xname2; 8578 - bool isView; 9282 + bool isView = false; 8579 9283 for (i = 0; i < 1024; i++) 8580 9284 { 8581 9285 primaryKeys[i] = -1; 8582 9286 blobCols[i] = -1; 8583 9287 } 8584 9288 primaryKeys[pk++] = 0; 8585 9289 MyObject *obj = (MyObject *) GetItemData(CurrentItem); 8586 9290 if (obj == NULL) 8587 9291 return; 9292 + if (obj->GetType() == MY_POSTGRES_TABLE || obj->GetType() == MY_POSTGIS_VIEW) 9293 + { 9294 + // special case: PostgreSQL table 9295 + bool hasGeom = false; 9296 + wxString viewName; 9297 + if (obj->GetType() == MY_POSTGRES_TABLE) 9298 + { 9299 + MyPostgresTable *table = 9300 + MainFrame->FindPostgresTable(obj->GetVirtName()); 9301 + if (table->GetFirst() != NULL) 9302 + hasGeom = true; 9303 + viewName = table->GetPostGisName(); 9304 + } 9305 + if (hasGeom == true) 9306 + { 9307 + int ret = wxMessageBox(wxT 9308 + ("Directly editing a PostgreSQL table containing PostGIS geometries " 9309 + "is a strongly discouraged operation.\n\n" 9310 + "You should instead edit the corresponding Spatial View: ") 9311 + + viewName + wxT("\n\n") + 9312 + wxT("Do you really intend to continue ?"), 9313 + wxT("spatialite_gui"), 9314 + wxYES_NO | wxICON_QUESTION, this); 9315 + if (ret != wxYES) 9316 + return; 9317 + } 9318 + sql = wxT("PRAGMA table_info(\""); 9319 + xname = (char *) malloc((obj->GetVirtName().Len() * 4) + 1); 9320 + strcpy(xname, obj->GetVirtName().ToUTF8()); 9321 + xname2 = gaiaDoubleQuotedSql(xname); 9322 + free(xname); 9323 + sql += wxString::FromUTF8(xname2); 9324 + free(xname2); 9325 + sql += wxT("\")"); 9326 + xsql = (char *) malloc((sql.Len() * 4) + 1); 9327 + strcpy(xsql, sql.ToUTF8()); 9328 + int ret = sqlite3_get_table(MainFrame->GetSqlite(), xsql, &results, 9329 + &rows, &columns, &errMsg); 9330 + free(xsql); 9331 + if (ret != SQLITE_OK) 9332 + { 9333 + wxMessageBox(wxT("SQLite SQL error: ") + wxString::FromUTF8(errMsg), 9334 + wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); 9335 + sqlite3_free(errMsg); 9336 + return; 9337 + } 9338 + if (rows < 1) 9339 + ; 9340 + else 9341 + { 9342 + sql = wxT("SELECT ROWID, "); 9343 + for (i = 1; i <= rows; i++) 9344 + { 9345 + column = results[(i * columns) + 1]; 9346 + sql += wxT("\""); 9347 + xname = (char *) malloc(strlen(column) + 1); 9348 + strcpy(xname, column); 9349 + xname2 = gaiaDoubleQuotedSql(xname); 9350 + free(xname); 9351 + sql += wxString::FromUTF8(xname2); 9352 + sql += wxT("\""); 9353 + free(xname2); 9354 + type = results[(i * columns) + 2]; 9355 + if (i < rows) 9356 + sql += wxT(", "); 9357 + } 9358 + } 9359 + sqlite3_free_table(results); 9360 + if (sql.Len() < 1) 9361 + return; 9362 + sql += wxT("\nFROM \""); 9363 + xname = (char *) malloc((obj->GetVirtName().Len() * 4) + 1); 9364 + strcpy(xname, obj->GetVirtName().ToUTF8()); 9365 + xname2 = gaiaDoubleQuotedSql(xname); 9366 + free(xname); 9367 + sql += wxString::FromUTF8(xname2); 9368 + free(xname2); 9369 + if (isView != true) 9370 + sql += wxT("\"\nORDER BY ROWID"); 9371 + else 9372 + sql += wxT("\""); 9373 + wxString prefix = wxT("MAIN"); 9374 + wxString noGeom; 9375 + MainFrame->InitializeSqlFilters(prefix, obj->GetVirtName(), false, 9376 + noGeom); 9377 + MainFrame->EditTable(sql, primaryKeys, blobCols, obj->GetVirtName()); 9378 + return; 9379 + } 8588 9380 isView = MainFrame->IsView(obj->GetMainName()); 8589 9381 sql = wxT("PRAGMA table_info(\""); 8590 9382 xname = (char *) malloc((obj->GetMainName().Len() * 4) + 1); 8591 9383 strcpy(xname, obj->GetMainName().ToUTF8()); 8592 9384 xname2 = gaiaDoubleQuotedSql(xname); 8593 9385 free(xname); 8594 9386 sql += wxString::FromUTF8(xname2); ................................................................................ 10118 10910 return; 10119 10911 err: 10120 10912 ::wxEndBusyCursor(); 10121 10913 wxMessageBox(wxT("Error: unable to remove Topology-Network '") + 10122 10914 obj->GetMainName() + wxT("'"), wxT("spatialite_gui"), 10123 10915 wxOK | wxICON_WARNING, this); 10124 10916 } 10917 + 10918 +void MyTableTree::OnCmdCreatePostgreSqlConn(wxCommandEvent & WXUNUSED(event)) 10919 +{ 10920 +// 10921 +// menu event - creating a new connection to a PostgreSQL DBMS 10922 +// 10923 + MainFrame->DoPostgreSqlConnection(); 10924 +} 10925 + 10926 +void MyTableTree::OnCmdCloseAllPostgreSqlConns(wxCommandEvent & WXUNUSED(event)) 10927 +{ 10928 +// 10929 +// menu event - closing all connections to PostgreSQL 10930 +// 10931 + ::wxBeginBusyCursor(); 10932 + MainFrame->AutoPostgresStop(); 10933 + ::wxEndBusyCursor(); 10934 + wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, Tree_RefreshDeferred); 10935 + AddPendingEvent(evt); 10936 +} 10937 + 10938 +void MyTableTree::OnCmdClosePostgreSqlConn(wxCommandEvent & WXUNUSED(event)) 10939 +{ 10940 +// 10941 +// menu event - closing a connection to PostgreSQL 10942 +// 10943 + MyObject *obj = (MyObject *) GetItemData(CurrentItem); 10944 + ::wxBeginBusyCursor(); 10945 + bool ret = 10946 + MainFrame->DoClosePostgreSqlConn(obj->GetHost(), obj->GetHostAddr(), 10947 + obj->GetPort(), obj->GetDbName(), 10948 + obj->GetUser()); 10949 + ::wxEndBusyCursor(); 10950 + if (ret == true) 10951 + { 10952 + wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, Tree_RefreshDeferred); 10953 + AddPendingEvent(evt); 10954 + } 10955 +} 10956 + 10957 +void MyTableTree::OnCmdPostgreSqlDropOrphans(wxCommandEvent & WXUNUSED(event)) 10958 +{ 10959 +// 10960 +// menu event - Dropping all PostgreSQL orphans 10961 +// 10962 + bool refresh = false; 10963 + int ret; 10964 + char *errMsg = NULL; 10965 + ::wxBeginBusyCursor(); 10966 + char *sql = MainFrame->DropPostgreSqlOrphans(); 10967 + if (sql != NULL) 10968 + { 10969 + // exec 10970 + ret = sqlite3_exec(MainFrame->GetSqlite(), sql, NULL, 0, &errMsg); 10971 + sqlite3_free(sql); 10972 + if (ret != SQLITE_OK) 10973 + { 10974 + wxMessageBox(wxT("DropPostgresOrphans: ") + 10975 + wxString::FromUTF8(errMsg), wxT("spatialite_gui"), 10976 + wxOK | wxICON_ERROR, this); 10977 + sqlite3_free(errMsg); 10978 + return; 10979 + } 10980 + refresh = true; 10981 + } 10982 + ::wxEndBusyCursor(); 10983 + if (refresh == true) 10984 + { 10985 + wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, Tree_RefreshDeferred); 10986 + AddPendingEvent(evt); 10987 + } 10988 +} 10989 + 10990 +void MyTableTree::OnCmdPostgreSqlInfos(wxCommandEvent & WXUNUSED(event)) 10991 +{ 10992 +// 10993 +// menu event - Infos about some PostgreSQL object 10994 +// 10995 + char dummy[128]; 10996 + wxString msg; 10997 + MyPostgresTable *table; 10998 + MyObject *obj = (MyObject *) GetItemData(CurrentItem); 10999 + switch (obj->GetType()) 11000 + { 11001 + case MY_POSTGRES_CONN: 11002 + msg = wxT("Connection to PostgreSQL\n\n"); 11003 + msg += wxT("Host: ") + obj->GetHost() + wxT("\n"); 11004 + msg += wxT("HostAddr: ") + obj->GetHostAddr() + wxT("\n"); 11005 + sprintf(dummy, "%d", obj->GetPort()); 11006 + msg += wxT("Port: ") + wxString::FromUTF8(dummy) + wxT("\n"); 11007 + msg += wxT("DbName: ") + obj->GetDbName() + wxT("\n"); 11008 + msg += wxT("User: ") + obj->GetUser() + wxT("\n\n"); 11009 + if (obj->IsReadOnly() == true) 11010 + msg += wxT("READ-ONLY Connection"); 11011 + else 11012 + msg += wxT("READ-WRITE Connection"); 11013 + break; 11014 + case MY_POSTGRES_SCHEMA: 11015 + msg += wxT("Role: PostgreSQL Schema\n"); 11016 + msg += wxT("PostgreSQL Name: ") + obj->GetSchema() + wxT("\n"); 11017 + break; 11018 + case MY_POSTGRES_TABLE: 11019 + msg += wxT("Role: PostgreSQL Table\n"); 11020 + msg += 11021 + wxT("PostgreSQL Name: ") + obj->GetSchema() + wxT(".") + 11022 + obj->GetName() + wxT("\n\n"); 11023 + table = MainFrame->FindPostgresTable(obj->GetVirtName()); 11024 + if (table != NULL) 11025 + { 11026 + MyPostGisGeometry *geom = table->GetFirst(); 11027 + while (geom != NULL) 11028 + { 11029 + msg += wxT("PostGIS Geometry: ") + geom->GetName(); 11030 + msg += wxT(" ") + geom->GetGeomType(); 11031 + char dummy[64]; 11032 + sprintf(dummy, "%d", geom->GetSrid()); 11033 + wxString xSrid = wxString::FromUTF8(dummy); 11034 + msg += wxT(" srid=") + xSrid; 11035 + sprintf(dummy, "%d", geom->GetDims()); 11036 + wxString xDims = wxString::FromUTF8(dummy); 11037 + msg += wxT(" dims=") + xDims + wxT("\n"); 11038 + geom = geom->GetNext(); 11039 + } 11040 + if (table->GetFirst() != NULL) 11041 + msg += wxT("\n"); 11042 + } 11043 + if (obj->HasPK() == true) 11044 + msg += wxT("Primary Key: YES\n"); 11045 + else 11046 + msg += wxT("Primary Key: NO\n"); 11047 + if (obj->CanSelect() == true) 11048 + msg += wxT("Select permission: YES\n"); 11049 + else 11050 + msg += wxT("Select permission: NO\n"); 11051 + if (obj->CanInsertUpdateDelete() == true) 11052 + msg += wxT("Insert/Update/Delete permission: YES\n"); 11053 + else 11054 + msg += wxT("Insert/Update/Delete permission: NO\n"); 11055 + wxT("\n"); 11056 + if (obj->IsReadOnly() == true) 11057 + msg += wxT("\nREAD-ONLY Connection"); 11058 + else 11059 + msg += wxT("\nREAD-WRITE Connection"); 11060 + break; 11061 + case MY_POSTGRES_VIEW: 11062 + msg += wxT("Role: PostgreSQL View\n"); 11063 + msg += 11064 + wxT("PostgreSQL Name: ") + obj->GetSchema() + wxT(".") + 11065 + obj->GetName() + wxT("\n\n"); 11066 + if (obj->HasPK() == true) 11067 + msg += wxT("Primary Key: YES\n"); 11068 + else 11069 + msg += wxT("Primary Key: NO\n"); 11070 + if (obj->CanSelect() == true) 11071 + msg += wxT("Select permission: YES\n"); 11072 + else 11073 + msg += wxT("Select permission: NO\n"); 11074 + if (obj->CanInsertUpdateDelete() == true) 11075 + msg += wxT("Insert/Update/Delete permission: YES\n"); 11076 + else 11077 + msg += wxT("Insert/Update/Delete permission: NO\n"); 11078 + if (obj->IsReadOnly() == true) 11079 + msg += wxT("\nREAD-ONLY Connection"); 11080 + else 11081 + msg += wxT("\nREAD-WRITE Connection"); 11082 + break; 11083 + case MY_POSTGIS_VIEW: 11084 + msg += wxT("Role: PostGIS Table wrapper (Spatial View)\n"); 11085 + msg += 11086 + wxT("PostgreSQL Name: ") + obj->GetSchema() + wxT(".") + 11087 + obj->GetName() + wxT("\n\n"); 11088 + table = MainFrame->FindPostGisView(obj->GetVirtName()); 11089 + if (table != NULL) 11090 + { 11091 + MyPostGisGeometry *geom = table->GetFirst(); 11092 + while (geom != NULL) 11093 + { 11094 + msg += wxT("PostGIS Geometry: ") + geom->GetName(); 11095 + msg += wxT(" ") + geom->GetGeomType(); 11096 + char dummy[64]; 11097 + sprintf(dummy, "%d", geom->GetSrid()); 11098 + wxString xSrid = wxString::FromUTF8(dummy); 11099 + msg += wxT(" srid=") + xSrid; 11100 + sprintf(dummy, "%d", geom->GetDims()); 11101 + wxString xDims = wxString::FromUTF8(dummy); 11102 + msg += wxT(" dims=") + xDims + wxT("\n"); 11103 + geom = geom->GetNext(); 11104 + } 11105 + if (table->GetFirst() != NULL) 11106 + msg += wxT("\n"); 11107 + } 11108 + if (obj->HasPK() == true) 11109 + msg += wxT("Primary Key: YES\n"); 11110 + else 11111 + msg += wxT("Primary Key: NO\n"); 11112 + if (obj->CanSelect() == true) 11113 + msg += wxT("Select permission: YES\n"); 11114 + else 11115 + msg += wxT("Select permission: NO\n"); 11116 + if (obj->CanInsertUpdateDelete() == true) 11117 + msg += wxT("Insert/Update/Delete permission: YES\n"); 11118 + else 11119 + msg += wxT("Insert/Update/Delete permission: NO\n"); 11120 + if (obj->IsReadOnly() == true) 11121 + msg += wxT("\nREAD-ONLY Connection"); 11122 + else 11123 + msg += wxT("\nREAD-WRITE Connection"); 11124 + break; 11125 + }; 11126 + if (msg.Len() > 0) 11127 + wxMessageBox(msg, wxT("spatialite_gui"), wxOK | wxICON_INFORMATION, this); 11128 +} 10125 11129 10126 11130 sqlite3 *MyTableTree::GetSQLiteHandle() 10127 11131 { 10128 11132 return MainFrame->GetSqlite(); 10129 11133 }
Changes to TextCsv.cpp.
1 1 /* 2 2 / TextCsv.cpp 3 3 / methods related to CSV/TXT loading 4 4 / 5 5 / version 1.7, 2013 May 8 6 6 / 7 -/ Author: Sandro Furieri a-furieri@lqt.it 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 8 / 9 9 / Copyright (C) 2008-2013 Alessandro Furieri 10 10 / 11 11 / This program is free software: you can redistribute it and/or modify 12 12 / it under the terms of the GNU General Public License as published by 13 13 / the Free Software Foundation, either version 3 of the License, or 14 14 / (at your option) any later version.
Changes to VectorSymbolizers1.cpp.
1 1 /* 2 2 / VectorSymbolizers1.cpp 3 3 / various dialog classes 4 4 / 5 5 / version 1.8, 2015 March 28 6 6 / 7 -/ Author: Sandro Furieri a-furieri@lqt.it 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 8 / 9 9 / Copyright (C) 2015 Alessandro Furieri 10 10 / 11 11 / This program is free software: you can redistribute it and/or modify 12 12 / it under the terms of the GNU General Public License as published by 13 13 / the Free Software Foundation, either version 3 of the License, or 14 14 / (at your option) any later version. ................................................................................ 10048 10048 xml = DoCreateSymbolizerXML(); 10049 10049 bool ret = MainFrame->DoInsertVectorSymbolizer(xml); 10050 10050 sqlite3_free(xml); 10051 10051 if (ret == true) 10052 10052 wxMessageBox(wxT 10053 10053 ("SLD/SE VectorSymbolizer successfully registered into the DBMS"), 10054 10054 wxT("spatialite_gui"), wxOK | wxICON_INFORMATION, this); 10055 - wxDialog::EndModal(wxID_OK); 10056 10055 wxDialog::EndModal(wxID_OK); 10057 10056 } 10058 10057 10059 10058 void SimplePolygonSymbolizerDialog::OnExport(wxCommandEvent & WXUNUSED(event)) 10060 10059 { 10061 10060 // 10062 10061 // exporting the VectorSymbolizer as an external file
Changes to VectorSymbolizers2.cpp.
1 1 /* 2 2 / VectorSymbolizers2.cpp 3 3 / various dialog classes 4 4 / 5 5 / version 1.8, 2015 April 21 6 6 / 7 -/ Author: Sandro Furieri a-furieri@lqt.it 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 8 / 9 9 / Copyright (C) 2015 Alessandro Furieri 10 10 / 11 11 / This program is free software: you can redistribute it and/or modify 12 12 / it under the terms of the GNU General Public License as published by 13 13 / the Free Software Foundation, either version 3 of the License, or 14 14 / (at your option) any later version. ................................................................................ 5496 5496 sqlite3_free(prev); 5497 5497 prev = xml; 5498 5498 xml = sqlite3_mprintf("%s\t\t\t<Font>\r\n", prev); 5499 5499 sqlite3_free(prev); 5500 5500 prev = xml; 5501 5501 str = new char[strlen(FontFamily.ToUTF8()) + 1]; 5502 5502 strcpy(str, FontFamily.ToUTF8()); 5503 + const char *font; 5504 + if (strcmp(str, "ToyFont: serif") == 0) 5505 + font = "serif"; 5506 + else if (strcmp(str, "ToyFont: sans-serif") == 0) 5507 + font = "sans serif"; 5508 + else if (strcmp(str, "ToyFont: monospace") == 0) 5509 + font = "monospace"; 5510 + else 5511 + font = str; 5503 5512 xml = 5504 5513 sqlite3_mprintf 5505 5514 ("%s\t\t\t\t<SvgParameter name=\"font-family\">%s</SvgParameter>\r\n", prev, 5506 - str); 5515 + font); 5507 5516 delete[]str; 5508 5517 sqlite3_free(prev); 5509 5518 prev = xml; 5510 5519 if (FontStyle == RL2_FONTSTYLE_ITALIC) 5511 5520 xml = 5512 5521 sqlite3_mprintf 5513 5522 ("%s\t\t\t\t<SvgParameter name=\"font-style\">italic</SvgParameter>\r\n", ................................................................................ 5814 5823 sqlite3_free(prev); 5815 5824 prev = xml; 5816 5825 xml = sqlite3_mprintf("%s\t<Font>\r\n", prev); 5817 5826 sqlite3_free(prev); 5818 5827 prev = xml; 5819 5828 str = new char[strlen(FontFamily.ToUTF8()) + 1]; 5820 5829 strcpy(str, FontFamily.ToUTF8()); 5830 + const char *font; 5831 + if (strcmp(str, "ToyFont: serif") == 0) 5832 + font = "serif"; 5833 + else if (strcmp(str, "ToyFont: sans-serif") == 0) 5834 + font = "sans serif"; 5835 + else if (strcmp(str, "ToyFont: monospace") == 0) 5836 + font = "monospace"; 5837 + else 5838 + font = str; 5821 5839 xml = 5822 5840 sqlite3_mprintf 5823 5841 ("%s\t\t<SvgParameter name=\"font-family\">%s</SvgParameter>\r\n", prev, 5824 - str); 5842 + font); 5825 5843 delete[]str; 5826 5844 sqlite3_free(prev); 5827 5845 prev = xml; 5828 5846 if (FontStyle == RL2_FONTSTYLE_ITALIC) 5829 5847 xml = 5830 5848 sqlite3_mprintf 5831 5849 ("%s\t\t<SvgParameter name=\"font-style\">italic</SvgParameter>\r\n",
Changes to Wfs.cpp.
1 1 /* 2 2 / Wfs.cpp 3 3 / WFS load data 4 4 / 5 5 / version 1.7, 2013 May 8 6 6 / 7 -/ Author: Sandro Furieri a-furieri@lqt.it 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 8 / 9 9 / Copyright (C) 2008-2013 Alessandro Furieri 10 10 / 11 11 / This program is free software: you can redistribute it and/or modify 12 12 / it under the terms of the GNU General Public License as published by 13 13 / the Free Software Foundation, either version 3 of the License, or 14 14 / (at your option) any later version.
Changes to WmsDialog.cpp.
1 1 /* 2 2 / WmsDialog.cpp 3 3 / various dialog classes supporting WMS datasources 4 4 / 5 5 / version 2.0, 2016 December 13 6 6 / 7 -/ Author: Sandro Furieri a-furieri@lqt.it 7 +/ Author: Sandro Furieri a.furieri@lqt.it 8 8 / 9 9 / Copyright (C) 2016 Alessandro Furieri 10 10 / 11 11 / This program is free software: you can redistribute it and/or modify 12 12 / it under the terms of the GNU General Public License as published by 13 13 / the Free Software Foundation, either version 3 of the License, or 14 14 / (at your option) any later version. ................................................................................ 697 697 698 698 void WmsDialog::OnWmsServer(wxCommandEvent & WXUNUSED(event)) 699 699 { 700 700 // 701 701 // searching a registered WMS server 702 702 // 703 703 WmsServersDialog dlg; 704 - dlg.Create(this, MainFrame); 704 + dlg.Create(MainFrame); 705 705 int ret = dlg.ShowModal(); 706 706 if (ret == wxID_OK) 707 707 { 708 708 wxTextCtrl *urlCtrl = (wxTextCtrl *) FindWindow(ID_WMS_URL); 709 709 urlCtrl->SetValue(dlg.GetURL()); 710 710 } 711 711 } ................................................................................ 1156 1156 else 1157 1157 HttpProxy = proxyCtrl->GetValue(); 1158 1158 wxTextCtrl *urlCtrl = (wxTextCtrl *) FindWindow(ID_WMS_URL); 1159 1159 URL = urlCtrl->GetValue(); 1160 1160 wxDialog::EndModal(wxID_OK); 1161 1161 } 1162 1162 1163 -bool WmsServersDialog::Create(WmsDialog * parent, MyFrame * grandparent) 1163 +bool WmsServersDialog::Create(MyFrame * grandparent) 1164 1164 { 1165 1165 // 1166 1166 // creating the dialog 1167 1167 // 1168 1168 MainFrame = grandparent; 1169 1169 List = NULL; 1170 1170 Count = 0; ................................................................................ 1804 1804 // populates individual controls 1805 1805 CreateControls(); 1806 1806 // sets dialog sizer 1807 1807 GetSizer()->Fit(this); 1808 1808 GetSizer()->SetSizeHints(this); 1809 1809 // centers the dialog window 1810 1810 Centre(); 1811 - int count = 0; 1812 1811 return true; 1813 1812 } 1814 1813 1815 1814 void WmsLayerInfosDialog::CreateControls() 1816 1815 { 1817 1816 // 1818 1817 // creating individual control and setting initial values ................................................................................ 2170 2169 wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); 2171 2170 return; 2172 2171 } 2173 2172 } 2174 2173 DoUpdateWmsLayer(); 2175 2174 wxDialog::EndModal(wxID_OK); 2176 2175 } 2176 + 2177 +WmsLayerConfigDialog::~WmsLayerConfigDialog() 2178 +{ 2179 + if (Version != NULL) 2180 + free(Version); 2181 + if (MaxVersion != NULL) 2182 + free(MaxVersion); 2183 + if (RefSys != NULL) 2184 + free(RefSys); 2185 + if (Style != NULL) 2186 + free(Style); 2187 + if (ImageFormat != NULL) 2188 + free(ImageFormat); 2189 + if (BgColor != NULL) 2190 + free(BgColor); 2191 +} 2177 2192 2178 2193 bool WmsLayerConfigDialog::Create(MyFrame * parent, wxString url, 2179 2194 wxString layer) 2180 2195 { 2181 2196 // 2182 2197 // creating the dialog 2183 2198 // ................................................................................ 2738 2753 ("SELECT version, srs, format, style, is_queryable, flip_axes, " 2739 2754 "is_cached, tiled, tile_width, tile_height, bgcolor, transparent " 2740 2755 "FROM \"%s\".wms_getmap WHERE url = %Q AND layer_name = %Q", 2741 2756 xdb_prefix, url, layer); 2742 2757 free(url); 2743 2758 free(layer); 2744 2759 free(xdb_prefix); 2745 - fprintf(stderr, "%s\n", sql); 2746 2760 ret = 2747 2761 sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, 2748 2762 NULL); 2749 2763 sqlite3_free(sql); 2750 2764 if (ret != SQLITE_OK) 2751 2765 { 2752 2766 Version = NULL; ................................................................................ 2824 2838 } 2825 2839 if (bgcolor == NULL) 2826 2840 BgColor = NULL; 2827 2841 else 2828 2842 { 2829 2843 if (strlen(bgcolor) == 6) 2830 2844 { 2831 - BgColor = (char *) malloc(6); 2832 - memcpy(BgColor, bgcolor, 6); 2845 + BgColor = (char *) malloc(7); 2846 + strcpy(BgColor, bgcolor); 2833 2847 } else 2834 2848 BgColor = NULL; 2835 2849 } 2836 2850 } 2837 2851 sqlite3_free_table(results); 2838 2852 } 2839 2853 ................................................................................ 3089 3103 // BgColor Enabled selection changed 3090 3104 // 3091 3105 wxBitmapButton *btn = (wxBitmapButton *) FindWindow(ID_WMS_BGCOLOR); 3092 3106 if (BgColorEnabled == false) 3093 3107 { 3094 3108 if (BgColor != NULL) 3095 3109 free(BgColor); 3096 - BgColor = (char *) malloc(6); 3097 - memcpy(BgColor, "ffffff", 6); 3110 + BgColor = (char *) malloc(7); 3111 + strcpy(BgColor, "ffffff"); 3098 3112 wxBitmap bmp; 3099 3113 GetButtonBitmap(BgColor, bmp); 3100 3114 btn->SetBitmapLabel(bmp); 3101 3115 BgColorEnabled = true; 3102 3116 btn->Enable(true); 3103 3117 } else 3104 3118 { ................................................................................ 3133 3147 char byte[3]; 3134 3148 sprintf(byte, "%02x", color.Red()); 3135 3149 memcpy(BgColor, byte, 2); 3136 3150 sprintf(byte, "%02x", color.Green()); 3137 3151 memcpy(BgColor + 2, byte, 2); 3138 3152 sprintf(byte, "%02x", color.Blue()); 3139 3153 memcpy(BgColor + 4, byte, 2); 3154 + *(BgColor + 6) = '\0'; 3140 3155 wxBitmap bmp; 3141 3156 GetButtonBitmap(BgColor, bmp); 3142 3157 wxBitmapButton *bgColorCtrl = 3143 3158 (wxBitmapButton *) FindWindow(ID_WMS_BGCOLOR); 3144 3159 bgColorCtrl->SetBitmapLabel(bmp); 3145 3160 } 3146 3161 }
Changes to aclocal.m4.
1 -# generated automatically by aclocal 1.15 -*- Autoconf -*- 1 +# generated automatically by aclocal 1.15.1 -*- Autoconf -*- 2 2 3 -# Copyright (C) 1996-2014 Free Software Foundation, Inc. 3 +# Copyright (C) 1996-2017 Free Software Foundation, Inc. 4 4 5 5 # This file is free software; the Free Software Foundation 6 6 # gives unlimited permission to copy and/or distribute it, 7 7 # with or without modifications, as long as this notice is preserved. 8 8 9 9 # This program is distributed in the hope that it will be useful, 10 10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without ................................................................................ 16 16 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 17 17 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, 18 18 [m4_warning([this file was generated for autoconf 2.69. 19 19 You have another version of autoconf. It may work, but is not guaranteed to. 20 20 If you have problems, you may need to regenerate the build system entirely. 21 21 To do so, use the procedure documented by the package, typically 'autoreconf'.])]) 22 22 23 -dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 24 -dnl serial 11 (pkg-config-0.29.1) 25 -dnl 23 +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 24 +# serial 11 (pkg-config-0.29.1) 25 + 26 26 dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 27 27 dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com> 28 28 dnl 29 29 dnl This program is free software; you can redistribute it and/or modify 30 30 dnl it under the terms of the GNU General Public License as published by 31 31 dnl the Free Software Foundation; either version 2 of the License, or 32 32 dnl (at your option) any later version. ................................................................................ 292 292 293 293 _PKG_CONFIG([$1], [variable="][$3]["], [$2]) 294 294 AS_VAR_COPY([$1], [pkg_cv_][$1]) 295 295 296 296 AS_VAR_IF([$1], [""], [$5], [$4])dnl 297 297 ])dnl PKG_CHECK_VAR 298 298 299 -# Copyright (C) 2002-2014 Free Software Foundation, Inc. 299 +dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, 300 +dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], 301 +dnl [DESCRIPTION], [DEFAULT]) 302 +dnl ------------------------------------------ 303 +dnl 304 +dnl Prepare a "--with-" configure option using the lowercase 305 +dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and 306 +dnl PKG_CHECK_MODULES in a single macro. 307 +AC_DEFUN([PKG_WITH_MODULES], 308 +[ 309 +m4_pushdef([with_arg], m4_tolower([$1])) 310 + 311 +m4_pushdef([description], 312 + [m4_default([$5], [build with ]with_arg[ support])]) 313 + 314 +m4_pushdef([def_arg], [m4_default([$6], [auto])]) 315 +m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) 316 +m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) 317 + 318 +m4_case(def_arg, 319 + [yes],[m4_pushdef([with_without], [--without-]with_arg)], 320 + [m4_pushdef([with_without],[--with-]with_arg)]) 321 + 322 +AC_ARG_WITH(with_arg, 323 + AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, 324 + [AS_TR_SH([with_]with_arg)=def_arg]) 325 + 326 +AS_CASE([$AS_TR_SH([with_]with_arg)], 327 + [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], 328 + [auto],[PKG_CHECK_MODULES([$1],[$2], 329 + [m4_n([def_action_if_found]) $3], 330 + [m4_n([def_action_if_not_found]) $4])]) 331 + 332 +m4_popdef([with_arg]) 333 +m4_popdef([description]) 334 +m4_popdef([def_arg]) 335 + 336 +])dnl PKG_WITH_MODULES 337 + 338 +dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, 339 +dnl [DESCRIPTION], [DEFAULT]) 340 +dnl ----------------------------------------------- 341 +dnl 342 +dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES 343 +dnl check._[VARIABLE-PREFIX] is exported as make variable. 344 +AC_DEFUN([PKG_HAVE_WITH_MODULES], 345 +[ 346 +PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) 347 + 348 +AM_CONDITIONAL([HAVE_][$1], 349 + [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) 350 +])dnl PKG_HAVE_WITH_MODULES 351 + 352 +dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, 353 +dnl [DESCRIPTION], [DEFAULT]) 354 +dnl ------------------------------------------------------ 355 +dnl 356 +dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after 357 +dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make 358 +dnl and preprocessor variable. 359 +AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], 360 +[ 361 +PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) 362 + 363 +AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], 364 + [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) 365 +])dnl PKG_HAVE_DEFINE_WITH_MODULES 366 + 367 +# Copyright (C) 2002-2017 Free Software Foundation, Inc. 300 368 # 301 369 # This file is free software; the Free Software Foundation 302 370 # gives unlimited permission to copy and/or distribute it, 303 371 # with or without modifications, as long as this notice is preserved. 304 372 305 373 # AM_AUTOMAKE_VERSION(VERSION) 306 374 # ---------------------------- ................................................................................ 307 375 # Automake X.Y traces this macro to ensure aclocal.m4 has been 308 376 # generated from the m4 files accompanying Automake X.Y. 309 377 # (This private macro should not be called outside this file.) 310 378 AC_DEFUN([AM_AUTOMAKE_VERSION], 311 379 [am__api_version='1.15' 312 380 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 313 381 dnl require some minimum version. Point them to the right macro. 314 -m4_if([$1], [1.15], [], 382 +m4_if([$1], [1.15.1], [], 315 383 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 316 384 ]) 317 385 318 386 # _AM_AUTOCONF_VERSION(VERSION) 319 387 # ----------------------------- 320 388 # aclocal traces this macro to find the Autoconf version. 321 389 # This is a private macro too. Using m4_define simplifies ................................................................................ 323 391 m4_define([_AM_AUTOCONF_VERSION], []) 324 392 325 393 # AM_SET_CURRENT_AUTOMAKE_VERSION 326 394 # ------------------------------- 327 395 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 328 396 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 329 397 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 330 -[AM_AUTOMAKE_VERSION([1.15])dnl 398 +[AM_AUTOMAKE_VERSION([1.15.1])dnl 331 399 m4_ifndef([AC_AUTOCONF_VERSION], 332 400 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 333 401 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) 334 402 335 403 # AM_AUX_DIR_EXPAND -*- Autoconf -*- 336 404 337 -# Copyright (C) 2001-2014 Free Software Foundation, Inc. 405 +# Copyright (C) 2001-2017 Free Software Foundation, Inc. 338 406 # 339 407 # This file is free software; the Free Software Foundation 340 408 # gives unlimited permission to copy and/or distribute it, 341 409 # with or without modifications, as long as this notice is preserved. 342 410 343 411 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 344 412 # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to ................................................................................ 382 450 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl 383 451 # Expand $ac_aux_dir to an absolute path. 384 452 am_aux_dir=`cd "$ac_aux_dir" && pwd` 385 453 ]) 386 454 387 455 # AM_CONDITIONAL -*- Autoconf -*- 388 456 389 -# Copyright (C) 1997-2014 Free Software Foundation, Inc. 457 +# Copyright (C) 1997-2017 Free Software Foundation, Inc. 390 458 # 391 459 # This file is free software; the Free Software Foundation 392 460 # gives unlimited permission to copy and/or distribute it, 393 461 # with or without modifications, as long as this notice is preserved. 394 462 395 463 # AM_CONDITIONAL(NAME, SHELL-CONDITION) 396 464 # ------------------------------------- ................................................................................ 413 481 fi 414 482 AC_CONFIG_COMMANDS_PRE( 415 483 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 416 484 AC_MSG_ERROR([[conditional "$1" was never defined. 417 485 Usually this means the macro was only invoked conditionally.]]) 418 486 fi])]) 419 487 420 -# Copyright (C) 1999-2014 Free Software Foundation, Inc. 488 +# Copyright (C) 1999-2017 Free Software Foundation, Inc. 421 489 # 422 490 # This file is free software; the Free Software Foundation 423 491 # gives unlimited permission to copy and/or distribute it, 424 492 # with or without modifications, as long as this notice is preserved. 425 493 426 494 427 495 # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be ................................................................................ 604 672 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 605 673 AC_SUBST([am__nodep])dnl 606 674 _AM_SUBST_NOTMAKE([am__nodep])dnl 607 675 ]) 608 676 609 677 # Generate code to set up dependency tracking. -*- Autoconf -*- 610 678 611 -# Copyright (C) 1999-2014 Free Software Foundation, Inc. 679 +# Copyright (C) 1999-2017 Free Software Foundation, Inc. 612 680 # 613 681 # This file is free software; the Free Software Foundation 614 682 # gives unlimited permission to copy and/or distribute it, 615 683 # with or without modifications, as long as this notice is preserved. 616 684 617 685 618 686 # _AM_OUTPUT_DEPENDENCY_COMMANDS ................................................................................ 680 748 [AC_CONFIG_COMMANDS([depfiles], 681 749 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 682 750 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 683 751 ]) 684 752 685 753 # Do all the work for Automake. -*- Autoconf -*- 686 754 687 -# Copyright (C) 1996-2014 Free Software Foundation, Inc. 755 +# Copyright (C) 1996-2017 Free Software Foundation, Inc. 688 756 # 689 757 # This file is free software; the Free Software Foundation 690 758 # gives unlimited permission to copy and/or distribute it, 691 759 # with or without modifications, as long as this notice is preserved. 692 760 693 761 # This macro actually does too much. Some checks are only needed if 694 762 # your package does certain things. But this isn't really a big deal. ................................................................................ 877 945 break ;; 878 946 * ) 879 947 _am_stamp_count=`expr $_am_stamp_count + 1` ;; 880 948 esac 881 949 done 882 950 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 883 951 884 -# Copyright (C) 2001-2014 Free Software Foundation, Inc. 952 +# Copyright (C) 2001-2017 Free Software Foundation, Inc. 885 953 # 886 954 # This file is free software; the Free Software Foundation 887 955 # gives unlimited permission to copy and/or distribute it, 888 956 # with or without modifications, as long as this notice is preserved. 889 957 890 958 # AM_PROG_INSTALL_SH 891 959 # ------------------ ................................................................................ 898 966 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; 899 967 *) 900 968 install_sh="\${SHELL} $am_aux_dir/install-sh" 901 969 esac 902 970 fi 903 971 AC_SUBST([install_sh])]) 904 972 905 -# Copyright (C) 2003-2014 Free Software Foundation, Inc. 973 +# Copyright (C) 2003-2017 Free Software Foundation, Inc. 906 974 # 907 975 # This file is free software; the Free Software Foundation 908 976 # gives unlimited permission to copy and/or distribute it, 909 977 # with or without modifications, as long as this notice is preserved. 910 978 911 979 # Check whether the underlying file-system supports filenames 912 980 # with a leading dot. For instance MS-DOS doesn't. ................................................................................ 920 988 fi 921 989 rmdir .tst 2>/dev/null 922 990 AC_SUBST([am__leading_dot])]) 923 991 924 992 # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- 925 993 # From Jim Meyering 926 994 927 -# Copyright (C) 1996-2014 Free Software Foundation, Inc. 995 +# Copyright (C) 1996-2017 Free Software Foundation, Inc. 928 996 # 929 997 # This file is free software; the Free Software Foundation 930 998 # gives unlimited permission to copy and/or distribute it, 931 999 # with or without modifications, as long as this notice is preserved. 932 1000 933 1001 # AM_MAINTAINER_MODE([DEFAULT-MODE]) 934 1002 # ---------------------------------- ................................................................................ 955 1023 MAINT=$MAINTAINER_MODE_TRUE 956 1024 AC_SUBST([MAINT])dnl 957 1025 ] 958 1026 ) 959 1027 960 1028 # Check to see how 'make' treats includes. -*- Autoconf -*- 961 1029 962 -# Copyright (C) 2001-2014 Free Software Foundation, Inc. 1030 +# Copyright (C) 2001-2017 Free Software Foundation, Inc. 963 1031 # 964 1032 # This file is free software; the Free Software Foundation 965 1033 # gives unlimited permission to copy and/or distribute it, 966 1034 # with or without modifications, as long as this notice is preserved. 967 1035 968 1036 # AM_MAKE_INCLUDE() 969 1037 # ----------------- ................................................................................ 1005 1073 AC_SUBST([am__quote]) 1006 1074 AC_MSG_RESULT([$_am_result]) 1007 1075 rm -f confinc confmf 1008 1076 ]) 1009 1077 1010 1078 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 1011 1079 1012 -# Copyright (C) 1997-2014 Free Software Foundation, Inc. 1080 +# Copyright (C) 1997-2017 Free Software Foundation, Inc. 1013 1081 # 1014 1082 # This file is free software; the Free Software Foundation 1015 1083 # gives unlimited permission to copy and/or distribute it, 1016 1084 # with or without modifications, as long as this notice is preserved. 1017 1085 1018 1086 # AM_MISSING_PROG(NAME, PROGRAM) 1019 1087 # ------------------------------ ................................................................................ 1046 1114 fi 1047 1115 ]) 1048 1116 1049 1117 # -*- Autoconf -*- 1050 1118 # Obsolete and "removed" macros, that must however still report explicit 1051 1119 # error messages when used, to smooth transition. 1052 1120 # 1053 -# Copyright (C) 1996-2014 Free Software Foundation, Inc. 1121 +# Copyright (C) 1996-2017 Free Software Foundation, Inc. 1054 1122 # 1055 1123 # This file is free software; the Free Software Foundation 1056 1124 # gives unlimited permission to copy and/or distribute it, 1057 1125 # with or without modifications, as long as this notice is preserved. 1058 1126 1059 1127 AC_DEFUN([AM_CONFIG_HEADER], 1060 1128 [AC_DIAGNOSE([obsolete], ................................................................................ 1073 1141 1074 1142 AC_DEFUN([AM_C_PROTOTYPES], 1075 1143 [AC_FATAL([automatic de-ANSI-fication support has been removed])]) 1076 1144 AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) 1077 1145 1078 1146 # Helper functions for option handling. -*- Autoconf -*- 1079 1147 1080 -# Copyright (C) 2001-2014 Free Software Foundation, Inc. 1148 +# Copyright (C) 2001-2017 Free Software Foundation, Inc. 1081 1149 # 1082 1150 # This file is free software; the Free Software Foundation 1083 1151 # gives unlimited permission to copy and/or distribute it, 1084 1152 # with or without modifications, as long as this notice is preserved. 1085 1153 1086 1154 # _AM_MANGLE_OPTION(NAME) 1087 1155 # ----------------------- ................................................................................ 1102 1170 1103 1171 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 1104 1172 # ------------------------------------------- 1105 1173 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 1106 1174 AC_DEFUN([_AM_IF_OPTION], 1107 1175 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 1108 1176 1109 -# Copyright (C) 1999-2014 Free Software Foundation, Inc. 1177 +# Copyright (C) 1999-2017 Free Software Foundation, Inc. 1110 1178 # 1111 1179 # This file is free software; the Free Software Foundation 1112 1180 # gives unlimited permission to copy and/or distribute it, 1113 1181 # with or without modifications, as long as this notice is preserved. 1114 1182 1115 1183 # _AM_PROG_CC_C_O 1116 1184 # --------------- ................................................................................ 1149 1217 CC="$am_aux_dir/compile $CC" 1150 1218 fi 1151 1219 AC_LANG_POP([C])]) 1152 1220 1153 1221 # For backward compatibility. 1154 1222 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) 1155 1223 1156 -# Copyright (C) 2001-2014 Free Software Foundation, Inc. 1224 +# Copyright (C) 2001-2017 Free Software Foundation, Inc. 1157 1225 # 1158 1226 # This file is free software; the Free Software Foundation 1159 1227 # gives unlimited permission to copy and/or distribute it, 1160 1228 # with or without modifications, as long as this notice is preserved. 1161 1229 1162 1230 # AM_RUN_LOG(COMMAND) 1163 1231 # ------------------- ................................................................................ 1168 1236 ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD 1169 1237 ac_status=$? 1170 1238 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD 1171 1239 (exit $ac_status); }]) 1172 1240 1173 1241 # Check to make sure that the build environment is sane. -*- Autoconf -*- 1174 1242 1175 -# Copyright (C) 1996-2014 Free Software Foundation, Inc. 1243 +# Copyright (C) 1996-2017 Free Software Foundation, Inc. 1176 1244 # 1177 1245 # This file is free software; the Free Software Foundation 1178 1246 # gives unlimited permission to copy and/or distribute it, 1179 1247 # with or without modifications, as long as this notice is preserved. 1180 1248 1181 1249 # AM_SANITY_CHECK 1182 1250 # --------------- ................................................................................ 1249 1317 # Hide warnings about reused PIDs. 1250 1318 wait $am_sleep_pid 2>/dev/null 1251 1319 fi 1252 1320 AC_MSG_RESULT([done])]) 1253 1321 rm -f conftest.file 1254 1322 ]) 1255 1323 1256 -# Copyright (C) 2009-2014 Free Software Foundation, Inc. 1324 +# Copyright (C) 2009-2017 Free Software Foundation, Inc. 1257 1325 # 1258 1326 # This file is free software; the Free Software Foundation 1259 1327 # gives unlimited permission to copy and/or distribute it, 1260 1328 # with or without modifications, as long as this notice is preserved. 1261 1329 1262 1330 # AM_SILENT_RULES([DEFAULT]) 1263 1331 # -------------------------- ................................................................................ 1309 1377 AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl 1310 1378 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl 1311 1379 AM_BACKSLASH='\' 1312 1380 AC_SUBST([AM_BACKSLASH])dnl 1313 1381 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl 1314 1382 ]) 1315 1383 1316 -# Copyright (C) 2001-2014 Free Software Foundation, Inc. 1384 +# Copyright (C) 2001-2017 Free Software Foundation, Inc. 1317 1385 # 1318 1386 # This file is free software; the Free Software Foundation 1319 1387 # gives unlimited permission to copy and/or distribute it, 1320 1388 # with or without modifications, as long as this notice is preserved. 1321 1389 1322 1390 # AM_PROG_INSTALL_STRIP 1323 1391 # --------------------- ................................................................................ 1337 1405 dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. 1338 1406 if test "$cross_compiling" != no; then 1339 1407 AC_CHECK_TOOL([STRIP], [strip], :) 1340 1408 fi 1341 1409 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 1342 1410 AC_SUBST([INSTALL_STRIP_PROGRAM])]) 1343 1411 1344 -# Copyright (C) 2006-2014 Free Software Foundation, Inc. 1412 +# Copyright (C) 2006-2017 Free Software Foundation, Inc. 1345 1413 # 1346 1414 # This file is free software; the Free Software Foundation 1347 1415 # gives unlimited permission to copy and/or distribute it, 1348 1416 # with or without modifications, as long as this notice is preserved. 1349 1417 1350 1418 # _AM_SUBST_NOTMAKE(VARIABLE) 1351 1419 # --------------------------- ................................................................................ 1356 1424 # AM_SUBST_NOTMAKE(VARIABLE) 1357 1425 # -------------------------- 1358 1426 # Public sister of _AM_SUBST_NOTMAKE. 1359 1427 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) 1360 1428 1361 1429 # Check how to create a tarball. -*- Autoconf -*- 1362 1430 1363 -# Copyright (C) 2004-2014 Free Software Foundation, Inc. 1431 +# Copyright (C) 2004-2017 Free Software Foundation, Inc. 1364 1432 # 1365 1433 # This file is free software; the Free Software Foundation 1366 1434 # gives unlimited permission to copy and/or distribute it, 1367 1435 # with or without modifications, as long as this notice is preserved. 1368 1436 1369 1437 # _AM_PROG_TAR(FORMAT) 1370 1438 # --------------------
Changes to config.h.
65 65 #define HAVE_INTTYPES_H 1 66 66 67 67 /* Define to 1 if you have the `CharLS' library (-lCharLS). */ 68 68 #define HAVE_LIBCHARLS 1 69 69 70 70 /* Define to 1 if you have the `openjp2' library (-lopenjp2). */ 71 71 #define HAVE_LIBOPENJP2 1 72 + 73 +/* Define to 1 if you have the <libpq-fe.h> header file. */ 74 +#define HAVE_LIBPQ_FE_H 1 72 75 73 76 /* Define to 1 if you have the `proj' library (-lproj). */ 74 77 #define HAVE_LIBPROJ 1 75 78 76 79 /* Define to 1 if you have the `sqlite3' library (-lsqlite3). */ 77 80 #define HAVE_LIBSQLITE3 1 78 81 ................................................................................ 95 98 /* Define to 1 if you have the `memset' function. */ 96 99 #define HAVE_MEMSET 1 97 100 98 101 /* Define to 1 if you have the <openjpeg-2.0/openjpeg.h> header file. */ 99 102 /* #undef HAVE_OPENJPEG_2_0_OPENJPEG_H */ 100 103 101 104 /* Define to 1 if you have the <openjpeg-2.1/openjpeg.h> header file. */ 102 -#define HAVE_OPENJPEG_2_1_OPENJPEG_H 1 105 +/* #undef HAVE_OPENJPEG_2_1_OPENJPEG_H */ 106 + 107 +/* Define to 1 if you have the <openjpeg-2.2/openjpeg.h> header file. */ 108 +/* #undef HAVE_OPENJPEG_2_2_OPENJPEG_H */ 109 + 110 +/* Define to 1 if you have the <openjpeg-2.3/openjpeg.h> header file. */ 111 +#define HAVE_OPENJPEG_2_3_OPENJPEG_H 1 103 112 104 113 /* Define to 1 if you have the <sqlite3ext.h> header file. */ 105 114 #define HAVE_SQLITE3EXT_H 1 106 115 107 116 /* Define to 1 if you have the <sqlite3.h> header file. */ 108 117 #define HAVE_SQLITE3_H 1 109 118 ................................................................................ 154 163 #define HAVE_SYS_TIME_H 1 155 164 156 165 /* Define to 1 if you have the <sys/types.h> header file. */ 157 166 #define HAVE_SYS_TYPES_H 1 158 167 159 168 /* Define to 1 if you have the <unistd.h> header file. */ 160 169 #define HAVE_UNISTD_H 1 170 + 171 +/* Should be defined in order to enable LibPQ late binding. */ 172 +/* #undef LIBPQ_DEFERRED */ 161 173 162 174 /* Define to 1 if `lstat' dereferences a symlink specified with a trailing 163 175 slash. */ 164 176 #define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 165 177 166 178 /* Define to the sub-directory in which libtool stores uninstalled libraries. 167 179 */ ................................................................................ 175 187 176 188 /* Should be defined in order to disable OpenJpeg support. */ 177 189 /* #undef OMIT_OPENJPEG */ 178 190 179 191 /* Should be defined in order to disable WebP support. */ 180 192 /* #undef OMIT_WEBP */ 181 193 182 -/* testing for OpenJpeg 2.1 */ 183 -#define OPENJPEG_2_1 1 184 - 185 194 /* Name of package */ 186 195 #define PACKAGE "spatialite_gui" 187 196 188 197 /* Define to the address where bug reports for this package should be sent. */ 189 198 #define PACKAGE_BUGREPORT "a.furieri@lqt.it" 190 199 191 200 /* Define to the full name of this package. */
Changes to config.h.in.
64 64 #undef HAVE_INTTYPES_H 65 65 66 66 /* Define to 1 if you have the `CharLS' library (-lCharLS). */ 67 67 #undef HAVE_LIBCHARLS 68 68 69 69 /* Define to 1 if you have the `openjp2' library (-lopenjp2). */ 70 70 #undef HAVE_LIBOPENJP2 71 + 72 +/* Define to 1 if you have the <libpq-fe.h> header file. */ 73 +#undef HAVE_LIBPQ_FE_H 71 74 72 75 /* Define to 1 if you have the `proj' library (-lproj). */ 73 76 #undef HAVE_LIBPROJ 74 77 75 78 /* Define to 1 if you have the `sqlite3' library (-lsqlite3). */ 76 79 #undef HAVE_LIBSQLITE3 77 80 ................................................................................ 95 98 #undef HAVE_MEMSET 96 99 97 100 /* Define to 1 if you have the <openjpeg-2.0/openjpeg.h> header file. */ 98 101 #undef HAVE_OPENJPEG_2_0_OPENJPEG_H 99 102 100 103 /* Define to 1 if you have the <openjpeg-2.1/openjpeg.h> header file. */ 101 104 #undef HAVE_OPENJPEG_2_1_OPENJPEG_H 105 + 106 +/* Define to 1 if you have the <openjpeg-2.2/openjpeg.h> header file. */ 107 +#undef HAVE_OPENJPEG_2_2_OPENJPEG_H 108 + 109 +/* Define to 1 if you have the <openjpeg-2.3/openjpeg.h> header file. */ 110 +#undef HAVE_OPENJPEG_2_3_OPENJPEG_H 102 111 103 112 /* Define to 1 if you have the <sqlite3ext.h> header file. */ 104 113 #undef HAVE_SQLITE3EXT_H 105 114 106 115 /* Define to 1 if you have the <sqlite3.h> header file. */ 107 116 #undef HAVE_SQLITE3_H 108 117 ................................................................................ 153 162 #undef HAVE_SYS_TIME_H 154 163 155 164 /* Define to 1 if you have the <sys/types.h> header file. */ 156 165 #undef HAVE_SYS_TYPES_H 157 166 158 167 /* Define to 1 if you have the <unistd.h> header file. */ 159 168 #undef HAVE_UNISTD_H 169 + 170 +/* Should be defined in order to enable LibPQ late binding. */ 171 +#undef LIBPQ_DEFERRED 160 172 161 173 /* Define to 1 if `lstat' dereferences a symlink specified with a trailing 162 174 slash. */ 163 175 #undef LSTAT_FOLLOWS_SLASHED_SYMLINK 164 176 165 177 /* Define to the sub-directory in which libtool stores uninstalled libraries. 166 178 */ ................................................................................ 174 186 175 187 /* Should be defined in order to disable OpenJpeg support. */ 176 188 #undef OMIT_OPENJPEG 177 189 178 190 /* Should be defined in order to disable WebP support. */ 179 191 #undef OMIT_WEBP 180 192 181 -/* testing for OpenJpeg 2.1 */ 182 -#undef OPENJPEG_2_1 183 - 184 193 /* Name of package */ 185 194 #undef PACKAGE 186 195 187 196 /* Define to the address where bug reports for this package should be sent. */ 188 197 #undef PACKAGE_BUGREPORT 189 198 190 199 /* Define to the full name of this package. */
Changes to configure.
631 631 # include <unistd.h> 632 632 #endif" 633 633 634 634 ac_subst_vars='am__EXEEXT_FALSE 635 635 am__EXEEXT_TRUE 636 636 LTLIBOBJS 637 637 OMIT_SQLITE_STMTSTATUS_AUTOINDEX_FLAGS 638 +PG_LIB 639 +PG_LDFLAGS 640 +PG_CFLAGS 641 +PGCONFIG 642 +LIBVIRTUALPG_LIBS 643 +LIBVIRTUALPG_CFLAGS 638 644 LIBRASTERLITE2_LIBS 639 645 LIBRASTERLITE2_CFLAGS 640 646 LIBSPATIALITE_LIBS 641 647 LIBSPATIALITE_CFLAGS 642 648 LIBLZMA_LIBS 643 649 LIBLZMA_CFLAGS 644 650 LIBWEBP_LIBS ................................................................................ 795 801 with_wxconfig 796 802 with_geosconfig 797 803 enable_freexl 798 804 enable_libxml2 799 805 enable_openjpeg 800 806 enable_webp 801 807 enable_charls 808 +with_pgconfig 809 +with_libpq_deferred 802 810 enable_sqlite_stmtstatus_autoindex 803 811 ' 804 812 ac_precious_vars='build_alias 805 813 host_alias 806 814 target_alias 807 815 CXX 808 816 CXXFLAGS ................................................................................ 824 832 LIBWEBP_CFLAGS 825 833 LIBWEBP_LIBS 826 834 LIBLZMA_CFLAGS 827 835 LIBLZMA_LIBS 828 836 LIBSPATIALITE_CFLAGS 829 837 LIBSPATIALITE_LIBS 830 838 LIBRASTERLITE2_CFLAGS 831 -LIBRASTERLITE2_LIBS' 839 +LIBRASTERLITE2_LIBS 840 +LIBVIRTUALPG_CFLAGS 841 +LIBVIRTUALPG_LIBS' 832 842 833 843 834 844 # Initialize some variables set by options. 835 845 ac_init_help= 836 846 ac_init_version=false 837 847 ac_unrecognized_opts= 838 848 ac_unrecognized_sep= ................................................................................ 1475 1485 --with-pic try to use only PIC/non-PIC objects [default=use 1476 1486 both] 1477 1487 --with-gnu-ld assume the C compiler uses GNU ld [default=no] 1478 1488 --with-sysroot=DIR Search for dependent libraries within DIR 1479 1489 (or the compiler's sysroot if not specified). 1480 1490 --with-wxconfig=FILE specify an alternative wx-config file 1481 1491 --with-geosconfig=FILE specify an alternative geos-config file 1492 + --with-pgconfig=FILE specify an alternative pg_config file 1493 + --with-libpq_deferred enables libpq late binding [default=no] 1482 1494 1483 1495 Some influential environment variables: 1484 1496 CXX C++ compiler command 1485 1497 CXXFLAGS C++ compiler flags 1486 1498 LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a 1487 1499 nonstandard directory <lib dir> 1488 1500 LIBS libraries to pass to the linker, e.g. -l<library> ................................................................................ 1517 1529 C compiler flags for LIBSPATIALITE, overriding pkg-config 1518 1530 LIBSPATIALITE_LIBS 1519 1531 linker flags for LIBSPATIALITE, overriding pkg-config 1520 1532 LIBRASTERLITE2_CFLAGS 1521 1533 C compiler flags for LIBRASTERLITE2, overriding pkg-config 1522 1534 LIBRASTERLITE2_LIBS 1523 1535 linker flags for LIBRASTERLITE2, overriding pkg-config 1536 + LIBVIRTUALPG_CFLAGS 1537 + C compiler flags for LIBVIRTUALPG, overriding pkg-config 1538 + LIBVIRTUALPG_LIBS 1539 + linker flags for LIBVIRTUALPG, overriding pkg-config 1524 1540 1525 1541 Use these variables to override the choices made by `configure' or to help 1526 1542 it to find libraries and programs with nonstandard names/locations. 1527 1543 1528 1544 Report bugs to <a.furieri@lqt.it>. 1529 1545 _ACEOF 1530 1546 ac_status=$? ................................................................................ 17064 17080 fi 17065 17081 17066 17082 if test x"$enable_openjpeg" != "xno"; then 17067 17083 # 17068 17084 # testing OpenJpeg-2 headers 17069 17085 # they could be either on -/include/openjpeg-2.0 17070 17086 # or on -/include/openjpeg-2.1 17087 + # or on -/include/openjpeg-2.2 17088 + # or on -/include/openjpeg-2.3 17071 17089 # 17072 17090 for ac_header in openjpeg-2.0/openjpeg.h 17073 17091 do : 17074 17092 ac_fn_c_check_header_mongrel "$LINENO" "openjpeg-2.0/openjpeg.h" "ac_cv_header_openjpeg_2_0_openjpeg_h" "$ac_includes_default" 17075 17093 if test "x$ac_cv_header_openjpeg_2_0_openjpeg_h" = xyes; then : 17076 17094 cat >>confdefs.h <<_ACEOF 17077 17095 #define HAVE_OPENJPEG_2_0_OPENJPEG_H 1 ................................................................................ 17088 17106 cat >>confdefs.h <<_ACEOF 17089 17107 #define HAVE_OPENJPEG_2_1_OPENJPEG_H 1 17090 17108 _ACEOF 17091 17109 17092 17110 fi 17093 17111 17094 17112 done 17113 + 17114 + for ac_header in openjpeg-2.2/openjpeg.h 17115 +do : 17116 + ac_fn_c_check_header_mongrel "$LINENO" "openjpeg-2.2/openjpeg.h" "ac_cv_header_openjpeg_2_2_openjpeg_h" "$ac_includes_default" 17117 +if test "x$ac_cv_header_openjpeg_2_2_openjpeg_h" = xyes; then : 17118 + cat >>confdefs.h <<_ACEOF 17119 +#define HAVE_OPENJPEG_2_2_OPENJPEG_H 1 17120 +_ACEOF 17121 + 17122 +fi 17123 + 17124 +done 17125 + 17126 + for ac_header in openjpeg-2.3/openjpeg.h 17127 +do : 17128 + ac_fn_c_check_header_mongrel "$LINENO" "openjpeg-2.3/openjpeg.h" "ac_cv_header_openjpeg_2_3_openjpeg_h" "$ac_includes_default" 17129 +if test "x$ac_cv_header_openjpeg_2_3_openjpeg_h" = xyes; then : 17130 + cat >>confdefs.h <<_ACEOF 17131 +#define HAVE_OPENJPEG_2_3_OPENJPEG_H 1 17132 +_ACEOF 17133 + 17134 +fi 17135 + 17136 +done 17095 17137 17096 17138 if test x"$ac_cv_header_openjpeg_2_0_openjpeg_h" != x"yes" && 17097 - test x"$ac_cv_header_openjpeg_2_1_openjpeg_h" != x"yes"; 17139 + test x"$ac_cv_header_openjpeg_2_1_openjpeg_h" != x"yes" && 17140 + test x"$ac_cv_header_openjpeg_2_2_openjpeg_h" != x"yes" && 17141 + test x"$ac_cv_header_openjpeg_2_3_openjpeg_h" != x"yes"; 17098 17142 then 17099 17143 as_fn_error $? "'OpenJpeg-2' is required but the header (openjpeg.h) doesn't seem to be installed on this system" "$LINENO" 5 17100 17144 fi 17101 17145 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for opj_create_decompress in -lopenjp2" >&5 17102 17146 $as_echo_n "checking for opj_create_decompress in -lopenjp2... " >&6; } 17103 17147 if ${ac_cv_lib_openjp2_opj_create_decompress+:} false; then : 17104 17148 $as_echo_n "(cached) " >&6 ................................................................................ 17141 17185 17142 17186 LIBS="-lopenjp2 $LIBS" 17143 17187 17144 17188 else 17145 17189 as_fn_error $? "'libopenjp2' is required but it doesn't seems to be installed on this system." "$LINENO" 5 17146 17190 fi 17147 17191 17148 - # testing for OpenJpeg 2.0 or 2.1 17149 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext 17150 -/* end confdefs.h. */ 17151 -#ifdef HAVE_OPENJPEG_2_1_OPENJPEG_H 17152 - #include <openjpeg-2.1/openjpeg.h> 17153 - #else 17154 - #include <openjpeg-2.0/openjpeg.h> 17155 - #endif 17156 -int 17157 -main () 17158 -{ 17159 -void *d; opj_stream_t *s; opj_stream_set_user_data (s, &d, NULL); 17160 - ; 17161 - return 0; 17162 -} 17163 -_ACEOF 17164 -if ac_fn_c_try_compile "$LINENO"; then : 17165 - 17166 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 17167 -$as_echo "yes" >&6; } 17168 - $as_echo "#define OPENJPEG_2_1 1" >>confdefs.h 17169 - 17170 - 17171 -else 17172 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 17173 -$as_echo "no" >&6; } 17174 - 17175 -fi 17176 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 17177 17192 else 17178 17193 $as_echo "#define OMIT_OPENJPEG 1" >>confdefs.h 17179 17194 17180 17195 fi 17181 17196 #----------------------------------------------------------------------- 17182 17197 17183 17198 #----------------------------------------------------------------------- ................................................................................ 17570 17585 LIBRASTERLITE2_LIBS=$pkg_cv_LIBRASTERLITE2_LIBS 17571 17586 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 17572 17587 $as_echo "yes" >&6; } 17573 17588 17574 17589 fi 17575 17590 17576 17591 17592 + 17593 + 17594 +pkg_failed=no 17595 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBVIRTUALPG" >&5 17596 +$as_echo_n "checking for LIBVIRTUALPG... " >&6; } 17597 + 17598 +if test -n "$LIBVIRTUALPG_CFLAGS"; then 17599 + pkg_cv_LIBVIRTUALPG_CFLAGS="$LIBVIRTUALPG_CFLAGS" 17600 + elif test -n "$PKG_CONFIG"; then 17601 + if test -n "$PKG_CONFIG" && \ 17602 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"virtualpg\""; } >&5 17603 + ($PKG_CONFIG --exists --print-errors "virtualpg") 2>&5 17604 + ac_status=$? 17605 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 17606 + test $ac_status = 0; }; then 17607 + pkg_cv_LIBVIRTUALPG_CFLAGS=`$PKG_CONFIG --cflags "virtualpg" 2>/dev/null` 17608 + test "x$?" != "x0" && pkg_failed=yes 17609 +else 17610 + pkg_failed=yes 17611 +fi 17612 + else 17613 + pkg_failed=untried 17614 +fi 17615 +if test -n "$LIBVIRTUALPG_LIBS"; then 17616 + pkg_cv_LIBVIRTUALPG_LIBS="$LIBVIRTUALPG_LIBS" 17617 + elif test -n "$PKG_CONFIG"; then 17618 + if test -n "$PKG_CONFIG" && \ 17619 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"virtualpg\""; } >&5 17620 + ($PKG_CONFIG --exists --print-errors "virtualpg") 2>&5 17621 + ac_status=$? 17622 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 17623 + test $ac_status = 0; }; then 17624 + pkg_cv_LIBVIRTUALPG_LIBS=`$PKG_CONFIG --libs "virtualpg" 2>/dev/null` 17625 + test "x$?" != "x0" && pkg_failed=yes 17626 +else 17627 + pkg_failed=yes 17628 +fi 17629 + else 17630 + pkg_failed=untried 17631 +fi 17632 + 17633 + 17634 + 17635 +if test $pkg_failed = yes; then 17636 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 17637 +$as_echo "no" >&6; } 17638 + 17639 +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then 17640 + _pkg_short_errors_supported=yes 17641 +else 17642 + _pkg_short_errors_supported=no 17643 +fi 17644 + if test $_pkg_short_errors_supported = yes; then 17645 + LIBVIRTUALPG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "virtualpg" 2>&1` 17646 + else 17647 + LIBVIRTUALPG_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "virtualpg" 2>&1` 17648 + fi 17649 + # Put the nasty error message in config.log where it belongs 17650 + echo "$LIBVIRTUALPG_PKG_ERRORS" >&5 17651 + 17652 + as_fn_error $? "'libvirtualpg' is required but it doesn't seem to be installed on this system." "$LINENO" 5 17653 +elif test $pkg_failed = untried; then 17654 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 17655 +$as_echo "no" >&6; } 17656 + as_fn_error $? "'libvirtualpg' is required but it doesn't seem to be installed on this system." "$LINENO" 5 17657 +else 17658 + LIBVIRTUALPG_CFLAGS=$pkg_cv_LIBVIRTUALPG_CFLAGS 17659 + LIBVIRTUALPG_LIBS=$pkg_cv_LIBVIRTUALPG_LIBS 17660 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 17661 +$as_echo "yes" >&6; } 17662 + 17663 +fi 17664 + 17665 + 17666 +#----------------------------------------------------------------------- 17667 + 17668 +#----------------------------------------------------------------------- 17669 +# --with-pgconfig 17670 +# 17671 + 17672 +# Check whether --with-pgconfig was given. 17673 +if test "${with_pgconfig+set}" = set; then : 17674 + withval=$with_pgconfig; PGCONFIG="$withval" 17675 +else 17676 + PGCONFIG="" 17677 +fi 17678 + 17679 +if test "x$PGCONFIG" = "x"; then 17680 + # PGCONFIG was not specified, so search within the current path 17681 + # Extract the first word of "pg_config", so it can be a program name with args. 17682 +set dummy pg_config; ac_word=$2 17683 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 17684 +$as_echo_n "checking for $ac_word... " >&6; } 17685 +if ${ac_cv_path_PGCONFIG+:} false; then : 17686 + $as_echo_n "(cached) " >&6 17687 +else 17688 + case $PGCONFIG in 17689 + [\\/]* | ?:[\\/]*) 17690 + ac_cv_path_PGCONFIG="$PGCONFIG" # Let the user override the test with a path. 17691 + ;; 17692 + *) 17693 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 17694 +for as_dir in $PATH 17695 +do 17696 + IFS=$as_save_IFS 17697 + test -z "$as_dir" && as_dir=. 17698 + for ac_exec_ext in '' $ac_executable_extensions; do 17699 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 17700 + ac_cv_path_PGCONFIG="$as_dir/$ac_word$ac_exec_ext" 17701 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 17702 + break 2 17703 + fi 17704 +done 17705 + done 17706 +IFS=$as_save_IFS 17707 + 17708 + ;; 17709 +esac 17710 +fi 17711 +PGCONFIG=$ac_cv_path_PGCONFIG 17712 +if test -n "$PGCONFIG"; then 17713 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PGCONFIG" >&5 17714 +$as_echo "$PGCONFIG" >&6; } 17715 +else 17716 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 17717 +$as_echo "no" >&6; } 17718 +fi 17719 + 17720 + 17721 + # If we couldn't find pg_config, display an error 17722 + if test "x$PGCONFIG" = "x"; then 17723 + as_fn_error $? "could not find pg_config within the current path. You may need to try re-running configure with a --with-pgconfig parameter." "$LINENO" 5 17724 + fi 17725 +else 17726 + # PGCONFIG was specified; display a message to the user 17727 + if test "x$PGSCONFIG" = "xyes"; then 17728 + as_fn_error $? "you must specify a parameter to --with-pgconfig, e.g. --with-pgconfig=/path/to/pg_config" "$LINENO" 5 17729 + else 17730 + if test -f $PGCONFIG; then 17731 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using user-specified pg_config file: $PGCONFIG" >&5 17732 +$as_echo "Using user-specified pg_config file: $PGCONFIG" >&6; } 17733 + else 17734 + as_fn_error $? "the user-specified pg_config file $PGCONFIG does not exist" "$LINENO" 5 17735 + fi 17736 + fi 17737 +fi 17738 +PG_CFLAGS=-I`$PGCONFIG --includedir` 17739 +PG_LDFLAGS=-L`$PGCONFIG --libdir` 17740 + 17741 + 17742 +#----------------------------------------------------------------------- 17743 + 17744 +#----------------------------------------------------------------------- 17745 +# --with-libpq_deferred 17746 +# 17747 + 17748 +# Check whether --with-libpq_deferred was given. 17749 +if test "${with_libpq_deferred+set}" = set; then : 17750 + withval=$with_libpq_deferred; 17751 +else 17752 + with_libpq_deferred=no 17753 +fi 17754 + 17755 +if test x"$with_libpq_deferred" != "xno"; then 17756 + $as_echo "#define LIBPQ_DEFERRED 1" >>confdefs.h 17757 + 17758 + libpq_deferred=1 17759 +fi 17577 17760 #----------------------------------------------------------------------- 17761 + 17762 +# Ensure that we can parse libpq-fe.h 17763 +CFLAGS_SAVE="$CFLAGS" 17764 +CFLAGS="$PG_CFLAGS" 17765 +for ac_header in libpq-fe.h 17766 +do : 17767 + ac_fn_c_check_header_mongrel "$LINENO" "libpq-fe.h" "ac_cv_header_libpq_fe_h" "$ac_includes_default" 17768 +if test "x$ac_cv_header_libpq_fe_h" = xyes; then : 17769 + cat >>confdefs.h <<_ACEOF 17770 +#define HAVE_LIBPQ_FE_H 1 17771 +_ACEOF 17772 + 17773 +else 17774 + as_fn_error $? "cannot find libpq-fe.h, bailing out" "$LINENO" 5 17775 +fi 17776 + 17777 +done 17778 + 17779 +CFLAGS="$CFLAGS_SAVE" 17780 + 17781 +if test x"$libpq_deferred" != "x1"; then 17782 + # Ensure we can link against libpq 17783 + LDFLAGS_SAVE="$LDFLAGS" 17784 + LDFLAGS="$PG_LDFLAGS" 17785 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PQconnectdb in -lpq" >&5 17786 +$as_echo_n "checking for PQconnectdb in -lpq... " >&6; } 17787 +if ${ac_cv_lib_pq_PQconnectdb+:} false; then : 17788 + $as_echo_n "(cached) " >&6 17789 +else 17790 + ac_check_lib_save_LIBS=$LIBS 17791 +LIBS="-lpq $LIBS" 17792 +cat confdefs.h - <<_ACEOF >conftest.$ac_ext 17793 +/* end confdefs.h. */ 17794 + 17795 +/* Override any GCC internal prototype to avoid an error. 17796 + Use char because int might match the return type of a GCC 17797 + builtin and then its argument prototype would still apply. */ 17798 +#ifdef __cplusplus 17799 +extern "C" 17800 +#endif 17801 +char PQconnectdb (); 17802 +int 17803 +main () 17804 +{ 17805 +return PQconnectdb (); 17806 + ; 17807 + return 0; 17808 +} 17809 +_ACEOF 17810 +if ac_fn_c_try_link "$LINENO"; then : 17811 + ac_cv_lib_pq_PQconnectdb=yes 17812 +else 17813 + ac_cv_lib_pq_PQconnectdb=no 17814 +fi 17815 +rm -f core conftest.err conftest.$ac_objext \ 17816 + conftest$ac_exeext conftest.$ac_ext 17817 +LIBS=$ac_check_lib_save_LIBS 17818 +fi 17819 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pq_PQconnectdb" >&5 17820 +$as_echo "$ac_cv_lib_pq_PQconnectdb" >&6; } 17821 +if test "x$ac_cv_lib_pq_PQconnectdb" = xyes; then : 17822 + PG_LIB=-lpq 17823 +else 17824 + as_fn_error $? "'libpq' is required but it doesn't seem to be installed on this system." "$LINENO" 5 17825 +fi 17826 + 17827 + LDFLAGS="$LDFLAGS_SAVE" 17828 + 17829 +fi 17578 17830 17579 17831 ac_config_files="$ac_config_files Makefile icons/Makefile win_resource/Makefile gnome_resource/Makefile mac_resource/Makefile" 17580 17832 17581 17833 17582 17834 #----------------------------------------------------------------------- 17583 17835 # --enable-sqlite_stmtstatus_autoindex 17584 17836 #
Changes to configure.ac.
15 15 [must be defined when using libspatialite-amalgamation]) 16 16 AH_TEMPLATE([OMIT_FREEXL], 17 17 [Should be defined in order to disable FREEXL support.]) 18 18 AH_TEMPLATE([ENABLE_LIBXML2], 19 19 [Should be defined in order to enable LIBXML2 support.]) 20 20 AH_TEMPLATE([OMIT_WEBP], 21 21 [Should be defined in order to disable WebP support.]) 22 -AH_TEMPLATE([OPENJPEG_2_1], 23 - [testing for OpenJpeg 2.1]) 24 22 AH_TEMPLATE([OMIT_OPENJPEG], 25 23 [Should be defined in order to disable OpenJpeg support.]) 26 24 AH_TEMPLATE([OMIT_CHARLS], 27 25 [Should be defined in order to disable CharLS support.]) 26 +AH_TEMPLATE([LIBPQ_DEFERRED], 27 + [Should be defined in order to enable LibPQ late binding.]) 28 28 AH_TEMPLATE([HAVE_DECL_SQLITE_DBSTATUS_LOOKASIDE_USED], 29 29 [depending on SQLite library version.]) 30 30 AH_TEMPLATE([HAVE_DECL_SQLITE_DBSTATUS_LOOKASIDE_HIT], 31 31 [depending on SQLite library version.]) 32 32 AH_TEMPLATE([HAVE_DECL_SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE], 33 33 [depending on SQLite library version.]) 34 34 AH_TEMPLATE([HAVE_DECL_SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL], ................................................................................ 195 195 [--enable-openjpeg], [enables OpenJpeg inclusion [default=yes]])], 196 196 [], [enable_openjpeg=yes]) 197 197 if test x"$enable_openjpeg" != "xno"; then 198 198 # 199 199 # testing OpenJpeg-2 headers 200 200 # they could be either on -/include/openjpeg-2.0 201 201 # or on -/include/openjpeg-2.1 202 + # or on -/include/openjpeg-2.2 203 + # or on -/include/openjpeg-2.3 202 204 # 203 205 AC_CHECK_HEADERS(openjpeg-2.0/openjpeg.h) 204 206 AC_CHECK_HEADERS(openjpeg-2.1/openjpeg.h) 207 + AC_CHECK_HEADERS(openjpeg-2.2/openjpeg.h) 208 + AC_CHECK_HEADERS(openjpeg-2.3/openjpeg.h) 205 209 if test x"$ac_cv_header_openjpeg_2_0_openjpeg_h" != x"yes" && 206 - test x"$ac_cv_header_openjpeg_2_1_openjpeg_h" != x"yes"; 210 + test x"$ac_cv_header_openjpeg_2_1_openjpeg_h" != x"yes" && 211 + test x"$ac_cv_header_openjpeg_2_2_openjpeg_h" != x"yes" && 212 + test x"$ac_cv_header_openjpeg_2_3_openjpeg_h" != x"yes"; 207 213 then 208 214 AC_MSG_ERROR(['OpenJpeg-2' is required but the header (openjpeg.h) doesn't seem to be installed on this system]) 209 215 fi 210 216 AC_CHECK_LIB(openjp2,opj_create_decompress,,AC_MSG_ERROR(['libopenjp2' is required but it doesn't seems to be installed on this system.]),-lm) 211 - # testing for OpenJpeg 2.0 or 2.1 212 - AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#ifdef HAVE_OPENJPEG_2_1_OPENJPEG_H 213 - #include <openjpeg-2.1/openjpeg.h> 214 - #else 215 - #include <openjpeg-2.0/openjpeg.h> 216 - #endif]], 217 - [[void *d; opj_stream_t *s; opj_stream_set_user_data (s, &d, NULL);]])], 218 - [ 219 - AC_MSG_RESULT([yes]) 220 - AC_DEFINE(OPENJPEG_2_1) 221 - ], 222 - [AC_MSG_RESULT([no])] 223 - ) 224 217 else 225 218 AC_DEFINE(OMIT_OPENJPEG) 226 219 fi 227 220 #----------------------------------------------------------------------- 228 221 229 222 #----------------------------------------------------------------------- 230 223 # --enable-webp ................................................................................ 266 259 AC_DEFINE(SPATIALITE_AMALGAMATION, 1) 267 260 fi 268 261 AC_SUBST(LIBSPATIALITE_LIBS) 269 262 270 263 PKG_CHECK_MODULES([LIBRASTERLITE2], [rasterlite2], , AC_MSG_ERROR(['librasterlite2' is required but it doesn't seem to be installed on this system.])) 271 264 AC_SUBST(LIBRASTERLITE2_CFLAGS) 272 265 AC_SUBST(LIBRASTERLITE2_LIBS) 266 + 267 +PKG_CHECK_MODULES([LIBVIRTUALPG], [virtualpg], , AC_MSG_ERROR(['libvirtualpg' is required but it doesn't seem to be installed on this system.])) 268 +AC_SUBST(LIBVIRTUALPG_CFLAGS) 269 +AC_SUBST(LIBVIRTUALPG_LIBS) 270 +#----------------------------------------------------------------------- 271 + 272 +#----------------------------------------------------------------------- 273 +# --with-pgconfig 274 +# 275 +AC_ARG_WITH([pgconfig], 276 + [AS_HELP_STRING([--with-pgconfig=FILE], [specify an alternative pg_config file])], 277 + [PGCONFIG="$withval"], [PGCONFIG=""]) 278 +if test "x$PGCONFIG" = "x"; then 279 + # PGCONFIG was not specified, so search within the current path 280 + AC_PATH_PROG([PGCONFIG], [pg_config]) 281 + # If we couldn't find pg_config, display an error 282 + if test "x$PGCONFIG" = "x"; then 283 + AC_MSG_ERROR([could not find pg_config within the current path. You may need to try re-running configure with a --with-pgconfig parameter.]) 284 + fi 285 +else 286 + # PGCONFIG was specified; display a message to the user 287 + if test "x$PGSCONFIG" = "xyes"; then 288 + AC_MSG_ERROR([you must specify a parameter to --with-pgconfig, e.g. --with-pgconfig=/path/to/pg_config]) 289 + else 290 + if test -f $PGCONFIG; then 291 + AC_MSG_RESULT([Using user-specified pg_config file: $PGCONFIG]) 292 + else 293 + AC_MSG_ERROR([the user-specified pg_config file $PGCONFIG does not exist]) 294 + fi 295 + fi 296 +fi 297 +PG_CFLAGS=-I`$PGCONFIG --includedir` 298 +PG_LDFLAGS=-L`$PGCONFIG --libdir` 299 +AC_SUBST(PG_CFLAGS) 300 +AC_SUBST(PG_LDFLAGS) 301 +#----------------------------------------------------------------------- 302 + 303 +#----------------------------------------------------------------------- 304 +# --with-libpq_deferred 305 +# 306 +AC_ARG_WITH(libpq_deferred, [AS_HELP_STRING( 307 + [--with-libpq_deferred], [enables libpq late binding [default=no]])], 308 + [], [with_libpq_deferred=no]) 309 +if test x"$with_libpq_deferred" != "xno"; then 310 + AC_DEFINE(LIBPQ_DEFERRED) 311 + libpq_deferred=1 312 +fi 273 313 #----------------------------------------------------------------------- 314 + 315 +# Ensure that we can parse libpq-fe.h 316 +CFLAGS_SAVE="$CFLAGS" 317 +CFLAGS="$PG_CFLAGS" 318 +AC_CHECK_HEADERS(libpq-fe.h,, [AC_MSG_ERROR([cannot find libpq-fe.h, bailing out])]) 319 +CFLAGS="$CFLAGS_SAVE" 320 + 321 +if test x"$libpq_deferred" != "x1"; then 322 + # Ensure we can link against libpq 323 + LDFLAGS_SAVE="$LDFLAGS" 324 + LDFLAGS="$PG_LDFLAGS" 325 + AC_CHECK_LIB(pq,PQconnectdb,PG_LIB=-lpq,AC_MSG_ERROR(['libpq' is required but it doesn't seem to be installed on this system.])) 326 + LDFLAGS="$LDFLAGS_SAVE" 327 + AC_SUBST(PG_LIB) 328 +fi 274 329 275 330 AC_CONFIG_FILES([Makefile \ 276 331 icons/Makefile \ 277 332 win_resource/Makefile \ 278 333 gnome_resource/Makefile \ 279 334 mac_resource/Makefile]) 280 335
Changes to gnome_resource/Makefile.in.
1 -# Makefile.in generated by automake 1.15 from Makefile.am. 1 +# Makefile.in generated by automake 1.15.1 from Makefile.am. 2 2 # @configure_input@ 3 3 4 -# Copyright (C) 1994-2014 Free Software Foundation, Inc. 4 +# Copyright (C) 1994-2017 Free Software Foundation, Inc. 5 5 6 6 # This Makefile.in is free software; the Free Software Foundation 7 7 # gives unlimited permission to copy and/or distribute it, 8 8 # with or without modifications, as long as this notice is preserved. 9 9 10 10 # This program is distributed in the hope that it will be useful, 11 11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without ................................................................................ 200 200 LIBOBJS = @LIBOBJS@ 201 201 LIBRASTERLITE2_CFLAGS = @LIBRASTERLITE2_CFLAGS@ 202 202 LIBRASTERLITE2_LIBS = @LIBRASTERLITE2_LIBS@ 203 203 LIBS = @LIBS@ 204 204 LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@ 205 205 LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@ 206 206 LIBTOOL = @LIBTOOL@ 207 +LIBVIRTUALPG_CFLAGS = @LIBVIRTUALPG_CFLAGS@ 208 +LIBVIRTUALPG_LIBS = @LIBVIRTUALPG_LIBS@ 207 209 LIBWEBP_CFLAGS = @LIBWEBP_CFLAGS@ 208 210 LIBWEBP_LIBS = @LIBWEBP_LIBS@ 209 211 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ 210 212 LIBXML2_LIBS = @LIBXML2_LIBS@ 211 213 LIPO = @LIPO@ 212 214 LN_S = @LN_S@ 213 215 LTLIBOBJS = @LTLIBOBJS@ ................................................................................ 226 228 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 227 229 PACKAGE_NAME = @PACKAGE_NAME@ 228 230 PACKAGE_STRING = @PACKAGE_STRING@ 229 231 PACKAGE_TARNAME = @PACKAGE_TARNAME@ 230 232 PACKAGE_URL = @PACKAGE_URL@ 231 233 PACKAGE_VERSION = @PACKAGE_VERSION@ 232 234 PATH_SEPARATOR = @PATH_SEPARATOR@ 235 +PGCONFIG = @PGCONFIG@ 236 +PG_CFLAGS = @PG_CFLAGS@ 237 +PG_LDFLAGS = @PG_LDFLAGS@ 238 +PG_LIB = @PG_LIB@ 233 239 PKG_CONFIG = @PKG_CONFIG@ 234 240 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ 235 241 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ 236 242 RANLIB = @RANLIB@ 237 243 SED = @SED@ 238 244 SET_MAKE = @SET_MAKE@ 239 245 SHELL = @SHELL@
Added helpgen/READ_ME.txt.
1 +About "helpgen" 2 +=============== 3 +this is a small C tool intended to simplify and make easy the process to 4 +tempestively update the HTML doc internally supplied by "spatialite_gui" 5 +about SpatiaLite and Rasterlite2 SQL functions. 6 + 7 + 8 +How it works 9 +============ 10 +1. "helpgen" will parse and rearrange the two HTML pages supporting 11 + each library, merging both into a single HTML page. 12 +2. this merged HTML page will then be compressed using the well known 13 + ZIP/DEFLATE algorithm (zlib). 14 +3. then the ZIP binary payload will be transformed into many short text 15 + strings encoded as hexadecimal bytes. 16 +4. and finally a C++ source will be autogenerated; this C++ source is 17 + intended to be compiled and linked within "spatialite_gui", and its 18 + specific scope is the one to "inject" into the executable all the 19 + above mentioned hexadecimal strings representing the zipped HTML doc. 20 +5. each time that the user will request "spatialite_gui" to show the 21 + internal HTML doc the "MyMain::GetHelp()" function defined into the 22 + autogenerated C++ source, the zipped payload will be decompressed 23 + and the HTML page will be shown on the screen. 24 + 25 + 26 +Using "helpgen" 27 +=============== 28 +a. build the "helpgen" executable (see below). 29 +b. prepare the SpatiaLite's own HTML page; this usually means copying 30 + "spatialite-sql-latest.html" from libspatialite's sources to 31 + ./spatialite-sql-latest.html 32 +c. prepare the RasterLite2's own HTML page; this usually means 33 + downloading from the Fossil Wiki: 34 + https://www.gaia-gis.it/fossil/librasterlite2/wiki?name=sql_reference_list 35 + the downloaded HTML page must be saved as ./rl2-sql-latest.html 36 +d. now you are ready to execute "helpgen" (no args): 37 + ./helpgen 38 +e. the "HtmlHelp.cpp" C++ source will be autogenerated. 39 +f. copy "HtmlHelp.cpp" into the spatialite_gui's sources and rebuild; 40 + the spatialite_gui executable will now contain the latest version 41 + of the HTML doc. 42 + 43 + 44 +Building "helpgen" 45 +================== 46 +You just have to directly invoke "gcc". 47 + 48 +on Linux and other *nix systems: 49 +gcc helpgen.c -o helpgen -lz 50 + 51 + 52 +on Windows using MSYS and MinGW: 53 +gcc helpgen.c -o helpgen.exe -lz
Added helpgen/helpgen.c.
1 +/* 2 +/ helpgen 3 +/ 4 +/ a tool autogenerating C++ code for SpatiaLite_GUI 5 +/ [HTML doc] 6 +/ 7 +/ version 1.0, 2017 August 4 8 +/ 9 +/ Author: Sandro Furieri a.furieri@lqt.it 10 +/ 11 +/ Copyright (C) 2017 Alessandro Furieri 12 +/ 13 +/ This program is free software: you can redistribute it and/or modify 14 +/ it under the terms of the GNU General Public License as published by 15 +/ the Free Software Foundation, either version 3 of the License, or 16 +/ (at your option) any later version. 17 +/ 18 +/ This program is distributed in the hope that it will be useful, 19 +/ but WITHOUT ANY WARRANTY; without even the implied warranty of 20 +/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 +/ GNU General Public License for more details. 22 +/ 23 +/ You should have received a copy of the GNU General Public License 24 +/ along with this program. If not, see <http://www.gnu.org/licenses/>. 25 +/ 26 +*/ 27 + 28 +#include <stdlib.h> 29 +#include <stdio.h> 30 +#include <string.h> 31 + 32 +#include <zlib.h> 33 + 34 +/* 35 +static void 36 +do_debug (const char *html, int len) 37 +{ 38 + fwrite (html, 1, len, stdout); 39 +} 40 +*/ 41 + 42 +static int 43 +load_splite (FILE * in, char **buf, int *buf_len) 44 +{ 45 +/* loading in memory "./spatialite-sql-latest.html" */ 46 + char *mem = NULL; 47 + int size; 48 + if (fseek (in, 0, SEEK_END) < 0) 49 + { 50 + fprintf (stderr, 51 + "ERROR: fseek failure on \"./spatialite-sql-latest.html/\"\n"); 52 + goto stop; 53 + } 54 + size = ftell (in); 55 + rewind (in); 56 + mem = malloc (size); 57 + if (mem == NULL) 58 + { 59 + fprintf (stderr, "ERROR: insufficient memory\n"); 60 + goto stop; 61 + } 62 + if (fread (mem, 1, size, in) != (unsigned int) size) 63 + { 64 + fprintf (stderr, 65 + "ERROR: fread failure on \"./spatialite-sql-latest.html/\"\n"); 66 + goto stop; 67 + } 68 + *buf = mem; 69 + *buf_len = size; 70 + return 1; 71 + 72 + stop: 73 + *buf = NULL; 74 + *buf_len = 0; 75 + return 0; 76 +} 77 + 78 +static int 79 +load_rl2 (FILE * in, char **buf, int *buf_len) 80 +{ 81 +/* loading in memory "./rl2-sql-latest.html" */ 82 + char *mem = NULL; 83 + int size; 84 + if (fseek (in, 0, SEEK_END) < 0) 85 + { 86 + fprintf (stderr, 87 + "ERROR: fseek failure on \"./rl2-sql-latest.html/\"\n"); 88 + goto stop; 89 + } 90 + size = ftell (in); 91 + rewind (in); 92 + mem = malloc (size); 93 + if (mem == NULL) 94 + { 95 + fprintf (stderr, "ERROR: insufficient memory\n"); 96 + goto stop; 97 + } 98 + if (fread (mem, 1, size, in) != (unsigned int) size) 99 + { 100 + fprintf (stderr, 101 + "ERROR: fread failure on \"./rl2-sql-latest.html/\"\n"); 102 + goto stop; 103 + } 104 + *buf = mem; 105 + *buf_len = size; 106 + return 1; 107 + 108 + stop: 109 + *buf = NULL; 110 + *buf_len = 0; 111 + return 0; 112 +} 113 + 114 +static int 115 +check_back (const char *buf) 116 +{ 117 + const char *p = buf; 118 + while (1) 119 + { 120 + if (*p == ' ' || *p == '\t') 121 + { 122 + /* skipping leading blanks */ 123 + p++; 124 + continue; 125 + } 126 + break; 127 + } 128 + if (strcmp 129 + (p, 130 + "<a href=\"https://www.gaia-gis.it/fossil/libspatialite\">back</a>") == 131 + 0) 132 + return 1; 133 + return 0; 134 +} 135 + 136 +static int 137 +check_end (const char *buf) 138 +{ 139 + const char *p = buf; 140 + while (1) 141 + { 142 + if (*p == ' ' || *p == '\t') 143 + { 144 + /* skipping leading blanks */ 145 + p++; 146 + continue; 147 + } 148 + break; 149 + } 150 + if (strncmp (p, "</body>", 7) == 0) 151 + return 1; 152 + return 0; 153 +} 154 + 155 +static void 156 +check_toc (char *buf) 157 +{ 158 + int i; 159 + char title[256]; 160 + const char *str; 161 + char *p = buf; 162 + while (1) 163 + { 164 + if (*p == ' ' || *p == '\t') 165 + { 166 + /* skipping leading blanks */ 167 + p++; 168 + continue; 169 + } 170 + break; 171 + } 172 + if (strncmp (p, "<h2>SpatiaLite ", 15) != 0) 173 + return; 174 + 175 + strcpy (title, p + 4); 176 + *(title + strlen (title) - 5) = '\0'; 177 + p = buf; 178 + 179 + str = "<h1>Table of Contents</h1>\n<ul>\n"; 180 + for (i = 0; i < (int) strlen (str); i++) 181 + *p++ = str[i]; 182 + 183 + str = "<li><a href=\"#spatialite_sql\">SpatiaLite SQL functions</a></li>\n"; 184 + for (i = 0; i < (int) strlen (str); i++) 185 + *p++ = str[i]; 186 + 187 + str = 188 + "<li><a href=\"#rasterlite2_sql\">RasterLite2 SQL functions</a></li>\n"; 189 + for (i = 0; i < (int) strlen (str); i++) 190 + *p++ = str[i]; 191 + 192 + str = "</ul><br><hr>\n<h2><a name=\"spatialite_sql\">"; 193 + for (i = 0; i < (int) strlen (str); i++) 194 + *p++ = str[i]; 195 + 196 + str = title; 197 + for (i = 0; i < (int) strlen (str); i++) 198 + *p++ = str[i]; 199 + 200 + str = "</a></h2>"; 201 + for (i = 0; i < (int) strlen (str); i++) 202 + *p++ = str[i]; 203 + 204 + *p = '\0'; 205 +} 206 + 207 +static void 208 +clean_splite (char **buf, int *buf_len) 209 +{ 210 +/* cleaning "./spatialite-sql-latest.html" */ 211 + const char *p_in = *buf; 212 + int in_len = *buf_len; 213 + char *out = malloc (in_len + 1024); 214 + char *p_out = out; 215 + char line[2048]; 216 + char *p_line = line; 217 + int i; 218 + 219 + for (i = 0; i < in_len; i++) 220 + { 221 + if (*p_in == '\r') 222 + { 223 + /* skipping RETURN chars */ 224 + p_in++; 225 + continue; 226 + } 227 + if (*p_in == '\n') 228 + { 229 + /* found a NEWLINE char */ 230 + int skip = 0; 231 + *p_line = '\0'; 232 + check_toc (line); 233 + if (check_back (line)) 234 + skip = 1; 235 + if (check_end (line)) 236 + skip = 1; 237 + if (!skip) 238 + { 239 + /* copying the current line into the output buffer */ 240 + unsigned int x; 241 + for (x = 0; x < strlen (line); x++) 242 + *p_out++ = line[x]; 243 + *p_out++ = '\n'; 244 + } 245 + p_line = line; 246 + p_in++; 247 + continue; 248 + } 249 + *p_line++ = *p_in++; 250 + } 251 + free (*buf); 252 + *buf = out; 253 + *buf_len = p_out - out; 254 +} 255 + 256 +static int 257 +check_start_rl2 (char *buf) 258 +{ 259 + int i; 260 + char title[256]; 261 + const char *str; 262 + char *p = buf; 263 + while (1) 264 + { 265 + if (*p == ' ' || *p == '\t') 266 + { 267 + /* skipping leading blanks */ 268 + p++; 269 + continue; 270 + } 271 + break; 272 + } 273 + if (strcmp (p, "<h1>RasterLite2 SQL functions - reference list</h1>") != 0) 274 + return 0; 275 + 276 + strcpy (title, p + 4); 277 + *(title + strlen (title) - 5) = '\0'; 278 + p = buf; 279 + 280 + str = title; 281 + for (i = 0; i < (int) strlen (str); i++) 282 + *p++ = str[i]; 283 + 284 + str = "</a></h1>"; 285 + for (i = 0; i < (int) strlen (str); i++) 286 + *p++ = str[i]; 287 + 288 + *p = '\0'; 289 + 290 + return 1; 291 +} 292 + 293 +static int 294 +check_end_rl2 (const char *buf) 295 +{ 296 + const char *p = buf; 297 + while (1) 298 + { 299 + if (*p == ' ' || *p == '\t') 300 + { 301 + /* skipping leading blanks */ 302 + p++; 303 + continue; 304 + } 305 + break; 306 + } 307 + if (strcmp 308 + (p, 309 + "Back to <a href=\"https://www.gaia-gis.it/fossil/librasterlite2/wiki?name=rasterlite2-doc\">RasterLite2 doc index</a>") 310 + == 0) 311 + return 1; 312 + return 0; 313 +} 314 + 315 +static void 316 +sanitize_tags (char *line) 317 +{ 318 + char *p; 319 + while (1) 320 + { 321 + p = strstr (line, "<br />"); 322 + if (p != NULL) 323 + memcpy (p, "<br> ", 6); 324 + else 325 + break; 326 + } 327 + while (1) 328 + { 329 + p = strstr (line, "<hr />"); 330 + if (p != NULL) 331 + memcpy (p, "<hr> ", 6); 332 + else 333 + break; 334 + } 335 +} 336 + 337 +static void 338 +clean_rl2 (char **buf, int *buf_len) 339 +{ 340 +/* cleaning "./rl2-sql-latest.html" */ 341 + const char *p_in = *buf; 342 + int in_len = *buf_len; 343 + char *out = malloc (in_len + 1024); 344 + char *p_out = out; 345 + char line[2048]; 346 + char *p_line = line; 347 + int i; 348 + int start = 0; 349 + int end = 0; 350 + const char *header = 351 + "<br><br><br><br><br><br>\n<h1><a name=\"rasterlite2_sql\">"; 352 + const char *footer = "</body></html>\n"; 353 + 354 + for (i = 0; i < in_len; i++) 355 + { 356 + if (*p_in == '\r') 357 + { 358 + /* skipping RETURN chars */ 359 + p_in++; 360 + continue; 361 + } 362 + if (*p_in == '\n') 363 + { 364 + /* found a NEWLINE char */ 365 + *p_line = '\0'; 366 + if (check_start_rl2 (line)) 367 + { 368 + int x; 369 + start = 1; 370 + for (x = 0; x < (int) strlen (header); x++) 371 + *p_out++ = header[x]; 372 + } 373 + if (check_end_rl2 (line)) 374 + end = 1; 375 + sanitize_tags (line); 376 + if (start && !end) 377 + { 378 + /* copying the current line into the output buffer */ 379 + unsigned int x; 380 + for (x = 0; x < strlen (line); x++) 381 + *p_out++ = line[x]; 382 + *p_out++ = '\n'; 383 + } 384 + p_line = line; 385 + p_in++; 386 + continue; 387 + } 388 + *p_line++ = *p_in++; 389 + } 390 + free (*buf); 391 + for (i = 0; i < (int) strlen (footer); i++) 392 + *p_out++ = footer[i]; 393 + *buf = out; 394 + *buf_len = p_out - out; 395 +} 396 + 397 +static int 398 +zip_compress (const char *html, int len_html, unsigned char **zip, int *len_zip) 399 +{ 400 +/* compressing the HTML page (DEFLATE - ZIP) */ 401 + int ret; 402 + uLong zLen = len_html - 1; 403 + unsigned char *zip_buf = malloc (zLen); 404 + if (zip_buf == NULL) 405 + { 406 + fprintf (stderr, "ERROR: insufficient memory\n"); 407 + goto error; 408 + } 409 + ret = compress (zip_buf, &zLen, (const Bytef *) html, (uLong) len_html); 410 + if (ret == Z_OK) 411 + { 412 + *zip = zip_buf; 413 + *len_zip = zLen; 414 + return 1; 415 + } 416 + else if (ret == Z_BUF_ERROR) 417 + fprintf (stderr, "ERROR: ZIP compression causes inflation\n"); 418 + else 419 + fprintf (stderr, "ERROR: internal ZIP codec failure (compression)\n"); 420 + 421 + error: 422 + *zip = NULL; 423 + *len_zip = 0; 424 + return 0; 425 +} 426 + 427 +static void 428 +print_source (FILE * out, int len_html, unsigned char *zip, int len_zip) 429 +{ 430 +/* printing the C++ source file */ 431 + int i; 432 + int j; 433 + int lim; 434 + 435 + fprintf (out, "/*\n/ HtmlHelp.cpp\n"); 436 + fprintf (out, "/ spatialite_gui HTML Help generator\n/\n"); 437 + fprintf (out, "/ This code was autogenerated by \"helpgen\" on xxxxx\n/\n"); 438 + fprintf (out, "/ Author: Sandro Furieri a.furieri@lqt.it\n/\n"); 439 + fprintf (out, "/ Copyright (C) 2017 Alessandro Furieri\n/\n"); 440 + fprintf (out, 441 + "/ This program is free software: you can redistribute it and/or modify\n"); 442 + fprintf (out, 443 + "/ it under the terms of the GNU General Public License as published by\n"); 444 + fprintf (out, 445 + "/ the Free Software Foundation, either version 3 of the License, or\n"); 446 + fprintf (out, "/ (at your option) any later version.\n/\n"); 447 + fprintf (out, 448 + "/ This program is distributed in the hope that it will be useful,\n"); 449 + fprintf (out, 450 + "/ but WITHOUT ANY WARRANTY; without even the implied warranty of\n"); 451 + fprintf (out, 452 + "/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"); 453 + fprintf (out, "/ GNU General Public License for more details.\n/\n"); 454 + fprintf (out, 455 + "/ You should have received a copy of the GNU General Public License\n"); 456 + fprintf (out, 457 + "/ along with this program. If not, see <http://www.gnu.org/licenses/>.\n/\n*/\n\n"); 458 + fprintf (out, "#include \"Classdef.h\"\n\n"); 459 + fprintf (out, "#include <zlib.h>\n\n"); 460 + fprintf (out, "void MyFrame::GetHelp(wxString & html_text)\n{\n"); 461 + fprintf (out, 462 + "//\n// return the HTML Help Page from the ZIP compressed data\n//\n"); 463 + fprintf (out, "\tunsigned char *zip_buf = NULL;\n"); 464 + fprintf (out, "\tint uncompressed_len = %d;\n", len_html); 465 + fprintf (out, "\tint compressed_len = %d;\n", len_zip); 466 + fprintf (out, "\tuLong inLen = compressed_len;\n"); 467 + fprintf (out, "\tuLong outLen = uncompressed_len;\n"); 468 + fprintf (out, "\tconst Bytef *in;\n"); 469 + fprintf (out, "\tBytef *out;\n"); 470 + fprintf (out, "\tchar *html = NULL;\n\n"); 471 + 472 + fprintf (out, "// allocating the ZIP compressed buffer\n"); 473 + fprintf (out, "\tzip_buf = (unsigned char *)malloc(uncompressed_len);\n"); 474 + fprintf (out, "\tif (zip_buf == NULL)\n\t\tgoto error;\n\n"); 475 + 476 + fprintf (out, "// feeding the ZIP compressed buffer\n"); 477 + for (i = 0; i < len_zip; i += 25) 478 + { 479 + fprintf (out, "\tFeedZipHtml (zip_buf, %d, \"", i); 480 + lim = 25; 481 + if (i + lim > len_zip) 482 + lim = len_zip - i; 483 + for (j = 0; j < lim; j++) 484 + fprintf (out, "%02x", *(zip + i + j)); 485 + fprintf (out, "\");\n"); 486 + } 487 + fprintf (out, "\n// uncompressing the ZIP payload\n"); 488 + fprintf (out, "\tin = zip_buf;\n"); 489 + fprintf (out, "\thtml = (char *)malloc (uncompressed_len + 1);\n"); 490 + fprintf (out, "\tif (html == NULL)\n\t\tgoto error;\n"); 491 + fprintf (out, "\tout = (Bytef *)html;\n"); 492 + fprintf (out, "\tif (uncompress (out, &outLen, in, inLen) != Z_OK)\n"); 493 + fprintf (out, "\t\tgoto error;\n"); 494 + fprintf (out, "\t*(html + uncompressed_len) = '\\0';\n"); 495 + fprintf (out, "\tfree(zip_buf);\n"); 496 + fprintf (out, "\thtml_text = wxString::FromUTF8(html);\n"); 497 + fprintf (out, "\tfree(html);\n"); 498 + fprintf (out, "\treturn;\n\nerror:\n"); 499 + fprintf (out, "\tif (zip_buf != NULL)\n\t\tfree(zip_buf);\n"); 500 + fprintf (out, "\tif (html != NULL)\n\t\tfree(html);\n"); 501 + fprintf (out, "\thtml_text = wxT(\"<html><body><h1>Sorry, HTML Help " 502 + "is currently unavailable.</h1></body></html>\");\n"); 503 + fprintf (out, "}\n"); 504 +} 505 + 506 +int 507 +main (void) 508 +{ 509 +/* 510 +/ 511 +/ Please note: no args are supported !!! 512 +/ 513 +/ we'll expect to find two input files respectively named: 514 +/ ./spatialite-sql-latest.html 515 +/ ./rl2-sql-latest.html 516 +/ 517 +/ the C++ code will be generated into: ./HtmlHelp.cpp 518 +/ 519 +*/ 520 + FILE *fl_splite = NULL; 521 + FILE *fl_rl2 = NULL; 522 + FILE *fl_out = NULL; 523 + char *p_splite = NULL; 524 + int len_splite = 0; 525 + char *p_rl2 = NULL; 526 + int len_rl2 = 0; 527 + char *html = NULL; 528 + int len_html = 0; 529 + unsigned char *zip = NULL; 530 + int len_zip = 0; 531 + 532 +/* opening input and output files */ 533 + fl_splite = fopen ("./spatialite-sql-latest.html", "rb"); 534 + if (fl_splite == NULL) 535 + { 536 + fprintf (stderr, 537 + "ERROR: unable to open the \"./spatialite-sql-latest.html\" input file\n"); 538 + goto stop; 539 + } 540 + fl_rl2 = fopen ("./rl2-sql-latest.html", "rb"); 541 + if (fl_rl2 == NULL) 542 + { 543 + fprintf (stderr, 544 + "ERROR: unable to open the \"./rl2-sql-latest.html\" input file\n"); 545 + goto stop; 546 + } 547 + fl_out = fopen ("./HtmlHelp.cpp", "wb"); 548 + if (fl_out == NULL) 549 + { 550 + fprintf (stderr, 551 + "ERROR: unable to open/create the \"./HtmlHelp.cpp\" output file\n"); 552 + goto stop; 553 + } 554 + 555 +/* loading and arranging input files */ 556 + if (!load_splite (fl_splite, &p_splite, &len_splite)) 557 + { 558 + fprintf (stderr, 559 + "ERROR: unable to load the \"./spatialite-sql-latest.html\" input file\n"); 560 + goto stop; 561 + } 562 + if (!load_rl2 (fl_rl2, &p_rl2, &len_rl2)) 563 + { 564 + fprintf (stderr, 565 + "ERROR: unable to load the \"./rl2-sql-latest.html\" input file\n"); 566 + goto stop; 567 + } 568 + clean_splite (&p_splite, &len_splite); 569 + clean_rl2 (&p_rl2, &len_rl2); 570 + 571 +/* creating in memory the uncompressed HTML page */ 572 + len_html = len_splite + len_rl2; 573 + html = malloc (len_html); 574 + if (html == NULL) 575 + { 576 + fprintf (stderr, "ERROR: insufficient memory\n"); 577 + goto stop; 578 + } 579 + memcpy (html, p_splite, len_splite); 580 + memcpy (html + len_splite, p_rl2, len_rl2); 581 + free (p_splite); 582 + p_splite = NULL; 583 + free (p_rl2); 584 + p_rl2 = NULL; 585 + 586 +/* compressing the HTML page */ 587 + if (!zip_compress (html, len_html, &zip, &len_zip)) 588 + { 589 + fprintf (stderr, "ERROR: unable to DEFLATE\n"); 590 + goto stop; 591 + } 592 + 593 +/* autogenerating the C++ source */ 594 + print_source (fl_out, len_html, zip, len_zip); 595 + 596 +/* end - cleanup */ 597 + stop: 598 + if (zip != NULL) 599 + free (zip); 600 + if (html != NULL) 601 + free (html); 602 + if (p_splite != NULL) 603 + free (p_splite); 604 + if (p_rl2 != NULL) 605 + free (p_rl2); 606 + if (fl_splite) 607 + fclose (fl_splite); 608 + if (fl_rl2) 609 + fclose (fl_rl2); 610 + if (fl_out) 611 + fclose (fl_out); 612 + return 0; 613 +}
Changes to icons/Makefile.am.
20 20 icon_map.xpm crosshair.xpm wms_off.xpm vector_off.xpm \ 21 21 coverage_off.xpm identify.xpm zoom_in.xpm zoom_out.xpm \ 22 22 map_table.xpm pan.xpm printer.xpm map_root.xpm map_go.xpm \ 23 23 map_edit.xpm map_add.xpm linestrings_on.xpm linestrings_off.xpm \ 24 24 points_on.xpm points_off.xpm polygons_on.xpm polygons_off.xpm \ 25 25 topo_geo_off.xpm topo_net_off.xpm dustbin.xpm gpkgtable.xpm \ 26 26 gpkgvtable.xpm gpkggeom.xpm virtgpkg.xpm gpkg_spatialidx.xpm \ 27 - red_light.xpm green_light.xpm yellow_light.xpm map_magnify.xpm 27 + red_light.xpm green_light.xpm yellow_light.xpm map_magnify.xpm \ 28 + postgres.xpm postgres_schema.xpm postgres_table.xpm \ 29 + postgres_view.xpm
Changes to icons/Makefile.in.
1 -# Makefile.in generated by automake 1.15 from Makefile.am. 1 +# Makefile.in generated by automake 1.15.1 from Makefile.am. 2 2 # @configure_input@ 3 3 4 -# Copyright (C) 1994-2014 Free Software Foundation, Inc. 4 +# Copyright (C) 1994-2017 Free Software Foundation, Inc. 5 5 6 6 # This Makefile.in is free software; the Free Software Foundation 7 7 # gives unlimited permission to copy and/or distribute it, 8 8 # with or without modifications, as long as this notice is preserved. 9 9 10 10 # This program is distributed in the hope that it will be useful, 11 11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without ................................................................................ 170 170 LIBOBJS = @LIBOBJS@ 171 171 LIBRASTERLITE2_CFLAGS = @LIBRASTERLITE2_CFLAGS@ 172 172 LIBRASTERLITE2_LIBS = @LIBRASTERLITE2_LIBS@ 173 173 LIBS = @LIBS@ 174 174 LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@ 175 175 LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@ 176 176 LIBTOOL = @LIBTOOL@ 177 +LIBVIRTUALPG_CFLAGS = @LIBVIRTUALPG_CFLAGS@ 178 +LIBVIRTUALPG_LIBS = @LIBVIRTUALPG_LIBS@ 177 179 LIBWEBP_CFLAGS = @LIBWEBP_CFLAGS@ 178 180 LIBWEBP_LIBS = @LIBWEBP_LIBS@ 179 181 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ 180 182 LIBXML2_LIBS = @LIBXML2_LIBS@ 181 183 LIPO = @LIPO@ 182 184 LN_S = @LN_S@ 183 185 LTLIBOBJS = @LTLIBOBJS@ ................................................................................ 196 198 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 197 199 PACKAGE_NAME = @PACKAGE_NAME@ 198 200 PACKAGE_STRING = @PACKAGE_STRING@ 199 201 PACKAGE_TARNAME = @PACKAGE_TARNAME@ 200 202 PACKAGE_URL = @PACKAGE_URL@ 201 203 PACKAGE_VERSION = @PACKAGE_VERSION@ 202 204 PATH_SEPARATOR = @PATH_SEPARATOR@ 205 +PGCONFIG = @PGCONFIG@ 206 +PG_CFLAGS = @PG_CFLAGS@ 207 +PG_LDFLAGS = @PG_LDFLAGS@ 208 +PG_LIB = @PG_LIB@ 203 209 PKG_CONFIG = @PKG_CONFIG@ 204 210 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ 205 211 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ 206 212 RANLIB = @RANLIB@ 207 213 SED = @SED@ 208 214 SET_MAKE = @SET_MAKE@ 209 215 SHELL = @SHELL@ ................................................................................ 285 291 icon_map.xpm crosshair.xpm wms_off.xpm vector_off.xpm \ 286 292 coverage_off.xpm identify.xpm zoom_in.xpm zoom_out.xpm \ 287 293 map_table.xpm pan.xpm printer.xpm map_root.xpm map_go.xpm \ 288 294 map_edit.xpm map_add.xpm linestrings_on.xpm linestrings_off.xpm \ 289 295 points_on.xpm points_off.xpm polygons_on.xpm polygons_off.xpm \ 290 296 topo_geo_off.xpm topo_net_off.xpm dustbin.xpm gpkgtable.xpm \ 291 297 gpkgvtable.xpm gpkggeom.xpm virtgpkg.xpm gpkg_spatialidx.xpm \ 292 - red_light.xpm green_light.xpm yellow_light.xpm map_magnify.xpm 298 + red_light.xpm green_light.xpm yellow_light.xpm map_magnify.xpm \ 299 + postgres.xpm postgres_schema.xpm postgres_table.xpm \ 300 + postgres_view.xpm 293 301 294 302 all: all-am 295 303 296 304 .SUFFIXES: 297 305 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) 298 306 @for dep in $?; do \ 299 307 case '$(am__configure_deps)' in \
Added icons/postgres.xpm.
1 +/* XPM */ 2 +static const char * postgres_xpm[] = { 3 +"16 16 60 1", 4 +" c None", 5 +". c #EEF2F4", 6 +"+ c #E6EBEE", 7 +"@ c #B6C5C9", 8 +"# c #AFBFC8", 9 +"$ c #91ABB7", 10 +"% c #39638A", 11 +"& c #346483", 12 +"* c #93A5B4", 13 +"= c #8FAAB4", 14 +"- c #396485", 15 +"; c #6B8EA1", 16 +"> c #93B5C4", 17 +", c #9AADBD", 18 +"' c #D5DFE5", 19 +") c #346391", 20 +"! c #35638C", 21 +"~ c #45697F", 22 +"{ c #4B708A", 23 +"] c #BCC9CF", 24 +"^ c #7596AD", 25 +"/ c #5D7D9E", 26 +"( c #2F628E", 27 +"_ c #7794A5", 28 +": c #6184A2", 29 +"< c #9BB8C4", 30 +"[ c #8CACC0", 31 +"} c #7D9DB2", 32 +"| c #8CA9BD", 33 +"1 c #A9BEC7", 34 +"2 c #C3D4DC", 35 +"3 c #C2CFD3", 36 +"4 c #95B2BC", 37 +"5 c #608592", 38 +"6 c #85A9BD", 39 +"7 c #416589", 40 +"8 c #7CA1B4", 41 +"9 c #5D809C", 42 +"0 c #6E96AA", 43 +"a c #577688", 44 +"b c #8DA6B8", 45 +"c c #466D89", 46 +"d c #3F6890", 47 +"e c #BAC5CB", 48 +"f c #D4DCDF", 49 +"g c #8BA4B6", 50 +"h c #ECEEEE", 51 +"i c #D9E1E3", 52 +"j c #8BA5AD", 53 +"k c #567698", 54 +"l c #8495A3", 55 +"m c #C1C6CA", 56 +"n c #2E688B", 57 +"o c #E7EDF1", 58 +"p c #5E81A3", 59 +"q c #4A7299", 60 +"r c #61839C", 61 +"s c #486B8A", 62 +"t c #597C96", 63 +"u c #D7E1E6", 64 +" .. .+ @#. ", 65 +" $%&&*=-&-;>&-, ", 66 +"'-)!~>&!!!!{$!-]", 67 +"$)!!^/(!%!)!_:)<", 68 +",!))[><}!)!|1<!2", 69 +"3!)!>~^4!!%456! ", 70 +".!!)[%!^7)->{8; ", 71 +" 9)!>&!}%))0a$' ", 72 +" b)!|c&>!!)d1e ", 73 +" f-!c]g4!!)!=h ", 74 +" g!] ijk)(!1lm ", 75 +" 2 'j@/)n%o ", 76 +" p)(d ", 77 +" :!(q ", 78 +" _!)r ", 79 +" 3stu "};
Added icons/postgres_schema.xpm.
1 +/* XPM */ 2 +static const char * postgres_schema_xpm[] = { 3 +"16 16 82 1", 4 +" g None", 5 +". g #80BABA", 6 +"+ g #80B8B8", 7 +"@ g #80B7B7", 8 +"# g #80B6B6", 9 +"$ g #80B4B4", 10 +"% g #80B3B3", 11 +"& g #80BBBB", 12 +"* g #80D0D0", 13 +"= g #80E8E8", 14 +"- g #80F3F3", 15 +"; g #80FDFD", 16 +"> g #80FCFC", 17 +", g #80EDED", 18 +"' g #80E0E0", 19 +") g #80C2C2", 20 +"! g #80ADAD", 21 +"~ g #80E1E1", 22 +"{ g #80FEFE", 23 +"] g #80FFFF", 24 +"^ g #80FBFB", 25 +"/ g #80CFCF", 26 +"( g #80A9A9", 27 +"_ g #80B9B9", 28 +": g #80F8F8", 29 +"< g #80EAEA", 30 +"[ g #80A7A7", 31 +"} g #80F7F7", 32 +"| g #80E7E7", 33 +"1 g #80EFEF", 34 +"2 g #80F6F6", 35 +"3 g #80FAFA", 36 +"4 g #80F0F0", 37 +"5 g #80DEDE", 38 +"6 g #80C3C3", 39 +"7 g #80E6E6", 40 +"8 g #80A5A5", 41 +"9 g #80B5B5", 42 +"0 g #80EBEB", 43 +"a g #80D6D6", 44 +"b g #80D5D5", 45 +"c g #80D1D1", 46 +"d g #80BCBC", 47 +"e g #80C0C0", 48 +"f g #80E5E5", 49 +"g g #80A3A3", 50 +"h g #80F5F5", 51 +"i g #80EEEE", 52 +"j g #80E2E2", 53 +"k g #80CDCD", 54 +"l g #80E3E3", 55 +"m g #80A0A0", 56 +"n g #80B2B2", 57 +"o g #80F4F4", 58 +"p g #80DDDD", 59 +"q g #80C9C9", 60 +"r g #80BDBD", 61 +"s g #80BFBF", 62 +"t g #809E9E", 63 +"u g #80B0B0", 64 +"v g #80D9D9", 65 +"w g #80DBDB", 66 +"x g #80C4C4", 67 +"y g #809B9B", 68 +"z g #80AEAE", 69 +"A g #80F2F2", 70 +"B g #80D8D8", 71 +"C g #80DCDC", 72 +"D g #809696", 73 +"E g #80ACAC", 74 +"F g #80D4D4", 75 +"G g #80D2D2", 76 +"H g #809090", 77 +"I g #808B8B", 78 +"J g #80CECE", 79 +"K g #808A8A", 80 +"L g #80A1A1", 81 +"M g #809F9F", 82 +"N g #80ABAB", 83 +"O g #809595", 84 +"P g #808D8D", 85 +"Q g #808989", 86 +" ", 87 +" .+@#$% ", 88 +" &*=-;>,')! ", 89 +" .~{]]]]]]^/( ", 90 +" _:{]]]]]]^<[ ", 91 +" @}|12^345678 ", 92 +" 9205abc6defg ", 93 +" $hi7j7~k))lm ", 94 +" no<~pl5qrsjt ", 95 +" u-|pv'wx+&~y ", 96 +" zAjBbCBe%@'D ", 97 +" E45FGwasu%5H ", 98 +" (5-wGwaeq7xI ", 99 +" 8J,oho1j.K ", 100 +" LMLN[OPQ ", 101 +" "};
Added icons/postgres_table.xpm.
1 +/* XPM */ 2 +static const char * postgres_table_xpm[] = { 3 +"16 16 100 2", 4 +" c None", 5 +". c #80C1EF", 6 +"+ c #80C0ED", 7 +"@ c #80BEEB", 8 +"# c #80BCEB", 9 +"$ c #80BAE9", 10 +"% c #80B7E7", 11 +"& c #80B5E6", 12 +"* c #80B2E4", 13 +"= c #80AFE2", 14 +"- c #80ACE0", 15 +"; c #80A9DD", 16 +"> c #80A5DC", 17 +", c #80A3DA", 18 +"' c #80C1EE", 19 +") c #80F7FB", 20 +"! c #80A0D7", 21 +"~ c #80BFEC", 22 +"{ c #80D59C", 23 +"] c #80D398", 24 +"^ c #80D094", 25 +"/ c #80CE90", 26 +"( c #80CB8B", 27 +"_ c #80C987", 28 +": c #80C682", 29 +"< c #80C37E", 30 +"[ c #80C17A", 31 +"} c #80BE76", 32 +"| c #809BD4", 33 +"1 c #80BDEB", 34 +"2 c #80FFFF", 35 +"3 c #8097D1", 36 +"4 c #80BAE9", 37 +"5 c #80C3E9", 38 +"6 c #8093CE", 39 +"7 c #80B7E7", 40 +"8 c #80C4E8", 41 +"9 c #80C7E8", 42 +"0 c #80F1F7", 43 +"a c #808FCB", 44 +"b c #80B4E5", 45 +"c c #80F6FA", 46 +"d c #80C6E9", 47 +"e c #80C6E9", 48 +"f c #80C7EA", 49 +"g c #80C7E9", 50 +"h c #80C9E9", 51 +"i c #80C9E9", 52 +"j c #80C8E8", 53 +"k c #80CCE8", 54 +"l c #80E7F2", 55 +"m c #808AC8", 56 +"n c #80B1E3", 57 +"o c #80F6FA", 58 +"p c #80C9EA", 59 +"q c #80C9EA", 60 +"r c #80E5F1", 61 +"s c #8086C6", 62 +"t c #80AEE1", 63 +"u c #80F4FA", 64 +"v c #80CBEA", 65 +"w c #80CCEA", 66 +"x c #80CEEA", 67 +"y c #80C8E8", 68 +"z c #80E2F0", 69 +"A c #8086C4", 70 +"B c #80AADF", 71 +"C c #80F3F9", 72 +"D c #80D0EB", 73 +"E c #80CFEA", 74 +"F c #80F6FB", 75 +"G c #808DC8", 76 +"H c #80A8DD", 77 +"I c #80D0EB", 78 +"J c #80D1EB", 79 +"K c #80CDEA", 80 +"L c #808AC6", 81 +"M c #80A4D9", 82 +"N c #80F3F9", 83 +"O c #80D2EB", 84 +"P c #80D3EB", 85 +"Q c #80C7EA", 86 +"R c #808CC6", 87 +"S c #80A1D7", 88 +"T c #80F2F8", 89 +"U c #80F0F7", 90 +"V c #80EDF6", 91 +"W c #80EAF4", 92 +"X c #80E7F3", 93 +"Y c #80E4F1", 94 +"Z c #808AC5", 95 +"` c #809ED6", 96 +" . c #8099D3", 97 +".. c #8096D1", 98 +"+. c #8092CE", 99 +"@. c #808ECB", 100 +"#. c #808AC9", 101 +"$. c #8087C7", 102 +"%. c #8084C3", 103 +"&. c #8077BB", 104 +" ", 105 +" . + @ # $ % & * = - ; > , ", 106 +" ' ) ) ) ) ) ) ) ) ) ) ) ) ! ", 107 +" ~ ) { ] ^ / ( _ : < [ } ) | ", 108 +" 1 ) 2 2 2 2 2 2 2 2 2 2 ) 3 ", 109 +" 4 ) 5 5 5 5 5 5 5 5 5 5 ) 6 ", 110 +" 7 ) 5 2 8 2 2 2 9 2 2 2 0 a ", 111 +" b c d e f g h i 9 i j k l m ", 112 +" n o p 2 q 2 2 2 9 2 2 2 r s ", 113 +" t u v w w w w x 9 9 j y z A ", 114 +" B C x 2 D 2 2 2 E F 2 2 z G ", 115 +" H C I D D D D J K K K K z L ", 116 +" M N O 2 P 2 2 2 Q 2 2 2 z R ", 117 +" S T U V W X Y z z z z z z Z ", 118 +" ` ...+.@.#.$.%.%.%.%.%.%.&. ", 119 +" "};
Added icons/postgres_view.xpm.
1 +/* XPM */ 2 +static const char * postgres_view_xpm[] = { 3 +"16 16 132 2", 4 +" c None", 5 +". c #80B9B9", 6 +"+ c #80B7B7", 7 +"@ c #80B5B5", 8 +"# c #80B2B2", 9 +"$ c #80B0B0", 10 +"% c #80BABA", 11 +"& c #80D6D6", 12 +"* c #80EDED", 13 +"= c #80F9F9", 14 +"- c #80FBFB", 15 +"; c #80F0F0", 16 +"> c #80D9D9", 17 +", c #80ABAB", 18 +"' c #80B8B8", 19 +") c #80F6F6", 20 +"! c #80F4F4", 21 +"~ c #80A8A8", 22 +"{ c #80B7E7", 23 +"] c #80B5E6", 24 +"^ c #80B2E4", 25 +"/ c #80AFE2", 26 +"( c #80ACE0", 27 +"_ c #80A9DD", 28 +": c #80A5DC", 29 +"< c #80A3DA", 30 +"[ c #80B6B6", 31 +"} c #80F2F2", 32 +"| c #80E4E4", 33 +"1 c #80E2E2", 34 +"2 c #80C8C8", 35 +"3 c #80F1F1", 36 +"4 c #80A5A5", 37 +"5 c #80F7FB", 38 +"6 c #80A0D7", 39 +"7 c #80B4B4", 40 +"8 c #80F8F8", 41 +"9 c #80DBDB", 42 +"0 c #80EFEF", 43 +"a c #80D0D0", 44 +"b c #80FFFF", 45 +"c c #80A2A2", 46 +"d c #80CB8B", 47 +"e c #80C987", 48 +"f c #80C682", 49 +"g c #80C37E", 50 +"h c #80C17A", 51 +"i c #80BE76", 52 +"j c #809BD4", 53 +"k c #80B1B1", 54 +"l c #80D5D5", 55 +"m c #80CBCB", 56 +"n c #809E9E", 57 +"o c #8097D1", 58 +"p c #80AEAE", 59 +"q c #80D1D1", 60 +"r c #80ECEC", 61 +"s c #80C5C5", 62 +"t c #80C6C6", 63 +"u c #809A9A", 64 +"v c #80C3E9", 65 +"w c #8093CE", 66 +"x c #80ACAC", 67 +"y c #80FAFA", 68 +"z c #80D7D7", 69 +"A c #80CACA", 70 +"B c #80CFCF", 71 +"C c #809393", 72 +"D c #80C7E8", 73 +"E c #80F1F7", 74 +"F c #808FCB", 75 +"G c #80A9A9", 76 +"H c #80EAEA", 77 +"I c #80959A", 78 +"J c #80C9E9", 79 +"K c #80C9E9", 80 +"L c #80C8E8", 81 +"M c #80CCE8", 82 +"N c #80E7F2", 83 +"O c #808AC8", 84 +"P c #80A4AF", 85 +"Q c #80ABAB", 86 +"R c #80A0A4", 87 +"S c #80A7A7", 88 +"T c #80A7B6", 89 +"U c #80F3F3", 90 +"V c #80E5F1", 91 +"W c #8086C6", 92 +"X c #80ACD8", 93 +"Y c #80DEE3", 94 +"Z c #80BBD2", 95 +"` c #80C2DB", 96 +" . c #80C7E3", 97 +".. c #80CCEA", 98 +"+. c #80CEEA", 99 +"@. c #80C8E8", 100 +"#. c #80E2F0", 101 +"$. c #8086C4", 102 +"%. c #80AADF", 103 +"&. c #80F3F9", 104 +"*. c #80D0EB", 105 +"=. c #80CFEA", 106 +"-. c #80F6FB", 107 +";. c #808DC8", 108 +">. c #80A8DD", 109 +",. c #80D0EB", 110 +"'. c #80D1EB", 111 +"). c #80CDEA", 112 +"!. c #808AC6", 113 +"~. c #80A4D9", 114 +"{. c #80F3F9", 115 +"]. c #80D2EB", 116 +"^. c #80D3EB", 117 +"/. c #80C7EA", 118 +"(. c #808CC6", 119 +"_. c #80A1D7", 120 +":. c #80F2F8", 121 +"<. c #80F0F7", 122 +"[. c #80EDF6", 123 +"}. c #80EAF4", 124 +"|. c #80E7F3", 125 +"1. c #80E4F1", 126 +"2. c #808AC5", 127 +"3. c #809ED6", 128 +"4. c #8099D3", 129 +"5. c #8096D1", 130 +"6. c #8092CE", 131 +"7. c #808ECB", 132 +"8. c #808AC9", 133 +"9. c #8087C7", 134 +"0. c #8084C3", 135 +"a. c #8077BB", 136 +" . + @ # $ ", 137 +"% & * = - ; > , ", 138 +"' ) ! = - ) ) ~ { ] ^ / ( _ : < ", 139 +"[ } > | 1 2 3 4 5 5 5 5 5 5 5 6 ", 140 +"7 8 9 0 a a b c d e f g h i 5 j ", 141 +"k 8 l 0 m m b n b b b b b b 5 o ", 142 +"p 8 q r s t b u v v v v v v 5 w ", 143 +"x y z 1 A B b C b b D b b b E F ", 144 +"G m H ; } r A I J K D K L M N O ", 145 +" P Q R S T U b b D b b b V W ", 146 +" X Y Z ` .....+.D D L @.#.$.", 147 +" %.&.+.b *.b b b =.-.b b #.;.", 148 +" >.&.,.*.*.*.*.'.).).).).#.!.", 149 +" ~.{.].b ^.b b b /.b b b #.(.", 150 +" _.:.<.[.}.|.1.#.#.#.#.#.#.2.", 151 +" 3.4.5.6.7.8.9.0.0.0.0.0.0.a."};
Changes to mac_resource/Makefile.in.
1 -# Makefile.in generated by automake 1.15 from Makefile.am. 1 +# Makefile.in generated by automake 1.15.1 from Makefile.am. 2 2 # @configure_input@ 3 3 4 -# Copyright (C) 1994-2014 Free Software Foundation, Inc. 4 +# Copyright (C) 1994-2017 Free Software Foundation, Inc. 5 5 6 6 # This Makefile.in is free software; the Free Software Foundation 7 7 # gives unlimited permission to copy and/or distribute it, 8 8 # with or without modifications, as long as this notice is preserved. 9 9 10 10 # This program is distributed in the hope that it will be useful, 11 11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without ................................................................................ 170 170 LIBOBJS = @LIBOBJS@ 171 171 LIBRASTERLITE2_CFLAGS = @LIBRASTERLITE2_CFLAGS@ 172 172 LIBRASTERLITE2_LIBS = @LIBRASTERLITE2_LIBS@ 173 173 LIBS = @LIBS@ 174 174 LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@ 175 175 LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@ 176 176 LIBTOOL = @LIBTOOL@ 177 +LIBVIRTUALPG_CFLAGS = @LIBVIRTUALPG_CFLAGS@ 178 +LIBVIRTUALPG_LIBS = @LIBVIRTUALPG_LIBS@ 177 179 LIBWEBP_CFLAGS = @LIBWEBP_CFLAGS@ 178 180 LIBWEBP_LIBS = @LIBWEBP_LIBS@ 179 181 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ 180 182 LIBXML2_LIBS = @LIBXML2_LIBS@ 181 183 LIPO = @LIPO@ 182 184 LN_S = @LN_S@ 183 185 LTLIBOBJS = @LTLIBOBJS@ ................................................................................ 196 198 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 197 199 PACKAGE_NAME = @PACKAGE_NAME@ 198 200 PACKAGE_STRING = @PACKAGE_STRING@ 199 201 PACKAGE_TARNAME = @PACKAGE_TARNAME@ 200 202 PACKAGE_URL = @PACKAGE_URL@ 201 203 PACKAGE_VERSION = @PACKAGE_VERSION@ 202 204 PATH_SEPARATOR = @PATH_SEPARATOR@ 205 +PGCONFIG = @PGCONFIG@ 206 +PG_CFLAGS = @PG_CFLAGS@ 207 +PG_LDFLAGS = @PG_LDFLAGS@ 208 +PG_LIB = @PG_LIB@ 203 209 PKG_CONFIG = @PKG_CONFIG@ 204 210 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ 205 211 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ 206 212 RANLIB = @RANLIB@ 207 213 SED = @SED@ 208 214 SET_MAKE = @SET_MAKE@ 209 215 SHELL = @SHELL@
Changes to win_resource/Makefile.in.
1 -# Makefile.in generated by automake 1.15 from Makefile.am. 1 +# Makefile.in generated by automake 1.15.1 from Makefile.am. 2 2 # @configure_input@ 3 3 4 -# Copyright (C) 1994-2014 Free Software Foundation, Inc. 4 +# Copyright (C) 1994-2017 Free Software Foundation, Inc. 5 5 6 6 # This Makefile.in is free software; the Free Software Foundation 7 7 # gives unlimited permission to copy and/or distribute it, 8 8 # with or without modifications, as long as this notice is preserved. 9 9 10 10 # This program is distributed in the hope that it will be useful, 11 11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without ................................................................................ 170 170 LIBOBJS = @LIBOBJS@ 171 171 LIBRASTERLITE2_CFLAGS = @LIBRASTERLITE2_CFLAGS@ 172 172 LIBRASTERLITE2_LIBS = @LIBRASTERLITE2_LIBS@ 173 173 LIBS = @LIBS@ 174 174 LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@ 175 175 LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@ 176 176 LIBTOOL = @LIBTOOL@ 177 +LIBVIRTUALPG_CFLAGS = @LIBVIRTUALPG_CFLAGS@ 178 +LIBVIRTUALPG_LIBS = @LIBVIRTUALPG_LIBS@ 177 179 LIBWEBP_CFLAGS = @LIBWEBP_CFLAGS@ 178 180 LIBWEBP_LIBS = @LIBWEBP_LIBS@ 179 181 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ 180 182 LIBXML2_LIBS = @LIBXML2_LIBS@ 181 183 LIPO = @LIPO@ 182 184 LN_S = @LN_S@ 183 185 LTLIBOBJS = @LTLIBOBJS@ ................................................................................ 196 198 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 197 199 PACKAGE_NAME = @PACKAGE_NAME@ 198 200 PACKAGE_STRING = @PACKAGE_STRING@ 199 201 PACKAGE_TARNAME = @PACKAGE_TARNAME@ 200 202 PACKAGE_URL = @PACKAGE_URL@ 201 203 PACKAGE_VERSION = @PACKAGE_VERSION@ 202 204 PATH_SEPARATOR = @PATH_SEPARATOR@ 205 +PGCONFIG = @PGCONFIG@ 206 +PG_CFLAGS = @PG_CFLAGS@ 207 +PG_LDFLAGS = @PG_LDFLAGS@ 208 +PG_LIB = @PG_LIB@ 203 209 PKG_CONFIG = @PKG_CONFIG@ 204 210 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ 205 211 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ 206 212 RANLIB = @RANLIB@ 207 213 SED = @SED@ 208 214 SET_MAKE = @SET_MAKE@ 209 215 SHELL = @SHELL@